Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 332-338 (lines=7) @@
329
			return $post_check;
330
		}
331
332
		if ( $has_media || $has_media_by_url ) {
333
			$media_files = ! empty( $input['media'] ) ? $input['media'] : array();
334
			$media_urls = ! empty( $input['media_urls'] ) ? $input['media_urls'] : array();
335
			$media_attrs = ! empty( $input['media_attrs'] ) ? $input['media_attrs'] : array();
336
			$force_parent_id = $post_id;
337
			$media_results = $this->handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs, $force_parent_id );
338
		}
339
340
		// set page template for this post..
341
		if ( isset( $input['page_template'] ) && 'page' == $post_type->name ) {

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

@@ 332-338 (lines=7) @@
329
			return $post_check;
330
		}
331
332
		if ( $has_media || $has_media_by_url ) {
333
			$media_files = ! empty( $input['media'] ) ? $input['media'] : array();
334
			$media_urls = ! empty( $input['media_urls'] ) ? $input['media_urls'] : array();
335
			$media_attrs = ! empty( $input['media_attrs'] ) ? $input['media_attrs'] : array();
336
			$force_parent_id = $post_id;
337
			$media_results = $this->handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs, $force_parent_id );
338
		}
339
340
		// set page template for this post..
341
		if ( isset( $input['page_template'] ) && 'page' == $post_type->name ) {