Make WordPress Core


Ignore:
Timestamp:
06/19/2013 08:11:59 AM (12 years ago)
Author:
nacin
Message:

Fall back to non-translated strings in _doing_it_wrong() if the translation function doesn't exist. This may be the case in sunrise, for example.

props SergeyBiryukov.
fixes #23555.
for trunk.

File:
1 edited

Legend:

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

    r24266 r24439  
    29822982    // Allow plugin to filter the output error trigger
    29832983    if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
    2984         $version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version );
    2985         $message .= ' ' . __( 'Please see <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.' );
    2986         trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );
     2984        if ( function_exists( '__' ) ) {
     2985            $version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version );
     2986            $message .= ' ' . __( 'Please see <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.' );
     2987            trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );
     2988        } else {
     2989            $version = is_null( $version ) ? '' : sprintf( '(This message was added in version %s.)', $version );
     2990            $message .= ' Please see <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.';
     2991            trigger_error( sprintf( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s', $function, $message, $version ) );
     2992        }
    29872993    }
    29882994}
Note: See TracChangeset for help on using the changeset viewer.