Ticket #16882: patch-core-get_comments_since.diff
File patch-core-get_comments_since.diff, 1.8 KB (added by , 14 years ago) |
---|
-
wp-includes/comment.php
213 213 'parent' => '', 214 214 'post_ID' => '', 215 215 'post_id' => 0, 216 'since' => '', 216 217 'status' => '', 217 218 'type' => '', 218 219 'user_id' => '', … … 230 231 if ( !$last_changed ) { 231 232 $last_changed = time(); 232 233 wp_cache_set('last_changed', $last_changed, 'comment'); 234 } elseif ( ( '' !== $since ) && ( $since > $last_changed ) ) { 235 return array(); 233 236 } 234 237 $cache_key = "get_comments:$key:$last_changed"; 235 238 … … 316 319 $where .= $wpdb->prepare( ' AND comment_parent = %d', $parent ); 317 320 if ( '' !== $user_id ) 318 321 $where .= $wpdb->prepare( ' AND user_id = %d', $user_id ); 322 if ( '' !== $since ) 323 $where .= $wpdb->prepare( ' AND comment_date_gmt > %s', $since ); 319 324 if ( '' !== $search ) 320 325 $where .= $this->get_search_sql( $search, array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_content' ) ); 321 326 -
wp-includes/class-wp-xmlrpc-server.php
1059 1059 if ( isset($struct['number']) ) 1060 1060 $number = absint($struct['number']); 1061 1061 1062 $comments = get_comments( array('status' => $status, 'post_id' => $post_id, 'offset' => $offset, 'number' => $number ) ); 1062 $since = ( isset($struct['since']) ) ? $struct['since'] : '' ; 1063 1064 $comments = get_comments( array('status' => $status, 'post_id' => $post_id, 'offset' => $offset, 'number' => $number, 'since' => $since ) ); 1063 1065 $num_comments = count($comments); 1064 1066 1065 1067 if ( ! $num_comments )