Commit b22409f649 for wordpress.org
commit b22409f649dc14237a2f5ce990a41ee9d2232767
Author: lancewillett <lancewillett@git.wordpress.org>
Date: Mon Nov 2 15:50:03 2026 +0000
REST API: Remove unreachable featured media update code.
Remove the unreachable `featured_media` block from `WP_REST_Attachments_Controller::update_item()` and its PHPStan baseline entries. The local `$schema` variable is never assigned, and the parent controller already handles featured media updates.
Developed in: https://github.com/WordPress/wordpress-develop/pull/13980
Props huzaifaalmesbah.
See #65817.
Built from https://develop.svn.wordpress.org/trunk@65187
git-svn-id: http://core.svn.wordpress.org/trunk@64336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
index 1be17d2dff..bc6ba492a3 100644
--- a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
+++ b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
@@ -1006,14 +1006,6 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
$attachment = get_post( $request['id'] );
- if ( ! empty( $schema['properties']['featured_media'] ) && isset( $request['featured_media'] ) ) {
- $thumbnail_update = $this->handle_featured_media( $request['featured_media'], $attachment->ID );
-
- if ( is_wp_error( $thumbnail_update ) ) {
- return $thumbnail_update;
- }
- }
-
$fields_update = $this->update_additional_fields_for_object( $attachment, $request );
if ( is_wp_error( $fields_update ) ) {
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 41b0fcdc67..a4bc58f5b0 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-beta3-65186';
+$wp_version = '7.2-beta3-65187';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.