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 have written few functions in the function.php file of the theme. Should I use add_filter function for those functions?

share|improve this question
1  
Please can you give more details? –  sorich87 Jun 18 '12 at 14:04
add comment

1 Answer

up vote 1 down vote accepted

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

share|improve this answer
add comment

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.