Inventory_Presser_Shortcode_Slider::add_make_and_model_query_args( $query_args,  $shortcode_atts )

On This Page


Source Source

File: includes/shortcode/class-shortcode-inventory-slider.php

	protected static function add_make_and_model_query_args( $query_args, $shortcode_atts ) {
		// Make filter.
		if ( ! empty( $shortcode_atts['make'] ) ) {
			$query_args['tax_query'] = array(
				array(
					'taxonomy' => 'make',
					'field'    => 'slug',
					'terms'    => $shortcode_atts['make'],
				),
			);
		}

		// Model filter.
		if ( ! empty( $shortcode_atts['model'] ) ) {
			$query_args['meta_query'][] = array(
				'key'     => apply_filters( 'invp_prefix_meta_key', 'model' ),
				'value'   => $shortcode_atts['model'],
				'compare' => 'LIKE',
			);
		}

		return $query_args;
	}