Changeset 44456
- Timestamp:
- 01/08/2019 04:31:56 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-query.php
r44452 r44456 1621 1621 case 'post_name__in': 1622 1622 if ( ! empty( $this->query_vars['post_name__in'] ) ) { 1623 $post_name__in = array_map( 'sanitize_title_for_query', $this->query_vars['post_name__in'] );1623 $post_name__in = array_map( 'sanitize_title_for_query', $this->query_vars['post_name__in'] ); 1624 1624 $post_name__in_string = "'" . implode( "','", $post_name__in ) . "'"; 1625 $orderby_clause = "FIELD( {$wpdb->posts}.post_name," . $post_name__in_string . ' )';1625 $orderby_clause = "FIELD( {$wpdb->posts}.post_name," . $post_name__in_string . ' )'; 1626 1626 } 1627 1627 break; -
trunk/tests/phpunit/tests/post/query.php
r44452 r44456 183 183 $ordered = array( $posts[2], $posts[0], $posts[3] ); 184 184 185 $q = new WP_Query( array( 186 'post_type' => 'any', 187 'post__in' => $ordered, 188 'orderby' => array( 'post__in' => 'ASC' ), 189 ) ); 185 $q = new WP_Query( 186 array( 187 'post_type' => 'any', 188 'post__in' => $ordered, 189 'orderby' => array( 'post__in' => 'ASC' ), 190 ) 191 ); 190 192 $this->assertSame( $ordered, wp_list_pluck( $q->posts, 'ID' ) ); 191 193 } … … 199 201 $ordered = array( $posts[2], $posts[0], $posts[3] ); 200 202 201 $q = new WP_Query( array( 202 'post_type' => 'any', 203 'post__in' => $ordered, 204 'orderby' => 'post__in', 205 ) ); 203 $q = new WP_Query( 204 array( 205 'post_type' => 'any', 206 'post__in' => $ordered, 207 'orderby' => 'post__in', 208 ) 209 ); 206 210 $this->assertSame( $ordered, wp_list_pluck( $q->posts, 'ID' ) ); 207 211 }
Note: See TracChangeset
for help on using the changeset viewer.