+2 votes
asked in Plugins by

As part of my plugin, I would like to show a notification on WordPress admin panel dashboard home. Like this :

Which hook to use ? Please advice.

2 Answers

+1 vote
answered by

These are called dashboard widgets. codex have documentation on this. Here is an example :

 * Add a widget to the dashboard.
 * This function is hooked into the 'wp_dashboard_setup' action below.
function example_add_dashboard_widgets() {

                 'example_dashboard_widget',         // Widget slug.
                 'Example Dashboard Widget',         // Title.
                 'example_dashboard_widget_function' // Display function.
add_action( 'wp_dashboard_setup', 'example_add_dashboard_widgets' );

 * Create the function to output the contents of our Dashboard Widget.
function example_dashboard_widget_function() {

	// Display whatever it is you want to show.
	echo "Hello World, I'm a great Dashboard Widget";

For more check out : https://codex.wordpress.org/Dashboard_Widgets_API
commented by
Great stuff man! Many thanks for this.
0 votes
answered by
This is sooo Cool !

I had an attempted failed search for this feature build long before.

This is not an answer, but I coudnt resist to leave my comment for this question. Moderators please excuse me or please move this to appropriate section ;)

Related questions

0 votes
0 answers 1.3k views
0 votes
1 answer 62 views
0 votes
0 answers 282 views
0 votes
1 answer 26 views
0 votes
1 answer 976 views
0 votes
0 answers 340 views
asked Dec 5, 2016 in Laravel by Jinu