[wp-hackers] wp_update_plugins hook?

DD32 wordpress at dd32.id.au
Wed Nov 12 22:27:09 GMT 2008


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:

> Hi --
>
> I want to hook a function to the process wherein WP checks plugins for
> updates -- I want my function to run immediately _after_ the standard
> process.
>
> I note that are places in the code that attach functions to a hook
> called "wp_update_plugins", but I can't find a corresponding do_action
> anywhere.  It does seem, however, to be a scheduled item.
>
> 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?  (And
> the 11 should make it run after the standard wp_update_plugins()
> function, yes?)
>
> Normally I would just try the thing, but the nature of scheduled
> actions makes testing more difficult.  Thanks!
>
> Stephen
>
>




More information about the wp-hackers mailing list