[wp-trac] [WordPress Trac] #63062: Parent theme incorrectly not getting resolved in WordPress 6.8-beta1
WordPress Trac
noreply at wordpress.org
Fri Mar 14 13:15:36 UTC 2025
#63062: Parent theme incorrectly not getting resolved in WordPress 6.8-beta1
-------------------------------------------------+-------------------------
Reporter: fabiankaegy | Owner: joemcgill
Type: defect (bug) | Status: closed
Priority: high | Milestone: 6.8
Component: Themes | Version: trunk
Severity: normal | Resolution: fixed
Keywords: has-patch needs-unit-tests needs- | Focuses:
testing has-testing-info has-screenshots |
-------------------------------------------------+-------------------------
Comment (by dinhtungdu):
Digging deeper into the Core to understand the issue, I found that:
* `wp_is_block_theme` doesn't need to be called after `after_theme_setup`,
it just needs to be called after [https://github.com/WordPress/wordpress-
develop/blob/32fe6af9c36e2b80e79a664fc6ae53d9c5cd3f9a/src/wp-
settings.php#L519 theme directories registration].
* The initial issue with the child theme is caused by calling that
function after [https://github.com/WordPress/wordpress-
develop/blob/32fe6af9c36e2b80e79a664fc6ae53d9c5cd3f9a/src/wp-
settings.php#L514 creating post types], which is before the theme
directories registration.
* Moving that logic to `after_theme_setup`, as we did in this ticket, is
enough to solve the issue.
* Plugins can never break the theme resolution because they are loaded
[https://github.com/WordPress/wordpress-
develop/blob/32fe6af9c36e2b80e79a664fc6ae53d9c5cd3f9a/src/wp-
settings.php#L529-L557 after] theme directories registration.
So the warning and early return don't protect us from anything and should
be removed.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63062#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list