Make WordPress Core

Changeset 27799


Ignore:
Timestamp:
03/28/2014 02:37:33 AM (13 years ago)
Author:
nacin
Message:

Pass walker arguments to get_comment_link() so pagination works when wp_list_comments() is used outside the comment template.

props SergeyBiryukov.
fixes #27007.

File:
1 edited

Legend:

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

    r27514 r27799  
    589589
    590590        // Backwards compat
    591         if ( !is_array($args) ) {
    592                 $page = $args;
    593                 $args = array();
    594                 $args['page'] = $page;
     591        if ( ! is_array( $args ) ) {
     592                $args = array( 'page' => $args );
    595593        }
    596594
    … …  
    17811779                <?php endif; ?>
    17821780
    1783                 <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
     1781                <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID, $args ) ); ?>">
    17841782                        <?php
    17851783                                /* translators: 1: date, 2: time */
    … …  
    18231821
    18241822                                        <div class="comment-metadata">
    1825                                                 <a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
     1823                                                <a href="<?php echo esc_url( get_comment_link( $comment->comment_ID, $args ) ); ?>">
    18261824                                                        <time datetime="<?php comment_time( 'c' ); ?>">
    18271825                                                                <?php printf( _x( '%1$s at %2$s', '1: date, 2: time' ), get_comment_date(), get_comment_time() ); ?>
Note: See TracChangeset for help on using the changeset viewer.