• Resolved akschoeck

    (@akschoeck)


    Hi there,

    I’m trying to get the plugin to be able to allow admins to post jobs without having to be approved while the ‘Moderate New Listings’ option is enabled. I’ve identified the code affecting this as being in the /public_html/wp-content/plugins/wp-job-manager/includes/forms/class-wp-job-manager-form-submit-job.php file. On line 660, there is some code that determines whether the job post gets set to the pending or published status. I tried changing the following code

    (it won’t allow me to mark this section as code for some reason)
    $update_job['post_status'] = get_option( 'job_manager_submission_requires_approval' ) ? 'pending' : 'publish';

    to

    if ( ! is_admin() ) {
       $update_job['post_status']   = get_option( 'job_manager_submission_requires_approval' ) ? 'pending' : 'publish';
    } else {
       $update_job['post_status']   = 'publish';
    }

    to make admins always have the published status for their job posts, but it’s still behaving the way it originally did. Can someone tell me what I’m doing wrong?

    https://wordpress.org/plugins/wp-job-manager/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    is_admin() (https://codex.wordpress.org/Function_Reference/is_admin) is the wrong function for this.

    https://codex.wordpress.org/Function_Reference/current_user_can should be used instead.

    Why can’t admin post via the backend to skip moderation? Then you won’t have to hack the files.

    Thread Starter akschoeck

    (@akschoeck)

    I actually did previously try that as well (and just tried again). It also did not work. Still needed approval for submitting a job.

    I think my client eventually wants to create some ‘trusted’ user roles to be able to post jobs without having access to the admin panel and without needing approval. I’m not 100% certain, just following orders right now. 🙂

    Any other ideas on how to get this to work?

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    If you log a request on github, perhaps we can add a filter to make this possible without editing core 🙂 You’ll still need a custom function, but it will be easier.

    Hi Mike,

    Was this filter implemented? I use wpjobmanager for a disabled charity, and the admins frequently post jobs on behalf of users. One of the admins uses a screen reader which is unusable with the backend!

    It would be great to bypass the approval flow for logged-in admins via the frontend.

    Thanks!

    Plugin Contributor Adam Heckler

    (@adamkheckler)

    I don’t think this has been implemented yet. It looks like your issue:

    https://github.com/Automattic/WP-Job-Manager/issues/531

    … is the first one we’ve received about this.

    Just keep an eye out there. From my cursory glance, it looks like a pretty simple thing to do, so hopefully we can get it added soon.

    Thanks! 🙂

    (Resolving this as we’re tracking it in GitHub now.)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Making the admin able to bypass pending’ is closed to new replies.