Code Duplication    Length = 7-7 lines in 2 locations

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

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

includes/class-wc-query.php 1 location

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