From 57e69d4a3f7fc151cbc7e04e3f78a790a5e92943 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Tue, 13 Oct 2015 18:58:25 +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. Built from https://develop.svn.wordpress.org/trunk@35144 git-svn-id: http://core.svn.wordpress.org/trunk@35110 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-upgrader.php | 12 ++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index b6b4573413..fe5413d442 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/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': diff --git a/wp-includes/version.php b/wp-includes/version.php index 9c3b59e20a..181b0143c3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-35143'; +$wp_version = '4.4-alpha-35144'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.