WordPress.org

Make WordPress Core

Ticket #35511: 35511.diff

File 35511.diff, 1.7 KB (added by Latz, 4 years ago)
  • comment-template.php

     
    730730                 * If the default page displays the oldest comments, the permalinks for comments on the default page
    731731                 * do not need a 'cpage' query var.
    732732                 */
    733                 $default_comments_page = get_option( 'default_comments_page' );
    734733                if ( 'oldest' === get_option( 'default_comments_page' ) && 1 === $cpage ) {
    735734                        $cpage = '';
    736735                }
     
    12491248 *                                  Default false.
    12501249 */
    12511250function comments_template( $file = '/comments.php', $separate_comments = false ) {
    1252         global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;
     1251        global $wp_query, $withcomments, $post, $user_ID, $overridden_cpage;
    12531252
    12541253        if ( !(is_single() || is_page() || $withcomments) || empty($post) )
    12551254                return;
     
    12771276        /*
    12781277         * The url of the current comment author escaped for use in attributes.
    12791278         */
    1280         $comment_author_url = esc_url($commenter['comment_author_url']);
    1281 
    12821279        $comment_args = array(
    12831280                'orderby' => 'comment_date_gmt',
    12841281                'order' => 'ASC',
     
    13001297                $comment_args['include_unapproved'] = array( $comment_author_email );
    13011298        }
    13021299
    1303         $per_page = 0;
    13041300        if ( get_option( 'page_comments' ) ) {
    13051301                $per_page = (int) get_query_var( 'comments_per_page' );
    13061302                if ( 0 === $per_page ) {
     
    14011397
    14021398        if ( $separate_comments ) {
    14031399                $wp_query->comments_by_type = separate_comments($comments);
    1404                 $comments_by_type = &$wp_query->comments_by_type;
    14051400        } else {
    14061401                $wp_query->comments_by_type = array();
    14071402        }