Postpone warnings when WP_DEBUG and WP_DEBUG_DISPLAY are set, see #18453

git-svn-id: https://develop.svn.wordpress.org/trunk@18747 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2011-09-22 02:27:00 +00:00
parent c0682ee59b
commit 033ed78e03
2 changed files with 32 additions and 2 deletions

View File

@@ -584,4 +584,27 @@ foreach ( $_wp_admin_css_colors as $color => $color_info ): ?>
</fieldset>
<?php
}
?>
/**
* Show error message only to single site admins or network admins
*
*/
function _show_errors_to_admins() {
global $_admin_error_messages;
if ( !is_super_admin() )
return;
if ( !empty($_admin_error_messages) ) {
echo '<div class="error">';
foreach ( (array) $_admin_error_messages as $message ) {
echo "<p>$message</p>\n";
}
echo "</div>\n";
}
}
add_action( 'admin_notices', '_show_errors_to_admins' );
add_action( 'network_admin_notices', '_show_errors_to_admins' );