Change WordPress user roles and capabilities Forums How to or FAQ Restrict access by role to Quick Edit functionality on post listing screens?

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2665
    Gonzalo
    Participant

    Hi there,
    Is it at all possible with the plugin to restrict a user’s access to the Quick Edit functionality of items on the posts/pages/cpt listing screen?

    We have a role that needs to be able to edit items of a custom post type but don’t want them to be able to update the slug. We’ve removed the slug from the individual edit page, but need to hide it from the Quick Edit functionality as well.

    Ideally we’d be able to remove Quick Edit for only the specific role, and still let administrators access it.

    Thanks

    #2670
    Vladimir
    Keymaster

    Hi,

    Add this code to the active theme’s functions.php file:

    
    if (current_user_can('your-specific-role-id')) {
        add_filter('post_row_actions','remove_quick_edit',10,1);
    }
    function remove_quick_edit( $actions ) {
        
        unset($actions['inline hide-if-no-js']);
        
        return $actions;    
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.