Skip Navigation

[Résolu] 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 support ticket is created Il y a 9 années et 9 mois. There's a good chance that you are reading advice that it now obsolete.
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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 -
- - - - - - -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

Marqué : 

This topic contains 4 réponses, has 3 voix.

Last updated by Ben Il y a 9 années et 9 mois.

Assisted by: Adriano.

Auteur
Publications
#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

Le forum ‘Types Community Support’ est fermé à de nouveaux sujets et réponses.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.