$args = array(
'cache_results' => false,
'update_post_meta_cache' => false,
'update_post_term_cache' => false,
'post_type' => 'estate_property',
'post_status' => 'publish',
'paged' => $pagination,
'posts_per_page' => $prop_no,
'meta_key' => $meta_order,
'orderby' => $order_by,
'order' => $meta_directions,
//'meta_query' => $meta_query,
'tax_query' => array(
'relation' => 'AND',
$categ_array,
$action_array,
$city_array,
$area_array,
$county_array
)
);
$features = array();
$features = wpestate_add_feature_to_search_ajax();
$metas = wpestate_convert_meta_to_postin($meta_query);
if( (!empty($features) ) {
if( (!empty($metas)) {
$all_ids = array_intersect($metas, $features);
} else {
$all_ids = $all_ids=$features;$features;
}
} else {
$all_ids = $all_ids=$metas;$metas;
}
if (empty($all_ids)) {
$all_ids[] = $all_ids[]=0;0;
}
$args['post__in'] = $args['post__in']=$all_ids;$all_ids;
global $keyword;
$keyword $keyword=esc_html= esc_html( $_POST['keyword']);
if (!is_numeric($keyword)) {
$args['meta_query']=array$args['meta_query'] = array(
'relation'=>'OR''relation' => 'OR',
array(
'meta_key'=>'taken 'meta_key' => 'taken-by',
'meta_value'=>$keyword 'meta_value' => $keyword,
'type'=>'CHAR' 'type' => 'CHAR',
'compare'=>'LIKE' 'compare' => 'LIKE'),
array(
'meta_key'=>'property 'meta_key' => 'property-project',
'meta_value'=>$keyword 'meta_value' => $keyword,
'type'=>'CHAR' 'type' => 'CHAR',
'compare'=>'LIKE'
'compare' => 'LIKE'
),
array(
'key'=>'post_title',
'key' => 'post_title',
'value'=>$keyword,
'value' => 'type'=>'CHAR'$keyword,
'compare'=>'LIKE'
'type' => 'CHAR',
)'compare' => 'LIKE'
);
);
} else {
$args['meta_query']=array$args['meta_query'] = array(
array(
'key'=>'ID',
'key' => 'value'=>$keyword'ID',
'type'=>'NUMERIC',
'value' => 'compare'=>'='$keyword,
'type' => 'NUMERIC',
)
);
'compare' => }'='
)
);
}
/*if( !empty($keyword) ){
add_filter( 'posts_where', 'wpestate_title_filter', 10, 2 );
}*/
$prop_selection $prop_selection== new Wp_Query($args);