diff --git a/src/wp-includes/block-patterns.php b/src/wp-includes/block-patterns.php index a2d90a261e43b..5e47efb35f0e1 100644 --- a/src/wp-includes/block-patterns.php +++ b/src/wp-includes/block-patterns.php @@ -377,10 +377,10 @@ function _register_theme_block_patterns() { foreach ( $themes as $theme ) { $dirpath = $theme->get_stylesheet_directory() . '/patterns/'; - if ( ! is_dir( $dirpath ) || ! is_readable( $dirpath ) ) { + + if ( ! is_readable( $dirpath ) ) { continue; - } - if ( file_exists( $dirpath ) ) { + } $files = glob( $dirpath . '*.php' ); if ( $files ) { foreach ( $files as $file ) {