Skip to main content
    $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);
   
    $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=$features;
        }
    }else{
        $all_ids=$metas;
    }
    

    
    
    if(empty($all_ids)){
        $all_ids[]=0;
    }
    
  
    $args['post__in']=$all_ids;
   
    
    global $keyword;
    $keyword=esc_html ( $_POST['keyword']);
   
    if(!is_numeric($keyword)){
    $args['meta_query']=array(
        'relation'=>'OR',
        array(
        'meta_key'=>'taken-by',
        'meta_value'=>$keyword,
        'type'=>'CHAR',
        'compare'=>'LIKE'),
        array(
        'meta_key'=>'property-project',
        'meta_value'=>$keyword,
        'type'=>'CHAR',
        'compare'=>'LIKE'
            ),
        array(
         'key'=>'post_title',
         'value'=>$keyword,
         'type'=>'CHAR',
         'compare'=>'LIKE'
                )
        );
    }else{
    $args['meta_query']=array(
        array(
        'key'=>'ID',
        'value'=>$keyword,
        'type'=>'NUMERIC',
        'compare'=>'='
                )
        );
    }
     
    /*if( !empty($keyword)  ){
     add_filter( 'posts_where', 'wpestate_title_filter', 10, 2 );
    }*/
    
    $prop_selection= new Wp_Query($args);
   
$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 = $features;
    }
} else {
    $all_ids = $metas;
}


if (empty($all_ids)) {
    $all_ids[] = 0;
}


$args['post__in'] = $all_ids;


global $keyword;
$keyword = esc_html($_POST['keyword']);

if (!is_numeric($keyword)) {
    $args['meta_query'] = array(
        'relation' => 'OR',
        array(
            'meta_key' => 'taken-by',
            'meta_value' => $keyword,
            'type' => 'CHAR',
            'compare' => 'LIKE'),
        array(
            'meta_key' => 'property-project',
            'meta_value' => $keyword,
            'type' => 'CHAR',
            'compare' => 'LIKE'
        ),
        array(
            'key' => 'post_title',
            'value' => $keyword,
            'type' => 'CHAR',
            'compare' => 'LIKE'
        )
    );
} else {
    $args['meta_query'] = array(
        array(
            'key' => 'ID',
            'value' => $keyword,
            'type' => 'NUMERIC',
            'compare' => '='
        )
    );
}

/*if( !empty($keyword)  ){
 add_filter( 'posts_where', 'wpestate_title_filter', 10, 2 );
}*/

$prop_selection = new Wp_Query($args);
added 406 characters in body
Source Link
if    $args = array(!is_numeric
        '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($keyword
                                'relation' => 'AND',
                                $categ_array,
                                $action_array,
                                $city_array,
                                $area_array,
                                $county_array

                            )
    ); {     
    $args['meta_key'] 
 = 'taken-by';
    $args['meta_value']$features             = $keyword;array();
    $args['post_type']$features = 'estate_property';wpestate_add_feature_to_search_ajax();
    $args['key']$metas = 'post_title';wpestate_convert_meta_to_postin($meta_query);


    $args['value']if( =!empty($features) $keyword;){
    $args['compare']    if( !empty($metas)){
            $all_ids = 'LIKE';array_intersect($metas,$features);
        }else{
            $all_ids=$features;
        }
    }else{
        $all_ids=$metas;
    }
    

    
    
    if(empty($all_ids)){
    $args['post_type'] = 'estate_property';  $all_ids[]=0;
    $args['key']}
 = 'ID';  
   
  $args['value'] = $args['post__in']=$all_ids;
   
    
    global $keyword;
    $keyword=esc_html ( $_POST['keyword']);
   
    if(!is_numeric($keyword)){
    $args['meta_query']=array(
        'relation'=>'OR',
        array(
        'meta_key'=>'taken-by',
        'meta_value'=>$keyword,
        'type'=>'CHAR',
        'compare'=>'LIKE'),
        array(
        'meta_key'=>'property-project',
        'meta_value'=>$keyword,
        'type'=>'CHAR',
        'compare'=>'LIKE'
            ),
        array(
         'key'=>'post_title',
         'value'=>$keyword,
         'type'=>'CHAR',
         'compare'=>'LIKE'
                )
        );
    }else{
    $args['meta_query']=array(
        array(
$prop_selection =       'key'=>'ID',
        'value'=>$keyword,
        'type'=>'NUMERIC',
        'compare'=>'='
                )
        );
    }
     
    /*if( !empty($keyword)  ){
     add_filter( 'posts_where', 'wpestate_title_filter', 10, 2 );
    }*/
    
    $prop_selection= new Wp_Query($args);
   
if (!is_numeric($keyword)) {
    $args['meta_key'] = 'taken-by';
    $args['meta_value'] = $keyword;
    $args['post_type'] = 'estate_property';
    $args['key'] = 'post_title';
    $args['value'] = $keyword;
    $args['compare'] = 'LIKE';
} else {
    $args['post_type'] = 'estate_property';
    $args['key'] = 'ID';
    $args['value'] = $keyword;
}

$prop_selection = new Wp_Query($args);
    $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=$features;
        }
    }else{
        $all_ids=$metas;
    }
    

    
    
    if(empty($all_ids)){
        $all_ids[]=0;
    }
    
   
    $args['post__in']=$all_ids;
   
    
    global $keyword;
    $keyword=esc_html ( $_POST['keyword']);
   
    if(!is_numeric($keyword)){
    $args['meta_query']=array(
        'relation'=>'OR',
        array(
        'meta_key'=>'taken-by',
        'meta_value'=>$keyword,
        'type'=>'CHAR',
        'compare'=>'LIKE'),
        array(
        'meta_key'=>'property-project',
        'meta_value'=>$keyword,
        'type'=>'CHAR',
        'compare'=>'LIKE'
            ),
        array(
         'key'=>'post_title',
         'value'=>$keyword,
         'type'=>'CHAR',
         'compare'=>'LIKE'
                )
        );
    }else{
    $args['meta_query']=array(
        array(
        'key'=>'ID',
        'value'=>$keyword,
        'type'=>'NUMERIC',
        'compare'=>'='
                )
        );
    }
     
    /*if( !empty($keyword)  ){
     add_filter( 'posts_where', 'wpestate_title_filter', 10, 2 );
    }*/
    
    $prop_selection= new Wp_Query($args);
   
edited title
Link

Is my code is correct?

added 352 characters in body
Source Link
Loading
Source Link
Loading