Hide Submenu via functions.php

Home Forums Calendar Products Events Calendar PRO Hide Submenu via functions.php

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1316650
    Palmtree
    Participant

    Hello,
    I was looking at the page below.

    Hide Events submenu

    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.

    #1317124
    Shelby
    Participant

    Hi 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 πŸ™‚

    #1317162
    Palmtree
    Participant

    Hi 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.
    #1317600
    Shelby
    Participant

    Hey 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 πŸ™‚

    #1317611
    Shelby
    Participant

    And 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 πŸ™‚

     

    #1319239
    Palmtree
    Participant

    Hello Shelby,
    Thanks for helping me out:)
    I didn’t notice there are two custom post type “events and venue”.

    Have a good day!

    #1319441
    Shelby
    Participant

    Glad 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 πŸ™‚

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Hide Submenu via functions.php’ is closed to new replies.