Code Duplication    Length = 5-5 lines in 2 locations

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

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