/**
* Generic function to show a message to the user using WP's
* standard CSS classes to make use of the already-defined
* message color scheme.
*
* @param $message The message you want to tell the user.
* @param $errormsg If true, the message is an error, so use
* The red message style. If false, the message is a status
* message, so use the yellow information message style.
*/
function showMessage($message, $errormsg = false)
{
if ($errormsg) {
echo '<div id="message" class="error">';
}
else {
echo '<div id="message" class="updated fade">';
}
echo "<p><strong>$message</strong></p></div>";
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter