Ticket #18453: 18453-2.patch
File 18453-2.patch, 2.1 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/misc.php
585 585 </fieldset> 586 586 <?php 587 587 } 588 ?> 588 589 /** 590 * Show error message only to single site admin or network admin level users 591 * 592 */ 593 function _show_errors_to_admins() { 594 global $_admin_error_messages; 595 596 if ( !is_super_admin() ) 597 return; 598 599 if ( !empty($_admin_error_messages) ) { 600 echo '<div class="error">'; 601 602 foreach ( (array) $_admin_error_messages as $message ) { 603 echo "<p>$message</p>\n"; 604 } 605 606 echo "</div>\n"; 607 } 608 } 609 add_action( 'admin_notices', '_show_errors_to_admins' ); 610 add_action( 'network_admin_notices', '_show_errors_to_admins' ); 611 -
wp-includes/functions.php
3519 3519 * @param string $version The version of WordPress where the message was added. 3520 3520 */ 3521 3521 function _doing_it_wrong( $function, $message, $version ) { 3522 global $_admin_error_messages; 3522 3523 3523 3524 do_action( 'doing_it_wrong_run', $function, $message, $version ); 3524 3525 3525 3526 // Allow plugin to filter the output error trigger 3526 3527 if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) { 3527 3528 $version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version ); 3528 trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) ); 3529 $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 ); 3530 3531 if ( WP_DEBUG_DISPLAY ) { 3532 (array) $_admin_error_messages[] = $error; 3533 } else { 3534 trigger_error( $error ); 3535 } 3529 3536 } 3530 3537 } 3531 3538