$terms ) { if ( 'listing_status' === $tax ) { // active or sold status if ( 1 === count( $terms ) ) { $args['meta_query'][] = array( 'key' => 'car_mark_as_sold', 'value' => ( 'listing_is_active' === $terms[0] ) ? '' : 'on', 'compare' => '=', ); } } elseif ( 'min_price' === $tax ) { $args['meta_query'][] = array( 'key' => 'stm_genuine_price', 'value' => $terms[0], 'type' => 'DECIMAL', 'compare' => '>=', ); } elseif ( 'max_price' === $tax ) { $args['meta_query'][] = array( 'key' => 'stm_genuine_price', 'value' => $terms[0], 'type' => 'DECIMAL', 'compare' => '<=', ); } else { // the rest of the filters $_value = array(); if ( ! empty( $terms ) ) { foreach ( $terms as $term ) { $exploded = explode( '-', $term ); array_pop( $exploded ); if ( count( $exploded ) > 1 ) { $_value[] = implode( '-', $exploded ); } else { $_value[] = $exploded[0]; } } } $args['tax_query'][] = array( 'taxonomy' => $tax, 'field' => 'slug', 'terms' => $_value, ); } } } } $modern_inventory_link = get_transient( 'stm_modern_inventory_link_' . $fake_id ); // previous page was a modern inventory if ( ! empty( $modern_inventory_link ) ) { $back_inventory_link = esc_url( $modern_inventory_link ); } } }