[wp-hackers] Plugin Update

Brian Krausz brian at nerdlife.net
Fri Jan 30 05:37:01 GMT 2009


static function variable?:

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

--Brian

On Thu, Jan 29, 2009 at 10:18 PM, Stephen Rider
<wp-hackers at striderweb.com>wrote:

>
> On Jan 26, 2009, at 8:33 AM, Otto wrote:
>
>  Auto update and integrating with WP is easy if you know where to look/hook
>>>> :)
>>>>
>>>
>>>
>> The update_plugins option is actually
>> updated twice. Once for the current time update, and once at the end
>> of the function. You need to be able to ignore the first call and only
>> trigger on the second call to your function.
>>
>
> I could probably figure it out, but do you have a good way to do that (that
> you might share?)  :-)
>
> Stephen
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list