public function getChildOf($current_page, $elements)
    {
        $child_of = 0;

        if (is_a($current_page, '\WP_Post')) {
            $current_page = $current_page->ID;
        }

        foreach ($elements as $key => $element) {
            if (isset($element->ID) && isset($current_page) && $element->ID == $current_page) {
                $child_of = $element->ID;
                unset($elements[$key]);

                if (intval($element->menu_item_parent) > 0) {
                    $child_of = $this->getChildOf(intval($element->menu_item_parent), $elements);
                }

                break;
            }
        }

        return $child_of;
    }