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.

New to wordpress here. The concept of actions/filters in and of itself is not too difficult to grasp. What I am overwhelmed by is the HUGE amount of actions and filters available. When I am looking at tutorials/guides, they say "simply add this function to the wp_head action or after_setup_theme". Without these tutorials, how on earth would i know to hook that function to that action?

As a beginner, how the heck would i know what is the appropriate action to hook on to? Any advice on how to navigate this? Thanks

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Take a look at Mike's answer to a similar question more specifically the plugin he posted there can be used to create a list of all action hooks and filters that were called to generate that page in order of execution.

share|improve this answer

The best way to learn the most important filters is to read the source code. Whenever you want to change the output of a function read its source. Then you’ll either find the hook in this function or in another function called by the first. In some cases there is no hook and you have to hack … but that’s the next level.

There are some tools to inspect hooks, and you will write your own probably sooner or later. But nothing beats reading the source.

share|improve this answer

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.