Hide certain post types from editors
I'm trying to hide a series of posts from my editors in the admin panel based on either custom post type or category (whichever is easiest).
I tried adding a function such as:
add_action( 'admin_menu', 'my_remove_menu_pages' );
function my_remove_menu_pages() {
global $current_user;
get_currentuserinfo();
if($current_user-user_login = 'test2') {
remove_submenu_page( 'edit.php?post_type=post', 'edit.php?post_format=imageamp;post_type=post' );
}
}
(In this snippet, I'm hiding it from one specific account) but it doesn't seem to work. Any ideas on how to do this?
Topic add-editor-style admin-menu functions Wordpress
Category Web