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

  • @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

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...

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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