The pre_term_description
action is used to hook into code before a term is updated in the database.
A plugin (or theme) can register an action hook from the example below.
<?php
add_action( 'pre_term_description', 'do_something_before_update', 10, 2 );
function do_something_before_update( $description, $taxonomy ) {
switch ( $taxonomy ) {
case 'category':
// the term to be saved is a category description
break;
case 'post_tag':
// the term to be saved is a post tag description
break;
}
// the returned description is what's being saved to the database
return $description;
}
?>