Add Content Guidelines experimental feature#74789
Draft
Jameswlepage wants to merge 4 commits intoWordPress:trunkfrom
Draft
Add Content Guidelines experimental feature#74789Jameswlepage wants to merge 4 commits intoWordPress:trunkfrom
Jameswlepage wants to merge 4 commits intoWordPress:trunkfrom
Conversation
This introduces Content Guidelines as an experimental feature in the Site Editor. While Global Styles define how your site looks, Content Guidelines define how your site sounds. Features: - New @wordpress/content-guidelines package with full UI - Site Editor integration with /guidelines route - Conditional loading based on experiment toggle - PHP API with REST endpoints for guidelines management - Support for site-level and block-specific guidelines - Draft/publish workflow with revision history - AI provider hooks for content generation integration The experiment can be enabled in Gutenberg > Experiments > Content Guidelines. Note: This commit skips linting. Follow-up commits will address: - Text domain changes (content-guidelines → default) - JSDoc format alignment - Unused variable cleanup - SCSS empty block fixes
This refactors Content Guidelines to use the standard Gutenberg pattern where core-data is the source of truth, matching how Global Styles works. Key changes: - Add useGuidelines hook using useEntityRecord for data access - Register contentGuidelines entity with core-data for SaveHub integration - Add REST route /wp/v2/content-guidelines/current for entity fetching - Simplify store to only manage UI state (revisions, test results) - Remove legacy panel components and draft/publish workflow - Add user avatars to Guidelines History panel The store no longer manages guidelines data directly - all CRUD operations now flow through core-data's editEntityRecord and saveEditedEntityRecord.
- Fix library panel layout causing one-word-per-line text wrapping - Simplify SectionCard markup using plain HTML instead of Flex components - Add proper focus states with border overlay (no doubling) - Remove bold from section titles - Add user avatars to history panel with WordPress default fallback - Add REST route /wp/v2/content-guidelines/current for core-data entity - Add page-guidelines styles for proper scrolling - Add border-bottom to list items - Fix PHP and JS linting issues
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Jameswlepage! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
- Remove guidelines-page component (old inline tabs UI) - Remove guidelines-screen component (only used by old UI) - Remove GuidelinesPage export from package index - Update commands to use Site Editor routes instead of non-existent admin page The content-guidelines package now only exports panel components that the Site Editor integrates via its own navigation structure.
ac78793 to
532fbdc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
This PR introduces Content Guidelines as an experimental feature in the Site Editor. While Global Styles define how your site looks, Content Guidelines define how your site sounds.
Content Guidelines provide a structured way to document and enforce editorial voice, tone, vocabulary, and copy rules across a WordPress site—making them discoverable by AI assistants and content tools.
Why?
As AI-powered writing assistance becomes more common in WordPress, there's a need for site owners to define their editorial identity in a machine-readable format. Currently, there's no standardized way for:
This feature complements Global Styles by adding the "content" counterpart to visual styling, enabling a complete site identity system.
How?
New package:
@wordpress/content-guidelinesuseGuidelineshook following canonical Gutenberg data patternsPHP Backend (
lib/experimental/content-guidelines/)wp_content_guidelines_*filters)Site Editor Integration
/guidelinesroute in Site EditorGuidelines Schema
Testing Instructions
wp_content_guidelines_run_playground_testfilterScreenshots
Notes
Related