Make WordPress Core

Opened 3 months ago

Last modified 3 months ago

#61254 new enhancement

Backport: Introduce new dedicated media search handler and add new label field search handler

Reported by: petitphp's profile petitphp Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch has-unit-tests
Focuses: rest-api Cc:

Description

This trac ticket is for backporting PHP changes for https://github.com/WordPress/gutenberg/pull/58638.
This change add a new REST search media handler and add a new label field to allow translating postType.

See: https://github.com/WordPress/gutenberg/issues/21377

Change History (3)

#1 @petitphp
3 months ago

  • Summary changed from Backport: to Backport: Introduce new dedicated media search handler and add new label field search handler

This ticket was mentioned in PR #6112 on WordPress/wordpress-develop by @petitphp.


3 months ago
#2

  • Keywords has-patch has-unit-tests added

This change is related to a PR in gutenberg to display localize name for suggestions in the link component.

This change felt too complex to be added to the gutenberg repository and backported afterward. Also I wanted to be able to update existing tests for the REST search handler.

This PR contain two changes :

  • Add a new label property in the WP_REST_Search_Controller and update existing handlers to fill this property accordingly
  • Add a new WP_REST_Media_Search_Handler handler to uniformize the shape of the data send back by the search endpoint between all types.

@TimothyBlynJacobs commented on PR #6112:


3 months ago
#3

It looks like the associated Gutenberg PR hasn't been merged yet. I'm leaving feedback there for now.

Note: See TracTickets for help on using tickets.