public static function get_page_depth($page = null)
    {
        if ($page === null) {
            global $wp_query;

            $object = $wp_query->get_queried_object();
        } else {
            $object = \get_post($page);
        }

        $parent_id  = $object->post_parent;
        $depth = 0;

        while ($parent_id > 0) {
            $page = \get_post($parent_id);
            $parent_id = $page->post_parent;
            $depth++;
        }

        return $depth;
    }