// Get the items for this group with proper ordering.
$group = [];
foreach ($ordering as $key => $dummy) {
if (isset($children[$key])) {
$group[$key] = $children[$key];
// Assign each menu items to the group.
$item = $menu[$key];
$item->group = $i;
}
}
// Update remaining children.
$children = array_diff_key($children, $ordering);
// Build child ordering.
$ordered += $group;
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »