[wp-trac] [WordPress Trac] #58520: Change the order of check in is_block_theme

WordPress Trac noreply at wordpress.org
Mon Jun 12 14:25:51 UTC 2023


#58520: Change the order of check in is_block_theme
--------------------------+----------------------------
 Reporter:  spacedmonkey  |      Owner:  (none)
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Future Release
Component:  Themes        |    Version:  5.8
 Severity:  normal        |   Keywords:  good-first-bug
  Focuses:  performance   |
--------------------------+----------------------------
 In the method `is_block_theme` in `WP_Theme` class, a check for files in
 `block-templates` and `templates`. However files in `block-templates`
 where deprecated in 5.9. It is far more like that themes will have files
 in the `templates` directory. To improve performance, change the order of
 the lookup, to check `block-templates` and save a file lookup.

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


More information about the wp-trac mailing list