Change WordPress user roles and capabilities Forums Restrict or Permit access inside WordPress – how to Need to restrict user access to plugin WP Auto Republish

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6908
    roromano
    Participant

    I have a plugin called WP Auto Republish and it appears to give everyone at Author and above access to a button under All Posts that says “Republish” next to “Edit”, “Quick Edit”, “Trash” etc. I need to restrict this feature’s ability to Admin only but I cannot find the capability in the list or in Meta Boxes. Do I need to add a certain capability from inside the plugin in order to restrict access to it? I need the ability to automatically republish certain posts but cannot have authors republishing their own posts to get it to the top of the site. Limiting access to this essential. Is there a way to look up capabilities inside a plugin? Thanks in advance.

    #6909
    roromano
    Participant

    Never mind! I figured out an alternative:

    add_filter( ‘post_row_actions’, ‘remove_row_actions’, 10, 1 );
    function remove_row_actions( $actions )
    {
    if( get_post_type() === ‘post’ )
    unset( $actions[‘republish’] );
    return $actions;
    }

    #6910
    Vladimir
    Keymaster

    OK. Thanks for sharing.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.