Fix: remove _doing_it_wrong notice and early return in WP_Theme:is_block_theme
#8508
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.