[wp-trac] [WordPress Trac] #65260: Emoji detection script breaks the script modules import map in the Site Editor
WordPress Trac
noreply at wordpress.org
Mon May 18 17:25:15 UTC 2026
#65260: Emoji detection script breaks the script modules import map in the Site
Editor
---------------------------+------------------------------
Reporter: wildworks | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Abilities API | Version: 6.9
Severity: normal | Resolution:
Keywords: | Focuses:
---------------------------+------------------------------
Comment (by westonruter):
I see, so this is only an issue in the block preview. It's not an issue in
the frontend.
Yes, r60899 to fix #63842 is related, but more specifically it was moved
to the footer in r60902 to fix #64076. The issue would have happened even
more so if it had been left in `wp_head`.
(On the frontend, the `importmap` is printed at `wp_footer` priority 10.
It seems like it should have been printed at priority 9, the same as in
the admin however, to go along with r62080 for #64907. Nevertheless, the
emoji loader on the frontend is printed at `wp_footer` priority 20 as part
of `wp_print_footer_scripts`. So it shouldn't be a problem on the
frontend.)
For the admin, it seems the problem is that the emoji detection script
wasn't moved to the footer like it was on the frontend. This might be all
we need to do:
{{{#!diff
diff --git a/src/wp-admin/includes/admin-filters.php b/src/wp-
admin/includes/admin-filters.php
index 5337cc02c8..2fe6f34034 100644
--- a/src/wp-admin/includes/admin-filters.php
+++ b/src/wp-admin/includes/admin-filters.php
@@ -56,7 +56,7 @@ if ( ! is_customize_preview() ) {
add_action( 'admin_print_styles', 'wp_resource_hints', 1 );
}
-add_action( 'admin_print_scripts', 'print_emoji_detection_script' );
+add_action( 'admin_print_footer_scripts', 'print_emoji_detection_script'
);
add_action( 'admin_print_scripts', 'print_head_scripts', 20 );
add_action( 'admin_print_footer_scripts', '_wp_footer_scripts' );
add_action( 'admin_enqueue_scripts', 'wp_enqueue_emoji_styles' );
}}}
(Back-compat concerns notwithstanding.)
However, I think we should take this as an opportunity to implement the
loading of that module as an external script via #64259. That would also
fix this issue.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/65260#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list