WP_Navigation_Fallback::get_fallback_classic_menu(): 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.

Determines the most appropriate classic navigation menu to use as a fallback.

Return

WP_Term|null The most appropriate classic navigation menu to use as a fallback.

Source

private static function get_fallback_classic_menu() {
	$classic_nav_menus = wp_get_nav_menus();

	if ( ! $classic_nav_menus || is_wp_error( $classic_nav_menus ) ) {
		return null;
	}

	$nav_menu = static::get_nav_menu_at_primary_location();

	if ( $nav_menu ) {
		return $nav_menu;
	}

	$nav_menu = static::get_nav_menu_with_primary_slug( $classic_nav_menus );

	if ( $nav_menu ) {
		return $nav_menu;
	}

	return static::get_most_recently_created_nav_menu( $classic_nav_menus );
}

Changelog

VersionDescription
6.3.0Introduced.

User Contributed Notes

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