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.

Merges [24439] to the 3.5 branch.

props SergeyBiryukov.
fixes #23555.



git-svn-id: http://core.svn.wordpress.org/branches/3.5@24440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-06-19 08:12:48 +00:00
parent e7379e4c5d
commit 07cabe2b02
1 changed files with 9 additions and 3 deletions

View File

@ -2954,9 +2954,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 <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.' );
trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %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 <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.' );
trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );
} else {
$version = is_null( $version ) ? '' : sprintf( '(This message was added in version %s.)', $version );
$message .= ' Please see <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.';
trigger_error( sprintf( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s', $function, $message, $version ) );
}
}
}