WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Action Reference/pre category description

Description

The pre_category_description action is used to hook into code before a a category description is updated in the database.

A plugin (or theme) can register an action hook from the example below.

Parameters

$description
(string) (required) contents of the description
Default: None

Examples

functions.php

<?php 
add_action( 'pre_category_description', 'do_something_before_update', 10, 2 ); 

function do_something_before_update( $description) {
    // do something with the description before it's saved here
    // the returned description is what's being saved to the database
    return $description;  
}
?>

See Also