Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 791-795 (lines=5) @@
788
					if ( ! $term ) {
789
						$term = wp_insert_term( trim( $k ), $tax );
790
791
						if ( is_wp_error( $term ) ) {
792
							echo wp_kses_post( $term->get_error_message() );
793
						} else {
794
							wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
795
						}
796
					} else {
797
						wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
798
					}
@@ 826-830 (lines=5) @@
823
			}
824
			$term = wp_insert_term( trim( $name ), $taxonomy,$parent );
825
826
			if ( is_wp_error( $term ) ) {
827
				echo wp_kses_post( $term->get_error_message() );
828
			} else {
829
				wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
830
			}
831
		} else {
832
			wp_set_object_terms( $id, intval( $term['term_id'] ), $taxonomy,true );
833
		}