Make WordPress Core

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: aaemnnosttv's profile aaemnnosttv 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.

Change History (1)

#1 @sabernhardt
3 years ago

  • Component changed from General to Script Loader

function added in #50328

Note: See TracTickets for help on using tickets.