Code Duplication    Length = 5-7 lines in 2 locations

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

@@ 1292-1298 (lines=7) @@
1289
			),
1290
		);
1291
1292
		if ( ( in_array( $post->post_type, array( 'post', 'page' ) ) || post_type_supports( $post->post_type, 'author' ) )
1293
			&& ! empty( $post->post_author ) ) {
1294
			$links['author'] = array(
1295
				'href'       => rest_url( 'wp/v2/users/' . $post->post_author ),
1296
				'embeddable' => true,
1297
			);
1298
		};
1299
1300
		if ( in_array( $post->post_type, array( 'post', 'page' ) ) || post_type_supports( $post->post_type, 'comments' ) ) {
1301
			$replies_url = rest_url( 'wp/v2/comments' );
@@ 1309-1313 (lines=5) @@
1306
			);
1307
		}
1308
1309
		if ( in_array( $post->post_type, array( 'post', 'page' ) ) || post_type_supports( $post->post_type, 'revisions' ) ) {
1310
			$links['version-history'] = array(
1311
				'href' => rest_url( trailingslashit( $base ) . $post->ID . '/revisions' ),
1312
			);
1313
		}
1314
		$post_type_obj = get_post_type_object( $post->post_type );
1315
		if ( $post_type_obj->hierarchical && ! empty( $post->post_parent ) ) {
1316
			$links['up'] = array(