Make WordPress Core


Ignore:
Timestamp:
06/15/2021 03:21:50 PM (3 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-styles-registry.php

    r50703 r51154  
    4444
    4545        if ( ! isset( $block_name ) || ! is_string( $block_name ) ) {
    46             $message = __( 'Block name must be a string.' );
    47             _doing_it_wrong( __METHOD__, $message, '5.3.0' );
     46            _doing_it_wrong(
     47                __METHOD__,
     48                __( 'Block name must be a string.' ),
     49                '5.3.0'
     50            );
    4851            return false;
    4952        }
    5053
    5154        if ( ! isset( $style_properties['name'] ) || ! is_string( $style_properties['name'] ) ) {
    52             $message = __( 'Block style name must be a string.' );
    53             _doing_it_wrong( __METHOD__, $message, '5.3.0' );
     55            _doing_it_wrong(
     56                __METHOD__,
     57                __( 'Block style name must be a string.' ),
     58                '5.3.0'
     59            );
    5460            return false;
    5561        }
     
    7480    public function unregister( $block_name, $block_style_name ) {
    7581        if ( ! $this->is_registered( $block_name, $block_style_name ) ) {
    76             /* translators: 1: Block name, 2: Block style name. */
    77             $message = sprintf( __( 'Block "%1$s" does not contain a style named "%2$s".' ), $block_name, $block_style_name );
    78             _doing_it_wrong( __METHOD__, $message, '5.3.0' );
     82            _doing_it_wrong(
     83                __METHOD__,
     84                /* translators: 1: Block name, 2: Block style name. */
     85                sprintf( __( 'Block "%1$s" does not contain a style named "%2$s".' ), $block_name, $block_style_name ),
     86                '5.3.0'
     87            );
    7988            return false;
    8089        }
Note: See TracChangeset for help on using the changeset viewer.