wp-includes/class-wp-navigation-fallback.php:249Gets the classic menu assigned to the primary navigation menu location if it exists.
WP_Term|null private static function get_nav_menu_at_primary_location() { $locations = get_nav_menu_locations(); if ( isset( $locations['primary'] ) ) { $primary_menu = wp_get_nav_menu_object( $locations['primary'] ); if ( $primary_menu ) { return $primary_menu; } } return null; }Introduced in 6.3.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/class-wp-navigation-fallback.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.