Skip to content

feat(taxonomy): add opt-in DataForm editor - #546

Open
faisalahammad wants to merge 2 commits into
WordPress:trunkfrom
faisalahammad:fix/156-taxonomy-dataform-editor
Open

faisalahammad wants to merge 2 commits into
WordPress:trunkfrom
faisalahammad:fix/156-taxonomy-dataform-editor

Conversation

@faisalahammad

Copy link
Copy Markdown

Adds an opt-in beta feature that renders the taxonomy editor Basic Settings with DataForm instead of the classic PHP fields. This is the first slice of #156 and covers taxonomies only, as the issue suggests. Field groups, post types and options pages are follow-ups.

The classic Basic Settings markup stays in the page and is hidden only after the editor mounts. That keeps the Post Types selector, the Advanced Configuration toggle, the taxonomy key slugification and any acf/taxonomy/basic_settings additions working, and it means a script failure leaves the original fields usable. Saving is untouched: the existing nonce, capability check, AJAX key validation and acf_update_internal_post_type() are still the only write path.

The editor uses @wordpress/dataviews and is limited to WordPress 7.0 and above, where the package is available. Note that #142 mentioned @automattic/dataviews back in May 2025, while the current WordPress docs use @wordpress/dataviews. Happy to switch if the listing work in #142 lands on the other package.

How to test:

  1. Go to Field Groups > Beta Features and enable Taxonomy Editor.
  2. On WordPress 7.0 or above, edit a taxonomy. The Plural Label, Singular Label, Taxonomy Key, Public and Hierarchical fields are now rendered by DataForm.
  3. Change those fields and save. The values persist on reload.
  4. Turn a toggle off and save, for example make a public taxonomy private. It stays off after reload.
  5. Confirm Post Types and Advanced Configuration still work.
  6. Disable the beta feature, or run WordPress below 7.0. The classic form shows again.

Two things worth knowing before review: the taxonomy key slugifies on blur of the classic singular label field, which is now hidden, so editing only the DataForm label will not auto-fill the key. The key is still editable in DataForm and saves as typed. Built assets are gitignored, so a source checkout needs npm run build before the editor loads.

Adds a beta feature that replaces the Basic Settings fields on the taxonomy
editor screen with a DataForm driven form. The classic markup stays in the
page and is hidden only after the script mounts, so the existing fields still
submit and the screen keeps working if the script fails to load.

The editor is opt-in through the existing Beta Features page and only loads on
WordPress 7.0 and above, where the DataForm components are available. Saving
still goes through the current nonce, capability and validation path, so no
new persistence route is introduced.

This is the first slice of WordPress#156 and covers taxonomies only. Field groups, post
types and options pages are follow-ups. See WordPress#156.
@github-actions

Copy link
Copy Markdown

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.

Core Committers: Use this line as a base for the props when committing in SVN:

Props faisalahammad.

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

- Handle View and Preview buttons in the shared editor fixture
- Match the renamed WP trunk preview menu item

Errors fixed:
- WP trunk preview timeout in openPreviewPage

Refs WordPress#546
@faisalahammad

Copy link
Copy Markdown
Author

CI Fix Summary

Updated tests/e2e/fixtures.js to support the WordPress trunk preview menu label change.

  • Handles both View and legacy Preview editor buttons.
  • Matches both Preview in new tab and Preview (opens in a new tab) menu labels.
  • Fixes the WP trunk openPreviewPage() timeout affecting shards 2/4, 3/4, and 4/4.

Validation: lint, Prettier, and diff checks passed. CodeRabbit was unavailable because the review limit was exhausted and no organization seat is assigned.

Commit: 0f7a15a

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant