I am trying to make a custom message instead of the default message when i save a post, does anybody know how to do it!
Leave a Reply
You must be logged in to post a comment.
I am trying to make a custom message instead of the default message when i save a post, does anybody know how to do it!
You must be logged in to post a comment.
http://codex.wordpress.org/Function_Reference/register_post_type
example:
Message Storage
The
'message'
part of the$_GET
array is what is responsible for holding the actual message value asinteger
. This means that everything that gets passed in there, will be set as actual message. The messages itself are stored inside a global array in the Admin UI templates. It’s named$messages
and has three keys per default:page
post
attachment
The messages are stored as sub-arrays of the main
$messages
array.Notes:
Some things to keep in mind (WP core v4.0.1):
0
is not in use.attachment
messages currently are a hack and just have the string'Media attachment updated.'
on every key.How to add custom messages
Use the
post_updated_messages
filter:Look at
~/wp-admin/edit-form-advanced.php
for which message is used for what.Custom Post Types
You can safely add your own set of messages via a callback on the bespoken filter. Just make sure that you use your custom post types name as key for the messages array:
The callback itself probably is best hooked on
Thought this might help some.
After going through length and breadth of various sites I could only get a custom message displayed with help from this.
https://onextrapixel.com/10-tips-for-a-deeply-customised-wordpress-admin-area/