• Resolved smithcreate

    (@smithcreate)


    I’m using this plugin for our HR department to post and manage job openings on our website. Something that has come up several times is that the “Employer” user can only edit job openings they have posted through the Job Dashboard page. I would like all users with the role “Employer” to be able to edit all job postings through the Job Dashboard. I installed the User Role Editor and gave permissions for the role to edit, delete and read job listing items. But it seems the Job Dashboard only displays job listings created by that user. Is there a way to have the Job Dashboard display ALL job listings so each Employer can access everything without seeing the WordPress back end?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Renatho (a11n)

    (@renathoc)

    Hi there!

    You could do it by filtering the dashboard jobs query args. I imagine the following snippet do what you want:

    add_filter( 'job_manager_get_dashboard_jobs_args', function( $job_dashboard_args ) {
    	$user  = wp_get_current_user();
    	$roles = ( array ) $user->roles;
    
    	if ( ! empty( $roles ) && in_array( 'employer', $roles, true ) ) {
    		unset( $job_dashboard_args['author'] );
    	}
    
    	return $job_dashboard_args;
    } );
    Thread Starter smithcreate

    (@smithcreate)

    Where would I add this code?

    Hi,

    Snippets can be added to your theme’s functions.php file, but we do recommend using Code Snippets plugin on adding snippets to your site.

    Thread Starter smithcreate

    (@smithcreate)

    Thank you everyone! The code seems to do exactly what I wanted. And the Code Snippets plugin worked to add the snippet without editing the functions.php file.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Job Dashboard display ALL Jobs’ is closed to new replies.