[wp-hackers] Plugin Update

Otto otto at ottodestruct.com
Mon Jan 26 14:33:26 GMT 2009


On Mon, Jan 26, 2009 at 7:51 AM, Stephen Rider
<wp-hackers at striderweb.com> wrote:
> On Jan 26, 2009, at 12:14 AM, DD32 wrote:
>
>> Auto update and integrating with WP is easy if you know where to look/hook
>> :)
>
> Cool. Can I see?

The wp_update_plugins function does the update check. At the end, it
calls update_option( 'update_plugins', $new_option ).

Therefore, if you hook a filter to "update_option_update_plugins",
you'll get triggered just after the update check to wp.org has
occurred, and you can do your own check there, and then alter the
$new_option value accordingly.

You have to be careful though. 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.


More information about the wp-hackers mailing list