Filter Guidelines service queries by content guideline type#593
Conversation
Gutenberg 23.1 introduced the `wp_guideline_type` taxonomy and now auto- tags guidelines saved without a type as `artifact`. The service queried the newest `wp_guideline` without filtering, so an artifact guideline could shadow the content singleton in prompt assembly. Restrict the query to the `content` term when the taxonomy is registered; fall back to the legacy "newest wins" behavior on older Gutenberg. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #593 +/- ##
=============================================
+ Coverage 73.16% 73.18% +0.02%
- Complexity 1730 1731 +1
=============================================
Files 85 85
Lines 7467 7473 +6
=============================================
+ Hits 5463 5469 +6
Misses 2004 2004
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…s#593) Changed - Filter Guideline queries by the guideline type content Co-authored-by: gziolo <gziolo@git.wordpress.org> Co-authored-by: dkotter <dkotter@git.wordpress.org> Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org> Co-authored-by: henryperkins <htperkins@git.wordpress.org>

Summary
Guidelines::fetch_guidelines()to thecontentterm of the newwp_guideline_typetaxonomy so a newerartifactguideline can't shadow the content singleton in prompt assembly.Guidelines::TAXONOMY/Guidelines::TERM_CONTENTconstants and three regression tests covering the content-vs-artifact preference, artifact-only sites, and the pre-taxonomy fallback path.Fixes #529.
Test plan
composer run-script format— cleancomposer run-script lint— cleancomposer run-script phpstan— clean for changed files (pre-existing unrelatedRequirements.phpwarning)npm run test:php -- --filter Guidelines_Test— 31/31 passnpm run test:php -- --filter Abstract_Ability_Guidelines_Test— 9/9 pass🤖 Generated with Claude Code