Add Dashboard Widgets on WordPress 2.7+
If you are familiar enough with WordPress, you should know that they are ever emerging, introducing new features and having new cool stuffs every now and then.
WordPress 2.7 is a big leap from previous version, with a revamped administration panel altogether. One cool thing that’s impressive is about the widgets on admin dashboard.

This is a rather great news for plugin developers, as it allows plugins to have more exposure to the user, at the same time allowing the user the flexibility to deactivate dashboard widgets. What’s more, it can be drag-and-dropped for widget rearrangement!
Registering your widget onto dashboard is easy.
function dashboard_widget_hello_world() {
echo ‘Hello World
}
// Add Dashboard Widget using wp_add_dashboard_widget() function
function dashboard_widget_hello_world_setup() {
wp_add_dashboard_widget( ‘dashboard_widget_hello_world’, __( ‘Hello World’ ), ‘dashboard_widget_hello_world’ );
}
// Register Dashboard Widget to WordPress
add_action(‘wp_dashboard_setup’, ‘dashboard_widget_hello_world_setup’);
The above code basically registers a dashboard widget called “Hello World” which contains “Hello World
” in the widget.
This feature is powerful, as in you may connect to database to retrieve any relevant data, or makes use of WordPress shortcodes to call functions. It is up to your imagination on how far you want to go!
For more information, as usual, please refer to WordPress Codex here
Have fun!
Got anything to say? Go ahead and leave a comment!
Archives
- July 2011
- June 2011
- May 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- March 2010
- February 2010
- January 2010
- December 2009
- September 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008



Posted under: