Index: src/wp-includes/class-wp-term-query.php
===================================================================
--- src/wp-includes/class-wp-term-query.php	(revision 41747)
+++ src/wp-includes/class-wp-term-query.php	(working copy)
@@ -98,7 +98,8 @@
 	 *     @type string       $orderby                Field(s) to order terms by. Accepts term fields ('name',
 	 *                                                'slug', 'term_group', 'term_id', 'id', 'description', 'parent'),
 	 *                                                'count' for term taxonomy count, 'include' to match the
-	 *                                                'order' of the $include param, 'meta_value', 'meta_value_num',
+	 *                                                'order' of the $include param, 'slug__in' to match the
+	 *                                                'order' of the $slug param, 'meta_value', 'meta_value_num',
 	 *                                                the value of `$meta_key`, the array keys of `$meta_query`, or
 	 *                                                'none' to omit the ORDER BY clause. Defaults to 'name'.
 	 *     @type string       $order                  Whether to order terms in ascending or descending order.
@@ -841,6 +842,9 @@
 		} elseif ( 'include' == $_orderby && ! empty( $this->query_vars['include'] ) ) {
 			$include = implode( ',', wp_parse_id_list( $this->query_vars['include'] ) );
 			$orderby = "FIELD( t.term_id, $include )";
+		} elseif ( 'slug__in' == $_orderby && ! empty( $this->query_vars['slug'] ) && is_array( $this->query_vars['slug'] ) ) {
+			$slugs = implode( "', '", array_map( 'sanitize_title', $this->query_vars['slug__in'] ) );
+			$orderby = "FIELD( t.slug, '" . $slugs . "')";
 		} elseif ( 'none' == $_orderby ) {
 			$orderby = '';
 		} elseif ( empty( $_orderby ) || 'id' == $_orderby || 'term_id' === $_orderby ) {
Index: src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
===================================================================
--- src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php	(revision 41747)
+++ src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php	(working copy)
@@ -874,9 +874,10 @@
 		// Map to proper WP_Query orderby param.
 		if ( isset( $query_args['orderby'] ) && isset( $request['orderby'] ) ) {
 			$orderby_mappings = array(
-				'id'      => 'ID',
-				'include' => 'post__in',
-				'slug'    => 'post_name',
+				'id'            => 'ID',
+				'include'       => 'post__in',
+				'slug'          => 'post_name',
+				'include_slugs' => 'post_name__in',
 			);
 
 			if ( isset( $orderby_mappings[ $request['orderby'] ] ) ) {
@@ -2109,6 +2110,7 @@
 				'parent',
 				'relevance',
 				'slug',
+				'include_slugs',
 				'title',
 			),
 		);
Index: src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
===================================================================
--- src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php	(revision 41747)
+++ src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php	(working copy)
@@ -188,6 +188,16 @@
 			}
 		}
 
+		if ( isset( $prepared_args['orderby'] ) && isset( $request['orderby'] ) ) {
+			$orderby_mappings = array(
+				'include_slugs' => 'slug__in',
+			);
+
+			if ( isset( $orderby_mappings[ $request['orderby'] ] ) ) {
+				$prepared_args['orderby'] = $orderby_mappings[ $request['orderby'] ];
+			}
+		}
+
 		if ( isset( $registered['offset'] ) && ! empty( $request['offset'] ) ) {
 			$prepared_args['offset'] = $request['offset'];
 		} else {
@@ -932,6 +942,7 @@
 				'include',
 				'name',
 				'slug',
+				'include_slugs',
 				'term_group',
 				'description',
 				'count',
Index: src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
===================================================================
--- src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php	(revision 41747)
+++ src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php	(working copy)
@@ -243,6 +243,7 @@
 				'name'            => 'display_name',
 				'registered_date' => 'registered',
 				'slug'            => 'user_nicename',
+				'include_slugs'   => 'nicename__in',
 				'email'           => 'user_email',
 				'url'             => 'user_url',
 			);
@@ -1338,6 +1339,7 @@
 				'name',
 				'registered_date',
 				'slug',
+				'include_slugs',
 				'email',
 				'url',
 			),
