Code Duplication    Length = 8-10 lines in 2 locations

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

@@ 1702-1709 (lines=8) @@
1699
		}
1700
1701
		$taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) );
1702
		foreach ( $taxonomies as $taxonomy ) {
1703
			$base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name;
1704
			$schema['properties'][ $base ] = array(
1705
				'description' => sprintf( __( 'The terms assigned to the object in the %s taxonomy.' ), $taxonomy->name ),
1706
				'type'        => 'array',
1707
				'context'     => array( 'view', 'edit' ),
1708
			);
1709
		}
1710
1711
		return $this->add_additional_fields_schema( $schema );
1712
	}
@@ 1837-1846 (lines=10) @@
1834
		);
1835
1836
		$taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) );
1837
		foreach ( $taxonomies as $taxonomy ) {
1838
			$base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name;
1839
1840
			$params[ $base ] = array(
1841
				'description'       => sprintf( __( 'Limit result set to all items that have the specified term assigned in the %s taxonomy.' ), $base ),
1842
				'type'              => 'array',
1843
				'sanitize_callback' => 'wp_parse_id_list',
1844
				'default'           => array(),
1845
			);
1846
		}
1847
1848
		if ( 'post' === $this->post_type ) {
1849
			$params['sticky'] = array(