Are you a WordPress plugin OR Themes developer and you want to add a global notification message for all admin pages, then keep your close attention in this tutorial as I am going to share how to add notification message in all WordPress admin pages.
This is a very easy and simple WordPress action function to add admin notification. We used the admin_notices
action to global notification message for all WordPress Admin pages.
Add the below code in your plugin files if you are displaying the notification via your plugin, OR if you want to display via your theme, then add below code inside your functions.php file from your theme.
1 2 3 4 5 6 7 8 9 | function wordpress_header_message_all_admin_pages() { ?> <div class="notice notice-error is-dismissible"> <p><?php _e('You have just installed Google Analytics Plugin, Please configure to track your site visitors - FreeWebMentor', 'freewebmentor'); ?></p> </div> <?php } add_action('admin_notices', 'wordpress_header_message_all_admin_pages') |
After adding the above code the notification message will look like below screenshot.
Hope this tutorial help you, then please do like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: woocommerce plugin for wordpress tutorial, WordPress admin notification, wordpress tutorial, wordpress tutorial for beginner, wordpress tutorial for beginners, wordpress tutorials, wordpress tutorials for beginners, wordpress tutorils