Code Duplication    Length = 3-4 lines in 3 locations

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

@@ 208-210 (lines=3) @@
205
			}
206
		}
207
208
		if ( isset( $input['categories'] ) && empty( $tax_input['category'] ) && 'revision' !== $post_type->name ) {
209
			$tax_input['category'][] = get_option( 'default_category' );
210
		}
211
212
		unset( $input['tags'], $input['categories'] );
213

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

@@ 213-215 (lines=3) @@
210
			}
211
		}
212
213
		if ( isset( $input['categories'] ) && empty( $tax_input['category'] ) && 'revision' !== $post_type->name ) {
214
			$tax_input['category'][] = get_option( 'default_category' );
215
		}
216
217
		unset( $input['tags'], $input['categories'] );
218

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

@@ 212-215 (lines=4) @@
209
			}
210
		}
211
212
		if ( ( isset( $input['categories'] ) || isset( $input['categories_by_id'] ) )
213
			&& empty( $tax_input['category'] ) && 'revision' !== $post_type->name ) {
214
			$tax_input['category'][] = get_option( 'default_category' );
215
		}
216
217
		unset( $input['tags'], $input['categories'], $input['tags_by_id'], $input['categories_by_id'] );
218