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

WordPress Trac noreply at wordpress.org
Mon Jun 19 16:02:59 UTC 2023


#58520: Change the order of check in is_block_theme
-----------------------------------+---------------------------
 Reporter:  spacedmonkey           |       Owner:  spacedmonkey
     Type:  enhancement            |      Status:  closed
 Priority:  normal                 |   Milestone:  6.3
Component:  Themes                 |     Version:  5.8
 Severity:  normal                 |  Resolution:  fixed
 Keywords:  good-first-bug commit  |     Focuses:  performance
-----------------------------------+---------------------------
Changes (by spacedmonkey):

 * owner:  (none) => spacedmonkey
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"55941" 55941]:
 {{{
 #!CommitTicketReference repository="" revision="55941"
 Themes: Change the order of path check in is_block_theme method.

 Change check to see if the current theme is a block theme, to check the
 path `/templates/index.html` first over the deprecated path `/block-
 templates/index.html`.
 As this path was deprecated in WP 5.9, it is more likely the block theme
 would use the current path. This saves a file_exists call which improves
 performance.

 Props nihar007, spacedmonkey.
 Fixes #58520.
 }}}

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


More information about the wp-trac mailing list