Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#61254 new enhancement

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

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

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

  • Summary Backport: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.


2 years 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:


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