$args = [
's' => $autocompleteTerm,
'orderby' => 'modified',
'fields' => 'all',
'post_status' => array('publish','future'),
];
$posts_query = new \WP_Query($args);
return $posts_query->get_posts();
$autocompleteTerm
is a string of what I am searching for, for example, if I publish an article with title 'top 10 candies'
when $autocompleteTerm = 'top 10'
, return is empty.
it works if $autocompleteTerm = 'top'
instead