问题是我安装了一个处理搜索的插件,叫做更好的搜索。
function query_1($query){
$query .= ",wp_postmeta.meta_value as total_saless ";
return $query;
}
add_filter( \'bsearch_posts_match_field\', \'query_1\' );
function query_2($query){
$query .= "AND wp_postmeta.meta_key=\'total_sales\' ";
return $query;
}
add_filter( \'bsearch_posts_where\', \'query_2\' );
function query_3($query){
$query = " CAST(total_saless AS INTEGER) > 99999 DESC, score DESC ";
return $query;
}
add_filter( \'bsearch_posts_orderby\', \'query_3\' );
我所要做的就是抓住它。