WordPress.org

Make WordPress Core

Opened 6 weeks ago

Closed 5 weeks ago

Last modified 3 weeks ago

#50529 closed enhancement (fixed)

REST API: Update post search handler to use rest_get_route_for_post()

Reported by: TimothyBlynJacobs Owned by: TimothyBlynJacobs
Milestone: 5.5 Priority: normal
Severity: normal Version: trunk
Component: REST API Keywords: good-first-bug has-patch
Focuses: Cc:

Description (last modified by TimothyBlynJacobs)

In [48273] the rest_get_route_for_post function was introduced. This simplifies determining the REST API route for any given post object. We should update the WP_REST_Post_Search_Handler to use that function instead of detect_rest_item_route method.

Change History (10)

#1 @TimothyBlynJacobs
6 weeks ago

  • Description modified (diff)

#2 @SergeyBiryukov
5 weeks ago

  • Summary changed from REST API: Update post search handler to use to REST API: Update post search handler to use rest_get_route_for_post()

#3 @TimothyBlynJacobs
5 weeks ago

  • Milestone changed from Future Release to 5.5

This ticket was mentioned in Slack in #core by timothybjacobs. View the logs.


5 weeks ago

This ticket was mentioned in PR #391 on WordPress/wordpress-develop by ravatparmar.


5 weeks ago

  • Keywords has-patch added

#6 @prbot
5 weeks ago

TimothyBJacobs commented on PR #391:

Thanks for working on that @ravatparmar! We also need to update where we call detect_rest_item_route in the post search handler to use the new function directly.

#7 @TimothyBlynJacobs
5 weeks ago

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

In 48381:

REST API: Use new rest_get_route_for_post() in the post search handler.

In [48273] the rest_get_route_for_post function was introduced. This simplifies determining the REST API route for any given post object and adds a filter for custom controllers.

Props ravatparmar.
Fixes #50529.

#8 @prbot
3 weeks ago

ravatparmar commented on PR #391:

Yes sure @TimothyBJacobs,

will update once done.

#9 @prbot
3 weeks ago

TimothyBJacobs commented on PR #391:

Hi @ravatparmar,

Sorry, I forgot to close this out. I made that change so that we had time to land the feature before Beta 1. Thanks for your work on this!

#10 @tannergeddes12
3 weeks ago

REST API: Use new rest_get_route_for_post() in the post search handler.

Note: See TracTickets for help on using tickets.