Code Duplication    Length = 8-8 lines in 3 locations

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

@@ 512-519 (lines=8) @@
509
			}
510
		}
511
512
		if ( ! empty( $insert['post_format'] ) ) {
513
			if ( 'default' !== strtolower( $insert['post_format'] ) ) {
514
				set_post_format( $post_id, $insert['post_format'] );
515
			}
516
			else {
517
				set_post_format( $post_id, get_option( 'default_post_format' ) );
518
			}
519
		}
520
521
		if ( isset( $featured_image ) ) {
522
			$this->parse_and_set_featured_image( $post_id, $delete_featured_image, $featured_image );

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

@@ 498-505 (lines=8) @@
495
			}
496
		}
497
498
		if ( ! empty( $insert['post_format'] ) ) {
499
			if ( 'default' !== strtolower( $insert['post_format'] ) ) {
500
				set_post_format( $post_id, $insert['post_format'] );
501
			}
502
			else {
503
				set_post_format( $post_id, get_option( 'default_post_format' ) );
504
			}
505
		}
506
507
		if ( isset( $featured_image  ) ) {
508
			$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

@@ 512-519 (lines=8) @@
509
			}
510
		}
511
512
		if ( ! empty( $insert['post_format'] ) ) {
513
			if ( 'default' !== strtolower( $insert['post_format'] ) ) {
514
				set_post_format( $post_id, $insert['post_format'] );
515
			}
516
			else {
517
				set_post_format( $post_id, get_option( 'default_post_format' ) );
518
			}
519
		}
520
521
		if ( isset( $featured_image ) ) {
522
			parent::parse_and_set_featured_image( $post_id, $delete_featured_image, $featured_image );