Make WordPress Core

Opened 17 months ago

Closed 17 months ago

Last modified 17 months ago

#48616 closed defect (bug) (fixed)

Parameter type for $item in WP_REST_Terms_Controller::prepare_item_for_response() uses invalid phpdoc keyword

Reported by: diddledan Owned by: SergeyBiryukov
Milestone: 5.4 Priority: normal
Severity: trivial Version: 4.7
Component: REST API Keywords: has-patch
Focuses: docs Cc:


In wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php the param type of $item for WP_REST_Terms_Controller::prepare_item_for_response() is documented as obj, which is not a valid keyword according to the phpdoc specification: https://docs.phpdoc.org/guides/types.html

The attached patch corrects obj to be object.

Attachments (1)

48616.patch (1.1 KB) - added by diddledan 17 months ago.
Patch to set param type to object

Download all attachments as: .zip

Change History (5)

17 months ago

Patch to set param type to object

#1 @TimothyBlynJacobs
17 months ago

  • Milestone changed from Awaiting Review to 5.4
  • Version changed from trunk to 4.7

Thanks for the patch @diddledan. It looks like this could be further narrowed to WP_Term.

#2 @diddledan
17 months ago

I had the same thought, but decided to err on the side of caution as I'm not very familiar with the code :-)

#3 @SergeyBiryukov
17 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 46731:

Docs: Correct parameter type for $item in WP_REST_Terms_Controller::prepare_item_for_response().

Props diddledan, TimothyBlynJacobs.
Fixes #48616.

#4 @SergeyBiryukov
17 months ago

#48627 was marked as a duplicate.

Note: See TracTickets for help on using tickets.