How to create a Dashboard Widget WordPress

You can easily create your own dashboard widgets using the Dashboard Widgets API

Basically you can add your own function when WordPress is showing the dasboard.

So, in fact, you could do everything.

Here in CodeGround I created a widget wich shows the most views posts using the data from an other plugin.

Ok, less talking and more coding…

Code

First of all we need to add the widget itself.

Fill the 3 parameters with your widget function, widget title and widget content function.

Now add the widget you have created to the Dashboard.

Finally create the widget content function.

Output

This is how it will looks like.

More

Read the codex for further information 😉

http://codex.wordpress.org/Dashboard_Widgets_API

2 Responses to “How to create a Dashboard Widget WordPress”

  1. Tom June 26, 2011 at 3:29 am #

    Thanks for this – going to give it a try 🙂

    • quicoto June 26, 2011 at 9:30 am #

      You’re welcome Tom 😉

Leave a Reply

Add <code> Some Code </code> by using this tags.