Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years 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: diddledani's profile diddledani Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.4 Priority: normal
Severity: trivial Version: 4.7
Component: REST API Keywords: has-patch
Focuses: docs Cc:

Description

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 diddledani 5 years ago.
Patch to set param type to object

Download all attachments as: .zip

Change History (5)

@diddledani
5 years ago

Patch to set param type to object

#1 @TimothyBlynJacobs
5 years 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 @diddledani
5 years 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
5 years 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
5 years ago

#48627 was marked as a duplicate.

Note: See TracTickets for help on using tickets.