Make WordPress Core


Ignore:
Timestamp:
06/15/2021 03:21:50 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Remove a one-time $message variable in some _doing_it_wrong() calls.

This brings some consistency with most other calls.

Follow-up to [23378], [25605], [34745], [36219], [44108], [46111], [48156].

See #52627.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-block-patterns-registry.php

    r50532 r51154  
    4242        public function register( $pattern_name, $pattern_properties ) {
    4343                if ( ! isset( $pattern_name ) || ! is_string( $pattern_name ) ) {
    44                         _doing_it_wrong( __METHOD__, __( 'Pattern name must be a string.' ), '5.5.0' );
     44                        _doing_it_wrong(
     45                                __METHOD__,
     46                                __( 'Pattern name must be a string.' ),
     47                                '5.5.0'
     48                        );
    4549                        return false;
    4650                }
    4751
    4852                if ( ! isset( $pattern_properties['title'] ) || ! is_string( $pattern_properties['title'] ) ) {
    49                         _doing_it_wrong( __METHOD__, __( 'Pattern title must be a string.' ), '5.5.0' );
     53                        _doing_it_wrong(
     54                                __METHOD__,
     55                                __( 'Pattern title must be a string.' ),
     56                                '5.5.0'
     57                        );
    5058                        return false;
    5159                }
    5260
    5361                if ( ! isset( $pattern_properties['content'] ) || ! is_string( $pattern_properties['content'] ) ) {
    54                         _doing_it_wrong( __METHOD__, __( 'Pattern content must be a string.' ), '5.5.0' );
     62                        _doing_it_wrong(
     63                                __METHOD__,
     64                                __( 'Pattern content must be a string.' ),
     65                                '5.5.0'
     66                        );
    5567                        return false;
    5668                }
    … …  
    7486        public function unregister( $pattern_name ) {
    7587                if ( ! $this->is_registered( $pattern_name ) ) {
    76                         /* translators: %s: Pattern name. */
    77                         $message = sprintf( __( 'Pattern "%s" not found.' ), $pattern_name );
    78                         _doing_it_wrong( __METHOD__, $message, '5.5.0' );
     88                        _doing_it_wrong(
     89                                __METHOD__,
     90                                /* translators: %s: Pattern name. */
     91                                sprintf( __( 'Pattern "%s" not found.' ), $pattern_name ),
     92                                '5.5.0'
     93                        );
    7994                        return false;
    8095                }
Note: See TracChangeset for help on using the changeset viewer.