Opened 4 years ago
Last modified 3 years ago
#53848 new defect (bug)
'is_feed was called incorrectly' notice if `wp_styles()` is called before the query
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 5.8 |
Component: | Script Loader | Keywords: | |
Focuses: | Cc: |
Description
WordPress 5.8 introduced the wp_should_load_separate_core_block_assets
(https://developer.wordpress.org/reference/functions/wp_should_load_separate_core_block_assets/) function which calls is_feed()
internally as part of its preliminary checks that guard the application of its filter.
Since wp_should_load_separate_core_block_assets
is now called within wp_default_styles()
, this has the potential to raise a "doing it wrong" notice if WP_Styles
is initialized before the query runs for non-admin requests.
wp_styles()
has never imposed such timing restrictions on when it is called, this is somewhat of a breaking change.
Ideally a different condition that does not impose the same limitation could be used in the place of is_feed
here.
function added in #50328