[wp-trac] [WordPress Trac] #63086: Customizer: notice errror regarding WP_Theme::is_block_theme
WordPress Trac
noreply at wordpress.org
Mon Mar 17 18:36:53 UTC 2025
#63086: Customizer: notice errror regarding WP_Theme::is_block_theme
------------------------------------------+------------------------
Reporter: wildworks | Owner: joemcgill
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 6.8
Component: Customize | Version:
Severity: normal | Resolution:
Keywords: has-testing-info needs-patch | Focuses:
------------------------------------------+------------------------
Changes (by joemcgill):
* keywords: has-testing-info has-patch => has-testing-info needs-patch
Comment:
@afragen I agree that this is tricky. Technically, we should throw the
error if `wp_get_theme()` is called too early (not the plural,
`wp_get_themes()`), since calling this function before the theme
directories are set up will break the resolution of parent/child themes.
However, given that this function has been in core basically unchanged for
13 years, I'm hesitant to add a new `_doing_it_wrong()` there.
It's much more likely for `wp_is_block_theme()` to be called too early,
given the amount of features that checking to see if the current theme is
a block theme. That's why I think moving the warning there, instead of the
`WP_Theme` method would be more appropriate. Hopefully that's more clear.
I've opened a new PR to demonstrate what I'm proposing.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63086#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list