Make WordPress Core


Ignore:
Timestamp:
02/12/2018 09:11:13 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Comments: Avoid a PHP notice in paginate_comments_links() if type argument is set to array.

The function is a wrapper for paginate_links(), which returns an array if requested.

Props anantajitjg.
Fixes #43299.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r42678 r42703  
    28972897 *
    28982898 * @param string|array $args Optional args. See paginate_links(). Default empty array.
    2899  * @return string|void Markup for pagination links.
     2899 * @return string|array|void Markup for comment page links or array of comment page links.
    29002900 */
    29012901function paginate_comments_links( $args = array() ) {
     
    29262926    $page_links = paginate_links( $args );
    29272927
    2928     if ( $args['echo'] ) {
     2928    if ( $args['echo'] && 'array' !== $args['type'] ) {
    29292929        echo $page_links;
    29302930    } else {
Note: See TracChangeset for help on using the changeset viewer.