pre_auto_update

Fires immediately prior to an auto-update.

Description

do_action( 'pre_auto_update', (string) $type, (object) $item, (string) $context ); 

Parameters (3)

0. $type (string)
The type of update being checked: core,, theme., plugin, or translation.
1. $item (object)
The update offer.
2. $context (string)
The filesystem context (a path) against which filesystem access and status should be checked.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'pre_auto_update', $type, $item, $context ); 
The following example is for adding a hook callback.
  1. // define the pre_auto_update callback 
  2. function action_pre_auto_update( $type, $item, $context ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'pre_auto_update', 'action_pre_auto_update', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'pre_auto_update', 'action_pre_auto_update', 10, 3 ); 

Defined (1)

The action is defined in the following location(s).

/wp-admin/includes/class-wp-automatic-updater.php  
  1. do_action( 'pre_auto_update', $type, $item, $context );