diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
index a0d395e..31f3025 100644
--- a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
+++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
@@ -274,11 +274,23 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
 			$tax_exclude = $base . '_exclude';
 
 			if ( ! empty( $request[ $base ] ) ) {
+				if ( isset( $request[ $base ]['ids'] ) ) {
+					$terms = absint($request[ $base ]['ids']);
+				} else {
+					$terms = $request[ $base ];
+				}
+
+				if ( isset( $request[ $base ]['include_children'] ) ) {
+					$include_children = (bool) $request[ $base ]['include_children'];
+				} else {
+					$include_children = false;
+				}
+
 				$query_args['tax_query'][] = array(
 					'taxonomy'         => $taxonomy->name,
 					'field'            => 'term_id',
-					'terms'            => $request[ $base ],
-					'include_children' => false,
+					'terms'            => $terms,
+					'include_children' => $include_children,
 				);
 			}
 
@@ -2192,9 +2204,21 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
 			$query_params[ $base ] = array(
 				/* translators: %s: taxonomy name */
 				'description'       => sprintf( __( 'Limit result set to all items that have the specified term assigned in the %s taxonomy.' ), $base ),
-				'type'              => 'array',
-				'items'             => array(
-					'type'          => 'integer',
+				'type'              => 'object',
+				'properties' 				=> array(
+					'ids'            => array(
+						'description' => __( 'The term ids to limit the post to' ),
+						'type'        => 'array',
+						'items'				=> array(
+							'type'				=> 'integer'
+						),
+						'default'			=> array()
+					),
+					'include_children'	=> array(
+						'description' => __( 'Whether or not to include the term children' ),
+						'type'        => 'boolean',
+						'default'			=> false
+					)
 				),
 				'default'           => array(),
 			);
diff --git a/tests/phpunit/tests/rest-api/rest-posts-controller.php b/tests/phpunit/tests/rest-api/rest-posts-controller.php
index de9b0db..c8dacc0 100644
--- a/tests/phpunit/tests/rest-api/rest-posts-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-posts-controller.php
@@ -678,6 +678,29 @@ class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te
 		$this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
 	}
 
+	/**
+	 * @ticket 39494
+	 */
+	public function test_get_items_categories_with_updated_taxonomy_schema() {
+		$id1 = self::$post_id;
+		$id2 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
+		$id3 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
+		$cat1 = wp_insert_term( 'My Category', 'category' );
+		$cat2 = wp_insert_term( 'Child Category', 'category', array( 'parent' => $cat1['term_id'] ) );
+
+		wp_set_object_terms( $id1, array( $cat2['term_id'] ), 'category' );
+		$request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
+		$request->set_param( 'categories', array(
+			'ids' => array( $cat1['term_id'] ),
+			'include_children' => true
+		) );
+
+		$response = $this->server->dispatch( $request );
+		$data = $response->get_data();
+		$this->assertCount( 1, $data );
+		$this->assertEquals( $id1, $data[0]['id'] );
+	}
+
 	public function test_get_items_sticky() {
 		$id1 = self::$post_id;
 		$id2 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
