Make WordPress Core

Ticket #17778: 17778.patch

File 17778.patch, 4.3 KB (added by jakub.tyrcha, 14 years ago)
  • wp-content/themes/twentyeleven/comments.php

     
    3535                        ?>
    3636                </h2>
    3737
    38                 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
     38                <?php if ( get_comment_pages_count() > 1 ) : // are there comments to navigate through ?>
    3939                <nav id="comment-nav-above">
    4040                        <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1>
    4141                        <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyeleven' ) ); ?></div>
    4242                        <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyeleven' ) ); ?></div>
    4343                </nav>
    4444                <?php endif; // check for comment navigation ?>
    45 
    4645                <ol class="commentlist">
    4746                        <?php
    4847                                /* Loop through and list the comments. Tell wp_list_comments()
     
    5554                        ?>
    5655                </ol>
    5756
    58                 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
     57                <?php if ( get_comment_pages_count() > 1 ) : // are there comments to navigate through ?>
    5958                <nav id="comment-nav-below">
    6059                        <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1>
    6160                        <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyeleven' ) ); ?></div>
  • wp-content/themes/twentyten/comments.php

     
    3636                        number_format_i18n( get_comments_number() ), '<em>' . get_the_title() . '</em>' );
    3737                        ?></h3>
    3838
    39 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
     39<?php if ( get_comment_pages_count() > 1 ) : // Are there comments to navigate through? ?>
    4040                        <div class="navigation">
    4141                                <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'twentyten' ) ); ?></div>
    4242                                <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
     
    5555                                ?>
    5656                        </ol>
    5757
    58 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
     58<?php if ( get_comment_pages_count() > 1 ) : // Are there comments to navigate through? ?>
    5959                        <div class="navigation">
    6060                                <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'twentyten' ) ); ?></div>
    6161                                <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
  • wp-includes/comment.php

     
    731731function get_comment_pages_count( $comments = null, $per_page = null, $threaded = null ) {
    732732        global $wp_query;
    733733
    734         if ( null === $comments && null === $per_page && null === $threaded && !empty($wp_query->max_num_comment_pages) )
     734        if ( null === $comments && null === $per_page && null === $threaded && !empty( $wp_query->max_num_comment_pages ) )
    735735                return $wp_query->max_num_comment_pages;
    736736
    737         if ( !$comments || !is_array($comments) )
     737        if ( !$comments || !is_array( $comments ) )
    738738                $comments = $wp_query->comments;
    739739
    740         if ( empty($comments) )
     740        if ( empty( $comments ) )
    741741                return 0;
    742 
    743         if ( !isset($per_page) )
    744                 $per_page = (int) get_query_var('comments_per_page');
     742               
     743        if ( ! get_option( 'page_comments' ) )
     744                return 1;
     745       
     746        if ( ! isset( $per_page ) )
     747                $per_page = (int) get_query_var( 'comments_per_page' );
    745748        if ( 0 === $per_page )
    746                 $per_page = (int) get_option('comments_per_page');
     749                $per_page = (int) get_option( 'comments_per_page' );
    747750        if ( 0 === $per_page )
    748751                return 1;
    749752
    750         if ( !isset($threaded) )
    751                 $threaded = get_option('thread_comments');
     753        if ( !isset( $threaded ) )
     754                $threaded = get_option( 'thread_comments' );
    752755
    753756        if ( $threaded ) {
    754757                $walker = new Walker_Comment;