get_page_of_comment example

$args['per_page'] = 0;
            $args['page']     = 0;
        }

        $cpage = $args['page'];

        if ( '' == $cpage ) {
            if ( ! empty( $in_comment_loop ) ) {
                $cpage = get_query_var( 'cpage' );
            } else {
                // Requires a database hit, so we only do it when we can't figure out from context.                 $cpage = get_page_of_comment( $comment->comment_ID, $args );
            }
        }

        /* * If the default page displays the oldest comments, the permalinks for comments on the default page * do not need a 'cpage' query var. */
        if ( 'oldest' === get_option( 'default_comments_page' ) && 1 === $cpage ) {
            $cpage = '';
        }
    }

    
if ( null === $page ) {
        if ( '' === $args['max_depth'] ) {
            if ( get_option( 'thread_comments' ) ) {
                $args['max_depth'] = get_option( 'thread_comments_depth' );
            } else {
                $args['max_depth'] = -1;
            }
        }

        // Find this comment's top-level parent if threading is enabled.         if ( $args['max_depth'] > 1 && 0 != $comment->comment_parent ) {
            return get_page_of_comment( $comment->comment_parent, $args );
        }

        $comment_args = array(
            'type'       => $args['type'],
            'post_id'    => $comment->comment_post_ID,
            'fields'     => 'ids',
            'count'      => true,
            'status'     => 'approve',
            'parent'     => 0,
            'date_query' => array(
                array(
                    
Home | Imprint | This part of the site doesn't use cookies.