我有一个Wordpress元查询,如下所述,我想通过另一个查询从另一个表中过滤掉这些帖子。
$meta_query_part['relation'] = 'AND';
$country_array =array();
$country_array['key'] = 'property_country';
$country_array['value'] = $search_string;
$country_array['type'] = 'CHAR';
$country_array['compare'] = 'LIKE';
$meta_query_part[] = $country_array;
$country_array =array();
$country_array['key'] = 'property_county';
$country_array['value'] = $search_string;
$country_array['type'] = 'CHAR';
$country_array['compare'] = 'LIKE';
$meta_query_part[] = $country_array;
$country_array =array();
$country_array['key'] = 'property_state';
$country_array['value'] = $search_string;
$country_array['type'] = 'CHAR';
$country_array['compare'] = 'LIKE';
$meta_query_part[] = $country_array;
$meta_query[]=$meta_query_part;
$args = array(
'cache_results' => false,
'update_post_meta_cache' => false,
'update_post_term_cache' => false,
'post_type' => 'estate_property',
'post_status' => 'publish',
'posts_per_page' => -1,
'meta_key' => 'prop_featured',
'orderby' => 'meta_value',
'order' => 'DESC',
'meta_query' => $meta_query,
);
$prop_selection = new WP_Query($args);
下面是另一个按价格范围过滤帖子的查询
SELECT post_id FROM `wp_prop_area_availability` WHERE price BETWEEN 34 AND 119
table to filter posts 如何将mysql查询转换为wordpress元查询,或者换句话说,我有wordpress元查询的结果,我想按价格范围过滤这些结果,而这个价格范围来自另一个表。