Make WordPress Core


Ignore:
Timestamp:
09/22/2011 02:27:00 AM (13 years ago)
Author:
azaozz
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r18724 r18747  
    35213521 */
    35223522function _doing_it_wrong( $function, $message, $version ) {
     3523    global $_admin_error_messages;
    35233524
    35243525    do_action( 'doing_it_wrong_run', $function, $message, $version );
     
    35273528    if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
    35283529        $version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version );
    3529         trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );
     3530        $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 );
     3531
     3532        if ( WP_DEBUG_DISPLAY ) {
     3533            (array) $_admin_error_messages[] = $error;
     3534        } else {
     3535            trigger_error( $error );
     3536        }
    35303537    }
    35313538}
Note: See TracChangeset for help on using the changeset viewer.