Skip to content

Commit 1ae9b70

Browse files
ryelleyouknowriad
authored andcommitted
Check theme support before registering patterns
1 parent 492f873 commit 1ae9b70

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/block-patterns.php

+4
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ function() {
244244
add_action(
245245
'current_screen',
246246
function( $current_screen ) {
247+
if ( ! get_theme_support( 'core-block-patterns' ) ) {
248+
return;
249+
}
250+
247251
$is_site_editor = ( function_exists( 'gutenberg_is_edit_site_page' ) && gutenberg_is_edit_site_page( $current_screen->id ) );
248252
if ( $current_screen->is_block_editor || $is_site_editor ) {
249253
load_remote_patterns();

0 commit comments

Comments
 (0)