#55574 closed enhancement (fixed)
WP_REST_Pattern_Directory_Controller::get_items doesn't support array arguments
Reported by: | antonvlasenko | Owned by: | antonvlasenko |
---|---|---|---|
Milestone: | 6.0 | Priority: | normal |
Severity: | normal | Version: | 5.8 |
Component: | REST API | Keywords: | has-patch |
Focuses: | rest-api | Cc: |
Description
Since http://api.wordpress.org/patterns
API supports array parameters, there is no need to implode slug values inside the _register_remote_theme_patterns
function.
Both WP_REST_Pattern_Directory_Controller
and _register_remote_theme_patterns
must be updated to support array request arguments.
Change History (6)
This ticket was mentioned in PR #2591 on WordPress/wordpress-develop by anton-vlasenko.
3 years ago
#1
- Keywords has-patch added
#2
@
3 years ago
Steps to test the PR:
- Activate a block-based theme like
Twenty Twenty-Two
. - Open the
theme.json
file for that theme and add a newpatterns
setting to it:"patterns": [ "short-text-surrounded-by-round-images", "visual-navigation-with-rainbow-gradient" ],
You can use any pattern instead of the patterns above. However, it's important to use at least 2 patterns.
A list of available patterns can be found here: https://wordpress.org/patterns/
- Make a GET call to this REST API endpoint:
/wp/v2/block-patterns/patterns
Expected result:
The response must contact patterns added in step 2
.
E.g.:
#3
@
3 years ago
This task is a follow-up to https://github.com/WordPress/wordpress-develop/pull/2488#pullrequestreview-936828609
3 years ago
#5
Committed with https://core.trac.wordpress.org/changeset/53218.
Trac ticket: https://core.trac.wordpress.org/ticket/55574