Make WordPress Core

Opened 4 years ago

Closed 16 months ago

Last modified 15 months ago

#51387 closed defect (bug) (fixed)

Add trash post type label

Reported by: ntsekouras's profile ntsekouras Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.3 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch needs-testing has-dev-note
Focuses: administration Cc:

Description

Now as we can see from the available post type labels, there is not one for trashing an entity.
Ref here: https://developer.wordpress.org/reference/functions/get_post_type_labels/.

In Gutenberg when you trash an entity should show a message from the labels, so as to be translated as well.

Related issue in Gutenberg here: https://github.com/WordPress/gutenberg/issues/19144

Change History (10)

#1 @SergeyBiryukov
4 years ago

  • Component changed from General to Posts, Post Types

#2 @johnbillion
4 years ago

  • Keywords needs-patch added

This ticket was mentioned in PR #4253 on WordPress/wordpress-develop by @James Roberts.


19 months ago
#3

  • Keywords has-patch added; needs-patch removed

Added the item_trashed default label to the get_default_labels() method.

This update adds the item_trashed default label to the get_default_labels() method. As per #25604 , this should allow #25563 to move forward now that the strings are translatable. Note: #25563 was reverted, pending this update to core.

Testing Instructions:

  1. Manually apply the changes in #25563 to a local copy of the Gutenberg plugin.
  2. Remove the if statement [ https://github.com/WordPress/gutenberg/blob/trunk/packages/editor/src/store/utils/notice-builder.js#L26 here].
  3. Instead of noticeMessage = ${ postType.labels.singular_name } trashed.;, use noticeMessage = postType.labels.item_trashed;
  4. Re-build Gutenberg - npm run build.
  5. Open a post in the editor - On the Document settings pane, click on "Move to trash".
  6. Voice Over should read "Post trashed" before redirecting.

Trac ticket: https://core.trac.wordpress.org/ticket/51387

#4 @James Roberts
19 months ago

  • Keywords needs-testing added

@James Roberts commented on PR #4253:


19 months ago
#5

E2E test locally gives the following results:

Test Suites: 6 passed, 6 total
Tests:       15 passed, 15 total
Snapshots:   0 total
Time:        117.714 s, estimated 224 s

Would it be possible to re-run it?

#6 @SergeyBiryukov
16 months ago

  • Milestone changed from Awaiting Review to 6.3

#7 @SergeyBiryukov
16 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 55923:

Posts, Post Types: Introduce item_trashed post type label.

This allows the block editor to announce the correct message when an entity is moved to the Trash.

Original issue from Gutenberg repository:

Props james-roberts, ntsekouras, nrqsnchz, afercia, swissspidy, joedolson, talldanwp, SergeyBiryukov.
Fixes #51387.

@SergeyBiryukov commented on PR #4253:


16 months ago
#8

Thanks for the PR! Merged in r55923.

#9 @swissspidy
16 months ago

  • Keywords needs-dev-note added

#10 @stevenlinx
15 months ago

  • Keywords has-dev-note added; needs-dev-note removed
Note: See TracTickets for help on using tickets.