Code Duplication    Length = 3-4 lines in 3 locations

includes/wc-term-functions.php 1 location

@@ 425-428 (lines=4) @@
422
		",
423
	);
424
425
	if ( count( $exclude_term_ids ) ) {
426
		$query['join']  .= " LEFT JOIN ( SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id IN ( " . implode( ',', array_map( 'absint', $exclude_term_ids ) ) . ' ) ) AS exclude_join ON exclude_join.object_id = p.ID';
427
		$query['where'] .= ' AND exclude_join.object_id IS NULL';
428
	}
429
430
	// Pre-process term taxonomy ids.
431
	if ( ! $terms_are_term_taxonomy_ids ) {

includes/data-stores/class-wc-product-data-store-cpt.php 2 locations

@@ 1285-1288 (lines=4) @@
1282
			',
1283
		);
1284
1285
		if ( count( $exclude_term_ids ) ) {
1286
			$query['join']  .= " LEFT JOIN ( SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id IN ( " . implode( ',', array_map( 'absint', $exclude_term_ids ) ) . ' ) ) AS exclude_join ON exclude_join.object_id = p.ID';
1287
			$query['where'] .= ' AND exclude_join.object_id IS NULL';
1288
		}
1289
1290
		if ( count( $include_term_ids ) ) {
1291
			$query['join'] .= " INNER JOIN ( SELECT object_id FROM {$wpdb->term_relationships} INNER JOIN {$wpdb->term_taxonomy} using( term_taxonomy_id ) WHERE term_id IN ( " . implode( ',', array_map( 'absint', $include_term_ids ) ) . ' ) ) AS include_join ON include_join.object_id = p.ID';
@@ 1290-1292 (lines=3) @@
1287
			$query['where'] .= ' AND exclude_join.object_id IS NULL';
1288
		}
1289
1290
		if ( count( $include_term_ids ) ) {
1291
			$query['join'] .= " INNER JOIN ( SELECT object_id FROM {$wpdb->term_relationships} INNER JOIN {$wpdb->term_taxonomy} using( term_taxonomy_id ) WHERE term_id IN ( " . implode( ',', array_map( 'absint', $include_term_ids ) ) . ' ) ) AS include_join ON include_join.object_id = p.ID';
1292
		}
1293
1294
		if ( count( $exclude_ids ) ) {
1295
			$query['where'] .= ' AND p.ID NOT IN ( ' . implode( ',', array_map( 'absint', $exclude_ids ) ) . ' )';