-
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
Block Bindings: Map edit_block_binding
capability
#65116
base: trunk
Are you sure you want to change the base?
Conversation
manage_block_bindings
capabilityedit_block_binding
capability
322766e
to
bd0b904
Compare
if ( empty( $editor_settings['canUpdateBlockBindings'] ) ) { | ||
$editor_settings['canUpdateBlockBindings'] = current_user_can( 'manage_options' ); | ||
function gutenberg_add_can_update_block_bindings_editor_setting( $editor_settings, $block_editor_context ) { | ||
if ( ! isset( $editor_settings['canUpdateBlockBindings'] ) ) { |
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.
Using empty was wrong because it could be false
and that is a valid value. This means we were overriding the setting from core even if it was defined there.
Migrating the code triggered a bug where the attributes panel is not shown in custom post types when Gutenberg plugin is not active. This is because the mapping capabilities logic wasn't correct. e2e tests passed because that logic was being overridden in Gutenberg. I've started a PR in core trying to address that: link. |
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. |
I've just realized this compatibility PR to match WordPress/wordpress-develop#7258 wasn't merged. It is not a huge deal because this is a compat file and the editor setting is mapped to |
0aa79be
to
4f6dbe1
Compare
Flaky tests detected in 4f6dbe1. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12273669630
|
What?
This pull requests add compatibility to create a
edit_block_binding
capability that will be mapped to what was decided here.Why?
The compatibility filters should work the same way as core.
How?
Adding a new
edit_block_binding
capability through aninit
hook.Testing Instructions
manage_block_bindings
capability and disable it: