Skip to content

Commit dbdf481

Browse files
authored
Revert "show proper message on trash (#25563)" (#25604)
This reverts commit f9965bb.
1 parent f062c21 commit dbdf481

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

packages/editor/src/store/utils/notice-builder.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,11 @@ export function getNotificationArgumentsForSaveSuccess( data ) {
3131
const publishStatus = [ 'publish', 'private', 'future' ];
3232
const isPublished = includes( publishStatus, previousPost.status );
3333
const willPublish = includes( publishStatus, post.status );
34-
const isTrashed = post.status === 'trash';
3534

3635
let noticeMessage;
3736
let shouldShowLink = get( postType, [ 'viewable' ], false );
3837

39-
// Since there is not a label for a post_type `trash` action,
40-
// we add the message manually.
41-
// Reference: https://developer.wordpress.org/reference/functions/get_post_type_labels/
42-
if ( isTrashed ) {
43-
noticeMessage = `${ postType.labels.singular_name } trashed.`;
44-
shouldShowLink = false;
45-
} else if ( ! isPublished && ! willPublish ) {
38+
if ( ! isPublished && ! willPublish ) {
4639
// If saving a non-published post, don't show notice.
4740
noticeMessage = null;
4841
} else if ( isPublished && ! willPublish ) {

packages/editor/src/store/utils/test/notice-builder.js

-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ describe( 'getNotificationArgumentsForSaveSuccess()', () => {
1717
item_scheduled: 'scheduled',
1818
item_updated: 'updated',
1919
view_item: 'view',
20-
singular_name: 'post',
2120
},
2221
viewable: false,
2322
};
@@ -75,11 +74,6 @@ describe( 'getNotificationArgumentsForSaveSuccess()', () => {
7574
},
7675
],
7776
],
78-
[
79-
'when post is trashed',
80-
[ 'publish', 'trash' ],
81-
[ 'post trashed.', defaultExpectedAction ],
82-
],
8377
].forEach(
8478
( [
8579
description,

0 commit comments

Comments
 (0)