Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php WordPress是否可以通过标准搜索查询和自定义税务查询的关键字进行搜索_Php_Wordpress - Fatal编程技术网

Php WordPress是否可以通过标准搜索查询和自定义税务查询的关键字进行搜索

Php WordPress是否可以通过标准搜索查询和自定义税务查询的关键字进行搜索,php,wordpress,Php,Wordpress,有这样的疑问: $key = 'xbox'; $test = get_posts( array( 'suppress_filters' => false, 's' => $key, 'numberposts' => 10, 'post_type' => array('games'), 'tax_query'

有这样的疑问:

$key = 'xbox';
$test = get_posts( 
    array(
        'suppress_filters' => false,
        's'                => $key,
        'numberposts'      => 10,
        'post_type'        => array('games'),
        'tax_query'              => array(
            'relation' => 'OR',
            array(
                'taxonomy'         => 'platforms',
                'field'            => 'slug',
                'terms'            => $key,
            ),
            array(
                'taxonomy' => 'genres',
                'field' => 'slug',
                'terms' => $key,
            ),
            array(
                'taxonomy' => 'post_tag',
                'field' => 'slug',
                'terms' => $key,
            ) 
        )

    ) 
);
我需要让搜索
s
和税务查询同时工作。。 例如,如果我搜索xbox,我希望查询会在我的帖子内容/标题中找到xbox。。但也要检查是否有任何帖子出现在术语
中,如%xbox%

有什么建议吗