Should I use add_filter for functions in function.php of the theme?

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

Related posts

Leave a Reply

1 comment

  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