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 comments

Leave a Reply

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

*
*