Make WordPress Core

Changeset 56474


Ignore:
Timestamp:
08/26/2023 04:47:09 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Fix typo in a translator comment in _deprecated_class().

Includes a few other formatting adjustments for consistency.

Follow-up to [48327], [56467], [56471].

See #58833.

File:
1 edited

Legend:

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

    r56472 r56474  
    54145414 * Marks a function as deprecated and inform when it has been used.
    54155415 *
    5416  * There is a hook {@see 'deprecated_function_run'} that will be called that can be used
    5417  * to get the backtrace up to what file and function called the deprecated
    5418  * function.
     5416 * There is a {@see 'deprecated_function_run'} hook that will be called that can be used
     5417 * to get the backtrace up to what file and function called the deprecated function.
    54195418 *
    54205419 * The current behavior is to trigger a user error if `WP_DEBUG` is true.
    … …  
    55035502 *
    55045503 * Similar to _deprecated_function(), but with different strings. Used to
    5505  * remove PHP4 style constructors.
     5504 * remove PHP4-style constructors.
    55065505 *
    55075506 * The current behavior is to trigger a user error if `WP_DEBUG` is true.
    55085507 *
    5509  * This function is to be used in every PHP4 style constructor method that is deprecated.
     5508 * This function is to be used in every PHP4-style constructor method that is deprecated.
    55105509 *
    55115510 * @since 4.3.0
    … …  
    56055604 *
    56065605 * This function is to be used in the class constructor for every deprecated class.
    5607  * See {@see _deprecated_constructor()} for deprecating PHP4 style constructors.
     5606 * See {@see _deprecated_constructor()} for deprecating PHP4-style constructors.
    56085607 *
    56095608 * @since 6.4.0
    … …  
    56365635        if ( WP_DEBUG && apply_filters( 'deprecated_class_trigger_error', true ) ) {
    56375636                if ( function_exists( '__' ) ) {
    5638                         if ( ! is_null( $replacement ) ) {
    5639                                 /* translators: 1: PHP class name, 2: version number, 3: alternative clas or function name */
    5640                                 trigger_error( sprintf( __( 'Class %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), $class, $version, $replacement ), E_USER_DEPRECATED );
     5637                        if ( $replacement ) {
     5638                                trigger_error(
     5639                                        sprintf(
     5640                                                /* translators: 1: PHP class name, 2: Version number, 3: Alternative class or function name. */
     5641                                                __( 'Class %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
     5642                                                $class,
     5643                                                $version,
     5644                                                $replacement
     5645                                        ),
     5646                                        E_USER_DEPRECATED
     5647                                );
    56415648                        } else {
    5642                                 /* translators: 1: PHP class name, 2: version number */
    5643                                 trigger_error( sprintf( __( 'Class %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ), $class, $version ), E_USER_DEPRECATED );
     5649                                trigger_error(
     5650                                        sprintf(
     5651                                                /* translators: 1: PHP class name, 2: Version number. */
     5652                                                __( 'Class %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
     5653                                                $class,
     5654                                                $version
     5655                                        ),
     5656                                        E_USER_DEPRECATED
     5657                                );
    56445658                        }
    56455659                } else {
    5646                         if ( ! is_null( $replacement ) ) {
    5647                                 trigger_error( sprintf( 'Class %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $class, $version, $replacement ), E_USER_DEPRECATED );
     5660                        if ( $replacement ) {
     5661                                trigger_error(
     5662                                        sprintf(
     5663                                                'Class %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
     5664                                                $class,
     5665                                                $version,
     5666                                                $replacement
     5667                                        ),
     5668                                        E_USER_DEPRECATED
     5669                                );
    56485670                        } else {
    5649                                 trigger_error( sprintf( 'Class %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $class, $version ), E_USER_DEPRECATED );
     5671                                trigger_error(
     5672                                        sprintf(
     5673                                                'Class %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.',
     5674                                                $class,
     5675                                                $version
     5676                                        ),
     5677                                        E_USER_DEPRECATED
     5678                                );
    56505679                        }
    56515680                }
    … …  
    56565685 * Marks a file as deprecated and inform when it has been used.
    56575686 *
    5658  * There is a hook {@see 'deprecated_file_included'} that will be called that can be used
    5659  * to get the backtrace up to what file and function included the deprecated
    5660  * file.
     5687 * There is a {@see 'deprecated_file_included'} hook that will be called that can be used
     5688 * to get the backtrace up to what file and function included the deprecated file.
    56615689 *
    56625690 * The current behavior is to trigger a user error if `WP_DEBUG` is true.
    … …  
    57515779 * Before this function is called, the argument must be checked for whether it was
    57525780 * used by comparing it to its default value or evaluating whether it is empty.
     5781 *
    57535782 * For example:
    57545783 *
    … …  
    57575786 *     }
    57585787 *
    5759  * There is a hook deprecated_argument_run that will be called that can be used
    5760  * to get the backtrace up to what file and function used the deprecated
    5761  * argument.
     5788 * There is a {@see 'deprecated_argument_run'} hook that will be called that can be used
     5789 * to get the backtrace up to what file and function used the deprecated argument.
    57625790 *
    57635791 * The current behavior is to trigger a user error if WP_DEBUG is true.
    … …  
    59125940 * Marks something as being incorrectly called.
    59135941 *
    5914  * There is a hook {@see 'doing_it_wrong_run'} that will be called that can be used
    5915  * to get the backtrace up to what file and function called the deprecated
    5916  * function.
     5942 * There is a {@see 'doing_it_wrong_run'} hook that will be called that can be used
     5943 * to get the backtrace up to what file and function called the deprecated function.
    59175944 *
    59185945 * The current behavior is to trigger a user error if `WP_DEBUG` is true.
Note: See TracChangeset for help on using the changeset viewer.