diff options
author | Sergey Biryukov <sergeybiryukov@git.wordpress.org> | 2022-01-20 13:11:04 +0000 |
---|---|---|
committer | Sergey Biryukov <sergeybiryukov@git.wordpress.org> | 2022-01-20 13:11:04 +0000 |
commit | 7ca1a2a0d755224018f203f35914a4d1ede4cedd (patch) | |
tree | 763c59f343dfd92e03a92b1d602aa1726c7b02d2 /src | |
parent | 26bb9fde3db1ace313356a9ede87e8343be15974 (diff) | |
download | wordpress-7ca1a2a0d755224018f203f35914a4d1ede4cedd.tar.gz wordpress-7ca1a2a0d755224018f203f35914a4d1ede4cedd.zip |
General: Clarify the deprecation messages in the `_deprecated_*()` functions family.
This makes the strings easier to translate and provides more details about what exactly is deprecated: a PHP function, a file name, or a WordPress hook.
The changes apply to:
* `_deprecated_function()`
* `_deprecated_constructor()`
* `_deprecated_file()`
* `_deprecated_argument()`
* `_deprecated_hook()`
* `_doing_it_wrong()`
Follow-up to [6514], [7884], [12536], [12584], [16939], [16942], [16945], [24439], [24723], [32989], [37861], [39315].
Props mukesh27, audrasjb, SergeyBiryukov.
Fixes #54658.
git-svn-id: https://develop.svn.wordpress.org/trunk@52609 602fd350-edb4-49c9-b593-d223f7449a82
Diffstat (limited to 'src')
-rw-r--r-- | src/wp-includes/functions.php | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 4666f980c7..33b1d9ecfc 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -5308,7 +5308,7 @@ function _deprecated_function( $function, $version, $replacement = '' ) { trigger_error( sprintf( /* translators: 1: PHP function name, 2: Version number, 3: Alternative function name. */ - __( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), + __( 'Function %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), $function, $version, $replacement @@ -5319,7 +5319,7 @@ function _deprecated_function( $function, $version, $replacement = '' ) { trigger_error( sprintf( /* translators: 1: PHP function name, 2: Version number. */ - __( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ), + __( 'Function %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ), $function, $version ), @@ -5330,7 +5330,7 @@ function _deprecated_function( $function, $version, $replacement = '' ) { if ( $replacement ) { trigger_error( sprintf( - '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', + 'Function %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $function, $version, $replacement @@ -5340,7 +5340,7 @@ function _deprecated_function( $function, $version, $replacement = '' ) { } else { trigger_error( sprintf( - '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', + 'Function %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $function, $version ), @@ -5400,7 +5400,7 @@ function _deprecated_constructor( $class, $version, $parent_class = '' ) { trigger_error( sprintf( /* translators: 1: PHP class name, 2: PHP parent class name, 3: Version number, 4: __construct() method. */ - __( 'The called constructor method for %1$s in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.' ), + __( 'The called constructor method for %1$s class in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.' ), $class, $parent_class, $version, @@ -5412,7 +5412,7 @@ function _deprecated_constructor( $class, $version, $parent_class = '' ) { trigger_error( sprintf( /* translators: 1: PHP class name, 2: Version number, 3: __construct() method. */ - __( 'The called constructor method for %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), + __( 'The called constructor method for %1$s class is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), $class, $version, '<code>__construct()</code>' @@ -5424,7 +5424,7 @@ function _deprecated_constructor( $class, $version, $parent_class = '' ) { if ( $parent_class ) { trigger_error( sprintf( - 'The called constructor method for %1$s in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.', + 'The called constructor method for %1$s class in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.', $class, $parent_class, $version, @@ -5435,7 +5435,7 @@ function _deprecated_constructor( $class, $version, $parent_class = '' ) { } else { trigger_error( sprintf( - 'The called constructor method for %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', + 'The called constructor method for %1$s class is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $class, $version, '<code>__construct()</code>' @@ -5498,7 +5498,7 @@ function _deprecated_file( $file, $version, $replacement = '', $message = '' ) { trigger_error( sprintf( /* translators: 1: PHP file name, 2: Version number, 3: Alternative file name. */ - __( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), + __( 'File %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), $file, $version, $replacement @@ -5509,7 +5509,7 @@ function _deprecated_file( $file, $version, $replacement = '', $message = '' ) { trigger_error( sprintf( /* translators: 1: PHP file name, 2: Version number. */ - __( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ), + __( 'File %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ), $file, $version ) . $message, @@ -5520,7 +5520,7 @@ function _deprecated_file( $file, $version, $replacement = '', $message = '' ) { if ( $replacement ) { trigger_error( sprintf( - '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', + 'File %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $file, $version, $replacement @@ -5530,7 +5530,7 @@ function _deprecated_file( $file, $version, $replacement = '', $message = '' ) { } else { trigger_error( sprintf( - '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', + 'File %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $file, $version ) . $message, @@ -5592,7 +5592,7 @@ function _deprecated_argument( $function, $version, $message = '' ) { trigger_error( sprintf( /* translators: 1: PHP function name, 2: Version number, 3: Optional message regarding the change. */ - __( '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s' ), + __( 'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s' ), $function, $version, $message @@ -5603,7 +5603,7 @@ function _deprecated_argument( $function, $version, $message = '' ) { trigger_error( sprintf( /* translators: 1: PHP function name, 2: Version number. */ - __( '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.' ), + __( 'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.' ), $function, $version ), @@ -5614,7 +5614,7 @@ function _deprecated_argument( $function, $version, $message = '' ) { if ( $message ) { trigger_error( sprintf( - '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s', + 'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s', $function, $version, $message @@ -5624,7 +5624,7 @@ function _deprecated_argument( $function, $version, $message = '' ) { } else { trigger_error( sprintf( - '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.', + 'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.', $function, $version ), @@ -5683,7 +5683,7 @@ function _deprecated_hook( $hook, $version, $replacement = '', $message = '' ) { trigger_error( sprintf( /* translators: 1: WordPress hook name, 2: Version number, 3: Alternative hook name. */ - __( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), + __( 'Hook %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), $hook, $version, $replacement @@ -5694,7 +5694,7 @@ function _deprecated_hook( $hook, $version, $replacement = '', $message = '' ) { trigger_error( sprintf( /* translators: 1: WordPress hook name, 2: Version number. */ - __( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ), + __( 'Hook %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ), $hook, $version ) . $message, @@ -5760,7 +5760,7 @@ function _doing_it_wrong( $function, $message, $version ) { trigger_error( sprintf( /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message, 3: WordPress version number. */ - __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), + __( 'Function %1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version @@ -5779,7 +5779,7 @@ function _doing_it_wrong( $function, $message, $version ) { trigger_error( sprintf( - '%1$s was called <strong>incorrectly</strong>. %2$s %3$s', + 'Function %1$s was called <strong>incorrectly</strong>. %2$s %3$s', $function, $message, $version |