Code Duplication    Length = 8-8 lines in 3 locations

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

@@ 492-499 (lines=8) @@
489
			}
490
		}
491
492
		if ( ! empty( $insert['post_format'] ) ) {
493
			if ( 'default' !== strtolower( $insert['post_format'] ) ) {
494
				set_post_format( $post_id, $insert['post_format'] );
495
			}
496
			else {
497
				set_post_format( $post_id, get_option( 'default_post_format' ) );
498
			}
499
		}
500
501
		if ( isset( $featured_image  ) ) {
502
			$this->parse_and_set_featured_image( $post_id, $delete_featured_image, $featured_image );

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

@@ 506-513 (lines=8) @@
503
			}
504
		}
505
506
		if ( ! empty( $insert['post_format'] ) ) {
507
			if ( 'default' !== strtolower( $insert['post_format'] ) ) {
508
				set_post_format( $post_id, $insert['post_format'] );
509
			}
510
			else {
511
				set_post_format( $post_id, get_option( 'default_post_format' ) );
512
			}
513
		}
514
515
		if ( isset( $featured_image ) ) {
516
			$this->parse_and_set_featured_image( $post_id, $delete_featured_image, $featured_image );

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

@@ 506-513 (lines=8) @@
503
			}
504
		}
505
506
		if ( ! empty( $insert['post_format'] ) ) {
507
			if ( 'default' !== strtolower( $insert['post_format'] ) ) {
508
				set_post_format( $post_id, $insert['post_format'] );
509
			}
510
			else {
511
				set_post_format( $post_id, get_option( 'default_post_format' ) );
512
			}
513
		}
514
515
		if ( isset( $featured_image ) ) {
516
			parent::parse_and_set_featured_image( $post_id, $delete_featured_image, $featured_image );