Skip to content

Commit

Permalink
Check theme support before registering patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
ryelle authored and youknowriad committed May 19, 2021
1 parent 492f873 commit 1ae9b70
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ function() {
add_action(
'current_screen',
function( $current_screen ) {
if ( ! get_theme_support( 'core-block-patterns' ) ) {
return;
}

$is_site_editor = ( function_exists( 'gutenberg_is_edit_site_page' ) && gutenberg_is_edit_site_page( $current_screen->id ) );
if ( $current_screen->is_block_editor || $is_site_editor ) {
load_remote_patterns();
Expand Down

0 comments on commit 1ae9b70

Please sign in to comment.