Ticket #46963: 46963.2.patch
File 46963.2.patch, 1.9 KB (added by , 5 years ago) |
---|
-
wp-admin/includes/meta-boxes.php
807 807 <p class="hide-if-no-js" id="add-new-comment"><button type="button" class="button" onclick="window.commentReply && commentReply.addcomment(<?php echo $post->ID; ?>);"><?php _e( 'Add comment' ); ?></button></p> 808 808 <?php 809 809 810 $ total= get_comments(810 $wp_get_comments = get_comments( 811 811 array( 812 812 'post_id' => $post->ID, 813 813 'number' => 1, 814 'count' => true,815 814 ) 816 815 ); 816 817 $total = get_comments_number( $post->ID ); 818 if ( 0 !== count( $wp_get_comments ) ) { 819 // Get the comment type (comment, trackback), 820 $comment_type = ( ! empty( $wp_get_comments[0]->comment_type ) ) ? $wp_get_comments[0]->comment_type : 'comment'; 821 } 817 822 $wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table' ); 818 823 $wp_list_table->display( true ); 819 824 … … 828 833 } 829 834 830 835 ?> 831 <p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.load(<?php echo $total; ?> );return false;"><?php _e( 'Show comments' ); ?></a> <span class="spinner"></span></p>836 <p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.load(<?php echo $total; ?>,'<?php echo $comment_type; ?>');return false;"><?php _e( 'Show comments' ); ?></a> <span class="spinner"></span></p> 832 837 <?php 833 838 } 834 839 -
wp-admin/js/post.js
95 95 * 96 96 * @memberof commentsBox 97 97 */ 98 load: function(total ){99 this.st = jQuery('#the-comment-list tr. comment:visible').length;98 load: function(total,comment_type){ 99 this.st = jQuery('#the-comment-list tr.'+comment_type+':visible').length; 100 100 this.get(total); 101 101 } 102 102 };