From 99ec80b140433ae04e3b1879525aa0ac9ef66058 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Tue, 13 Oct 2015 18:58:00 +0000 Subject: [PATCH] Upgrader: Introduce a new action hook `pre_auto_update`, which fires immediately prior to an auto-update for core, themes, plugins, or translations. Props DavidAnderson, welcher. Fixes #30441. git-svn-id: https://develop.svn.wordpress.org/trunk@35144 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-upgrader.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/wp-admin/includes/class-wp-upgrader.php b/src/wp-admin/includes/class-wp-upgrader.php index b6b4573413..fe5413d442 100644 --- a/src/wp-admin/includes/class-wp-upgrader.php +++ b/src/wp-admin/includes/class-wp-upgrader.php @@ -2854,6 +2854,18 @@ class WP_Automatic_Updater { if ( ! $this->should_update( $type, $item, $context ) ) return false; + /** + * Fires immediately prior to an auto-update. + * + * @since 4.4.0 + * + * @param string $type The type of update being checked: 'core', 'theme', 'plugin', or 'translation'. + * @param object $item The update offer. + * @param string $context The filesystem context (a path) against which filesystem access and status + * should be checked. + */ + do_action( 'pre_auto_update', $type, $item, $context ); + $upgrader_item = $item; switch ( $type ) { case 'core':