-
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: Register the export pattern action like any third-party action #63046
Conversation
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. |
Size Change: +23 B (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
6b5377b
to
0539bc8
Compare
f78ba1f
to
ec7dc4c
Compare
0539bc8
to
3a65582
Compare
ec7dc4c
to
e2abb45
Compare
...( | ||
state[ action.kind ]?.[ action.name ] ?? [] | ||
).filter( | ||
( _action ) => _action.id !== action.config.id |
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.
Why do we need this filtering? Is it just defensive programming for trying to register the same action twice or was it needed actually for this PR?
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.
Yes, It's to override the previous action with the same id.
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.
Besides my small question about the filtering, this looks good. Thanks!
I can't merge this PR until the parent PR is reviewed #63042 |
92de1dd
to
51e975b
Compare
51e975b
to
5c1d40e
Compare
…tion (WordPress#63046) Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
Related #61084
Similar to #62913
What?
In #62052 an API to register and unregister dataviews actions has been implemented. But in order to allow third-party developers to be able to unregister these actions, we need to be using the same actions in Core to register the core actions.
The current PR explore the possibility to use the API to register one action: "export pattern".
Testing Instructions
1- Open the patterns dataviews
2- Click "My patterns"
3- On the actions menu per pattern, click "Export as JSON"