Changeset 32600
- Timestamp:
- 05/25/2015 05:58:52 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-comments-list-table.php
r32516 r32600 117 117 118 118 $_comments = get_comments( $args ); 119 120 update_comment_cache( $_comments );121 122 $this->items = array_slice( $_comments, 0, $comments_per_page );123 $this->extra_items = array_slice( $_comments, $comments_per_page );124 125 $total_comments = get_comments( array_merge( $args, array('count' => true, 'offset' => 0, 'number' => 0)) );126 127 $_comment_post_ids = array();128 foreach ( $_comments as $_c ) {129 $_comment_post_ids[] = $_c->comment_post_ID; 130 }131 132 $_comment_post_ids = array_unique( $_comment_post_ids );133 134 $this->pending_count = get_pending_comments_num( $_comment_post_ids);119 if ( is_array( $_comments ) ) { 120 update_comment_cache( $_comments ); 121 122 $this->items = array_slice( $_comments, 0, $comments_per_page ); 123 $this->extra_items = array_slice( $_comments, $comments_per_page ); 124 125 $_comment_post_ids = array_unique( wp_list_pluck( $_comments, 'comment_post_ID' ) ); 126 127 $this->pending_count = get_pending_comments_num( $_comment_post_ids ); 128 } 129 130 $total_comments = get_comments( array_merge( $args, array( 131 'count' => true, 132 'offset' => 0, 133 'number' => 0 134 ) ) ); 135 135 136 136 $this->set_pagination_args( array( -
trunk/src/wp-admin/includes/dashboard.php
r32175 r32600 767 767 768 768 while ( count( $comments ) < $total_items && $possible = get_comments( $comments_query ) ) { 769 if ( ! is_array( $possible ) ) { 770 break; 771 } 769 772 foreach ( $possible as $comment ) { 770 773 if ( ! current_user_can( 'read_post', $comment->comment_post_ID ) ) -
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r32591 r32600 3197 3197 $number = absint($struct['number']); 3198 3198 3199 $comments = get_comments( array( 'status' => $status, 'post_id' => $post_id, 'offset' => $offset, 'number' => $number ) );3199 $comments = get_comments( array( 'status' => $status, 'post_id' => $post_id, 'offset' => $offset, 'number' => $number ) ); 3200 3200 3201 3201 $comments_struct = array(); 3202 3203 foreach ( $comments as $comment ) { 3204 $comments_struct[] = $this->_prepare_comment( $comment ); 3202 if ( is_array( $comments ) ) { 3203 foreach ( $comments as $comment ) { 3204 $comments_struct[] = $this->_prepare_comment( $comment ); 3205 } 3205 3206 } 3206 3207 -
trunk/src/wp-includes/default-widgets.php
r32589 r32600 1010 1010 1011 1011 $output .= '<ul id="recentcomments">'; 1012 if ( $comments ) {1012 if ( is_array( $comments ) && $comments ) { 1013 1013 // Prime cache for associated posts. (Prime post term cache if we need it for permalinks.) 1014 1014 $post_ids = array_unique( wp_list_pluck( $comments, 'comment_post_ID' ) );
Note: See TracChangeset
for help on using the changeset viewer.