-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patterns: add delete_posts
to the wp_block (patterns) capabilities
#53405
Conversation
delete_posts
to the wp_block (patterns) capabilitiesdelete_posts
to the wp_block (patterns) capabilities
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/compat/wordpress-6.4/blocks.php ❔ lib/load.php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix here @ramonjd 👍
✅ Could replicate original issue
✅ Applying this PR allows deletion of draft pattern
I only had one minor question that I left via an inline comment. Pending that though, I'm happy to approve this.
Before | After |
---|---|
37e85c4
to
c592cc7
Compare
I tried to add tests for this PR, but for some reason Maybe something I'm missing in the way that the admin page works in this context. |
…nce of `$args['capabilities']` before typing checking. If the first expression fails we skip the second, otherwise there'll be a PHP error.
Maybe resolves #53367
What?
Adds
delete_posts
to the wp_block (patterns) capabilities.WordPress core backport PR:
delete_posts
to capabilities. wordpress-develop#4987Why?
It's currently not possible to delete draft posts. The
wp_block
post type hasdelete_published_posts
in the capabilities array only.See: https://github.com/WordPress/wordpress-develop/blob/444bdf49bc38883f603a584bcc119aedf98257b8/src/wp-includes/post.php#L322
How?
Using the register_{$post_type}_post_type_args hook.
Testing Instructions
Screenshots or screencast
Before
2023-08-08.14.13.56.mp4
After
2023-08-08.14.14.24.mp4