#32532 closed enhancement (wontfix)
Add admin notification message text to array of labels when registering a custom post type
| Reported by: | nathanrice | Owned by: | johnbillion |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Posts, Post Types | Version: | 4.3 |
| Severity: | normal | Keywords: | needs-patch bulk-reopened |
| Cc: | Focuses: |
Description
#14827 tried to cover this, but it ended up being reduced down to a mere public check.
The initial complain still stands, though. The $messages array only handles posts, pages, and media. As it is now, you can register a CPT, change all the labels to make sure nothing references "Post(s)" and think you're good to go. Then you go to save an entry, and you get an ugly "Post Updated. View post" message. Not at all what you would expect.
If you want to change the messages for a CPT, you have to filter the array and inject them. Not terribly difficult, but it's a completely unnecessary step that really should be handled in the same way the labels are handled.
I have a rough solution in place for a plugin I manage. It's not perfect, but it's a good example of a possible way it could be handled.
https://github.com/copyblogger/simple-urls/blob/develop/plugin.php#L112
I'm giving a tentative +1 to this. It should handle both
post_updated_messagesandbulk_post_updated_messages, and we should do the same for taxonomies too.My Extended CPTs and Extended Taxos libraries demonstrate what the formatted strings should probably look like.
See also #17609.