Make WordPress Core

Changeset 52609


Ignore:
Timestamp:
01/20/2022 01:11:04 PM (2 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r52422 r52609  
    53095309                    sprintf(
    53105310                        /* translators: 1: PHP function name, 2: Version number, 3: Alternative function name. */
    5311                         __( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
     5311                        __( 'Function %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
    53125312                        $function,
    53135313                        $version,
     
    53205320                    sprintf(
    53215321                        /* translators: 1: PHP function name, 2: Version number. */
    5322                         __( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
     5322                        __( 'Function %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
    53235323                        $function,
    53245324                        $version
     
    53315331                trigger_error(
    53325332                    sprintf(
    5333                         '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
     5333                        'Function %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
    53345334                        $function,
    53355335                        $version,
     
    53415341                trigger_error(
    53425342                    sprintf(
    5343                         '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.',
     5343                        'Function %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.',
    53445344                        $function,
    53455345                        $version
     
    54015401                    sprintf(
    54025402                        /* translators: 1: PHP class name, 2: PHP parent class name, 3: Version number, 4: __construct() method. */
    5403                         __( 'The called constructor method for %1$s in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.' ),
     5403                        __( 'The called constructor method for %1$s class in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.' ),
    54045404                        $class,
    54055405                        $parent_class,
     
    54135413                    sprintf(
    54145414                        /* translators: 1: PHP class name, 2: Version number, 3: __construct() method. */
    5415                         __( 'The called constructor method for %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
     5415                        __( 'The called constructor method for %1$s class is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
    54165416                        $class,
    54175417                        $version,
     
    54255425                trigger_error(
    54265426                    sprintf(
    5427                         'The called constructor method for %1$s in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.',
     5427                        'The called constructor method for %1$s class in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.',
    54285428                        $class,
    54295429                        $parent_class,
     
    54365436                trigger_error(
    54375437                    sprintf(
    5438                         'The called constructor method for %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
     5438                        'The called constructor method for %1$s class is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
    54395439                        $class,
    54405440                        $version,
     
    54995499                    sprintf(
    55005500                        /* translators: 1: PHP file name, 2: Version number, 3: Alternative file name. */
    5501                         __( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
     5501                        __( 'File %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
    55025502                        $file,
    55035503                        $version,
     
    55105510                    sprintf(
    55115511                        /* translators: 1: PHP file name, 2: Version number. */
    5512                         __( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
     5512                        __( 'File %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
    55135513                        $file,
    55145514                        $version
     
    55215521                trigger_error(
    55225522                    sprintf(
    5523                         '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
     5523                        'File %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
    55245524                        $file,
    55255525                        $version,
     
    55315531                trigger_error(
    55325532                    sprintf(
    5533                         '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.',
     5533                        'File %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.',
    55345534                        $file,
    55355535                        $version
     
    55935593                    sprintf(
    55945594                        /* translators: 1: PHP function name, 2: Version number, 3: Optional message regarding the change. */
    5595                         __( '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s' ),
     5595                        __( 'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s' ),
    55965596                        $function,
    55975597                        $version,
     
    56045604                    sprintf(
    56055605                        /* translators: 1: PHP function name, 2: Version number. */
    5606                         __( '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
     5606                        __( 'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
    56075607                        $function,
    56085608                        $version
     
    56155615                trigger_error(
    56165616                    sprintf(
    5617                         '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s',
     5617                        'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s',
    56185618                        $function,
    56195619                        $version,
     
    56255625                trigger_error(
    56265626                    sprintf(
    5627                         '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.',
     5627                        'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.',
    56285628                        $function,
    56295629                        $version
     
    56845684                sprintf(
    56855685                    /* translators: 1: WordPress hook name, 2: Version number, 3: Alternative hook name. */
    5686                     __( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
     5686                    __( 'Hook %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
    56875687                    $hook,
    56885688                    $version,
     
    56955695                sprintf(
    56965696                    /* translators: 1: WordPress hook name, 2: Version number. */
    5697                     __( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
     5697                    __( 'Hook %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
    56985698                    $hook,
    56995699                    $version
     
    57615761                sprintf(
    57625762                    /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message, 3: WordPress version number. */
    5763                     __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ),
     5763                    __( 'Function %1$s was called <strong>incorrectly</strong>. %2$s %3$s' ),
    57645764                    $function,
    57655765                    $message,
     
    57805780            trigger_error(
    57815781                sprintf(
    5782                     '%1$s was called <strong>incorrectly</strong>. %2$s %3$s',
     5782                    'Function %1$s was called <strong>incorrectly</strong>. %2$s %3$s',
    57835783                    $function,
    57845784                    $message,
Note: See TracChangeset for help on using the changeset viewer.