mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-05 15:16:59 +00:00
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
This commit is contained in:
@@ -10385,6 +10385,11 @@ mockedApiResponse.Schema = {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"required": false
|
||||
},
|
||||
"slug": {
|
||||
"description": "Limit results to those matching a pattern (slug).",
|
||||
"type": "array",
|
||||
"required": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user