title: Wordpress init hook called multiple times
body: <p>I did a fresh installation of wordpress 3.0.4 and attempted to write a simple theme for just the sake of trying. </p>
  
  <p>In functions.php, I created a function called my_setup and hooked it up to init. I noticed that my_setup() is called multiple times and I tried to use a global flag variable to control the execution of the function but to no avail. How do I ensure that my function is only called once?</p>
  
  <pre><code>       &lt;?php
         // global variables
         $setup_run_before = 0;
         ?&gt; 
  
        &lt;?php
  
        function my_setup() {
                global $setup_run_before, $a;
                if($setup_run_before == 0) {
                        $setup_run_before = 1;
  // this section is always called even with global variable.
                }       
        }       
  
  
  
  
  
        ?&gt;
  
        &lt;?php
        add_action('init', 'my_setup');
  
        ?&gt;
  </code></pre>
  
  <p>Regards,
  John Doe</p>