Skip to content

Content Guidelines: Add Import, Export and Restore from revision history actions - #75434

Closed
iamchughmayank wants to merge 6 commits into
WordPress:trunkfrom
iamchughmayank:add/content-guidelines-actions
Closed

iamchughmayank wants to merge 6 commits into
WordPress:trunkfrom
iamchughmayank:add/content-guidelines-actions

Conversation

@iamchughmayank

@iamchughmayank iamchughmayank commented Feb 11, 2026 •

Copy link
Copy Markdown
Contributor

What?

Related issue: #75260

This PR builds upon the sibling PR to introduce the actions like Import/ Export / Restore in Content Guidelines. The page is accessible via Settings > Content Guidelines in wp-admin and provides a structured interface for importing/exporting Content Guidelines in JSON format as well as restoring from a previous version of Content Guidelines.

Why?

How?

This PR adds:

  • New Admin Page Route: Created routes/content-guidelines/ with a React-based admin page route that integrates with wp-admin
  • PHP Integration: Added lib/experimental/content-guidelines/load.php to register the admin submenu page under Settings
  • UI Components:
    • ActionsSection: Display list of options to Import or Export guidelines
    • RevisionHistoryScreen: Display list of all versions of content guidelines in a data view. The current version is marked so with (current) text
  • Navigation: Uses WordPress Navigator component for seamless navigation between list and edit views
  • Styling: Custom SCSS following Figma design tokens for consistent UI

The 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

Use the following sample guideline JSON to upload and test. You can modify it to test:

{
  "version": "1.0",
  "site": {
    "guidelines": "This is a technology blog focused on web development best practices."
  },
  "copy": {
    "guidelines": "Use a professional yet approachable tone. Avoid jargon when possible."
  },
  "images": {
    "guidelines": "Use high-resolution images. Prefer PNG for screenshots, WebP for photos."
  },
  "blocks": [
    {
      "blockType": "image",
      "guidelines": "Image guidelines"
    }
  ],
  "additional": {
    "guidelines": "Follow SEO best practices for all published content."
  }
}
  1. Navigate to Settings > Content Guidelines in wp-admin
  2. Verify list of actions - Import/Export/Restore displayed
  3. Verify Download is disabled if no guidelines are present
  4. Verify File explorer opens when you click on Upload
  5. Verify clicking on "View History" takes you to screen with "No revisions yet" placeholder text if no revisions are present
  6. Verify Revision history screen shows the guidelines revision once you upload
  7. Verify selecting a valid JSON file from file system uploads successfully
  8. Verify Download button becomes enabled after you upload a valid file.

Testing Instructions for Keyboard

  1. Navigate to Settings > Content Guidelines using keyboard navigation (Tab key)
  2. Use Tab to navigate through the action list
  3. Press Enter or Space to select the buttons like "Upload" and "Download"
  4. Press Enter on the back button to return from Revision History Screen
  5. Verify screen reader announcements are clean and descriptive

Screenshots or screencast

Before After
image image image image image

@github-actions github-actions Bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Feb 11, 2026
@github-actions

Copy link
Copy Markdown

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @iamchughmayank! 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.

@iamchughmayank

Copy link
Copy Markdown
Contributor Author

Not needed anymore. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant