wordpress-develop/src/wp-includes/rest-api
Tonya Mork dc3204ec1d REST API: Fixes /wp/v2/pattern-directory/patterns endpoint response for slug parameter.
[53218] introduced a bug of a wrong response from the `wp/v2/pattern-directory/patterns` endpoint with a `slug` parameter. As the response is cached, it can result in an incorrect list of available patterns supported by the current theme.

This commit resolves by:

* Limiting the `slug` to an `array` in the query parameters.
* When set, parsing and sorting the slug(s) and then serializing the sorted query args as part of the hashed transient keys.

Props antonvlasenko, timothyblynjacobs, spacedmonkey, costdev, hellofromTonya.

Follow-up to [53218], [53152], [51208].
Fixes #55617.

git-svn-id: https://develop.svn.wordpress.org/trunk@53333 602fd350-edb4-49c9-b593-d223f7449a82
2022-05-02 13:58:48 +00:00
..
endpoints REST API: Fixes /wp/v2/pattern-directory/patterns endpoint response for slug parameter. 2022-05-02 13:58:48 +00:00
fields REST API: Update “object” strings to use the appropriate nouns. 2021-05-25 13:11:55 +00:00
search REST API: Corrections and improvements to docblocks for REST API filters. 2021-01-10 22:21:39 +00:00
class-wp-rest-request.php Code Modernization: Silence the deprecation warnings for missing return type in WP_REST_Request. 2021-08-03 11:07:28 +00:00
class-wp-rest-response.php Docs: Update spelling for inline comments in a few files. 2022-01-25 13:54:01 +00:00
class-wp-rest-server.php REST API: Use rest_parse_embed_param function in WP_REST_Server class. 2022-04-08 17:27:42 +00:00