-
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
Allow Disabling of Synced Pattern Overrides (dynamically) #62338
Comments
As pattern overrides are implemented using the block binding API, I'll also add the 'Block bindings' label to this. It could potentially be a block bindings feature rather than specific to patterns. |
It seems there are different use cases here that might affect the potential implementation:
The first two points seem specific to the Synced Patterns UI, which does not use bindings. For the last one, I assume that if a user has the permissions to edit the post where the pattern is inserted, they should be able to edit the overridable values. And if they don't have permissions, they shouldn't. Is that right? |
Related: #28895 (comment) |
The first is really #28895. Patterns (wp_block post types) need their own distinct capabilities to enable that. The second is more nuanced (hiding the Enable/Disable overrides button), and I think that's what this issue is about. In my mind this is more closely related to bindings. For example, it might be that in the future extenders can configure which blocks support which bindings, and that could be one way to achieve this. Whether it disables the UI for enabling bindings or completely prevents the bindings from working at all is another matter. The second option is dangerous as it can completely change a site's content if they already have active bindings. It could also be that there's some config in the binding source to prevent the UI from showing, though perhaps that's only for the default bindings UI. There's also the possibility of unregistering the binding source completely.
Yep, that's correct. |
Linking the related issue that proposes adding meta capability for Pattern Overrides: Speaking of Block Bindings, there was recently a block editor setting introduced that controls whether the user should be able to manage Block Bindings through UI: There is a follow-up work that explores adding meta capability to add more control on the server: |
What problem does this address?
While we are very excited about the possibilities of Synced Pattern Overrides, it feels like a very advanced topic that we'd like to prevent our content providers from creating on their own (at least for now). We also imagine a world where Network Administrators can create them (and content providers could use them)
What is your proposed solution?
Allow the ability to create patterns that contain overrides to be removed with a filter, such as with block_editor_settings_all (https://developer.wordpress.org/reference/hooks/block_editor_settings_all/). This would allow us the ability to let Network Administrators create them, but typical users could only use them.
The text was updated successfully, but these errors were encountered: