-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Content lock: make filter hook namespace unique #46344
Content lock: make filter hook namespace unique #46344
Conversation
…te of the equivalent in packages/block-editor/src/hooks/style.js The assumption is that namespaces should be unique. This is especially important since using `removeFilter` will remove them both otherwise.
Size Change: +7 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
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.
LGTM.
From what I can tell the filter was released in core in 6.1, so it would be good to add a small dev note to mention this change (I've added the label).
Thanks @talldan This comment seems to indicate that it wasn't, as it was part of the experimental package (?) https://make.wordpress.org/core/2022/10/11/content-locking-features-and-updates/#comment-43975 |
Withdraw that. I don't think it's in 6.1 after all. |
@@ -168,6 +168,6 @@ export const withBlockControls = createHigherOrderComponent( | |||
|
|||
addFilter( | |||
'editor.BlockEdit', | |||
'core/style/with-block-controls', | |||
'core/content-lock-ui/with-block-controls', |
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.
Oh, I missed this in my review. Thanks for taking care of it.
What?
This PR is a follow up to #43037
I'm renaming the filter hook namespace from
'core/style/with-block-controls'
to'core/content-lock-ui/with-block-controls'
because the current value is a duplicate of the equivalent in packages/block-editor/src/hooks/style.jsThis is especially important since using
removeFilter
will remove them both otherwise, e.g.,Why?
The assumption is that namespaces should be unique. I could be wrong about this. If so, we should probably highlight the fact in the docs, which state that:
I'm happy to update the docs 😄
Testing Instructions