WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

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

Considering how often functions.php is called, shouldn't all of its contents be hooked or filtered into core WP functions like init?

share|improve this question
@trnsfrmr - Can you clarify your question? I'm not really clear what you are asking. As opposed to what? What are you trying to avoid? I ask because I'd like to retitle this question so that it is clearly to whomever sees it what you are asking. – MikeSchinkel Oct 24 '10 at 3:10
What do you think the title should be? – jnthnclrk Oct 25 '10 at 19:36
up vote 4 down vote accepted

It can be used for much about anything that requires php...

You'd only use hooks if you don't want to execute the php logic immediately. This is usually the case, but not always.

Likewise, you'd typically use the WP API. But not always either...

share|improve this answer
If code is not hooked or filtered, then isn't it constantly re-writing over itself? Isn't that inefficient in some way? – jnthnclrk Oct 22 '10 at 11:48
All of the code is processed and compiled on every run (except when opcode caching is used), that is normal way to operate for PHP. Amount of code in functions.php is usually insignificant in comparison to whole WP engine. – Rarst Oct 22 '10 at 12:17
OK, I'll stop worrying about it then. – jnthnclrk Oct 22 '10 at 12:32

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.