Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save maxyudin/4da5b721c6c5300b865096f3b6f91d56 to your computer and use it in GitHub Desktop.
Save maxyudin/4da5b721c6c5300b865096f3b6f91d56 to your computer and use it in GitHub Desktop.
[WordPress] Add custom taxonomy term editing messages
/**
* See wp-admin/includes/edit-tag-messages.php
*/
add_filter( 'term_updated_messages', 'my_term_updated_messages' );
function my_term_updated_messages( $messages ) {
// $messages['MY_TAXONOMY']
$messages['movie_genre'] = array(
0 => '', // 0 = unused. Messages start at index 1.
1 => __( 'Movie Genre added.' ),
2 => __( 'Movie Genre deleted.' ),
3 => __( 'Movie Genre updated.' ),
4 => __( 'Movie Genre not added.' ),
5 => __( 'Movie Genre not updated.' ),
6 => __( 'Movie Genres deleted.' ),
7 => 'Test Message' // custom message to use, e.g., in add_query_arg() for wp_redirect()
);
return $messages;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment