Code Duplication    Length = 7-8 lines in 4 locations

includes/shortcodes.php 4 locations

@@ 589-595 (lines=7) @@
586
			),
587
		);
588
589
		if ( ! empty( $atts['cats'] ) ) {
590
			$cats                     = array_filter( array_map( 'trim', explode( ',', $atts['cats'] ) ) );
591
			$form_args['tax_query'][] = array(
592
				'taxonomy' => 'give_forms_category',
593
				'terms'    => $cats,
594
			);
595
		}
596
597
		if ( ! empty( $atts['tags'] ) ) {
598
			$tags                     = array_filter( array_map( 'trim', explode( ',', $atts['tags'] ) ) );
@@ 597-603 (lines=7) @@
594
			);
595
		}
596
597
		if ( ! empty( $atts['tags'] ) ) {
598
			$tags                     = array_filter( array_map( 'trim', explode( ',', $atts['tags'] ) ) );
599
			$form_args['tax_query'][] = array(
600
				'taxonomy' => 'give_forms_tag',
601
				'terms'    => $tags,
602
			);
603
		}
604
605
		/**
606
		 * Filter to modify WP Query for Total Goal.
@@ 821-828 (lines=8) @@
818
	}
819
820
	// Maybe filter by form category.
821
	if ( ! empty( $atts['cats'] ) ) {
822
		$cats                     = array_filter( array_map( 'trim', explode( ',', $atts['cats'] ) ) );
823
		$tax_query                = array(
824
			'taxonomy' => 'give_forms_category',
825
			'terms'    => $cats,
826
		);
827
		$form_args['tax_query'][] = $tax_query;
828
	}
829
830
	// Maybe filter by form tag.
831
	if ( ! empty( $atts['tags'] ) ) {
@@ 831-838 (lines=8) @@
828
	}
829
830
	// Maybe filter by form tag.
831
	if ( ! empty( $atts['tags'] ) ) {
832
		$tags                     = array_filter( array_map( 'trim', explode( ',', $atts['tags'] ) ) );
833
		$tax_query                = array(
834
			'taxonomy' => 'give_forms_tag',
835
			'terms'    => $tags,
836
		);
837
		$form_args['tax_query'][] = $tax_query;
838
	}
839
	
840
	/**
841
	 * Filter to modify WP Query for Total Goal.