REST API: After [41760], use correct query variable in `WP_Term_Query::parse_orderby()` when `'include_slugs' => 'slug__in'` is passed.

See #40826.

git-svn-id: https://develop.svn.wordpress.org/trunk@41769 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2017-10-05 02:27:02 +00:00
parent fb28cd4663
commit 86125a6a2d
1 changed files with 1 additions and 1 deletions

View File

@ -844,7 +844,7 @@ class WP_Term_Query {
$include = implode( ',', wp_parse_id_list( $this->query_vars['include'] ) );
$orderby = "FIELD( t.term_id, $include )";
} elseif ( 'slug__in' == $_orderby && ! empty( $this->query_vars['slug'] ) && is_array( $this->query_vars['slug'] ) ) {
$slugs = implode( "', '", array_map( 'sanitize_title_for_query', $this->query_vars['slug__in'] ) );
$slugs = implode( "', '", array_map( 'sanitize_title_for_query', $this->query_vars['slug'] ) );
$orderby = "FIELD( t.slug, '" . $slugs . "')";
} elseif ( 'none' == $_orderby ) {
$orderby = '';