diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 856f657b2f..9b39204cfb 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -2864,10 +2864,17 @@ function _deprecated_function( $function, $version, $replacement = null ) {
// Allow plugin to filter the output error trigger
if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {
- if ( ! is_null($replacement) )
- trigger_error( sprintf( __('%1$s is deprecated since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
- else
- trigger_error( sprintf( __('%1$s is deprecated since version %2$s with no alternative available.'), $function, $version ) );
+ if ( function_exists( '__' ) ) {
+ if ( ! is_null( $replacement ) )
+ trigger_error( sprintf( __('%1$s is deprecated since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
+ else
+ trigger_error( sprintf( __('%1$s is deprecated since version %2$s with no alternative available.'), $function, $version ) );
+ } else {
+ if ( ! is_null( $replacement ) )
+ trigger_error( sprintf( '%1$s is deprecated since version %2$s! Use %3$s instead.', $function, $version, $replacement ) );
+ else
+ trigger_error( sprintf( '%1$s is deprecated since version %2$s with no alternative available.', $function, $version ) );
+ }
}
}
@@ -2904,10 +2911,17 @@ function _deprecated_file( $file, $version, $replacement = null, $message = '' )
// Allow plugin to filter the output error trigger
if ( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) {
$message = empty( $message ) ? '' : ' ' . $message;
- if ( ! is_null( $replacement ) )
- trigger_error( sprintf( __('%1$s is deprecated since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) . $message );
- else
- trigger_error( sprintf( __('%1$s is deprecated since version %2$s with no alternative available.'), $file, $version ) . $message );
+ if ( function_exists( '__' ) ) {
+ if ( ! is_null( $replacement ) )
+ trigger_error( sprintf( __('%1$s is deprecated since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) . $message );
+ else
+ trigger_error( sprintf( __('%1$s is deprecated since version %2$s with no alternative available.'), $file, $version ) . $message );
+ } else {
+ if ( ! is_null( $replacement ) )
+ trigger_error( sprintf( '%1$s is deprecated since version %2$s! Use %3$s instead.', $file, $version, $replacement ) . $message );
+ else
+ trigger_error( sprintf( '%1$s is deprecated since version %2$s with no alternative available.', $file, $version ) . $message );
+ }
}
}
/**
@@ -2948,10 +2962,17 @@ function _deprecated_argument( $function, $version, $message = null ) {
// Allow plugin to filter the output error trigger
if ( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) {
- if ( ! is_null( $message ) )
- trigger_error( sprintf( __('%1$s was called with an argument that is deprecated since version %2$s! %3$s'), $function, $version, $message ) );
- else
- trigger_error( sprintf( __('%1$s was called with an argument that is deprecated since version %2$s with no alternative available.'), $function, $version ) );
+ if ( function_exists( '__' ) ) {
+ if ( ! is_null( $message ) )
+ trigger_error( sprintf( __('%1$s was called with an argument that is deprecated since version %2$s! %3$s'), $function, $version, $message ) );
+ else
+ trigger_error( sprintf( __('%1$s was called with an argument that is deprecated since version %2$s with no alternative available.'), $function, $version ) );
+ } else {
+ if ( ! is_null( $message ) )
+ trigger_error( sprintf( '%1$s was called with an argument that is deprecated since version %2$s! %3$s', $function, $version, $message ) );
+ else
+ trigger_error( sprintf( '%1$s was called with an argument that is deprecated since version %2$s with no alternative available.', $function, $version ) );
+ }
}
}