WordPress.org

Make WordPress Core

Opened 3 weeks ago

Closed 3 weeks ago

Last modified 3 weeks 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:
PR Number:

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 diddledan 3 weeks ago.
Patch to set param type to object

Download all attachments as: .zip

Change History (5)

@diddledan
3 weeks ago

Patch to set param type to object

#1 @TimothyBlynJacobs
3 weeks 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
3 weeks 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
3 weeks 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
3 weeks ago

#48627 was marked as a duplicate.

Note: See TracTickets for help on using tickets.