Support » Plugins » [Plugin: Dashboard Commander] wordpress.com stats dashboard widget is missing

  • Resolved ddeconin

    (@ddeconin)


    When you have the wordpress.com stats plugin active , the stats dashboard widget is not part of the list of widgets that can be controlled. Some other widgets from other plugins are.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thanks for letting me know, I’ll take a look at that plugin’s code to see how it adds its widget.

    Okay, WordPress.com Stats Dashboard is not adding widgets using the WordPress API method, so I won’t be able to support that, but I do have a method of removal for you to use and it can be used for other plugins that may be using the same non-standard method.

    Put the following code into your theme’s functions.php file:

    add_filter('wp_dashboard_widgets', 'filter_wp_dashboard_widgets', 99);
    
    function filter_wp_dashboard_widgets($widgets){
    	$widgets_to_remove = array('dashboard_stats');
    	foreach($widgets as $key => $value){
    		if(in_array($value, $widgets_to_remove)){
    			unset($widgets[$key]);
    		}
    	}
    	return $widgets;
    }

    You can modify the $widgets_to_remove array to add more widget names as they come along.

    Hope that takes care of you, thanks!

    Thx for the workaround, ill try it soon !

    So for me, it shows up fine in an admin account, but I also want the WordPress.com stats widget to show up for editors. Is there any chance this plugin is currently preventing Editors from seeing it?

    Yes, the WordPress.com Stats plugin code specifies the only users with the ‘manage_options’ capability can view the dashboard widget.

    Ah, okay, thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Dashboard Commander] wordpress.com stats dashboard widget is missing’ is closed to new replies.