Created
March 16, 2019 10:08
-
-
Save maxyudin/4da5b721c6c5300b865096f3b6f91d56 to your computer and use it in GitHub Desktop.
[WordPress] Add custom taxonomy term editing messages
This file contains hidden or 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
/** | |
* 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