wp-includes/blocks/navigation-submenu.php:46Returns the submenu visibility value with backward compatibility for the deprecated openSubmenusOnClick attribute.
$contextarraystringfunction block_core_navigation_submenu_get_submenu_visibility( $context ) { $deprecated_open_submenus_on_click = $context['openSubmenusOnClick'] ?? null; // For backward compatibility, prioritize the legacy attribute if present. If it has been loaded and saved in the editor, then // the deprecated attribute will be replaced by submenuVisibility. if ( null !== $deprecated_open_submenus_on_click ) { // Convert boolean to string: true -> 'click', false -> 'hover'. return ! empty( $deprecated_open_submenus_on_click ) ? 'click' : 'hover'; } $submenu_visibility = $context['submenuVisibility'] ?? null; // Use submenuVisibility for migrated/new blocks. return $submenu_visibility ?? 'hover';}Introduced in 6.9.0. Unchanged from 7.0.4 through 7.1.0.
Signature, return type and hooks compared across 2 parsed releases.
src/wp-includes/blocks/navigation-submenu.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.