Skip to content

Commit 053b669

Browse files
committed
implement IS_GUTENBERG_PLUGIN check
1 parent 0e82018 commit 053b669

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

packages/block-library/src/navigation-link/index.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,13 @@ function render_block_core_navigation_link( $attributes, $content, $block ) {
262262

263263
if ( isset( $block->context['showSubmenuIcon'] ) && $block->context['showSubmenuIcon'] && $has_submenu ) {
264264
// The submenu icon can be hidden by a CSS rule on the Navigation Block.
265-
$html .= '<span class="wp-block-navigation__submenu-icon">' . gutenberg_block_core_shared_navigation_render_submenu_icon() . '</span>';
265+
$html .= '<span class="wp-block-navigation__submenu-icon">';
266+
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
267+
$html .= gutenberg_block_core_shared_navigation_render_submenu_icon();
268+
} else {
269+
$html .= block_core_shared_navigation_render_submenu_icon();
270+
}
271+
$html .= '</span>';
266272
}
267273

268274
if ( $has_submenu ) {

packages/block-library/src/navigation-submenu/index.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,13 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
240240
if ( $show_submenu_indicators && $has_submenu ) {
241241
// The submenu icon is rendered in a button here
242242
// so that there's a clickable element to open the submenu.
243-
$html .= '<button aria-label="' . esc_attr( $aria_label ) . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">' . gutenberg_block_core_shared_navigation_render_submenu_icon() . '</button>';
243+
$html .= '<button aria-label="' . esc_attr( $aria_label ) . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">';
244+
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
245+
$html .= gutenberg_block_core_shared_navigation_render_submenu_icon();
246+
} else {
247+
$html .= block_core_shared_navigation_render_submenu_icon();
248+
}
249+
$html .= '</button>';
244250
}
245251
} else {
246252
$html .= '<button aria-label="' . esc_attr( $aria_label ) . '" class="wp-block-navigation-item__content wp-block-navigation-submenu__toggle" aria-expanded="false">';
@@ -262,7 +268,13 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
262268
$html .= '</button>';
263269

264270
if ( $has_submenu ) {
265-
$html .= '<span class="wp-block-navigation__submenu-icon">' . gutenberg_block_core_shared_navigation_render_submenu_icon() . '</span>';
271+
$html .= '<span class="wp-block-navigation__submenu-icon">';
272+
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
273+
$html .= gutenberg_block_core_shared_navigation_render_submenu_icon();
274+
} else {
275+
$html .= block_core_shared_navigation_render_submenu_icon();
276+
}
277+
$html .= '</span>';
266278
}
267279
}
268280

0 commit comments

Comments
 (0)