Code Duplication    Length = 7-7 lines in 2 locations

lib/endpoints/class-wp-rest-posts-controller.php 2 locations

@@ 393-399 (lines=7) @@
390
391
		$schema = $this->get_item_schema();
392
393
		if ( ! empty( $schema['properties']['sticky'] ) ) {
394
			if ( ! empty( $request['sticky'] ) ) {
395
				stick_post( $post_id );
396
			} else {
397
				unstick_post( $post_id );
398
			}
399
		}
400
401
		if ( ! empty( $schema['properties']['featured_media'] ) && isset( $request['featured_media'] ) ) {
402
			$this->handle_featured_media( $request['featured_media'], $post->ID );
@@ 506-512 (lines=7) @@
503
			$this->handle_featured_media( $request['featured_media'], $post_id );
504
		}
505
506
		if ( ! empty( $schema['properties']['sticky'] ) && isset( $request['sticky'] ) ) {
507
			if ( ! empty( $request['sticky'] ) ) {
508
				stick_post( $post_id );
509
			} else {
510
				unstick_post( $post_id );
511
			}
512
		}
513
514
		if ( ! empty( $schema['properties']['template'] ) && isset( $request['template'] ) ) {
515
			$this->handle_template( $request['template'], $post->ID );