WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 3 months ago

Last modified 3 months ago

#51459 closed task (blessed) (fixed)

REST API: Add post formats search handler

Reported by: TimothyBlynJacobs Owned by: TimothyBlynJacobs
Milestone: 5.6 Priority: normal
Severity: normal Version: 5.0
Component: REST API Keywords: has-patch has-unit-tests commit
Focuses: Cc:

Description

This is a tracking ticket for merging the post formats search handler from Gutenberg.

https://github.com/WordPress/gutenberg/blob/master/lib/class-wp-rest-post-format-search-handler.php

At the same time as the merge, we'll be updating the id to use the post format slug instead of the fake index.

#51131, https://github.com/WordPress/gutenberg/pull/22600#discussion_r475247522

Change History (6)

This ticket was mentioned in PR #578 on WordPress/wordpress-develop by TimothyBJacobs.


4 months ago

  • Keywords has-patch has-unit-tests added

#2 @prbot
3 months ago

noisysocks commented on PR #578:

Looks good. I ran it with the latest Gutenberg master and tested that I could link to a post format using Twenty Sixteen.

Again, we should probably update the Gutenberg plugin to check if WP_REST_Post_Format_Search_Handler is already in the handlers array before adding it.

#3 @prbot
3 months ago

noisysocks commented on PR #578:

Again, we should probably update the Gutenberg plugin to check if WP_REST_Post_Format_Search_Handler is already in the handlers array before adding it.

Actually, it doesn't matter, because WP_REST_Post_Format_Search_Handler is the class that's defined by Core and the array containing duplicates is transformed into a map:

https://github.com/WordPress/wordpress-develop/blob/98866f50321e9480b24760a8d384f81a2cf4aaec/src/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php#L80

So all good 👍 :shipit:

#4 @noisysocks
3 months ago

  • Keywords commit added

#5 @TimothyBlynJacobs
3 months ago

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

In 49132:

REST API: Introduce search post format handler.
This allows for clients to search the used post formats via the /wp/v2/search endpoint by using a type=post-format query parameter.
Fixes #51459.
Props andraganescu, zieladam, noisysocks, TimothyBlynJacobs.

#6 @prbot
3 months ago

TimothyBJacobs commented on PR #578:

Merged in c39f290.

Note: See TracTickets for help on using tickets.