Return to Snippet

Revision: 46353
at May 17, 2011 22:35 by screamwork


Initial Code
add
===

function my_admin_bar_link() {
    global $wp_admin_bar;
    if ( !is_super_admin() || !is_admin_bar_showing() )
        return;
    $wp_admin_bar->add_menu( array(
    'id' => 'diww',
    'parent' => 'my-blogs',
    'title' => __( 'Title of the link you want to add'),
    'href' => admin_url( 'http://mysitesurl.com/wp-admin.php' )
    ) );
}
add_action('admin_bar_menu', 'my_admin_bar_link');

remove
======

function remove_admin_bar_links() {
    global $wp_admin_bar;
    $wp_admin_bar->remove_menu('my-blogs');
    $wp_admin_bar->remove_menu('my-account-with-avatar');
}
add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_links' );

Initial URL

                                

Initial Description

                                

Initial Title
Add or Remove Links to the New WP Admin Bar

Initial Tags

                                

Initial Language
PHP