Make WordPress Core

Changeset 42703


Ignore:
Timestamp:
02/12/2018 09:11:13 PM (6 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.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r42660 r42703  
    37693769 *     @type string $after_page_number  A string to append after the page number. Default empty.
    37703770 * }
    3771  * @return array|string|void String of page links or array of page links.
     3771 * @return string|array|void String of page links or array of page links.
    37723772 */
    37733773function paginate_links( $args = '' ) {
  • 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.