Code Duplication    Length = 8-8 lines in 3 locations

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

@@ 511-518 (lines=8) @@
508
			}
509
		}
510
511
		if ( ! empty( $insert['post_format'] ) ) {
512
			if ( 'default' !== strtolower( $insert['post_format'] ) ) {
513
				set_post_format( $post_id, $insert['post_format'] );
514
			}
515
			else {
516
				set_post_format( $post_id, get_option( 'default_post_format' ) );
517
			}
518
		}
519
520
		if ( isset( $featured_image  ) ) {
521
			$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

@@ 579-586 (lines=8) @@
576
			}
577
		}
578
579
		if ( ! empty( $insert['post_format'] ) ) {
580
			if ( 'default' !== strtolower( $insert['post_format'] ) ) {
581
				set_post_format( $post_id, $insert['post_format'] );
582
			}
583
			else {
584
				set_post_format( $post_id, get_option( 'default_post_format' ) );
585
			}
586
		}
587
588
		if ( isset( $featured_image ) ) {
589
			$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

@@ 580-587 (lines=8) @@
577
			}
578
		}
579
580
		if ( ! empty( $insert['post_format'] ) ) {
581
			if ( 'default' !== strtolower( $insert['post_format'] ) ) {
582
				set_post_format( $post_id, $insert['post_format'] );
583
			}
584
			else {
585
				set_post_format( $post_id, get_option( 'default_post_format' ) );
586
			}
587
		}
588
589
		if ( isset( $featured_image ) ) {
590
			parent::parse_and_set_featured_image( $post_id, $delete_featured_image, $featured_image );