0

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?

1

Sure, 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.