Created
February 13, 2014 21:41
-
-
Save codescribblr/8984435 to your computer and use it in GitHub Desktop.
custom post type custom update message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//add a custom message to the post message function | |
add_filter('post_updated_messages', 'listing_updated_messages'); | |
function listing_updated_messages( $messages ) { | |
$messages['listing'] = array( | |
0 => '', // Unused. Messages start at index 1. | |
1 => sprintf( __('Listing updated. <a href="%s">View Listing</a>'), esc_url( get_permalink($post_ID) ) ), | |
2 => __('Custom field updated.'), | |
3 => __('Custom field deleted.'), | |
4 => __('Listing updated.'), | |
/* translators: %s: date and time of the revision */ | |
5 => isset($_GET['revision']) ? sprintf( __('Listing restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, | |
6 => sprintf( __('Listing published. <a href="%s">View Listing</a>'), esc_url( get_permalink($post_ID) ) ), | |
7 => __('Listing saved.'), | |
8 => sprintf( __('Listing submitted. <a target="_blank" href="%s">Preview Listing</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ), | |
9 => sprintf( __('Listing scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview Listing</a>'), | |
// translators: Publish box date format, see http://php.net/date | |
date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ), | |
10 => sprintf( __('Listing draft updated. <a target="_blank" href="%s">Preview Listing</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ), | |
); | |
return $messages; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment