mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Revert [18747] until we can discuss it further. See #18453.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
19f46502c0
commit
b816f54124
@ -584,27 +584,4 @@ 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' );
|
||||
|
||||
?>
|
||||
|
@ -3522,20 +3522,13 @@ function _deprecated_argument( $function, $version, $message = null ) {
|
||||
* @param string $version The version of WordPress where the message was added.
|
||||
*/
|
||||
function _doing_it_wrong( $function, $message, $version ) {
|
||||
global $_admin_error_messages;
|
||||
|
||||
do_action( 'doing_it_wrong_run', $function, $message, $version );
|
||||
|
||||
// Allow plugin to filter the output error trigger
|
||||
if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
|
||||
$version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version );
|
||||
$error = sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s. For more information please install a debugging plugin like <a href="http://wordpress.org/extend/plugins/debug-bar/">Debug Bar</a> or <a href="http://wordpress.org/extend/plugins/log-deprecated-notices/">Log Deprecated Notices</a>.' ), $function, $message, $version );
|
||||
|
||||
if ( WP_DEBUG_DISPLAY ) {
|
||||
(array) $_admin_error_messages[] = $error;
|
||||
} else {
|
||||
trigger_error( $error );
|
||||
}
|
||||
trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user