WordPress.org

Make WordPress Core

Ticket #18512: add-backtrace-to-doing_it_wrong.diff

File add-backtrace-to-doing_it_wrong.diff, 887 bytes (added by chrisbliss18, 4 years ago)
  • wp-includes/functions.php

     
    35163516 
    35173517        // Allow plugin to filter the output error trigger 
    35183518        if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) { 
     3519                $backtrace = debug_backtrace(); 
     3520                $called_by = sprintf( __( '(Called by %1$s line %2$s)' ), $backtrace[1]['file'], $backtrace[1]['line'] ); 
     3521                 
    35193522                $version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version ); 
    3520                 trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) ); 
     3523                trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s %4$s' ), $function, $message, $version, $called_by ) ); 
    35213524        } 
    35223525} 
    35233526