get_the_comments_pagination

Retrieves a paginated navigation to next/previous set of comments, when applicable.

Description

(string) get_the_comments_pagination( (array) $args = array() ); 

Returns (string)

Markup for pagination links.

Parameters (1)

0. $args — Optional. (array) => array()
Default pagination arguments.

Options

    ;        


    Usage

    1. if ( !function_exists( 'get_the_comments_pagination' ) ) { 
    2. require_once ABSPATH . WPINC . '/link-template.php'; 
    3.  
    4. // Optional. Default pagination arguments. 
    5. $args = array(); 
    6.  
    7. // NOTICE! Understand what this does before running. 
    8. $result = get_the_comments_pagination($args); 
    9.  

    Defined (1)

    The function is defined in the following location(s).

    /wp-includes/link-template.php  
    1. function get_the_comments_pagination( $args = array() ) { 
    2. $navigation = ''; 
    3. $args = wp_parse_args( $args, array( 
    4. 'screen_reader_text' => __( 'Comments navigation' ),  
    5. ) ); 
    6. $args['echo'] = false; 
    7.  
    8. // Make sure we get plain links, so we get a string we can work with. 
    9. $args['type'] = 'plain'; 
    10.  
    11. $links = paginate_comments_links( $args ); 
    12.  
    13. if ( $links ) { 
    14. $navigation = _navigation_markup( $links, 'comments-pagination', $args['screen_reader_text'] ); 
    15.  
    16. return $navigation;