From f6c73370ee4b105c5546605811796cd5c761c30e Mon Sep 17 00:00:00 2001 From: Utsav Patel <75293077+up1512001@users.noreply.github.com> Date: Tue, 18 Jun 2024 13:50:58 +0530 Subject: [PATCH] Fix: empty style attribute issue in navigation block (#62600) * Fix: empty style attribute issue in navigation block * update: store overlay style to variable for better readibility and performance * Fix: linting issue * Fix: added missing quotes to make valid markup ---- Unlinked contributors: convolutedkdlkf. Co-authored-by: up1512001 Co-authored-by: artemiomorales Co-authored-by: talldan --- packages/block-library/src/navigation/index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/navigation/index.php b/packages/block-library/src/navigation/index.php index f814e19a13cd3..44c4d1410f4be 100644 --- a/packages/block-library/src/navigation/index.php +++ b/packages/block-library/src/navigation/index.php @@ -519,9 +519,11 @@ private static function get_responsive_container_markup( $attributes, $inner_blo '; } + $overlay_inline_styles = esc_attr( safecss_filter_attr( $colors['overlay_inline_styles'] ) ); + return sprintf( ' -
+
@@ -537,7 +539,7 @@ private static function get_responsive_container_markup( $attributes, $inner_blo $toggle_aria_label_close, esc_attr( implode( ' ', $responsive_container_classes ) ), esc_attr( implode( ' ', $open_button_classes ) ), - esc_attr( safecss_filter_attr( $colors['overlay_inline_styles'] ) ), + ( ! empty( $overlay_inline_styles ) ) ? "style=\"$overlay_inline_styles\"" : '', $toggle_button_content, $toggle_close_button_content, $open_button_directives,