Code Duplication    Length = 6-6 lines in 2 locations

classes/class-wetu-importer.php 2 locations

@@ 778-783 (lines=6) @@
775
					if ( ! $term = term_exists( trim( $k ), $tax ) ) {
776
						$term = wp_insert_term( trim( $k ), $tax );
777
778
						if ( is_wp_error( $term ) ) {
779
							// @codingStandardsIgnoreLine
780
							echo $term->get_error_message();
781
						} else {
782
							wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
783
						}
784
					} else {
785
						wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
786
					}
@@ 815-820 (lines=6) @@
812
813
			$term = wp_insert_term( trim( $name ), $taxonomy,$parent );
814
815
			if ( is_wp_error( $term ) ) {
816
				// @codingStandardsIgnoreLine
817
				echo $term->get_error_message();
818
			} else {
819
				wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
820
			}
821
		} else {
822
			wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
823
		}