wp-includes/blocks/navigation.php:945Returns a unique name for the navigation.
$attributesarraystring private static function get_unique_navigation_name( $attributes ) { $nav_menu_name = static::get_navigation_name( $attributes ); // This is used to count the number of times a navigation name has been seen, // so that we can ensure every navigation has a unique id. if ( isset( static::$seen_menu_names[ $nav_menu_name ] ) ) { ++static::$seen_menu_names[ $nav_menu_name ]; } else { static::$seen_menu_names[ $nav_menu_name ] = 1; } // If the menu name has been used previously then append an ID // to the name to ensure uniqueness across a given post. if ( isset( static::$seen_menu_names[ $nav_menu_name ] ) && static::$seen_menu_names[ $nav_menu_name ] > 1 ) { $count = static::$seen_menu_names[ $nav_menu_name ]; $nav_menu_name = $nav_menu_name . ' ' . ( $count ); } return $nav_menu_name; }Introduced in 6.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/blocks/navigation.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.