-
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 Extensibility: Allow unregistering trash post action #64087
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: +178 B (+0.01%) Total Size: 1.76 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.
Works as expected. I didn't notice any regression after migration ✅
Side note: When trashing a post from the post editor, the editor renders a "missing entity" state. This wasn't the case with the old "Move to Trash" button; we should probably try and fix it. See 2s-3s in screencast.
CleanShot.2024-07-30.at.13.53.06.mp4
|
||
const trashPost: Action< PostWithPermissions > = { | ||
id: 'move-to-trash', | ||
label: __( 'Move to Trash' ), |
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.
I know this wasn't introduced in this PR, but:
I thought we use sentence case nowadays? i.e. Move to trash
with lowercase t.
? sprintf( | ||
// translators: %s: The item's title. | ||
__( | ||
'Are you sure you want to move to trash "%s"?' |
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.
I know this wasn't introduced in this PR, but:
This is odd grammar. Wouldn't one say "Are you sure you want to move XYZ to the trash?"
'Are you sure you want to move to trash %d item?', | ||
'Are you sure you want to move to trash %d items?', |
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.
I know this wasn't introduced in this PR, but:
This is odd grammar. Wouldn't one say "Are you sure you want to move XYZ item(s) to the trash?"
typedError.reason.message; | ||
} else { | ||
errorMessage = __( | ||
'An error occurred while moving to trash the item.' |
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.
Ditto here and everywhere below... "An error occurred while moving the item to the trash"
Related #61084
Similar to #62647
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: "trash post".
Testing Instructions
1- Open the pages dataviews and try moving a page to the trash.
2- You should be able to see the "move to trash" action in the actions dropdown menu
3- you can try to use the action.