library/Helper/NavigationTree.php
protected function getCurrentPage()
    {
        if (is_post_type_archive()) {
            $pageForPostType = get_option('page_for_' . get_post_type());
            return get_post($pageForPostType);
        }

        global $post;

        if (!is_object($post)) {
            return get_queried_object();
        }

        return $post;
    }
protected function getCurrentPage()
    {
        if (is_post_type_archive()) {
            $pageForPostType = get_option('page_for_' . get_post_type());
            return get_post($pageForPostType);
        }

        global $post;

        if (!is_object($post)) {
            return get_queried_object();
        }

        return $post;
    }
protected function getCurrentPage ( ) { if ( is_post_type_archive ( ) ) { $ pageForPostType = get_option ( 'page_for_' . get_post_type ( ) ) ; return get_post ( $ pageForPostType ) ; } global $ post ; if ( ! is_object ( $ post ) ) { return get_queried_object ( ) ; } return $ post ; }
Gets the current page object
@return object
Gets the current page object