Changeset 36480 for trunk/src/wp-includes/class-wp-comment-query.php
- Timestamp:
- 02/05/2016 06:49:46 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-comment-query.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-comment-query.php
r36479 r36480 215 215 * @type int $post_ID Currently unused. 216 216 * @type int $post_id Limit results to those affiliated with a given post ID. 217 * Default null.217 * Default 0. 218 218 * @type array $post__in Array of post IDs to include affiliated comments for. 219 219 * Default empty. … … 279 279 'post_author__not_in' => '', 280 280 'post_ID' => '', 281 'post_id' => null,281 'post_id' => 0, 282 282 'post__in' => '', 283 283 'post__not_in' => '', … … 648 648 } 649 649 650 if ( strlen( $this->query_vars['post_id'] ) ) { 651 $this->sql_clauses['where']['post_id'] = $wpdb->prepare( 'comment_post_ID = %d', $this->query_vars['post_id'] ); 650 $post_id = absint( $this->query_vars['post_id'] ); 651 if ( ! empty( $post_id ) ) { 652 $this->sql_clauses['where']['post_id'] = $wpdb->prepare( 'comment_post_ID = %d', $post_id ); 652 653 } 653 654
Note: See TracChangeset
for help on using the changeset viewer.