get_comment_pages_count [ WordPress Function ]
get_comment_pages_count ( $comments = null, $per_page = null, $threaded = null )
| Parameters: |
|
| Uses: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: get_comment_count, get_comment_author, get_comment_guid, get_comment_meta, get_comment_date
Calculate the total number of comment pages.
Source
<?php
function get_comment_pages_count( $comments = null, $per_page = null, $threaded = null ) {
global $wp_query;
if ( null === $comments && null === $per_page && null === $threaded && !empty($wp_query->max_num_comment_pages) )
return $wp_query->max_num_comment_pages;
if ( !$comments || !is_array($comments) )
$comments = $wp_query->comments;
if ( empty($comments) )
return 0;
if ( !isset($per_page) )
$per_page = (int) get_query_var('comments_per_page');
if ( 0 === $per_page )
$per_page = (int) get_option('comments_per_page');
if ( 0 === $per_page )
return 1;
if ( !isset($threaded) )
$threaded = get_option('thread_comments');
if ( $threaded ) {
$walker = new Walker_Comment;
$count = ceil( $walker->get_number_of_root_elements( $comments ) / $per_page );
} else {
$count = ceil( count( $comments ) / $per_page );
}
return $count;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- get_comment_pages_count | A HitchHackers guide through ...
Feb 12, 2011 ... function get_comment_pages_count( $comments = null, $per_page = null, $ threaded = null ) { global $wp_query; if ( null === $comments ...
hitchhackerguide.com - get_comment_pages_count (WordPress Function) - WPSeek.com
WordPress lookup for get_comment_pages_count, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - #17778 (get_comment_pages_count() returns > 1 when pagination ...
get_comment_pages_count() returns > 1 when pagination is disabled ... If pagination is disabled, get_comment_pages_count() will still return the number of ...
core.trac.wordpress.org - get_comment_pages_count
Function and Method Cross Reference. get_comment_pages_count(). Defined at : /wp-includes/comment.php -> line 736. Referenced 8 times: ...
phpxref.ftwr.co.uk