Previously I wrote an article that detailed modifying the WordPress Most Commented plugin to display the most commented WordPress posts via the WP admin site. If you need more information on creating admin plugins or just wanted to glance over the article related to this one you can read it by clicking here. Something I did not include in that article was how to add code to the plugin that would also display a widget on the WP Admin dashboard. Below is basic information that should assist you in adding code that will display a dashboard widget.

Modify Plugin To Display A WordPress Admin Dashboard Widget:

It is nice to have all of the information you need regarding your WordPress blog available via the WP admin dashboard. The original article, located here, provides information that will assist creating a admin plugin and this information takes that a step further and extends that plugin to display it as a widget on the admin dashboard.

Add Dashboard Widget Hook:You should add a hook that will register the plugins functions with the WP admin dashboard.

// Hook into the 'wp_dashboard_setup' action to register the plugins other functions
add_action('wp_dashboard_setup', 'most_commented_add_dashboard_widgets' );

Admin Dashboard Widget Display: Now add the below to actually display the widget.

Admin Dashboard Widget Display Details: The mcd function is called from the above code so now it needs to be created with the details of what should display in the dashboard widget. The below uses the mdv_most_commented function to generate the display of the posts with the most comments.

Verify New Dashboard Widget:Now with all of the above combined and added to the plugin you are generating the admin dashboard widget for login to your WordPress admin to verify the widget is displaying properly on the WordPress dashboard.

The above just provides simple examples of the minimal amount of code needed to display a WordPress admin dashboard widget.

I am sure there is a way. I assume you just need to make sure that the widget you are installing loads last. I am not sure right off though about how to go about this the easiest way as I think all of the widgets are created on the page at the same time.

Did you come up with a solution? If not let us know and we can look into it when time allows to see if we can come up with a way to accomplish this.