Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#51459 closed task (blessed) (fixed)

REST API: Add post formats search handler

Reported by: timothyblynjacobs's profile TimothyBlynJacobs Owned by: timothyblynjacobs's profile 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 years ago
#1

  • Keywords has-patch has-unit-tests added

noisysocks commented on PR #578:


4 years ago
#2

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.

noisysocks commented on PR #578:


4 years ago
#3

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

  • Keywords commit added

#5 @TimothyBlynJacobs
4 years 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.

TimothyBJacobs commented on PR #578:


4 years ago
#6

Merged in c39f290.

Note: See TracTickets for help on using tickets.