Remove the 'events' node in the WP Admin Bar Menu

Home Forums Calendar Products Events Calendar PRO Remove the 'events' node in the WP Admin Bar Menu

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #22553
    Shaun
    Participant

    We’d like to remove the ‘events’ button in the WP Admin Bar Menu, as part of making Events Calendar Pro more whitelabel (there are links there to Help, and Addons). I have tried the following code but it is not working, probably because the node is being added after I remove it. Help?

    add_action( 'admin_bar_menu', 'remove_tribe_events', 999 );
    function remove_tribe_events( $wp_admin_bar ) {
    $wp_admin_bar->remove_node( 'tribe-events' );
    }

    #22638
    Rob
    Member

    Hey Shaun. Not sure about this one myself, but I can ask one of our devs to chime in. Once answered this would probably be worth adding to the FAQ too.

    Stay tuned and I’ll have someone take a look as soon as possible. Thanks for your patience so far.

    #22734
    moderntribe
    Participant

    Hi, Shaun;
    Try hooking into `wp_before_admin_bar_render` (with a high-numbered priority, like 100) and let me know if that works for you better. Make sure also to instantiate the global $wp_admin_bar. Good luck, and let me know if that works better for you!

    #23339
    Shaun
    Participant

    In the end I did this with the following:

    add_action( ‘wp_before_admin_bar_render’, ‘remove_tribe_events’, 100 );
    function remove_tribe_events() {
    global $wp_admin_bar;
    $wp_admin_bar->remove_node( ‘tribe-events’ );
    }

    #23371
    Rob
    Member

    Awesome to hear that did it! Thanks for confirming, Shaun. Sounds like you’re all set here but please do reach out if we can assist in the future. Cheers.

    #977525
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Remove the 'events' node in the WP Admin Bar Menu’ is closed to new replies.