[wp-trac] [WordPress Trac] #32532: Add admin notification message text to array of labels when registering a custom post type
WordPress Trac
noreply at wordpress.org
Fri May 29 20:58:23 UTC 2015
#32532: Add admin notification message text to array of labels when registering a
custom post type
-------------------------------+-----------------------------
Reporter: nathanrice | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------------+-----------------------------
#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
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32532>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list