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.

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
add comment

1 Answer

up vote 3 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
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.