From 96b51724d88faf4cf3961cc644a2e314cd7187ef Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Sat, 13 Jan 2024 13:46:22 +0000 Subject: [PATCH] fixes --- packages/edit-site/src/components/actions/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/edit-site/src/components/actions/index.js b/packages/edit-site/src/components/actions/index.js index 1043e0711c791a..eb6e7565aff25f 100644 --- a/packages/edit-site/src/components/actions/index.js +++ b/packages/edit-site/src/components/actions/index.js @@ -34,7 +34,7 @@ export const trashPostAction = { }, supportsBulk: true, hideModalHeader: true, - RenderModal: ( { items: posts, closeModal } ) => { + RenderModal: ( { items: posts, closeModal, onPerform } ) => { const { createSuccessNotice, createErrorNotice } = useDispatch( noticesStore ); const { deleteEntityRecord } = useDispatch( coreStore ); @@ -50,7 +50,7 @@ export const trashPostAction = { : sprintf( // translators: %d: The number of pages (2 or more). __( - 'Are you sure you want to delete "%d" pages?' + 'Are you sure you want to delete %d pages?' ), posts.length ) } @@ -149,6 +149,10 @@ export const trashPostAction = { } ); } } + if ( onPerform ) { + onPerform(); + } + closeModal(); } } > { __( 'Delete' ) } @@ -305,12 +309,12 @@ export function useRestorePostAction() { ? sprintf( /* translators: The number of posts. */ __( '%d posts have been restored.' ), - decodeEntities( posts[ 0 ].title.rendered ) + posts.length ) : sprintf( /* translators: The number of posts. */ __( '"%s" has been restored.' ), - posts.length + decodeEntities( posts[ 0 ].title.rendered ) ), { type: 'snackbar',