Determines 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
Version | Description |
---|---|
6.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.