WordPress / WordPress/pattern-directory
Pattern API: Search requests ignore other API parameters
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 134
- Forks
- 46
- Avg merge
- 9h 4m
- Merged PRs (30d)
- 19
Description
See https://github.com/WordPress/pattern-directory/pull/540#issuecomment-1375377118
I'm testing the GB PR and it seems can fetch patterns with more blocks, if we also provide the search param, ex:
https://api.wordpress.org/patterns/1.0/?search=image&allowed_blocks[]=core/heading&allowed_blocks[]=core/galleryAny insights about this?
Probably due to using ElasticSearch for search results.
Sync the wpop_contains_block_types meta and use it for a filter like https://github.com/WordPress/pattern-directory/commit/29f7b31a8c4142f068a2076935fd3583584b27eb.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the patterns API search handling and compare it with commit 29f7b31a8c4142f068a2076935fd3583584b27eb. Review how wpop_contains_block_types is synchronized and filtered when the API request includes search and allowed_blocks[]. Done means the example request applies both search and allowed_blocks[] constraints.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elasticsearch, php
- Domain
- api, backend, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100