Returns an array of menu items grouped by the id of the parent menu item.
Parameters
$menu_items
arrayrequired- An array of menu items.
Source
private static function group_by_parent_id( $menu_items ) {
$menu_items_by_parent_id = array();
foreach ( $menu_items as $menu_item ) {
$menu_items_by_parent_id[ $menu_item->menu_item_parent ][] = $menu_item;
}
return $menu_items_by_parent_id;
}
Changelog
Version | Description |
---|---|
6.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.