From e5200a2d190c2a2b479ddcc52d22397eb5b14795 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 19 Jun 2013 08:11:59 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@24439 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index d31e58ae42..4a4a944e84 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2981,9 +2981,15 @@ function _doing_it_wrong( $function, $message, $version ) { // Allow plugin to filter the output error trigger if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) { - $version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version ); - $message .= ' ' . __( 'Please see Debugging in WordPress for more information.' ); - trigger_error( sprintf( __( '%1$s was called incorrectly. %2$s %3$s' ), $function, $message, $version ) ); + if ( function_exists( '__' ) ) { + $version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version ); + $message .= ' ' . __( 'Please see Debugging in WordPress for more information.' ); + trigger_error( sprintf( __( '%1$s was called incorrectly. %2$s %3$s' ), $function, $message, $version ) ); + } else { + $version = is_null( $version ) ? '' : sprintf( '(This message was added in version %s.)', $version ); + $message .= ' Please see Debugging in WordPress for more information.'; + trigger_error( sprintf( '%1$s was called incorrectly. %2$s %3$s', $function, $message, $version ) ); + } } }