WPDev.one
Core Function
View Source on Trac ↗

get_comment_pages_count()

get_comment_pages_count( mixed $comments = null, mixed $per_page = null, mixed $threaded = null )

Calculates the total number of comment pages.

Parameters 2 required

Name / Type Description
$comments
WP_Comment[]

Optional. Array of WP_Comment objects. Defaults to `$wp_query->comments`.

int

$per_page Optional. Comments per page. Defaults to the value of `comments_per_page` query var, option of the same name, or 1 (in that order).

Required
bool

$threaded Optional. Control over flat or threaded comments. Defaults to the value of `thread_comments` option.

Required

Return Value

(int)
Number of comment pages.

Function Information

Since Version
2.7.0
Source File
wp-includes/comment.php
Advertisement