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.
Built from https://develop.svn.wordpress.org/trunk@52609


git-svn-id: http://core.svn.wordpress.org/trunk@52197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2022-01-20 13:13:01 +00:00
parent d4306e8d8a
commit e07b5af042
2 changed files with 21 additions and 21 deletions

View File

@ -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

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.0-alpha-52608';
$wp_version = '6.0-alpha-52609';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.