[wp-trac] [WordPress Trac] #63086: Customizer: notice errror regarding WP_Theme::is_block_theme

WordPress Trac noreply at wordpress.org
Sat Mar 15 10:02:15 UTC 2025


#63086: Customizer: notice errror regarding WP_Theme::is_block_theme
-------------------------------------------------+-------------------------
 Reporter:  wildworks                            |       Owner:  joemcgill
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.8
Component:  Customize                            |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-testing-info needs-unit-tests    |     Focuses:
  needs-refresh                                  |
-------------------------------------------------+-------------------------

Comment (by SirLouen):

 Replying to [comment:17 dinhtungdu]:
 > @SirLouen I tested your snippet and I can see the difference after
 switching: the warning and value of `$is_block_theme` is `false` when
 using the `plugins_loaded` callback. Is that the difference you're talking
 about?

 I'm not 1000% because I have not read all the context, but this is just a
 notice.

 This is not a warning and is not an error checker to raise an exception.
 It's not "protecting" anything but the developer to code wrongly.

 It's merely a developer notice that is informing of what you are saying
 here: "Themes are not yet loaded at this point, therefore the
 `$is_block_theme` is always going to be `false`, so please, gently move
 your `is_block_theme` call forward to a point where the call to
 `is_block_theme`, makes real sense.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63086#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list