Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 1223-1229 (lines=7) @@
1220
			$data['sticky'] = is_sticky( $post->ID );
1221
		}
1222
1223
		if ( ! empty( $schema['properties']['template'] ) ) {
1224
			if ( $template = get_page_template_slug( $post->ID ) ) {
1225
				$data['template'] = $template;
1226
			} else {
1227
				$data['template'] = '';
1228
			}
1229
		}
1230
1231
		if ( ! empty( $schema['properties']['format'] ) ) {
1232
			$data['format'] = get_post_format( $post->ID );
@@ 1231-1237 (lines=7) @@
1228
			}
1229
		}
1230
1231
		if ( ! empty( $schema['properties']['format'] ) ) {
1232
			$data['format'] = get_post_format( $post->ID );
1233
			// Fill in blank post format.
1234
			if ( empty( $data['format'] ) ) {
1235
				$data['format'] = 'standard';
1236
			}
1237
		}
1238
1239
		$taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) );
1240
		foreach ( $taxonomies as $taxonomy ) {