Skip to content

Commit

Permalink
Template Loader: Use glob constant instead of numeric value. (#18893)
Browse files Browse the repository at this point in the history
* Template Loader: Use `glob` constant instead of numeric value.

* Template Loader: Remove `glob` flags.
  • Loading branch information
epiqueras authored Dec 3, 2019
1 parent ff92da2 commit 0480528
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/template-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ function gutenberg_find_template( $template_file ) {
// See if there is a theme block template with higher priority than the resolved template post.
$higher_priority_block_template_path = null;
$higher_priority_block_template_priority = PHP_INT_MAX;
$block_template_files = glob( get_stylesheet_directory() . '/block-templates/*.html', 1 ) ?: array();
$block_template_files = glob( get_stylesheet_directory() . '/block-templates/*.html' ) ?: array();
if ( is_child_theme() ) {
$block_template_files = array_merge( $block_template_files, glob( get_template_directory() . '/block-templates/*.html', 1 ) ?: array() );
$block_template_files = array_merge( $block_template_files, glob( get_template_directory() . '/block-templates/*.html' ) ?: array() );
}
if ( gutenberg_is_experiment_enabled( 'gutenberg-full-site-editing-demo' ) ) {
$block_template_files = array_merge( $block_template_files, glob( dirname( __FILE__ ) . '/demo-block-templates/*.html', 1 ) ?: array() );
$block_template_files = array_merge( $block_template_files, glob( dirname( __FILE__ ) . '/demo-block-templates/*.html' ) ?: array() );
}
foreach ( $block_template_files as $path ) {
$theme_block_template_priority = $slug_priorities[ basename( $path, '.html' ) ];
Expand Down

0 comments on commit 0480528

Please sign in to comment.