Make WordPress Core

Opened 4 weeks ago

Closed 4 weeks ago

Last modified 4 weeks ago

#61593 closed enhancement (fixed)

Unused variables in wp-includes/rest-api/*.php files

Reported by: antonvlasenko's profile antonvlasenko Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.7 Priority: normal
Severity: minor Version: 6.6
Component: REST API Keywords: has-patch
Focuses: rest-api, coding-standards Cc:

Description

After inspecting the code in the wp-includes/rest-api/ files, the following minor issues have been identified:

  • unused variables;
  • incorrect @return type in the DocBlocks;
  • typos;
  • incorrect variable passed to the wp_parse_str() function in the WP_Rest_Server::serve_batch_request_v1() method.

Affected classes and files:

  • WP_REST_Attachments_Controller;
  • WP_REST_Block_Types_Controller;
  • WP_REST_Post_Statuses_Controller;
  • WP_REST_Posts_Controller;
  • WP_REST_Taxonomies_Controller;
  • WP_REST_Terms_Controller;
  • WP_REST_Themes_Controller;
  • WP_REST_URL_Details_Controller;
  • WP_REST_Widgets_Controller;
  • WP_REST_Post_Format_Search_Handler;
  • WP_REST_Post_Search_Handler;
  • WP_REST_Request;
  • WP_REST_Server;
  • rest-api.php.

Change History (8)

This ticket was mentioned in PR #6979 on WordPress/wordpress-develop by @antonvlasenko.


4 weeks ago
#1

  • Keywords has-patch added

#2 @SergeyBiryukov
4 weeks ago

  • Milestone changed from Awaiting Review to 6.7
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#3 @SergeyBiryukov
4 weeks ago

In 58688:

REST API: Correct variable type in WP_Rest_Server::serve_batch_request_v1().

wp_parse_str() expects an array as the second parameter.

Follow-up to [49252].

Props antonvlasenko.
See #61593.

#4 @SergeyBiryukov
4 weeks ago

In 58694:

REST API: Remove a few unused variables in foreach loops.

Follow-up to [38832], [48173], [49132], [49925].

Props antonvlasenko.
See #61593.

#5 @SergeyBiryukov
4 weeks ago

In 58704:

Docs: Correct @return values for a few REST API class methods.

Includes listing the expected type first, instead of WP_Error.

Follow-up to [39031], [39033], [46696], [49927], [49929], [50993], [51286], [51973], [52079], [52286], [53152], [56415].

Props antonvlasenko.
See #61593.

#6 @antonvlasenko
4 weeks ago

Thank you for handling this ticket.
Next time, I'll ensure PRs are split by the type of changes they introduce.

#7 @SergeyBiryukov
4 weeks ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 58706:

Docs: Fix typos in various REST API DocBlocks and comments.

Follow-up to [34928], [43739], [46422], [50717], [51973], [54528].

Props antonvlasenko.
Fixes #61593.

@SergeyBiryukov commented on PR #6979:


4 weeks ago
#8

Thanks for the PR! Merged in r58688, r58694, r58704, and r58706.

Note: See TracTickets for help on using tickets.