From f3341272631adb939cd996cd51cdabb4cf831fe9 Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Fri, 3 Dec 2021 12:43:59 +0800 Subject: [PATCH] Also check value of `IS_GUTENBERG_PLUGIN` Co-authored-by: Tonya Mork Check value of `IS_GUTENBERG_PLUGIN` Co-authored-by: Tonya Mork --- packages/block-library/src/navigation/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/navigation/index.php b/packages/block-library/src/navigation/index.php index 6182213f6b5774..11205500c16f0d 100644 --- a/packages/block-library/src/navigation/index.php +++ b/packages/block-library/src/navigation/index.php @@ -7,7 +7,7 @@ // These functions are used for the __unstableLocation feature and only active // when the gutenberg plugin is active. -if ( defined( 'IS_GUTENBERG_PLUGIN' ) ) { +if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { /** * Returns the menu items for a WordPress menu location. * @@ -404,7 +404,7 @@ function render_block_core_navigation( $attributes, $content, $block ) { // - we don't have a relationship to a `wp_navigation` Post (via `ref`). // ...then create inner blocks from the classic menu assigned to that location. if ( - defined( 'IS_GUTENBERG_PLUGIN' ) && + defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN && array_key_exists( '__unstableLocation', $attributes ) && ! array_key_exists( 'ref', $attributes ) && ! empty( block_core_navigation_get_menu_items_at_location( $attributes['__unstableLocation'] ) )