Opened 5 years ago
Last modified 5 years ago
#53848 new defect (bug)
'is_feed was called incorrectly' notice if `wp_styles()` is called before the query
| Reported by: | aaemnnosttv | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Script Loader | Version: | 5.8 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
function added in #50328