WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Removing Events Manager Quick links from admin bar (11 posts)

  1. kanthraj
    Member
    Posted 1 year ago #

    I want to remove the quick links displayed on the top admin bar. Any help ?

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 1 year ago #

    you can try this snippet (paste in your theme functions.php)

    function mytheme_admin_bar_render() {
     global $wp_admin_bar;
     //print_r($wp_admin_bar);
     $wp_admin_bar->remove_menu('edit');
    }
    add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );

    basically, just use print_r to remove more (by looking for the their id)

  3. kanthraj
    Member
    Posted 1 year ago #

    Hello aglonwl,

    Thank you for the reply, I am using buddypress and i need the admin bar, i just want to remove the quick links of events manager like : create event or location from the admin bar.

  4. agelonwl
    Member
    Posted 1 year ago #

    try this snippet

    function mytheme_admin_bar_render() {
     global $wp_admin_bar;
     $wp_admin_bar->remove_menu('new-location');
     $wp_admin_bar->remove_menu('new-event-recurring');
     $wp_admin_bar->remove_menu('new-event');
    }
    add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );
  5. kanthraj
    Member
    Posted 1 year ago #

    Thanks for the quick reply. New event creation link has gone, but i stil see the new location creation link. Any more fix ?

  6. agelonwl
    Member
    Posted 1 year ago #

    hi, just try to use print_r($wp_admin_bar); then you will see an array of menus that can be removed then used its id inside the function

    e.g.
    $wp_admin_bar->remove_menu('id-here');

  7. kanthraj
    Member
    Posted 1 year ago #

    Am sorry but where to use ? I just need to get rid of events manager links in wp-admin bar

  8. agelonwl
    Member
    Posted 1 year ago #

    please see my first snippet line //print_r($wp_admin_bar); just remove // then refresh your page and see the array of id's

  9. kanthraj
    Member
    Posted 1 year ago #

    Could you please explain where to use ? to see the array of ids ?

  10. agelonwl
    Member
    Posted 1 year ago #

    if you use this print_r($wp_admin_bar); then refresh your frontend page and you will see something like this

    WP_Admin_Bar Object ( [nodes:private] => Array ( [user-actions] => stdClass Object ( [id] => user-actions [title] => [parent] => my-account [href] => [group] => 1 [meta] => Array ( ) ) [user-info] => stdClass Object ( [id] => user-info.......

    then noticed [id] => user-actions; you need to do something like this in my shared snippet $wp_admin_bar->remove_menu('user-actions');

  11. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    try adding this to your functions.php

    function my_em_remove_admin_bar(){
    remove_action( 'admin_bar_menu', 'em_admin_bar_mod', 21 );
    }
    add_action('init','my_em_remove_admin_bar');

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic