Sorts the classic menus and returns the most recently created one.
Parameters
$classic_nav_menus
WP_Term[]required- Array of classic nav menu term objects.
Source
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];
}
Changelog
Version | Description |
---|---|
6.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.