Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer
    
+1 Thanks Jared, checking it now. –  N2Mystic Jan 23 '12 at 5:32
    
@N2Mystic No problem, if it works don't forget to accept my answer. :) –  Jared Jan 23 '12 at 6:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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