Skip to content

Commit

Permalink
Data views: Make trash a quick action again (WordPress#60165)
Browse files Browse the repository at this point in the history
* Data views: Make trash a quick action again

* Use _n

* Update packages/edit-site/src/components/actions/index.js

Co-authored-by: Pascal Birchler <pascalb@google.com>

* Update packages/edit-site/src/components/actions/index.js

Co-authored-by: Pascal Birchler <pascalb@google.com>

---------

Co-authored-by: Pascal Birchler <pascalb@google.com>
Co-authored-by: Jorge Costa <jorge.costa@developer.pt>
  • Loading branch information
3 people authored and carstingaxion committed Mar 27, 2024
1 parent f5e8bf4 commit e6a3b5c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/edit-site/src/components/actions/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* WordPress dependencies
*/
import { external, edit, backup } from '@wordpress/icons';
import { external, trash, edit, backup } from '@wordpress/icons';
import { addQueryArgs } from '@wordpress/url';
import { useDispatch } from '@wordpress/data';
import { decodeEntities } from '@wordpress/html-entities';
import { store as coreStore } from '@wordpress/core-data';
import { __, sprintf } from '@wordpress/i18n';
import { __, _n, sprintf } from '@wordpress/i18n';
import { store as noticesStore } from '@wordpress/notices';
import { useMemo } from '@wordpress/element';
import { privateApis as routerPrivateApis } from '@wordpress/router';
Expand All @@ -27,6 +27,8 @@ const { useHistory } = unlock( routerPrivateApis );
export const trashPostAction = {
id: 'move-to-trash',
label: __( 'Move to Trash' ),
isPrimary: true,
icon: trash,
isEligible( { status } ) {
return status !== 'trash';
},
Expand All @@ -47,8 +49,10 @@ export const trashPostAction = {
)
: sprintf(
// translators: %d: The number of pages (2 or more).
__(
'Are you sure you want to delete %d pages?'
_n(
'Are you sure you want to delete %d page?',
'Are you sure you want to delete %d pages?',
posts.length
),
posts.length
) }
Expand Down

0 comments on commit e6a3b5c

Please sign in to comment.