Content Types: Add post type management#77754
Conversation
|
Size Change: +49 kB (+0.63%) Total Size: 7.87 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in 9d02036. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25156451060
|
ab9c502 to
ca062fd
Compare
ca062fd to
c53bee8
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 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. |
| 'taxonomies', | ||
| 'supports', | ||
| 'public', | ||
| 'hierarchical', |
There was a problem hiding this comment.
I feel we need less fields in the general group, but it's fine to land and iterate with the addition of more fields.
ntsekouras
left a comment
There was a problem hiding this comment.
Thanks! I think this is fine to land as v1 and iterate. It mirrors many of the architectural decisions we have discussed for taxonomies and some of the follow ups will also follow suit, like the REST PR for taxonomies, etc..
It would be good to add the follow ups (in your description) as tasks in the tracking issue.
What?
Introduces the foundations of user-defined custom post type (CPT) management interface as part of the content types experiment.
Why?
To manage custom post types natively and naturally from the WP admin interface.
Part of #77600
How?
We register a private
wp_user_post_typeCPT holds one record per user-defined post type, with the slug, status, and a JSON-encoded config stored in the standard post fields.Each published record is read on init and registered via
register_post_type()with atightly-validated subset of its config.
A REST insert filter rejects slug collisions with existing post types or other records.
New package -
@wordpress/user-post-typesexposes the form data model, fields, and bulk actions. Same shape as@wordpress/user-taxonomies.New routes -
routes/post-typesandroutes/post-type-editAdditional work or considerations not included in this initial PR:
flush_rewrite_rules()on change ofhas_archive,public, or renaming the CPT slugTesting Instructions
/wp-admin/edit.php?post_type=book. Expect the post type to be registered, the block editor to load for new entries, and the Featured image panel to be available./book/. Expect the archive page to render (after permalink rules update — see known issue below).wp-admin/edit.php?post_type=bookto 404 because the post type is no longer registered.message identifying the collision.
Testing Instructions for Keyboard
Same
Screenshots or screencast
Use of AI Tools
Opus 4.7