How To Show An Urgent Message In WordPress Admin Area

Today’s helpful tip comes from the people behind WPDoctors and it’s a nifty ready-to-use WordPress action hook that displays a custom message to admins that indicates urgency. This is helpful in situations where you need your message recipients to take immediate action on admin-related concerns.

function showMessage($message, $errormsg = false){
 if ($errormsg) {
 echo '<div id="message">';
 } else {
 echo '<div id="message">';
 }
 echo "<p><strong>$message</strong></p></div>";
}  
function showAdminMessages() {
 showMessage("You need to upgrade your database as soon as possible...", true);
 if (user_can('manage_options') {
 showMessage("Hello admins!");
 }
}
add_action('admin_notices', 'showAdminMessages');

Incoming search terms for the article:

Related Posts

EWWW Image Optimizer

Twitter Cards PHP 1.1

Nodemailer – Easy Email Sending With Node.JS

The Benefits of Using HTML5 in Web Development