I have written few functions in the function.php file of the theme. Should I use add_filter function for those functions?

  • 1
    Please can you give more details?
    – sorich87
    Commented Jun 18, 2012 at 14:04

1 Answer 1


It depends on the things you want to do. you can use add_filter and add_action based on what you want to do.

Actions: Actions are the hooks that the WordPress core launches at specific points during execution, or when specific events occur. Your plugin can specify that one or more of its PHP functions are executed at these points, using the Action API.

Filters: Filters are the hooks that WordPress launches to modify text of various types before adding it to the database or sending it to the browser screen. Your plugin can specify that one or more of its PHP functions is executed to modify specific types of text at these times, using the Filter API.

so if you want to modify the content, you should hook using filter functions. For doing your own stuffs, you need to hook using action functions.

if you have explained your purpose, we could probably tell you what you need to use.

More details here: http://codex.wordpress.org/Plugin_API

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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