protected function prepare_items_query($prepared_args = array(), $request = null)
{
$query_args = array();
foreach ($prepared_args as $key => $value) {
/**
* Filters the query_vars used in get_items() for the constructed query.
*
* The dynamic portion of the hook name, `$key`, refers to the query_var key.
*
* @since 4.7.0
*
* @param string $value The query_var value.
*/
$query_args[$key] = apply_filters("rest_query_var-{$key}", $value);
}
if ('post' !== $this->post_type || !isset($query_args['ignore_sticky_posts'])) {
$query_args['ignore_sticky_posts'] = true;
}
if ('include' === $query_args['orderby']) {
$query_args['orderby'] = 'post__in';
}
return $query_args;
}