• Skip to primary navigation
  • Skip to main content

Genesis Community

Resources for Genesis WordPress Theme Users

  • Facebook
  • Twitter
  • Slack
  • Wiki
  • Login
You are here: Home / Wikis / Plugins / Add Media Library & Plugins to Main Menu of Admin Bar

Add Media Library & Plugins to Main Menu of Admin Bar

/** Add Media Library & Plugins to Main Menu of Admin Bar */

if ( ! function_exists( 'x_add_options_item_to_admin_bar' ) ) {
 function x_add_options_item_to_admin_bar() {
    global $wp_admin_bar;
    $wp_admin_bar->add_menu(
     array(
        'parent' => 'site-name',
        'id'     => 'x_library',
        'title'  => __( 'Media Library', 'x' ),
        'href'   => esc_url( admin_url( 'upload.php' ) ),
        'meta'   => false
        // array of any of the following options: array( 'html' => '', 'class' => '', 'onclick' => '', target => '', title => '' );
     )
    );
    $wp_admin_bar->add_menu(
     array(
        'parent' => 'site-name',
        'id'     => 'x_plugins',
        'title'  => __( 'Plugins', 'x' ),
        'href'   => esc_url( admin_url( 'plugins.php' ) ),
        'meta'   => false
        // array of any of the following options: array( 'html' => '', 'class' => '', 'onclick' => '', target => '', title => '' );
     )
    );
 }
 add_action( 'wp_before_admin_bar_render', 'x_add_options_item_to_admin_bar' );
}

Notes:

Via:

http://wplifeguard.com/how-to-add-links-to-wordpress-3-3s-admin-bar/

https://codex.wordpress.org/Function_Reference/add_node

https://codex.wordpress.org/Function_Reference/add_menu

Posted by: jodzeee Category: Plugins Tags: admin_bar

« Enable Honeypot for all new GravityForms forms
Remove Jetpack admin menu item for non-admin users »

Copyright © 2026 · Genesis Sample on Genesis Framework · WordPress · Log in