WP_Navigation_Fallback::get_most_recently_created_nav_menu()
Sorts the classic menus and returns the most recently created one.
Метод класса: WP_Navigation_Fallback{}
Хуков нет.
Возвращает
WP_Term
. The most recently created classic nav menu.
Использование
$result = WP_Navigation_Fallback::get_most_recently_created_nav_menu( $classic_nav_menus );
- $classic_nav_menus(WP_Term[]) (обязательный)
- Array of classic nav menu term objects.
Список изменений
С версии 6.3.0 | Введена. |
Код WP_Navigation_Fallback::get_most_recently_created_nav_menu() WP Navigation Fallback::get most recently created nav menu WP 6.6.2
private static function get_most_recently_created_nav_menu( $classic_nav_menus ) { usort( $classic_nav_menus, static function ( $a, $b ) { return $b->term_id - $a->term_id; } ); return $classic_nav_menus[0]; }