[wp-trac] [WordPress Trac] #50438: item_ labels do not work once registered in a post type
WordPress Trac
noreply at wordpress.org
Wed Oct 4 11:02:23 UTC 2023
#50438: item_ labels do not work once registered in a post type
-------------------------------+------------------------------
Reporter: ninetyninew | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version:
Severity: normal | Resolution:
Keywords: close | Focuses: docs
-------------------------------+------------------------------
Changes (by lopo):
* keywords: needs-patch => close
Comment:
I've been working on this ticket during the Yoast Contributor Day.
It looks like there is a mismatch between the labels used by the Block
editor and those used by the Classic editor, making it difficult to map
the former to the latter.
In detail:
1. Classic editor has `Post restored to revision from %s.` which is
missing in the Block editor labels
2. Classic editor has `Post saved.` which is missing in the Block editor
labels (though I'm not sure whether it's still used)
3. Classic editor has `Post submitted.`, to be followed by a preview link,
while Block editor uses `Draft saved` (not tied to a post type)
4. Classic editor has `Post scheduled for: %s.`(%s is the date), while
Block editor has just `Post scheduled.`
5. Classic editor has `Post draft updated.` while Block editor uses either
`Draft saved` (not tied to a post type) when simply updating or `Post
reverted to draft.` when unpublishing a post
6. Block editor has `Post published privately.` which is missing in the
Classic editor labels
7. Block editor has `Post trashed` which is missing in the Classic editor
labels (though it looks unused at the moment)
Considering all the above, I don't think it's easy to find a solution
here, unless we either add Classic editor-oriented labels to the array, or
change the behavior of the Classic editor notices (losing useful info in
some cases, e.g. when scheduling), or a mix of the two things.
While we can have a few improvements on the Block editor side (`Post
scheduled for: %s.` would be a nice addition), I don't think it's likely
to refactor Classic editor to support Block editor labels.
The most immediate way to add custom messages for custom post types is
still to hook into `post_updated_messages`
[https://developer.wordpress.org/reference/hooks/post_updated_messages/]
and add items there. In fact, even for block editor-based post types you'd
need to hook into `bulk_post_updated_messages`
[https://developer.wordpress.org/reference/hooks/bulk_post_updated_messages/]
to customize the notices in the post list (so you have `1 car moved to the
Trash` instead of `1 post moved to the Trash`).
My proposal then is to `close` instead of leaving this pending while there
is already a documented way to achieve the intended result.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50438#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list