Add CRUD abilities for all post types#153
Conversation
Implements standardized Create, Read, Update, and Delete abilities for WordPress posts that work uniformly across all post types (built-in and custom). New abilities: - core/create-post: Create posts with title, content, excerpt, status - core/get-post: Retrieve a single post by ID - core/list-posts: List posts with pagination, filtering, and search - core/update-post: Partial updates to existing posts - core/delete-post: Soft delete (trash) or permanent deletion Features: - Respects WordPress capabilities system for all operations - Supports all post types via post_type parameter - Full input/output schema validation - Proper error handling with WP_Error and HTTP status codes - REST API exposure via show_in_rest annotation - Semantic annotations (readonly, destructive, idempotent) Closes #84
|
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. |
Codecov Report❌ Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add phpcs:ignore comments for WordPress.WP.Capabilities.Undetermined warnings. These are false positives - the capabilities are dynamically retrieved from post type objects which is a valid WordPress pattern.
Summary
Implements standardized CRUD abilities for WordPress posts that work uniformly across all post types (built-in and custom), as requested in #84.
New abilities
core/create-postcore/get-postcore/list-postscore/update-postcore/delete-postKey features
post_typefieldcurrent_user_can()WP_Errorwith appropriate HTTP status codesshow_in_rest: truereadonly,destructive,idempotenthints for toolingTest plan
Closes #84