[wp-trac] [WordPress Trac] #55617: /wp/v2/pattern-directory/patterns endpoint: slug parameter has no effect on the response
WordPress Trac
noreply at wordpress.org
Mon Apr 25 16:04:50 UTC 2022
#55617: /wp/v2/pattern-directory/patterns endpoint: slug parameter has no effect on
the response
---------------------------+-----------------------------
Reporter: antonvlasenko | Owner: antonvlasenko
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: trunk
Severity: major | Keywords:
Focuses: |
---------------------------+-----------------------------
Steps to reproduce the bug:
1. Install [https://github.com/WP-API/Basic-Auth this plugin] to allow
basic authorization for REST API requests.
2. Activate the plugin.
3. Send a `GET` request to your WordPress instance, e.g.:
{{{
curl --user username:user_password "http://your.wordpress.instance/wp-
json/wp/v2/pattern-directory/patterns?slug%5B0%5D=visual-navigation-with-
rainbow-gradient"
}}}
Replace
{{{
username:user_password
}}}
with the actual credentials.
Replace
{{{
http://your.wordpress.instance
}}}
with the actual URL of your instance.
3. Note the response. It should contain at least 1 pattern.
4. Send a GET request again, but this time replace
{{{
visual-navigation-with-rainbow-gradient
}}}
with some non-existent pattern. E.g.:
{{{
curl --user username:user_password "http://your.wordpress.instance/wp-
json/wp/v2/pattern-directory/patterns?slug%5B0%5D=non-existent-pattern"
}}}
Expected result:
The endpoint should return an empty response.
Actual result:
The endpoint will return the previous response. `slug` parameter has no
effect on the response.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55617>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list