• Resolved WebEndev

    (@munman)


    This piece of code:

    function sl_dashboard_tweaks_render() {
    	global $wp_admin_bar;
    	$wp_admin_bar->add_menu( array(
    		'id'    => 'wp-logo',
    		'title' => '<span class="sl-dashboard-logo"></span>',
    		'href'  => is_admin() ? home_url( '/' ) : admin_url(),
    		'meta'  => array(
    			'title' => __('Visit the Frontend of your website'),
    		),
    	) );
    	$wp_admin_bar->remove_menu('about');
    	$wp_admin_bar->remove_menu('wporg');
    	$wp_admin_bar->remove_menu('documentation');
    	$wp_admin_bar->remove_menu('support-forums');
    	$wp_admin_bar->remove_menu('feedback');
    	$wp_admin_bar->remove_menu('view-site');
    }
    add_action( 'wp_before_admin_bar_render', 'sl_dashboard_tweaks_render' );

    removes each of the submenu items, but the drop down is still there. And the warning “Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\test3_3\wp-includes\class-wp-admin-bar.php on line 245” is in the drop down.

    Thanks

    http://wordpress.org/extend/plugins/dashboard-tweaks/

Viewing 10 replies - 1 through 10 (of 10 total)
  • I’ve got a plugin, too, with this problem in 3.3 RC-1 and I haven’t completely fixed the issue yet, but according to the Dev Chat IRC logs:

    * Introduce a get_node() method for plugins.
    * Deprecate $wp_admin_bar->menu. Plugins will need to use get_node(), remove_node(), add_node() to make modifications. This finalizes a backwards incompatible change made earlier in the cycle.
    * Allow add_node() to take a node object (which could come from get_node(), then be modified).
    * Ensure that our underlying storage (the nodes property) is private to core. Introduce _set_node, _unset_node, _get_nodes, get_nodes as the only ways to interface with this.

    Some sort of standards for these seem to be found in the /wp-includes/class-wp-admin-bar.php.

    Plugin Author Pieter Bos

    (@senlin)

    Apologies for my late response.

    You are right that it doesn’t remove the submenu, but hides it instead; sorry for the bad choice of words, I will fix that soon.

    I cannot however reproduce the warning you are receiving.

    I will look into this and if you have more information on this, it would be a great help.

    I get the above error on a live site but not on a local set-up – both using 3.3 rc1.

    Thread Starter WebEndev

    (@munman)

    FYI – The plugin now works with 3.3 RC2

    Apparently there were some corrections done in RC2 that resolved the issue.

    I does look like it’s sorted now.
    At least, it’s working on my live and local test sites.

    Plugin Author Pieter Bos

    (@senlin)

    Great news, thanks for checking that @bruce and @lee! Been swamped lately, hence my later than usual responses.

    Other responses on the same subject on:
    Google+

    WP TIPS

    add_action( 'admin_bar_menu', 'remove_wp_logo_links', 25 );
    function remove_wp_logo_links( $wp_admin_bar ) {
        $wp_admin_bar->remove_node('wp-logo');
    }

    This worked for me 😉

    Plugin Author Pieter Bos

    (@senlin)

    @sexyapples thanks for your alternative solution. However this topic has been marked as resolved for a month orso or do you still experience difficulties with the plugin?

    Oh my goodness Piet … I was just feverishly surfing around the other day and happened upon here and saw the questions … the issue was something I had just dealt with so I thought I’d be helpful and quickly post … didn’t even realize I wasn’t on the general forums … my apologies

    Plugin Author Pieter Bos

    (@senlin)

    hahaha, no worries and thanks for the alternative then 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: Dashboard Tweaks] WP Submenu Drop Down not removed’ is closed to new replies.