summaryrefslogtreecommitdiffstats
path: root/wp-includes/block-template-utils.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/block-template-utils.php')
-rw-r--r--wp-includes/block-template-utils.php4
1 files changed, 1 insertions, 3 deletions
diff --git a/wp-includes/block-template-utils.php b/wp-includes/block-template-utils.php
index cfae702..8ba4874 100644
--- a/wp-includes/block-template-utils.php
+++ b/wp-includes/block-template-utils.php
@@ -229,14 +229,12 @@ function _get_block_templates_paths( $base_directory ) {
return $template_path_list[ $base_directory ];
}
$path_list = array();
- try {
+ if ( is_dir( $base_directory ) ) {
$nested_files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $base_directory ) );
$nested_html_files = new RegexIterator( $nested_files, '/^.+\.html$/i', RecursiveRegexIterator::GET_MATCH );
foreach ( $nested_html_files as $path => $file ) {
$path_list[] = $path;
}
- } catch ( Exception $e ) {
- // Do nothing.
}
$template_path_list[ $base_directory ] = $path_list;
return $path_list;