Code Duplication    Length = 5-5 lines in 2 locations

classes/class-lsx-wetu-importer.php 2 locations

@@ 782-786 (lines=5) @@
779
					if ( ! $term ) {
780
						$term = wp_insert_term( trim( $k ), $tax );
781
782
						if ( is_wp_error( $term ) ) {
783
							echo wp_kses_post( $term->get_error_message() );
784
						} else {
785
							wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
786
						}
787
					} else {
788
						wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
789
					}
@@ 817-821 (lines=5) @@
814
			}
815
			$term = wp_insert_term( trim( $name ), $taxonomy,$parent );
816
817
			if ( is_wp_error( $term ) ) {
818
				echo wp_kses_post( $term->get_error_message() );
819
			} else {
820
				wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
821
			}
822
		} else {
823
			wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
824
		}