Skip to content

Instantly share code, notes, and snippets.

@jentanbernardus
Created August 4, 2013 02:57
Show Gist options
  • Save jentanbernardus/6148906 to your computer and use it in GitHub Desktop.
Save jentanbernardus/6148906 to your computer and use it in GitHub Desktop.
WordPress Functions: Show error message in dashboard
function showMessage($message, $errormsg = false)
{
if ($errormsg) {
echo '
<div id="message" class="error">';
}
else {
echo '
<div id="message" class="updated fade">';
}
echo "
<strong>$message</strong>
</div>
";
}
function showAdminMessages()
{
showMessage("Welcome to the new WordPress theme.", true);
}
add_action('admin_notices', 'showAdminMessages');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment