[wp-trac] [WordPress Trac] #53848: 'is_feed was called incorrectly' notice if `wp_styles()` is called before the query

WordPress Trac noreply at wordpress.org
Sat Jul 31 17:20:16 UTC 2021


#53848: 'is_feed was called incorrectly' notice if `wp_styles()` is called before
the query
--------------------------+-----------------------------
 Reporter:  aaemnnosttv   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.8
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53848>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list