Changeset 34212 for trunk/src/wp-includes/class-wp-comment-query.php
- Timestamp:
- 09/15/2015 04:34:14 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-comment-query.php
r34205 r34212 95 95 * @since 4.2.0 96 96 * @since 4.4.0 `$parent__in` and `$parent__not_in` were added. 97 * @since 4.4.0 Order by `comment__in` was added. 97 98 * @access public 98 99 * … … 131 132 * 'comment_date_gmt', 'comment_ID', 'comment_karma', 132 133 * 'comment_parent', 'comment_post_ID', 'comment_type', 'user_id', 133 * ' meta_value', 'meta_value_num', the value of $meta_key, and the134 * 'comment__in', 'meta_value', 'meta_value_num', the value of $meta_key, and the 134 135 * array keys of `$meta_query`. Also accepts false, an empty array, 135 136 * or 'none' to disable `ORDER BY` clause. … … 391 392 } 392 393 393 if ( ! $found_orderby_comment_ID && 'comment_ID' === $_orderby) {394 if ( ! $found_orderby_comment_ID && in_array( $_orderby, array( 'comment_ID', 'comment__in' ) ) ) { 394 395 $found_orderby_comment_ID = true; 395 396 } … … 398 399 399 400 if ( ! $parsed ) { 401 continue; 402 } 403 404 if ( 'comment__in' === $_orderby ) { 405 $orderby_array[] = $parsed; 400 406 continue; 401 407 } … … 773 779 } elseif ( $orderby == 'meta_value_num' ) { 774 780 $parsed = "$wpdb->commentmeta.meta_value+0"; 781 } elseif ( $orderby == 'comment__in' ) { 782 $comment__in = implode( ',', array_map( 'absint', $this->query_vars['comment__in'] ) ); 783 $parsed = "FIELD( {$wpdb->comments}.comment_ID, $comment__in )"; 775 784 } elseif ( in_array( $orderby, $allowed_keys ) ) { 776 785
Note: See TracChangeset
for help on using the changeset viewer.