WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm going back through my older WordPress theme and making the functions filterable and also adding the function_exists checks. Is there anything I'm not thinking about that this may cause problems with existing code?

// Dummy function
if ( ! function_exists( 'custom_func' )) {
    function custom_func() {
        $output = "Something Awesome";
        return apply_filters('custom_func', $output);


share|improve this question

I would add prefixes, as a plugin developer may have functions with the same name or filters with the same name, e.g. mytheme_

share|improve this answer
Agreed. (My example wasn't great) I am just wondering of any downsides of adding the apply_filters to every custom function to make the themes more flexible down the road. – hhins Nov 17 '11 at 1:23

Your Answer


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.