[wp-trac] [WordPress Trac] #63399: Twenty Twenty-Five: editor style isn't enqueued
WordPress Trac
noreply at wordpress.org
Fri Jun 20 03:12:51 UTC 2025
#63399: Twenty Twenty-Five: editor style isn't enqueued
----------------------------------------------+------------------------
Reporter: wildworks | Owner: audrasjb
Type: defect (bug) | Status: reviewing
Priority: high | Milestone: 6.8.2
Component: Bundled Theme | Version: 6.7
Severity: normal | Resolution:
Keywords: has-patch commit needs-test-info | Focuses:
----------------------------------------------+------------------------
Comment (by wildworks):
I think I understand why we can't reproduce this problem stably.
I thought that the `add_editor_style()` function only supported a relative
file path as an argument, but it seems that's not the case.
- The stylesheet is added to the `$editor_styles` global variable via the
`add_editor_style()` function: [https://github.com/WordPress/wordpress-
develop/blob/ebace79f789958504e1ec27e6644fac79ebc3ee4/src/wp-
includes/theme.php#L2182 Source]
- That stylesheet is passed to the block editor via the
`get_block_editor_theme_styles()` function: [https://github.com/WordPress
/wordpress-develop/blob/ebace79f789958504e1ec27e6644fac79ebc3ee4/src/wp-
includes/block-editor.php#L784 Source]
Looking at the implementation here, if the stylesheet string starts with
http or https, it attempts to download the stylesheet via `wp_remote_get`.
**In other words, the add_editor_style() function has internal support for
some stylesheets that are URLs**.
I believe that the default Playground environment does not allow network
access, which causes the stylesheet that starts with https to fail to
download, resulting in the problem being reproduced:
https://playground.wordpress.net/
On the other hand, in a Playground environment with network access
enabled, the problem should not be reproduced:
https://playground.wordpress.net/?networking=yes
Either way, it's a good idea to change it to a relative path to improve
the performance of loading editor styles and ensure they load in all
environments.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63399#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list