I'm running an add_filter function on the_content and I need to run the same function on the category description.
Does something like that exist or do I need to create a custom function for it?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communitySure, hook it right onto category_description
.
Here's an example:
function category_desc_filter( $desc, $cat_id ) {
$desc = 'Description: ' . $desc;
return $desc;
}
add_filter( 'category_description', 'category_desc_filter' );
Didn't test it but based on the Codex it should work.
See the Codex for more info: http://codex.wordpress.org/Plugin_API/Filter_Reference#Category_and_Term_Filters