最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp query - WP_Query no result if keyword contains number

programmeradmin2浏览0评论
$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

发布评论

评论列表(0)

  1. 暂无评论