Code Duplication    Length = 7-7 lines in 2 locations

includes/widgets/class-wc-widget-price-filter.php 1 location

@@ 174-180 (lines=7) @@
171
		$tax_query  = isset( $args['tax_query'] ) ? $args['tax_query'] : array();
172
		$meta_query = isset( $args['meta_query'] ) ? $args['meta_query'] : array();
173
174
		if ( ! empty( $args['taxonomy'] ) && ! empty( $args['term'] ) ) {
175
			$tax_query[] = array(
176
				'taxonomy' => $args['taxonomy'],
177
				'terms'    => array( $args['term'] ),
178
				'field'    => 'slug',
179
			);
180
		}
181
182
		foreach ( $meta_query as $key => $query ) {
183
			if ( ! empty( $query['price_filter'] ) || ! empty( $query['rating_filter'] ) ) {

includes/class-wc-query.php 1 location

@@ 626-632 (lines=7) @@
623
		$args      = $wp_the_query->query_vars;
624
		$tax_query = isset( $args['tax_query'] ) ? $args['tax_query'] : array();
625
626
		if ( ! empty( $args['taxonomy'] ) && ! empty( $args['term'] ) ) {
627
			$tax_query[] = array(
628
				'taxonomy' => $args['taxonomy'],
629
				'terms'    => array( $args['term'] ),
630
				'field'    => 'slug',
631
			);
632
		}
633
634
		return $tax_query;
635
	}