Commit ec605caf1b for wordpress.org
commit ec605caf1bab7d684fa907119576c521c475cc46
Author: SergeyBiryukov <sergeybiryukov@git.wordpress.org>
Date: Sun Oct 11 23:33:52 2026 +0000
Docs: Remove variable names from `@return` tags.
Per the [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/ inline documentation standards], `@return` tags should only contain the type and an optional description, not the name of the returned variable. This commit removes the variable names from all remaining `@return` tags in core.
Developed in https://github.com/WordPress/wordpress-develop/pull/13844.
Props Soean, mukesh27.
See #65860.
Built from https://develop.svn.wordpress.org/trunk@64304
git-svn-id: http://core.svn.wordpress.org/trunk@63454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-admin/includes/class-custom-background.php b/wp-admin/includes/class-custom-background.php
index 7f8f234850..e147739162 100644
--- a/wp-admin/includes/class-custom-background.php
+++ b/wp-admin/includes/class-custom-background.php
@@ -593,8 +593,8 @@ class Custom_Background {
* @since 3.4.0
* @deprecated 3.5.0
*
- * @param array $form_fields
- * @return array $form_fields
+ * @param array $form_fields An array of attachment form fields.
+ * @return array Unmodified form fields.
*/
public function attachment_fields_to_edit( $form_fields ) {
return $form_fields;
@@ -604,8 +604,8 @@ class Custom_Background {
* @since 3.4.0
* @deprecated 3.5.0
*
- * @param array $tabs
- * @return array $tabs
+ * @param array $tabs An array of media upload tabs.
+ * @return array Unmodified upload tabs.
*/
public function filter_upload_tabs( $tabs ) {
return $tabs;
diff --git a/wp-admin/includes/class-custom-image-header.php b/wp-admin/includes/class-custom-image-header.php
index 367ba04cdc..a4cf43b1ce 100644
--- a/wp-admin/includes/class-custom-image-header.php
+++ b/wp-admin/includes/class-custom-image-header.php
@@ -1138,8 +1138,8 @@ endif;
*
* @since 3.4.0
*
- * @param array $form_fields
- * @return array $form_fields
+ * @param array $form_fields An array of attachment form fields.
+ * @return array Unmodified form fields.
*/
public function attachment_fields_to_edit( $form_fields ) {
return $form_fields;
@@ -1150,8 +1150,8 @@ endif;
*
* @since 3.4.0
*
- * @param array $tabs
- * @return array $tabs
+ * @param array $tabs An array of media upload tabs.
+ * @return array Unmodified upload tabs.
*/
public function filter_upload_tabs( $tabs ) {
return $tabs;
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index 42de0269a0..ee4c2add91 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -39,7 +39,7 @@ function media_upload_tabs() {
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param array $tabs Associative array of default tab names.
- * @return array $tabs Filtered tabs with gallery if post has image attachment.
+ * @return array Filtered tabs with gallery if post has image attachment.
*/
function update_gallery_tab( $tabs ) {
global $wpdb;
diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php
index 5709dd2ef5..928081cbc0 100644
--- a/wp-includes/class-wp-editor.php
+++ b/wp-includes/class-wp-editor.php
@@ -1769,7 +1769,7 @@ final class _WP_Editors {
* @type int $pagenum Page number. Default 1.
* @type string $s Search keywords.
* }
- * @return array|false $results {
+ * @return array|false {
* An array of associative arrays of query results, false if there are none.
*
* @type array ...$0 {
diff --git a/wp-includes/class-wp-theme-json.php b/wp-includes/class-wp-theme-json.php
index 837499fb63..c17f2b1b07 100644
--- a/wp-includes/class-wp-theme-json.php
+++ b/wp-includes/class-wp-theme-json.php
@@ -3430,7 +3430,7 @@ class WP_Theme_JSON {
* @since 6.1.1
*
* @param array $declarations List of declarations.
- * @return array $declarations List of declarations filtered.
+ * @return array List of declarations filtered.
*/
private static function update_separator_declarations( $declarations ) {
$background_color = '';
diff --git a/wp-includes/comment.php b/wp-includes/comment.php
index 9111358efc..95314e4947 100644
--- a/wp-includes/comment.php
+++ b/wp-includes/comment.php
@@ -3902,7 +3902,7 @@ function _close_comments_for_old_posts( $posts, $query ) {
*
* @param bool $open Comments open or closed.
* @param int $post_id Post ID.
- * @return bool $open
+ * @return bool True if comments are open, false otherwise.
*/
function _close_comments_for_old_post( $open, $post_id ) {
if ( ! $open ) {
diff --git a/wp-includes/ms-blogs.php b/wp-includes/ms-blogs.php
index 2ac766ffc3..adb20da267 100644
--- a/wp-includes/ms-blogs.php
+++ b/wp-includes/ms-blogs.php
@@ -741,7 +741,7 @@ function is_archived( $id ) {
*
* @param int $id Blog ID.
* @param string $archived The new status.
- * @return string $archived
+ * @return string The new archived status.
*/
function update_archived( $id, $archived ) {
update_blog_status( $id, 'archived', $archived );
@@ -760,7 +760,7 @@ function update_archived( $id, $archived ) {
* @param string $pref Field name.
* @param string $value Field value.
* @param mixed $deprecated Not used.
- * @return string|false $value
+ * @return string|false The passed field value, or false if the update failed.
*/
function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) {
global $wpdb;
@@ -798,7 +798,7 @@ function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) {
*
* @param int $id Blog ID.
* @param string $pref Field name.
- * @return bool|string|null $value
+ * @return bool|string|null The field value, or null if not found.
*/
function get_blog_status( $id, $pref ) {
global $wpdb;
diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-navigation-fallback-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-navigation-fallback-controller.php
index 575a1a900e..a299ab3c60 100644
--- a/wp-includes/rest-api/endpoints/class-wp-rest-navigation-fallback-controller.php
+++ b/wp-includes/rest-api/endpoints/class-wp-rest-navigation-fallback-controller.php
@@ -147,7 +147,7 @@ class WP_REST_Navigation_Fallback_Controller extends WP_REST_Controller {
*
* @param WP_Post $item The wp_navigation Post object whose response is being prepared.
* @param WP_REST_Request $request Request object.
- * @return WP_REST_Response $response The response data.
+ * @return WP_REST_Response The response data.
*/
public function prepare_item_for_response( $item, $request ) {
$data = array();
diff --git a/wp-includes/version.php b/wp-includes/version.php
index a3e56da698..11d42a0f83 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-alpha-64303';
+$wp_version = '7.2-alpha-64304';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.