| 548 | * Returns all child nav_menu_items under a specific parent |
| 549 | * |
| 550 | * @param int the parent nav_menu_item ID |
| 551 | * @param array nav_menu_items |
| 552 | * @return array returns filtered array of nav_menu_items |
| 553 | */ |
| 554 | function get_nav_menu_item_children( $parent_id, $nav_menu_items ) { |
| 555 | $nav_menu_item_list = array(); |
| 556 | foreach ( (array) $nav_menu_items as $nav_menu_item ) { |
| 557 | if ( $nav_menu_item->menu_item_parent == $parent_id ) { |
| 558 | $nav_menu_item_list[] = $nav_menu_item; |
| 559 | if ( $children = get_nav_menu_item_children( $nav_menu_item->ID, $nav_menu_items ) ) |
| 560 | $nav_menu_item_list = array_merge( $nav_menu_item_list, $children ); |
| 561 | } |
| 562 | } |
| 563 | return $nav_menu_item_list; |
| 564 | } |
| 565 | |
| 566 | /** |