diff --git a/packages/block-library/src/navigation/index.php b/packages/block-library/src/navigation/index.php index 9484ad13ed002..dd300eb12c6fe 100644 --- a/packages/block-library/src/navigation/index.php +++ b/packages/block-library/src/navigation/index.php @@ -344,6 +344,10 @@ private static function get_navigation_name( $attributes ) { $navigation_name = $attributes['ariaLabel'] ?? ''; + if ( ! empty( $navigation_name ) ) { + return $navigation_name; + } + // Load the navigation post. if ( array_key_exists( 'ref', $attributes ) ) { $navigation_post = get_post( $attributes['ref'] );