#55574 closed enhancement (fixed)
WP_REST_Pattern_Directory_Controller::get_items doesn't support array arguments
| Reported by: | antonvlasenko | Owned by: | antonvlasenko |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.0 |
| Component: | REST API | Version: | 5.8 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | rest-api |
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_patternsmust be updated to support array request arguments.
Change History (6)
This ticket was mentioned in PR #2591 on WordPress/wordpress-develop by anton-vlasenko.
4 years ago
#1
- Keywords has-patch added
#2
@
4 years ago
Steps to test the PR:
- Activate a block-based theme like
Twenty Twenty-Two. - Open the
theme.jsonfile for that theme and add a newpatternssetting 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
@
4 years ago
This task is a follow-up to https://github.com/WordPress/wordpress-develop/pull/2488#pullrequestreview-936828609
4 years ago
#5
Committed with https://core.trac.wordpress.org/changeset/53218.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/55574