Tuesday, February 24, 2015

An Introduction to the WordPress Dashboard Widgets API

The WordPress Dashboard Widgets API lets themes and plugins add, remove or re-position WordPress dashboard widgets. The WordPress Dashboard is the first thing we see when we log in to the WordPress administration screen. The WordPress Dashboard Widget API has been available from WordPress 2.7 onwards.


In this tutorial we'll look at the different actions and functions that are provided by the API. And, how to add, remove and position dashboard widgets using this API.


Behind the Scene of WordPress Dashboard Widgets


Internally, WordPress dashboard widgets are WordPress meta boxes. The Dashboard Widget API uses the WordPress meta box API to add, remove and position dashboard widgets.


Adding a Dashboard Widget


We can add a widget to the WordPress dashboard using the wp_add_dashboard_widget function. We need to wrap this function inside the wp_dashboard_setup hook.


Continue reading %An Introduction to the WordPress Dashboard Widgets API%




by Narayan Prusty via SitePoint

No comments:

Post a Comment