Index: tests/phpunit/tests/rest-api/rest-categories-controller.php
===================================================================
--- tests/phpunit/tests/rest-api/rest-categories-controller.php	(revision 41747)
+++ tests/phpunit/tests/rest-api/rest-categories-controller.php	(working copy)
@@ -287,6 +287,22 @@
 		$this->assertEquals( 'Cantaloupe', $data[2]['name'] );
 	}
 
+	public function test_get_items_orderby_slugs() {
+		$this->factory->category->create( array( 'name' => 'Burrito' ) );
+		$this->factory->category->create( array( 'name' => 'Taco' ) );
+		$this->factory->category->create( array( 'name' => 'Chalupa' ) );
+
+		$request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
+		$request->set_param( 'orderby', 'include_slugs' );
+		$request->set_param( 'slug', array( 'taco', 'burrito', 'chalupa' ) );
+		$response = $this->server->dispatch( $request );
+		$data = $response->get_data();
+		$this->assertEquals( 200, $response->get_status() );
+		$this->assertEquals( 'taco', $data[0]['slug'] );
+		$this->assertEquals( 'burrito', $data[1]['slug'] );
+		$this->assertEquals( 'chalupa', $data[2]['slug'] );
+	}
+
 	protected function post_with_categories() {
 		$post_id = $this->factory->post->create();
 		$category1 = $this->factory->category->create( array(
Index: tests/phpunit/tests/rest-api/rest-posts-controller.php
===================================================================
--- tests/phpunit/tests/rest-api/rest-posts-controller.php	(revision 41747)
+++ tests/phpunit/tests/rest-api/rest-posts-controller.php	(working copy)
@@ -598,6 +598,24 @@
 		$this->assertPostsOrderedBy( '{posts}.post_name DESC' );
 	}
 
+	public function test_get_items_with_orderby_slugs() {
+		$slugs = array( 'burrito', 'taco', 'chalupa' );
+		foreach ( $slugs as $slug ) {
+			$this->factory->post->create( array( 'post_title' => $slug, 'post_name' => $slug, 'post_status' => 'publish' ) );
+		}
+
+		$request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
+		$request->set_param( 'orderby', 'include_slugs' );
+		$request->set_param( 'slug', array( 'taco', 'chalupa', 'burrito' ) );
+
+		$response = $this->server->dispatch( $request );
+		$data = $response->get_data();
+
+		$this->assertEquals( 'taco', $data[0]['slug'] );
+		$this->assertEquals( 'chalupa', $data[1]['slug'] );
+		$this->assertEquals( 'burrito', $data[2]['slug'] );
+	}
+
 	public function test_get_items_with_orderby_relevance() {
 		$id1 = $this->factory->post->create( array( 'post_title' => 'Title is more relevant', 'post_content' => 'Content is', 'post_status' => 'publish' ) );
 		$id2 = $this->factory->post->create( array( 'post_title' => 'Title is', 'post_content' => 'Content is less relevant', 'post_status' => 'publish' ) );
Index: tests/phpunit/tests/rest-api/rest-tags-controller.php
===================================================================
--- tests/phpunit/tests/rest-api/rest-tags-controller.php	(revision 41747)
+++ tests/phpunit/tests/rest-api/rest-tags-controller.php	(working copy)
@@ -250,6 +250,22 @@
 		$this->assertEquals( 'Cantaloupe', $data[2]['name'] );
 	}
 
+	public function test_get_items_orderby_slugs() {
+		$this->factory->tag->create( array( 'name' => 'Burrito' ) );
+		$this->factory->tag->create( array( 'name' => 'Taco' ) );
+		$this->factory->tag->create( array( 'name' => 'Chalupa' ) );
+
+		$request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
+		$request->set_param( 'orderby', 'include_slugs' );
+		$request->set_param( 'slug', array( 'taco', 'burrito', 'chalupa' ) );
+		$response = $this->server->dispatch( $request );
+		$data = $response->get_data();
+		$this->assertEquals( 200, $response->get_status() );
+		$this->assertEquals( 'taco', $data[0]['slug'] );
+		$this->assertEquals( 'burrito', $data[1]['slug'] );
+		$this->assertEquals( 'chalupa', $data[2]['slug'] );
+	}
+
 	public function test_get_items_post_args() {
 		$post_id = $this->factory->post->create();
 		$tag1 = $this->factory->tag->create( array( 'name' => 'DC' ) );
Index: tests/phpunit/tests/rest-api/rest-users-controller.php
===================================================================
--- tests/phpunit/tests/rest-api/rest-users-controller.php	(revision 41747)
+++ tests/phpunit/tests/rest-api/rest-users-controller.php	(working copy)
@@ -409,6 +409,24 @@
 		$this->assertEquals( $low_id, $data[0]['id'] );
 	}
 
+	public function test_get_items_orderby_slugs() {
+		wp_set_current_user( self::$user );
+
+		$this->factory->user->create( array( 'user_nicename' => 'burrito' ) );
+		$this->factory->user->create( array( 'user_nicename' => 'taco' ) );
+		$this->factory->user->create( array( 'user_nicename' => 'chalupa' ) );
+
+		$request = new WP_REST_Request( 'GET', '/wp/v2/users' );
+		$request->set_param( 'orderby', 'include_slugs' );
+		$request->set_param( 'slug', array( 'taco', 'burrito', 'chalupa' ) );
+		$response = $this->server->dispatch( $request );
+		$data = $response->get_data();
+
+		$this->assertEquals( 'taco', $data[0]['slug'] );
+		$this->assertEquals( 'burrito', $data[1]['slug'] );
+		$this->assertEquals( 'chalupa', $data[2]['slug'] );
+	}
+
 	public function test_get_items_orderby_email() {
 		wp_set_current_user( self::$user );
 
Index: tests/phpunit/tests/rest-api.php
===================================================================
--- tests/phpunit/tests/rest-api.php	(revision 41747)
+++ tests/phpunit/tests/rest-api.php	(working copy)
@@ -430,6 +430,40 @@
 	}
 
 	/**
+		* Ensure that nested fields may be whitelisted with request['_fields'].
+		*/
+	public function test_rest_filter_response_fields_nested_field_filter() {
+		$response = new WP_REST_Response();
+
+		$response->set_data( array(
+			'a' => 0,
+			'b' => array(
+				'1' => 1,
+				'2' => 2,
+			),
+			'c' => 3,
+			'd' => array(
+				'4' => 4,
+				'5' => 5,
+			),
+		) );
+		$request = array(
+			'_fields' => array( 'b.1', 'c', 'd.5' )
+		);
+
+		$response = rest_filter_response_fields( $response, null, $request );
+		$this->assertEquals( array(
+			'b' => array(
+				'1' => 1,
+			),
+			'c' => 3,
+			'd' => array(
+				'5' => 5,
+			),
+		), $response->get_data() );
+	}
+
+	/**
 	 * The get_rest_url function should return a URL consistently terminated with a "/",
 	 * whether the blog is configured with pretty permalink support or not.
 	 */
Index: tests/qunit/fixtures/wp-api-generated.js
===================================================================
--- tests/qunit/fixtures/wp-api-generated.js	(revision 41747)
+++ tests/qunit/fixtures/wp-api-generated.js	(working copy)
@@ -284,6 +284,7 @@
                                 "parent",
                                 "relevance",
                                 "slug",
+                                "include_slugs",
                                 "title"
                             ],
                             "description": "Sort collection by object attribute.",
@@ -905,6 +906,7 @@
                                 "parent",
                                 "relevance",
                                 "slug",
+                                "include_slugs",
                                 "title",
                                 "menu_order"
                             ],
@@ -1443,6 +1445,7 @@
                                 "parent",
                                 "relevance",
                                 "slug",
+                                "include_slugs",
                                 "title"
                             ],
                             "description": "Sort collection by object attribute.",
@@ -2023,6 +2026,7 @@
                                 "include",
                                 "name",
                                 "slug",
+                                "include_slugs",
                                 "term_group",
                                 "description",
                                 "count"
@@ -2266,6 +2270,7 @@
                                 "include",
                                 "name",
                                 "slug",
+                                "include_slugs",
                                 "term_group",
                                 "description",
                                 "count"
@@ -2495,6 +2500,7 @@
                                 "name",
                                 "registered_date",
                                 "slug",
+                                "include_slugs",
                                 "email",
                                 "url"
                             ],
