Code Duplication    Length = 6-6 lines in 2 locations

classes/class-wetu-importer.php 2 locations

@@ 755-760 (lines=6) @@
752
					if ( ! $term = term_exists( trim( $k ), $tax ) ) {
753
						$term = wp_insert_term( trim( $k ), $tax );
754
755
						if ( is_wp_error( $term ) ) {
756
							// @codingStandardsIgnoreLine
757
							echo $term->get_error_message();
758
						} else {
759
							wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
760
						}
761
					} else {
762
						wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
763
					}
@@ 783-788 (lines=6) @@
780
781
			$term = wp_insert_term( trim( $name ), $taxonomy,$parent );
782
783
			if ( is_wp_error( $term ) ) {
784
				// @codingStandardsIgnoreLine
785
				echo $term->get_error_message();
786
			} else {
787
				wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
788
			}
789
		} else {
790
			wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
791
		}