Hi,
I have a custom post type I use as obligatory object to allow many-to-many relationships. I would like to hide this type and there is of course an option for that "Hidden - users cannot directly edit data in this type", but I would like also to have a possibility to create a views for this post types. After checking "hidden" option, the custom type is not visible under view and 'Content selection'.
How can I hide the custom post type from the users but still could create a view for this type?
Regards,
Michael
Dear Michael,
Right, so in this case you can not use this option "Hidden – users cannot directly edit data in this type". You should insert the code below in functions.php instead:
function wpse28782_remove_menu_items() {
remove_menu_page( 'edit.php?post_type=your_post_type' );
}
add_action( 'admin_menu', 'wpse28782_remove_menu_items' );
You must replace "your_post_type" with the slug name of the post type you want to hide from menu.
Thank you Adriano, it works.
Regards,
Michael