WordPress.org

Ready to get started?Download WordPress

Forums

[closed] How To Remove WordPress Menu List From Admin-Bar (2 posts)

  1. Hardeep Asrani
    Member
    Posted 11 months ago #

    Hey, I want to remove first list item from admin-bar, which features wordpress logo. Last time I tried to remove it by removing following code from admin-bar.php

    /**
     * Add the WordPress logo menu.
     *
     * @since 3.3.0
     */
    function wp_admin_bar_wp_menu( $wp_admin_bar ) {
    	$wp_admin_bar->add_menu( array(
    		'id'    => 'wp-logo',
    		'title' => '<span class="ab-icon"></span>',
    		'href'  => self_admin_url( 'about.php' ),
    		'meta'  => array(
    			'title' => __('About WordPress'),
    		),
    	) );
    
    	if ( is_user_logged_in() ) {
    		// Add "About WordPress" link
    		$wp_admin_bar->add_menu( array(
    			'parent' => 'wp-logo',
    			'id'     => 'about',
    			'title'  => __('About WordPress'),
    			'href'  => self_admin_url( 'about.php' ),
    		) );
    	}
    
    	// Add WordPress.org link
    	$wp_admin_bar->add_menu( array(
    		'parent'    => 'wp-logo-external',
    		'id'        => 'wporg',
    		'title'     => __('WordPress.org'),
    		'href'      => __('http://wordpress.org/'),
    	) );
    
    	// Add codex link
    	$wp_admin_bar->add_menu( array(
    		'parent'    => 'wp-logo-external',
    		'id'        => 'documentation',
    		'title'     => __('Documentation'),
    		'href'      => __('http://codex.wordpress.org/'),
    	) );
    
    	// Add forums link
    	$wp_admin_bar->add_menu( array(
    		'parent'    => 'wp-logo-external',
    		'id'        => 'support-forums',
    		'title'     => __('Support Forums'),
    		'href'      => __('http://wordpress.org/support/'),
    	) );
    
    	// Add feedback link
    	$wp_admin_bar->add_menu( array(
    		'parent'    => 'wp-logo-external',
    		'id'        => 'feedback',
    		'title'     => __('Feedback'),
    		'href'      => __('http://wordpress.org/support/forum/requests-and-feedback'),
    	) );
    }

    It worked but was showing following error on admin panel:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'wp_admin_bar_wp_menu' not found or invalid function name in /home/content/01/10875201/html/wp-includes/plugin.php on line 487

    Please tell me if there is a possible way to remove it.

    s

  2. Krishna
    Volunteer Moderator
    Posted 11 months ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags