From 3aa0a2422b8357bd07bc22bde11a719e15e6b9d3 Mon Sep 17 00:00:00 2001 From: Jarda Snajdr Date: Tue, 29 Mar 2022 08:54:38 +0200 Subject: [PATCH] Remove batch support declaration from block patterns REST, fix navigation areas --- lib/class-wp-rest-block-navigation-areas-controller.php | 8 ++++---- .../class-wp-rest-block-pattern-categories-controller.php | 3 +-- .../class-wp-rest-block-patterns-controller.php | 3 +-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/class-wp-rest-block-navigation-areas-controller.php b/lib/class-wp-rest-block-navigation-areas-controller.php index 1a6603b6a937b..fef584e04c3cd 100644 --- a/lib/class-wp-rest-block-navigation-areas-controller.php +++ b/lib/class-wp-rest-block-navigation-areas-controller.php @@ -37,8 +37,7 @@ public function register_routes() { 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), - 'schema' => array( $this, 'get_public_item_schema' ), - 'allow_batch' => array( 'v1' => true ), + 'schema' => array( $this, 'get_public_item_schema' ), ) ); @@ -46,7 +45,7 @@ public function register_routes() { $this->namespace, '/' . $this->rest_base . '/(?P[\w-]+)', array( - 'args' => array( + 'args' => array( 'area' => array( 'description' => __( 'An alphanumeric identifier for the navigation area.', 'gutenberg' ), 'type' => 'string', @@ -66,7 +65,8 @@ public function register_routes() { 'permission_callback' => array( $this, 'update_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), ), - 'schema' => array( $this, 'get_public_item_schema' ), + 'schema' => array( $this, 'get_public_item_schema' ), + 'allow_batch' => array( 'v1' => true ), ) ); } diff --git a/lib/compat/wordpress-6.0/class-wp-rest-block-pattern-categories-controller.php b/lib/compat/wordpress-6.0/class-wp-rest-block-pattern-categories-controller.php index 8edc2080b33dd..44ece97f07d9d 100644 --- a/lib/compat/wordpress-6.0/class-wp-rest-block-pattern-categories-controller.php +++ b/lib/compat/wordpress-6.0/class-wp-rest-block-pattern-categories-controller.php @@ -36,8 +36,7 @@ public function register_routes() { 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), ), - 'schema' => array( $this, 'get_public_item_schema' ), - 'allow_batch' => array( 'v1' => true ), + 'schema' => array( $this, 'get_public_item_schema' ), ) ); } diff --git a/lib/compat/wordpress-6.0/class-wp-rest-block-patterns-controller.php b/lib/compat/wordpress-6.0/class-wp-rest-block-patterns-controller.php index f42e733a1f824..b6242b3ea53c6 100644 --- a/lib/compat/wordpress-6.0/class-wp-rest-block-patterns-controller.php +++ b/lib/compat/wordpress-6.0/class-wp-rest-block-patterns-controller.php @@ -36,8 +36,7 @@ public function register_routes() { 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), ), - 'schema' => array( $this, 'get_public_item_schema' ), - 'allow_batch' => array( 'v1' => true ), + 'schema' => array( $this, 'get_public_item_schema' ), ) ); }