Make WordPress Core


Ignore:
Timestamp:
06/15/2021 02:01:57 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Editor, I18N: Remove code from a translatable string in wp_migrate_old_typography_shape().

Replace a trigger_error() call with _doing_it_wrong() for consistency with how similar messages are displayed elsewhere in core.

Follow-up to [51089].

See #52991.

File:
1 edited

Legend:

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

    r51148 r51153  
    8585    );
    8686    if ( ! file_exists( $script_asset_path ) ) {
    87         $message = sprintf(
    88             /* translators: %1: field name. %2: block name */
    89             __( 'The asset file for the "%1$s" defined in "%2$s" block definition is missing.', 'default' ),
    90             $field_name,
    91             $metadata['name']
     87        _doing_it_wrong(
     88            __FUNCTION__,
     89            sprintf(
     90                /* translators: 1: Field name, 2: Block name. */
     91                __( 'The asset file for the "%1$s" defined in "%2$s" block definition is missing.', 'default' ),
     92                $field_name,
     93                $metadata['name']
     94            ),
     95            '5.5.0'
    9296        );
    93         _doing_it_wrong( __FUNCTION__, $message, '5.5.0' );
    9497        return false;
    9598    }
     
    987990        $support_for_key = _wp_array_get( $metadata['supports'], array( $typography_key ), null );
    988991        if ( null !== $support_for_key ) {
    989             trigger_error(
    990                 /* translators: %1$s: Block type, %2$s: typography supports key e.g: fontSize, lineHeight etc... */
    991                 sprintf( __( 'Block %1$s is declaring %2$s support on block.json under supports.%2$s. %2$s support is now declared under supports.typography.%2$s.' ), $metadata['name'], $typography_key ),
    992                 headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
     992            _doing_it_wrong(
     993                'register_block_type_from_metadata()',
     994                sprintf(
     995                    /* translators: 1: Block type, 2: Typography supports key, e.g: fontSize, lineHeight, etc. 3: block.json, 4: Old metadata key, 5: New metadata key. */
     996                    __( 'Block "%1$s" is declaring %2$s support in %3$s file under %4$s. %2$s support is now declared under %5$s.' ),
     997                    $metadata['name'],
     998                    "<code>$typography_key</code>",
     999                    '<code>block.json</code>',
     1000                    "<code>supports.$typography_key</code>",
     1001                    "<code>supports.typography.$typography_key</code>"
     1002                ),
     1003                '5.8.0'
    9931004            );
    9941005            _wp_array_set( $metadata['supports'], array( 'typography', $typography_key ), $support_for_key );
Note: See TracChangeset for help on using the changeset viewer.