Content Guidelines: Add UX for site, copy, image, and additional guidelines#75420
Content Guidelines: Add UX for site, copy, image, and additional guidelines#75420andrewserong merged 22 commits intoWordPress:trunkfrom
Conversation
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @aswasif007! 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. |
mirka
left a comment
There was a problem hiding this comment.
Just left some high level notes for components usage. Markup itself seems pretty solid 👍
e153a01 to
11a4cc7
Compare
11a4cc7 to
51dd71c
Compare
|
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @aswasif007, @iamchughmayank. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
andrewserong
left a comment
There was a problem hiding this comment.
This is generally looking pretty good as a starting point to me!
Looks like the PR could use a rebase as it's currently got some failing checks.
I see the implementation here uses an accordion instead of separate views. What's the reason behind the design shift (not a blocker as I'm sure the UI can evolve over time). To me it can look a bit repetitive when multiple accordions are open, and I found navigate between and expanding / collapsing the accordions a bit fiddly since you have to click on the button itself rather than the heading.
I was also wondering if there's an opportunity to re-use DataForm / Card components, etc, for consistency, too.
In terms of code organisation, it could be a good time to add a types.ts file, and at some point I imagine the store.ts file could be split up into separate files for selector / reducer, etc, if and when more methods etc are added.
Was there any particular feedback you were looking for at this stage? Does this need a design review, or were you planning to land this in the short-term and continue iterating on the design in follow-ups?
routes/content-guidelines/components/guideline-accordion-form.tsx
Outdated
Show resolved
Hide resolved
|
@aagam-shah and @saroshaga, I know you're both keen on this feature — did you have any thoughts / concerns with the approach here? Overall it's looking like a pretty good start to me, just flagged a few code quality ideas, and looks like the PR will need a rebase. Were there any designers y'all have been working with who can give this a once over, too? |
|
Thanks you @andrewserong!
I think we wanted to simplify the design. Previously we had multiple screens, but here we are combining them and using accordions.
We are using Card component on the accordion. I'll see if I can replace the
👍
I was looking for general feedback because this is a foundational PR for the Content Guideline UX, and also my first PR on this repository! Thanks for the reviews! |
Sounds great. I think because it's behind an experiment we can comfortably land this in whatever shape you and @aagam-shah and others feel comfortable with and that helps you to continue iterating on the feature. Let me know once this has had a rebase and you're happy with the overall shape, and I can give it another 👀 and ✅ ! (Also as always, if any of the feedback feels too rabbit-holey, please call that out — I certainly don't want to derail any progress with my comments!) |
1081558 to
65bc7c4
Compare
Oh, sorry, I meant the https://wordpress.github.io/gutenberg/?path=/story/dataviews-dataform--layout-card The code for that example lives here: And this is timely, looks like there's a dev doc blog post on using that kind of approach here, too: https://developer.wordpress.org/news/2026/01/how-to-use-dataform-to-create-plugin-settings-pages/ |
| const handleSave = ( event: FormEvent< HTMLFormElement > ) => { | ||
| event.preventDefault(); | ||
| setGuideline( slug, draft ); | ||
| saveContentGuidelines(); | ||
| }; |
There was a problem hiding this comment.
Just thinking about form validation, maybe it's too early but I'll add some notes anyway 😄 Nothing blocking here. There should be probably be a design review at a later state.
- what is considered "valid" content for guidelines? are there any best practices a user needs to know, e.g., structure, no HTML, no line breaks, for real-time validation? at the very least I guess the forms should check for empty values before allowing submission
- a later task might be to include a helpful tips section for the above
- i'd be interested to hear from design folks, but maybe validation could be centralized via a single save button. that might also mitigate multiple, simultaneous submissions given there are 4 x submit buttons
There was a problem hiding this comment.
what is considered "valid" content for guidelines?
for now, only text. but I'd wait a bit before putting guardrails/validations here.
|
Ah, fair enough! It might be better to use an ad hoc approach in the short-term, then. You could always still use DataForm for the body of the accordion if that suits your needs?
If you think it'll be a common use case for the DataForm card layout, it could be worth opening an issue to propose adding an optional description/sub-title or other approach? For now, though, sounds like going with |
|
Thanks for the review @andrewserong! I've gone through the PR and left some additional inline feedback. On the design side — good call on flagging the need for a design review. @fditrapani has been working with us on this. I think getting a design review from them before merge would be good, especially to align on component patterns (accordion vs DataForm card layout vs the On the data layer — the PR currently uses a custom Redux store and hand-rolled |
routes/content-guidelines/components/guideline-accordion-form.tsx
Outdated
Show resolved
Hide resolved
3f0df29 to
c45aa2b
Compare
493fb5e to
c9de462
Compare
saroshaga
left a comment
There was a problem hiding this comment.
There are a couple of non-blocking things to discuss and follow-up on, but it looks good to go. Thank you for working on this, and for addressing the feedback @aswasif007 ❤️
andrewserong
left a comment
There was a problem hiding this comment.
This is testing well for me, too!
Thanks for all the back-and-forth @aswasif007, this feels like a good basis for the feature to me, too.
Since the card layout in DataForm didn't quite work out for you, it could be worth opening a follow-up issue to capture the limitations you ran into, and how you expected it to work / which features felt missing surrounding descriptions, etc.
But this LGTM! 🚀
|
Congratulations on your first merged pull request, @aswasif007! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts: https://profiles.wordpress.org/me/profile/edit/ And if you don't have a WordPress.org account, you can create one on this page: https://login.wordpress.org/register Kudos! |
|
Great work, all! |
…ines (#75420) * Add ux components for content guidelines * Integrate api and store with content-guidelines * Display snackbar for success/error * Rename additional guideline -> internal * Update behaviour so that each guideline can be saved separately * Refactor to separate form from accordion * Update package-lock.json * Refactor to not have to clone react element * Update spacing * Improve error handling * Manage ts types and interfaces with types.ts * Use DataForm instead of TextAreaControl * Improve css * Remove unwanted dep * Stop propagation on chevron click * Rename css * Update draft when value changes * Rename internal to additional * Clear error if user retries and succeeds * Improve accordion accessibility * Do not disable save when textarea is empty * Eliminate redundant logic Unlinked contributors: aswasif007, iamchughmayank. Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org> Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: aagam-shah <aagam94@git.wordpress.org> Co-authored-by: saroshaga <saroshaga@git.wordpress.org> Co-authored-by: fditrapani <fditrapani@git.wordpress.org>
|
I just cherry-picked this PR to the release/22.7 branch to get it included in the next release: 6c8572e |


What?
Related issue: #75260
This PR introduces a new Content Guidelines admin page that allows site administrators to define content standards for their site. The page is accessible via Settings > Content Guidelines in wp-admin and provides a structured interface for setting guidelines across four categories: Site, Copy, Images, and Additional guidelines.
Why?
This feature enables site administrators to establish and maintain content standards that can guide content creators, inform plugins, and help AI tools generate content that matches the site's voice and requirements. By providing a centralized location for content guidelines, teams can ensure consistency across all content creation workflows.
How?
This PR adds:
routes/content-guidelines/with a React-based admin page route that integrates with wp-adminlib/experimental/content-guidelines/load.phpto register the admin submenu page under SettingsGuidelineItemCard: Displays guideline categories as clickable cards in the list viewGuidelineItemEdit: Form component for editing individual guideline categories with TextareaControlThe page follows the same wp-admin integrated pattern as other admin pages like Font Library, maintaining the WordPress admin sidebar.
Note: This is an experimental feature (located in
lib/experimental/). The save functionality for guidelines is not yet implemented - this PR focuses on establishing the UI structure and navigation flow.Testing Instructions
Testing Instructions for Keyboard
Screenshots