Opened 2 years ago
Closed 2 years ago
#56126 closed defect (bug) (fixed)
Pattern keywords are not passed through from pattern directory
Reported by: | ryelle | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 6.0.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | REST API | Keywords: | has-patch needs-testing has-testing-info fixed-major |
Focuses: | Cc: |
Description
Patterns on the Pattern Directory can have keywords for better discoverability while searching. The way these are stored was changed, but the /wp/v2/pattern-directory/patterns
endpoint is still pulling from that old value.
The result is that patterns loaded remotely are not registered with any keywords.
To reproduce
- Use a theme with a
theme.json
- Add
heading-large-text-and-link
to thepatterns
list (example) - That pattern has the keyword "big text"
- Open the editor, open the inserter
- Try searching for "big text"
- No results, when it should show the "Heading, large text, and link" pattern
Change History (16)
This ticket was mentioned in PR #2935 on WordPress/wordpress-develop by ryelle.
2 years ago
#1
- Keywords has-patch added
#2
@
2 years ago
I don't have a strong objection to changing the way the Core endpoint works. But it does mean users on older WP versions won't automatically get a fix if the .org response was adjusted.
Might be better to put this in a point release and potentially backport it?
#3
@
2 years ago
Yeah, I'm happy to have this in a point release & backport it (though I don't know how that process goes outside of the RC process) - this was introduced in 5.8, so we'd need to backport 5.8, 5.9 & 6.0.
#4
@
2 years ago
I'm not sure what that process would be like either. Cc: @SergeyBiryukov, @desrosj.
#5
@
2 years ago
- Milestone changed from Awaiting Review to 6.0.1
I think changing a WP.org API response format does not happen often, so there might not be an established process :) For any major changes, I guess we'd generally bump the version in the http://api.wordpress.org/patterns/1.0/
URL from 1.0
to 1.1
, so that older installs could continue to use the previous version.
If I understand correctly, that is not the case here, as the change is minor and we'd like to update the 5.8 and later branches to recognize the new keywords format in the patterns endpoint.
I have no objections to backporting this to 6.0 and then 5.9 and 5.8 as mentioned. For the latter two this will be included when there's a new security release for them.
#6
@
2 years ago
- Keywords needs-testing has-testing-info added
Adding testing keywords so PR 2935 can be picked up by the Test team.
#9
@
2 years ago
Keeping the ticket open for now to also backport to 5.9 and 5.8 branches, per comment:3.
The property returned from the API for "keywords" has been updated from a taxonomy to meta value, so the
keyword_slugs
will not return the expected content. The correct property to use for this field ismeta.wpop_keywords
, which returns a single string with comma-separated keywords.Note: I'm making this change here, rather than updating
keyword_slugs
in the wp.org API's response, because the keywords are not "slugs", they're regular human-readable phrases. That property was also used for the "core" keyword taxonomy term, which is a format we're not using anymore (see https://github.com/WordPress/pattern-directory/commit/69548ff1f0326c4fd4d9ea7390c48b6d9d227055). If it's preferred to update it in wp.org anyway, I can make that change.To test
heading-large-text-and-link
to the patterns list (example)Trac ticket: https://core.trac.wordpress.org/ticket/56126