[wp-hackers] Plugin Update

Charles K. Clarkson cclarkson at htcomp.net
Fri Jan 30 06:50:08 GMT 2009


Brian Krausz wrote:

> add_action('update_plugins', 'hook_me_baby');
> function hook_me_baby() {
>     static $run = false;
>     if(!$run) {
>         $run = true;
>         return;
>     }
>     $run = false;
>     //Your code
> }

     I could see myself scratching my head over that in six or eight
months. I do not hold the programmer which inhabited my body six or
eight months ago in very high esteem.

     add_action('update_plugins', 'hook_me_baby');

     function hook_me_baby() {

         static $first_time_called = true;

         if ($first_time_called) {
             $first_time_called = false;
             return;
         }

         // Skipped first time called.

     }


HTH,

Charles Clarkson
-- 
Mobile Home Investor
Free Market Advocate
Programmer

Stephenville, TX
http://www.clarksonenergyhomes.com/wordpress/about/
http://twitter.com/CharlesClarkson
+1 (254) 968-8328


More information about the wp-hackers mailing list