This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
post_updated_messages filter
Filters the post updated messages.
apply_filters( 'post_updated_messages', array[] $messages )
Description
This is filter hook , its filter the post updated messages.
Its consists of one parameter, that is array of $messages.
Parameters
- $messages : (array[]) Post updated messages. For defaults see $messages declarations above.
Live Example
To run the hook, copy the example below.
$array = apply_filters( 'post_updated_messages', $array ); if ( !empty( $array ) ) { // everything has led up to this point... }
The following example is for adding a hook callback.
// define the post_updated_messages callback function filter_post_updated_messages( $array ) { // make filter magic happen here... return $array; }; // add the filter add_filter( 'post_updated_messages', 'filter_post_updated_messages', 10, 1 );
To remove a hook callback, use the example below.
// remove the filter remove_filter( 'post_updated_messages', 'filter_post_updated_messages', 10, 1 );
$messages['post'] = array( 0 => '', // Unused. Messages start at index 1. 1 => __( 'Post updated.' ) . $view_post_link_html, 2 => __( 'Custom field updated.' ), 3 => __( 'Custom field deleted.' ), 4 => __( 'Post updated.' ), /* translators: %s: date and time of the revision */ 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Post restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 6 => __( 'Post published.' ) . $view_post_link_html, 7 => __( 'Post saved.' ), . '</strong>' ) . $scheduled_post_link_html, ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, . '</strong>' ) . $scheduled_page_link_html, ) ); // Hack, for now.
Explore the latest in WordPress
Trying to stay on top of it all? Get the best tools, resources and inspiration sent to your inbox every Wednesday.