[wp-trac] [WordPress Trac] #59018: Blocks in child themes with folder names starting with the same as the parent cannot load assets in WP6.3
WordPress Trac
noreply at wordpress.org
Wed Aug 23 20:03:58 UTC 2023
#59018: Blocks in child themes with folder names starting with the same as the
parent cannot load assets in WP6.3
-------------------------------------------------+-------------------------
Reporter: lgladdy | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.3.2
Component: Editor | Version: 6.3
Severity: major | Resolution:
Keywords: has-unit-tests needs-testing needs- | Focuses:
patch |
-------------------------------------------------+-------------------------
Comment (by azaozz):
Looking at this more: seems adding a trailing slash would make it work
(somehow) for now. Not a fan of this solution but then there seems to be
some "pretty unusual" code there (not really sure what is the intent for
this use of substr_replace: `substr_replace( $script_path, '.asset.php', -
strlen( '.js' ) )`, why the negative index and why do `strlen()` of a
hard-coded string).
Thinking the `trailingslashit()` would be better applied to
`$template_path_norm` and `$template_path_norm`, not just when comparing
the paths. Later on when construction the script/stylesheet URL
`get_theme_file_uri()` removes slashes from the beginning of the fragment
anyways.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59018#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list