[wp-hackers] wp_update_plugins hook?

Stephen Rider wp-hackers at striderweb.com
Wed Nov 12 23:04:28 GMT 2008


Ooooooooo Shiny.  I forgot you could hook option updates.  Nice idea.

(That's just one of those incredibly underused, incredibly powerful  
aspects of WordPress that makes me love this platform!)

Thanks. :)


On Nov 12, 2008, at 4:27 PM, DD32 wrote:

> Thats how it works AFAIK, Cron fires a action, and the update  
> routines are attached to that action.
> However, The action is only used to fire it from cron, http://trac.wordpress.org/browser/trunk/wp-includes/update.php#L274 
>  as you can see, _maybe_update_plugins() calls it directly too
>
> Your other option is to hook in on the update_option-update_plugins  
> (You'll need to check the names right there) hook as that takes at  
> the end of the update procedure when it saves the new status, If you  
> hook in there (taking note to make sure you dont clobber the new  
> option) then your code will run everytime the update_plugins option  
> is updated, which should only be every time the update notifications  
> change, but wont fire on the _maybe_update_plugins() items if it  
> doesnt need to be updated..
>
>
> On Thu, 13 Nov 2008 09:14:24 +1100, Stephen Rider <wp-hackers at striderweb.com 
> > wrote:
>
>> So, does the scheduling act as a sort of alternate "do_action"?  If I
>> hook my function as...
>>
>> 	add_action( 'wp_update_plugins', 'my_function', 11 );
>>
>> ...does that mean it will run when the scheduled action fires?


More information about the wp-hackers mailing list