Home › Forums › Calendar Products › Events Calendar PRO › Hide Submenu via functions.php
- This topic has 7 replies, 2 voices, and was last updated 8 years, 9 months ago by
Palmtree.
-
AuthorPosts
-
July 5, 2017 at 9:52 pm #1316650
Palmtree
ParticipantHello,
I was looking at the page below.By following the solution, I could successfully hide, “event tags, help and add-on” but not “venue”.
function remove_menu() {
remove_submenu_page('edit.php?post_type=tribe_events', 'edit-tags.php?taxonomy=post_tag&post_type=tribe_events');
remove_submenu_page('edit.php?post_type=tribe_venue');
remove_submenu_page('edit.php?post_type=tribe_events', 'tribe-help');
remove_submenu_page('edit.php?post_type=tribe_events', 'tribe-app-shop');
}
add_action('admin_menu', 'remove_menu', 999);I have no idea why this doesn’t work on the “tribe_venue”.
I would be grateful for any advise.Thank you.
July 6, 2017 at 2:04 pm #1317124Shelby
ParticipantHi there,
I’m happy to help out with this! π
First, can you verify that you’ve referenced this knowledgebase article to help guide you in making these changes?
If you’ve used these guidelines and are still having trouble, I can help you figure it out. π
Best,
Shelby π
July 6, 2017 at 4:12 pm #1317162Palmtree
ParticipantHi Shelby,
Thanks for your reply:-)
Yes, I’ve read it but code below (referred from the article)function tribe_remove_venue_from_events( $default_types ) { if ( ! is_array( $default_types ) || empty( $default_types ) ) { return $default_types; } if ( ( $key = array_search( 'tribe_venue', $default_types ) ) !== false ) { unset( $default_types[ $key ] ); } return $default_types; } add_filter( 'tribe_events_register_default_linked_post_types', 'tribe_remove_venue_from_events');can only remove “venue” from the main event editing area not from the submenu on the left-hand side.
Without adding the filter above, I have actually used CSS to hide it but submenu is difficult to hide without using “function remove_menu and remove_submenu_page”It would be appreciated if you could look into it. Apart from tribe_venue, the piece of code I’ve pasted in my original post work.
-
This reply was modified 8 years, 9 months ago by
Palmtree.
July 7, 2017 at 12:29 pm #1317600Shelby
ParticipantHey there,
I’m going to have to check in with our team on this one. I’ll update you when I hear back. π
Thanks for sitting tight!
Best,
Shelby π
July 7, 2017 at 12:44 pm #1317611Shelby
ParticipantAnd I’m back! The following snippet should remove your venues sub menu. π
Let me know if you have any problems with it or any follow up questions!
function remove_menu() { remove_submenu_page('edit.php?post_type=tribe_events', 'edit.php?post_type=tribe_venue'); } add_action('admin_menu', 'remove_menu', 999);Cheers,
Shelby π
July 10, 2017 at 5:46 pm #1319239Palmtree
ParticipantHello Shelby,
Thanks for helping me out:)
I didn’t notice there are two custom post type “events and venue”.Have a good day!
July 11, 2017 at 6:10 am #1319441Shelby
ParticipantGlad to see this resolved! π Β Please reach out to us anytime you have questions or concerns about our plugins & their features in the future.
Cheers!
Shelby π
-
This reply was modified 8 years, 9 months ago by
-
AuthorPosts
- The topic ‘Hide Submenu via functions.php’ is closed to new replies.
