Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#50529 closed enhancement (fixed)

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

Reported by: timothyblynjacobs's profile TimothyBlynJacobs Owned by: timothyblynjacobs's profile TimothyBlynJacobs
Milestone: 5.5 Priority: normal
Severity: normal Version: 5.5
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
3 years ago

  • Description modified (diff)

#2 @SergeyBiryukov
3 years 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
3 years ago

  • Milestone changed from Future Release to 5.5

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


3 years ago

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


3 years ago
#5

  • Keywords has-patch added

TimothyBJacobs commented on PR #391:


3 years ago
#6

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
3 years 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.

ravatparmar commented on PR #391:


3 years ago
#8

Yes sure @TimothyBJacobs,

will update once done.

TimothyBJacobs commented on PR #391:


3 years ago
#9

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 years ago

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

Note: See TracTickets for help on using tickets.