Code Duplication    Length = 5-5 lines in 2 locations

json-endpoints/class.wpcom-json-api-update-post-v1-1-endpoint.php 1 location

@@ 173-177 (lines=5) @@
170
		// Convert comma-separated terms to array before attempting to
171
		// merge with hardcoded taxonomies
172
		foreach ( $input['terms'] as $taxonomy => $terms ) {
173
			if ( is_string( $terms ) ) {
174
				$input['terms'][ $taxonomy ] = explode( ',', $terms );
175
			} else if ( ! is_array( $terms ) ) {
176
				$input['terms'][ $taxonomy ] = array();
177
			}
178
		}
179
180
		// For each hard-coded taxonomy, merge into terms object

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

@@ 153-157 (lines=5) @@
150
			// Convert comma-separated terms to array before attempting to
151
			// merge with hardcoded taxonomies
152
			foreach ( $input[ $term_input_key ] as $taxonomy => $terms ) {
153
				if ( is_string( $terms ) ) {
154
					$input[ $term_input_key ][ $taxonomy ] = explode( ',', $terms );
155
				} else if ( ! is_array( $terms ) ) {
156
					$input[ $term_input_key ][ $taxonomy ] = array();
157
				}
158
			}
159
160
			// For each hard-coded taxonomy, merge into terms object