How to hide the tags “all, publish, thrash, draft, pending” for authors posts but not for the administrator?

Question

I had find the code below and it is hide the tags “all, publish, thrash, draft, pending” for authors posts BUT is also keep hiding the tags for administrator too !

function remove_edit_post_views( $views ) {
    if ( ! current_user_can( 'manage_options' ) ) {
        unset($views['all']);       
        unset($views['publish']);       
        unset($views['trash']);
        unset($views['draft']);       
        unset($views['pending']);
        return $views;
    }
}    

add_action( 'views_edit-post', 'remove_edit_post_views' );

How can be showing those tabs for administrator?

Any help is appreciated!

Sorry for my not good english

0
Lefteris 4 months 2021-06-30T06:18:09-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse