-
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
DataViews: Use items with permissions and avoid hooks to register actions #63923
Conversation
Size Change: +585 B (+0.03%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
0b55895
to
a78b7ed
Compare
bb71e27
to
c73bcbc
Compare
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. |
c73bcbc
to
176d14e
Compare
@@ -1035,14 +985,13 @@ export function usePostActions( { postType, onActionPerformed, context } ) { | |||
userCanCreatePostType && | |||
duplicateTemplatePartAction, | |||
isPattern && userCanCreatePostType && duplicatePatternAction, | |||
supportsTitle && renamePostActionForPostType, | |||
supportsTitle && renamePostAction, |
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.
It looks like some of these need to be added to the dependency array.
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.
they are now top level variables so stable references, the lint rule understands that it seems so they don't need to be added to the dependencies.
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.
Related #55083
Builds on top of #63857
What?
This PR updates the different post type actions to use "item with permissions" that way there's no need to call a selector within
isEligilble
Testing Instructions
We need to check the different data views (pages, templates, patterns and template parts) to ensure that we're not regressing and we're actually rendering the right actions with the right permissions.