WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/15/2021 03:21:50 PM (6 months 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/shortcodes.php

    r49963 r51154  
    6565
    6666    if ( '' === trim( $tag ) ) {
    67         $message = __( 'Invalid shortcode name: Empty name given.' );
    68         _doing_it_wrong( __FUNCTION__, $message, '4.4.0' );
     67        _doing_it_wrong(
     68            __FUNCTION__,
     69            __( 'Invalid shortcode name: Empty name given.' ),
     70            '4.4.0'
     71        );
    6972        return;
    7073    }
    7174
    7275    if ( 0 !== preg_match( '@[<>&/\[\]\x00-\x20=]@', $tag ) ) {
    73         /* translators: 1: Shortcode name, 2: Space-separated list of reserved characters. */
    74         $message = sprintf( __( 'Invalid shortcode name: %1$s. Do not use spaces or reserved characters: %2$s' ), $tag, '& / < > [ ] =' );
    75         _doing_it_wrong( __FUNCTION__, $message, '4.4.0' );
     76        _doing_it_wrong(
     77            __FUNCTION__,
     78            sprintf(
     79                /* translators: 1: Shortcode name, 2: Space-separated list of reserved characters. */
     80                __( 'Invalid shortcode name: %1$s. Do not use spaces or reserved characters: %2$s' ),
     81                $tag,
     82                '& / < > [ ] ='
     83            ),
     84            '4.4.0'
     85        );
    7686        return;
    7787    }
     
    315325
    316326    if ( ! is_callable( $shortcode_tags[ $tag ] ) ) {
    317         /* translators: %s: Shortcode tag. */
    318         $message = sprintf( __( 'Attempting to parse a shortcode without a valid callback: %s' ), $tag );
    319         _doing_it_wrong( __FUNCTION__, $message, '4.3.0' );
     327        _doing_it_wrong(
     328            __FUNCTION__,
     329            /* translators: %s: Shortcode tag. */
     330            sprintf( __( 'Attempting to parse a shortcode without a valid callback: %s' ), $tag ),
     331            '4.3.0'
     332        );
    320333        return $m[0];
    321334    }
Note: See TracChangeset for help on using the changeset viewer.