[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 9 08:54:17 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: Awaiting Review
Component: Editor | Version: 6.3
Severity: major | Keywords:
Focuses: |
--------------------------+-----------------------------
A bug has been introduced in WordPress 6.3 for blocks contained inside a
child theme, where their path begins with the parent themes path.
For example, if my theme is called `twentytwentythreechild` as is a child
theme of `twentytwentythree` the code in blocks.php's
register_block_script_handle and register_block_style_handle to handle
child themes assets path will incorrectly change the script to:
`/wp-content/themes/twentytwentythree/child/blocks/all-fields-block-json
/all-fields-block-in-theme.js`
instead of:
`/wp-content/themes/twentytwentythreechild/blocks/all-fields-block-json
/all-fields-block-in-theme.js`
The specific code causing this is the switch on `$is_parent_theme_block`,
commented as `// Get the script path deterministically based on whether or
not it was registered in a parent or child theme.`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59018>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list