WP_Navigation_Fallback::get_nav_menu_with_primary_slug( WP_Term[] $classic_nav_menus ): WP_Term|null

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Returns the classic menu with the slug primary if it exists.

Parameters

$classic_nav_menusWP_Term[]required
Array of classic nav menu term objects.

Return

WP_Term|null The classic nav menu with the slug primary or null.

Source

private static function get_nav_menu_with_primary_slug( $classic_nav_menus ) {
	foreach ( $classic_nav_menus as $classic_nav_menu ) {
		if ( 'primary' === $classic_nav_menu->slug ) {
			return $classic_nav_menu;
		}
	}

	return null;
}

Changelog

VersionDescription
6.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.