Commit 239bb97809 for wordpress.org
commit 239bb97809f72f60dc20a7b89212012c875d7763
Author: SergeyBiryukov <sergeybiryukov@git.wordpress.org>
Date: Sat Oct 10 22:32:51 2026 +0000
Docs: Allow `false` in the documented type of `WP_REST_Posts_Controller::$allow_batch`.
`WP_REST_Posts_Controller::$allow_batch` is documented as `array`, while `WP_REST_Attachments_Controller`, `WP_REST_Font_Faces_Controller` and `WP_REST_Font_Families_Controller` override it with `false` to opt out of batching. PHPStan reports this as a PHPDoc type that is not covariant with the parent.
`false` is a supported value, as documented for the `allow_batch` route option in `WP_REST_Server` (`array{v1?: bool}|false`). `WP_REST_Server::serve_batch_request_v1()` explicitly handles this value, rejecting the request with `rest_batch_not_allowed` when `allow_batch` is not an array. The parent type is therefore widened to `array|false` to match. This is a documentation-only change.
This resolves all three errors in the `property.phpDocType` PHPStan baseline, which is deleted.
Developed in https://github.com/WordPress/wordpress-develop/pull/13812.
Follow-up to r52068, r57548.
Props Soean.
See #65817.
Built from https://develop.svn.wordpress.org/trunk@64295
git-svn-id: http://core.svn.wordpress.org/trunk@63445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
index 443f839dba..7310de2806 100644
--- a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
+++ b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
@@ -43,7 +43,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
* Whether the controller supports batching.
*
* @since 5.9.0
- * @var array
+ * @var array|false
*/
protected $allow_batch = array( 'v1' => true );
diff --git a/wp-includes/version.php b/wp-includes/version.php
index c46130ea83..1994ab4943 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-alpha-64294';
+$wp_version = '7.2-alpha-64295';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.