File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1414 * @property {?Function } readyCallback
1515 */
1616
17+ // For compatibility with other scripts that read from this global.
18+ window . _wpemojiSettings = /** @type {WPEmojiSettings } */ (
19+ JSON . parse ( document . getElementById ( 'wp-emoji-settings' ) . textContent )
20+ ) ;
21+
1722/**
1823 * Support tests.
1924 * @typedef SupportTests
Original file line number Diff line number Diff line change @@ -6137,8 +6137,18 @@ function _print_emoji_detection_script() {
61376137 }
61386138
61396139 wp_print_inline_script_tag (
6140- sprintf ( 'window._wpemojiSettings = %s; ' , wp_json_encode ( $ settings ) ) . "\n" .
6141- file_get_contents ( ABSPATH . WPINC . '/js/wp-emoji-loader ' . wp_scripts_get_suffix () . '.js ' )
6140+ wp_json_encode ( $ settings , JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ),
6141+ array (
6142+ 'id ' => 'wp-emoji-settings ' ,
6143+ 'type ' => 'application/json ' ,
6144+ )
6145+ );
6146+
6147+ wp_print_inline_script_tag (
6148+ file_get_contents ( ABSPATH . WPINC . '/js/wp-emoji-loader ' . wp_scripts_get_suffix () . '.js ' ),
6149+ array (
6150+ 'type ' => 'module ' ,
6151+ )
61426152 );
61436153}
61446154
You can’t perform that action at this time.
0 commit comments