Skip to content

Commit ac9298f

Browse files
committed
split checks
1 parent b723c92 commit ac9298f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/compat/wordpress-6.0/block-patterns.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ function gutenberg_register_remote_theme_patterns() {
3535
add_action(
3636
'current_screen',
3737
function( $current_screen ) {
38-
$should_load_remote = apply_filters( 'should_load_remote_block_patterns', true );
39-
$theme_has_support = WP_Theme_JSON_Resolver_Gutenberg::theme_has_support();
40-
if ( ! get_theme_support( 'core-block-patterns' ) || ! $should_load_remote || ! $theme_has_support ) {
38+
if ( ! get_theme_support( 'core-block-patterns' ) ) {
39+
return;
40+
}
41+
if ( ! apply_filters( 'should_load_remote_block_patterns', true ) ) {
42+
return;
43+
}
44+
if ( ! WP_Theme_JSON_Resolver_Gutenberg::theme_has_support() ) {
4145
return;
4246
}
4347

0 commit comments

Comments
 (0)