Skip to content

Guidelines CPT: Changes slug from wp_content_guidelines to wp_guidelines#77147

Merged
gziolo merged 1 commit intoWordPress:trunkfrom
iamchughmayank:update/guideline-cpt-slug
Apr 9, 2026
Merged

Guidelines CPT: Changes slug from wp_content_guidelines to wp_guidelines#77147
gziolo merged 1 commit intoWordPress:trunkfrom
iamchughmayank:update/guideline-cpt-slug

Conversation

@iamchughmayank
Copy link
Copy Markdown
Contributor

@iamchughmayank iamchughmayank commented Apr 8, 2026

What?

Closes

See #76384

Renames the Content Guidelines custom post type slug from wp_content_guideline to wp_guideline.

Why?

Before the 22.7 release, the public-facing name was simplified from "Content Guidelines" to just "Guidelines" — recognizing the feature extends beyond content to design guidelines, coding standards, and more (announcement
post
).

This PR aligns the internal CPT slug with that direction. As noted in the core review comments, wp_guideline follows WordPress's CPT naming convention (wp_block,
wp_template, wp_global_styles).

How?

Two changes:

  • Gutenberg_Content_Guidelines_Post_Type::POST_TYPE constant → 'wp_guideline'
  • Gutenberg_Content_Guidelines_Revisions_Controller constructor default → 'wp_guideline'

All other code references the POST_TYPE constant, so they pick up the change automatically. The rest_base remains content-guidelines. Meta keys (_content_guideline_*) are unchanged.

Testing Instructions

Setup: Boot up local WordPress using npm run wp-env start

  1. Enable the experiment in Settings > Experiments under the label: "Guidelines"
  2. Navigate to Settings > Guidelines.
  3. Add text in the Copy and Images fields, click Save.
  4. Refresh — verify saved guidelines load correctly.

Testing Instructions for Keyboard

No special steps for keyboard testing required

Screenshots or screencast

Before After

No visual changes

Use of AI Tools

Claude Opus used for planning the task and creating summarised draft of PR description

@iamchughmayank iamchughmayank marked this pull request as ready for review April 8, 2026 11:47
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: iamchughmayank <iamchughmayank@git.wordpress.org>
Co-authored-by: gziolo <gziolo@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@gziolo gziolo added [Type] Bug An existing feature does not function as intended [Feature] Guidelines An experimental feature for adding site-wide editorial rules. labels Apr 9, 2026
Copy link
Copy Markdown
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These atomic changes look good. I couldn't locate more occurrences of wp_content_guideline. The rest of the code will need to be updated to reflect the changes, like the names of both modified classes and files.

gziolo added a commit that referenced this pull request Apr 9, 2026
Follow-up to #77147. That PR renames the Guidelines CPT slug but the
feature has no end-to-end coverage, so there is no regression signal
for changes that touch the CPT, REST controller, or admin page
boot-up. This adds three Playwright specs that drive the UI the same
way the PR's "Testing Instructions" do.

See also #76390. This
partially covers the scope of that issue on the e2e level.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gziolo
Copy link
Copy Markdown
Member

gziolo commented Apr 9, 2026

I verified this change locally by running a new e2e suite I put up in #77192 against this branch. All three specs pass with the renamed wp_guideline slug, including the full Copy + Images save-and-refresh round-trip from the Testing Instructions here.

If you're open to it, it would be great to pull #77192 into your local branch (or rebase on top once it lands) and re-run npm run test:e2e -- test/e2e/specs/admin/guidelines.spec.js as part of the verification for this PR. That would make future CPT/REST/admin-page changes in this area much easier to validate and protect the feature from regressions while it's still experimental.

@iamchughmayank
Copy link
Copy Markdown
Contributor Author

I verified this change locally by running a new e2e suite I put up in #77192 against this branch. All three specs pass with the renamed wp_guideline slug, including the full Copy + Images save-and-refresh round-trip from the Testing Instructions here.

If you're open to it, it would be great to pull #77192 into your local branch (or rebase on top once it lands) and re-run npm run test:e2e -- test/e2e/specs/admin/guidelines.spec.js as part of the verification for this PR. That would make future CPT/REST/admin-page changes in this area much easier to validate and protect the feature from regressions while it's still experimental.

Thanks! I pulled the linked PR with E2Es and the tests are working fine ( #77192 (comment) )

@gziolo gziolo merged commit 39662c2 into WordPress:trunk Apr 9, 2026
48 of 50 checks passed
@github-actions github-actions bot added this to the Gutenberg 23.0 milestone Apr 9, 2026
gziolo added a commit that referenced this pull request Apr 9, 2026
Follow-up to #77147. That PR renames the Guidelines CPT slug but the
feature has no end-to-end coverage, so there is no regression signal
for changes that touch the CPT, REST controller, or admin page
boot-up. This adds three Playwright specs that drive the UI the same
way the PR's "Testing Instructions" do.

See also #76390. This
partially covers the scope of that issue on the e2e level.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
gziolo added a commit that referenced this pull request Apr 9, 2026
Follow-up to #77147. That PR renames the Guidelines CPT slug but the
feature has no end-to-end coverage, so there is no regression signal
for changes that touch the CPT, REST controller, or admin page
boot-up. This adds three Playwright specs that drive the UI the same
way the PR's "Testing Instructions" do.

See also #76390. This
partially covers the scope of that issue on the e2e level.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Co-authored-by: gziolo <gziolo@git.wordpress.org>
Co-authored-by: iamchughmayank <iamchughmayank@git.wordpress.org>
@gziolo gziolo added [Type] Breaking Change For PRs that introduce a change that will break existing functionality and removed [Type] Bug An existing feature does not function as intended labels Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Guidelines An experimental feature for adding site-wide editorial rules. [Type] Breaking Change For PRs that introduce a change that will break existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants