Hello, Here is one more Tutorial How to Add Custom Dashboard Widgets in WordPress. Some times You have to Add Custom Widget in WordPress Admin Dashboard.

You can check above Screenshot. Here we learn How to Add Custom Dashboard Widgets in WordPress Admin. Now We Start this.
Here is The Code You have to Copy this Code and paste this Code in Current theme functions.php. You can also Create a Custom Plugin and Use this Code.
1 2 3 4 5 6 7 8 9 |
add_action('wp_dashboard_setup', 'custom_dashboard_widgets'); function custom_dashboard_widgets() { wp_add_dashboard_widget('custom_widget', 'Admin Widget Title', 'custom_dashboard_callback'); } function custom_dashboard_callback() { echo 'This is Widget for Wp Dashboard'; } |
Now Explain the Code.
First we use the WordPress Action Hook wp_dashboard_setup. This Action call when WordPress load the Dashboard. Second Parameter is the call_back_function.
1 |
wp_add_dashboard_widget('string $widget_id', 'string $widget_title', 'callable $callback_function'); |
wp_add_dashboard_widget is used for Adds a new dashboard widget.
$widget_id => Custom Widget Id$widget_title => Widget Title
$callback_function => call Back Function
For More WordPress Tutorial
Hope this Help #ktechblog