Few questions about EasyBook

Home Forums WordPress Theme EasyBook – WordPress Theme Few questions about EasyBook

This topic contains 26 replies, has 2 voices, and was last updated by  44francecom 2 months ago.

Viewing 2 posts - 26 through 27 (of 27 total)
  • Author
    Posts
  • #36303

    CTHthemes
    Keymaster

    Try this:

    add_filter( 'easybook_addons_ajax_search_args', function($post_args){
        $tax_queries = isset($post_args['tax_query']) && is_array($post_args['tax_query']) ? $post_args['tax_query'] : array();
    
        if( isset($_POST['stars']) && !empty( $_POST['stars'] ) ){
            $tax_queries[] =    array(
                                    'taxonomy' => 'campings_etoiles',
                                    'field'    => 'slug',
                                    'terms'    => $_POST['stars'],
                                    'operator' => 'AND', // default IN
                                );
        }
    
        if(!empty($tax_queries)){
            if( count($tax_queries) > 1 ) $tax_queries['relation'] = easybook_addons_get_option('search_tax_relation');
            $post_args['tax_query'] = $tax_queries;
        } 
    
        return $post_args;
    
    } );
    #36325

    44francecom
    Participant

    Supported

    It works, thanks !

Viewing 2 posts - 26 through 27 (of 27 total)

The topic ‘Few questions about EasyBook’ is closed to new replies.

New featues: CityBook - Listing & Directory WordPress Theme version 2.1.8 was outUpdate now
+