Make WordPress Core

Changeset 52325


Ignore:
Timestamp:
12/06/2021 10:12:28 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Remove the replace:emoji-banner-text Grunt task.

The task was previously used to ensure that /*! This file is auto-generated */ comment is not included on front end as part of the inline emoji detection script.

As the wp-emoji-loader.js script is now included via file_get_contents() and wp_print_inline_script_tag() instead of grunt-include to simplify the logic, the task does not find anything to replace and is no longer necessary.

Additionally, include a line break before the wp-emoji-loader.js script content for better line wrapping.

Follow-up to [48096], [50651], [52132].

See #44632, #44306, #53363.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r52132 r52325  
    10941094                ]
    10951095            },
    1096             'emoji-banner-text': {
    1097                 options: {
    1098                     patterns: [
    1099                         {
    1100                             match: new RegExp( '\\s*' + BANNER_TEXT.replace( /[\/\*\!]/g, '\\$&' ) ),
    1101                             replacement: ''
    1102                         }
    1103                     ]
    1104                 },
    1105                 files: [
    1106                     {
    1107                         expand: true,
    1108                         flatten: true,
    1109                         src: [
    1110                             BUILD_DIR + 'wp-includes/formatting.php'
    1111                         ],
    1112                         dest: BUILD_DIR + 'wp-includes/'
    1113                     }
    1114                 ]
    1115             },
    11161096            'source-maps': {
    11171097                options: {
     
    15841564                'build:js',
    15851565                'build:css',
    1586                 'replace:emoji-banner-text',
    15871566                'replace:source-maps',
    15881567                'verify:build'
  • trunk/src/wp-includes/formatting.php

    r52294 r52325  
    57885788
    57895789    wp_print_inline_script_tag(
    5790         sprintf( 'window._wpemojiSettings = %s;', wp_json_encode( $settings ) ) .
     5790        sprintf( 'window._wpemojiSettings = %s;', wp_json_encode( $settings ) ) . "\n" .
    57915791            file_get_contents( sprintf( ABSPATH . WPINC . '/js/wp-emoji-loader' . wp_scripts_get_suffix() . '.js' ) )
    57925792    );
Note: See TracChangeset for help on using the changeset viewer.