Make WordPress Core

Changeset 55941


Ignore:
Timestamp:
06/19/2023 04:02:41 PM (10 months ago)
Author:
spacedmonkey
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme.php

    r55939 r55941  
    15161516
    15171517        $paths_to_index_block_template = array(
     1518            $this->get_file_path( '/templates/index.html' ),
    15181519            $this->get_file_path( '/block-templates/index.html' ),
    1519             $this->get_file_path( '/templates/index.html' ),
    15201520        );
    15211521
Note: See TracChangeset for help on using the changeset viewer.