Fix: remove _doing_it_wrong notice and early return in WP_Theme:is_block_theme#8508
Fix: remove _doing_it_wrong notice and early return in WP_Theme:is_block_theme#8508dinhtungdu wants to merge 1 commit intoWordPress:trunkfrom
_doing_it_wrong notice and early return in WP_Theme:is_block_theme#8508Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
WP_Theme:is_block_theme_doing_it_wrong notice and early return in WP_Theme:is_block_theme
|
Absolutely agree. This is filling up my logs and not sure it's even effecting function as I'm sure it's used in a plugin. |
|
Closing in favor of #8526 |
This PR partially reverts https://core.trac.wordpress.org/changeset/59968 by removing the
warningnotice and early return inWP_Theme::is_block_theme(), which causes issues if active plugins callwp_is_block_theme()early. It's safe for plugins to callwp_is_block_theme()anytime so the early return and notice should be removed.wp_is_block_themedoesn't need to be called afterafter_theme_setup, it just needs to be called after theme directories have been registered.after_theme_setup, as we did in https://core.trac.wordpress.org/changeset/59968, is enough to solve the issue.Trac ticket: https://core.trac.wordpress.org/ticket/63086
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.