Code Duplication    Length = 9-9 lines in 2 locations

json-endpoints/class.wpcom-json-api-update-post-v1-2-endpoint.php 2 locations

@@ 217-225 (lines=9) @@
214
					$term_info = wp_insert_term( $term, $taxonomy );
215
				}
216
217
				if ( ! is_wp_error( $term_info ) ) {
218
					if ( $is_hierarchical ) {
219
						// Hierarchical terms must be added by ID
220
						$tax_input[$taxonomy][] = (int) $term_info['term_id'];
221
					} else {
222
						// Non-hierarchical terms must be added by name
223
						$tax_input[$taxonomy][] = $term;
224
					}
225
				}
226
			}
227
		}
228
@@ 247-255 (lines=9) @@
244
				$term = (int) $term;
245
				$term_info = get_term_by( 'id', $term, $taxonomy, ARRAY_A );
246
247
				if ( $term_info && ! is_wp_error( $term_info ) ) {
248
					if ( $is_hierarchical ) {
249
						// Categories must be added by ID
250
						$tax_input[$taxonomy][] = $term;
251
					} else {
252
						// Tags must be added by name
253
						$tax_input[$taxonomy][] = $term_info['name'];
254
					}
255
				}
256
			}
257
		}
258