diff --git a/functions.php b/functions.php index 893e4529..f653bdcd 100644 --- a/functions.php +++ b/functions.php @@ -137,8 +137,7 @@ // Restrict to only selected blocks // Set the value to 'all' to allow all blocks everywhere 'allowed_blocks' => [ - 'default' => [ - ], + 'default' => [], 'post' => [ 'core/archives', 'core/audio', diff --git a/inc/hooks/gutenberg.php b/inc/hooks/gutenberg.php index 07c47dc1..23524739 100644 --- a/inc/hooks/gutenberg.php +++ b/inc/hooks/gutenberg.php @@ -25,6 +25,10 @@ function allowed_block_types( $allowed_blocks, $editor_context ) { // If there is post type specific blocks, add them to the allowed blocks list if ( isset( $editor_context->post->post_type ) && isset( THEME_SETTINGS['allowed_blocks'][ $editor_context->post->post_type ] ) ) { + if ( 'all' === THEME_SETTINGS['allowed_blocks'][ $editor_context->post->post_type ] ) { + return $allowed_blocks; + } + $allowed_blocks = array_merge( $allowed_blocks, THEME_SETTINGS['allowed_blocks'][ $editor_context->post->post_type ] ); } diff --git a/inc/includes/nav-walker.php b/inc/includes/nav-walker.php index 196b8266..9c3ff71d 100755 --- a/inc/includes/nav-walker.php +++ b/inc/includes/nav-walker.php @@ -106,7 +106,6 @@ public function start_lvl( &$output, $depth = 0, $args = null ) { } else { $output .= "\n{$n}{$indent}