Add Custom Dashboard Widgets in WordPress Using Plugin

What is a Dashboard widget?

Dashboard Widget — Using Custom Plugin

Plugin Setup

/* Plugin Name: Custom Dashboard Widget Plugin URI: http://example.com/custom-dashboard-widget Description: This is sample plugin which when activates creates a custom dashboard widget. Author: Online Web Tutor Version: 1.0 Author URI: https://onlinewebtutorblog.com/ */
add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
function my_custom_dashboard_widgets() { global $wp_meta_boxes; wp_add_dashboard_widget('custom_help_widget', 'OWT Custom Widget', 'owt_custom_dashboard_widget'); }
function owt_custom_dashboard_widget() { echo '<p>Welcome to Online Web tutor Custom Widget! Need help? Contact the developer <a href="mailto:onlinewebtutorhub@gmail.com">here</a>. For WordPress Tutorials visit: <a href="https://onlinewebtutorblog.com/" target="_blank">Online Web Tutor</a></p>'; }

Complete Code — Custom Plugin For Dashboard Widget

<?php /* Plugin Name: Custom Dashboard Widget Plugin URI: http://example.com/custom-dashboard-widget Description: This is sample plugin which when activates creates a custom dashboard widget. Author: Online Web Tutor Version: 1.0 Author URI: https://onlinewebtutorblog.com/ */ add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets'); function my_custom_dashboard_widgets() { global $wp_meta_boxes; wp_add_dashboard_widget('custom_help_widget', 'OWT Custom Widget', 'owt_custom_dashboard_widget'); } function owt_custom_dashboard_widget() { echo '<p>Welcome to Online Web tutor Custom Widget! Need help? Contact the developer <a href="mailto:onlinewebtutorhub@gmail.com">here</a>. For WordPress Tutorials visit: <a href="https://onlinewebtutorblog.com/" target="_blank">Online Web Tutor</a></p>'; }

--

--

--

Online Web Tutor is web development community found by Sanjay Kumar. It provides web development course for free worldwide by professionally trained instructors

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Online Web Tutor

Online Web Tutor

Online Web Tutor is web development community found by Sanjay Kumar. It provides web development course for free worldwide by professionally trained instructors

More from Medium

Create Fake REST APIs Server in CodeIgniter 4

How to Create login, register, and logout manually in laravel.

How to Disable the WordPress JSON REST API Without Plugin

How to make a custom command in Laravel * DevRohit Think simplified