Skip Navigation

[Resolved] Custom Types Visibility and Views

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Tagged: 

This topic contains 4 replies, has 3 voices.

Last updated by Ben 7 years, 2 months ago.

Assigned support staff: Adriano.

Author
Posts
#227507

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

#227573

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.

#227860

Thank you Adriano, it works.
Regards,
Michael

#227928

Nice, you are welcome.

#321863

Ben

The forum ‘Types Community Support’ is closed to new topics and replies.