Ticket #18453: add-backtrace-to-doing_it_wrong.diff
File add-backtrace-to-doing_it_wrong.diff, 1.1 KB (added by , 13 years ago) |
---|
-
wp-includes/functions.php
3524 3524 3525 3525 // Allow plugin to filter the output error trigger 3526 3526 if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) { 3527 $backtrace = debug_backtrace(); 3528 if ( isset( $backtrace[1]['line'] ) ) 3529 $source = sprintf( __( '(Source: %1$s line %2$s)' ), $backtrace[1]['file'], $backtrace[1]['line'] ); 3530 else if ( isset( $backtrace[1]['class'] ) ) 3531 $source = sprintf( __( '(Source: %1$s%2$s%3$s)' ), $backtrace[1]['class'], $backtrace[1]['type'], $backtrace[1]['function'] ); 3532 else 3533 $source = __( '(Source: unknown)' ); 3534 3527 3535 $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 ) );3536 trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s %4$s' ), $function, $message, $source, $version ) ); 3529 3537 } 3530 3538 } 3531 3539