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
This commit is contained in:
parent
a15ff7d800
commit
99ec80b140
@ -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':
|
||||
|
Loading…
Reference in New Issue
Block a user