Changeset 37225 for trunk/src/wp-includes/query.php
- Timestamp:
- 04/17/2016 03:16:36 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/query.php
r37075 r37225 1469 1469 * Introduced the `$comment_status` and `$ping_status` parameters. 1470 1470 * Introduced `RAND(x)` syntax for `$orderby`, which allows an integer seed value to random sorts. 1471 * @since 4.6.0 Added 'post_name__in' support for `$orderby`. 1471 1472 * @access public 1472 1473 * … … 1524 1525 * 'RAND(x)' (where 'x' is an integer seed value), 1525 1526 * 'comment_count', 'meta_value', 'meta_value_num', 'post__in', 1526 * and the array keys of `$meta_query`. 1527 * 'post_name__in', 'post_parent__in', and the array keys 1528 * of `$meta_query`. 1527 1529 * @type int $p Post ID. 1528 1530 * @type int $page Show the number of posts that would show up on page X of a … … 2746 2748 } elseif ( is_array( $q['post_name__in'] ) && ! empty( $q['post_name__in'] ) ) { 2747 2749 $q['post_name__in'] = array_map( 'sanitize_title_for_query', $q['post_name__in'] ); 2748 $where .= " AND $wpdb->posts.post_name IN ('" . implode( "' ,'", $q['post_name__in'] ) . "')"; 2750 $post_name__in = "'" . implode( "','", $q['post_name__in'] ) . "'"; 2751 $where .= " AND $wpdb->posts.post_name IN ($post_name__in)"; 2749 2752 } 2750 2753 … … 2964 2967 } elseif ( $q['orderby'] == 'post_parent__in' && ! empty( $post_parent__in ) ) { 2965 2968 $orderby = "FIELD( {$wpdb->posts}.post_parent, $post_parent__in )"; 2969 } elseif ( $q['orderby'] == 'post_name__in' && ! empty( $post_name__in ) ) { 2970 $orderby = "FIELD( {$wpdb->posts}.post_name, $post_name__in )"; 2966 2971 } else { 2967 2972 $orderby_array = array();
Note: See TracChangeset
for help on using the changeset viewer.