Skip to content

Commit

Permalink
Also check value of IS_GUTENBERG_PLUGIN
Browse files Browse the repository at this point in the history
Co-authored-by: Tonya Mork <hello@hellofromtonya.com>

Check value of `IS_GUTENBERG_PLUGIN`

Co-authored-by: Tonya Mork <hello@hellofromtonya.com>
  • Loading branch information
talldan and Tonya Mork committed Dec 3, 2021
1 parent b161958 commit f334127
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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'] ) )
Expand Down

0 comments on commit f334127

Please sign in to comment.