pre_auto_update
Fires immediately prior to an auto-update.
Description
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.
- // run the action
- do_action( 'pre_auto_update', $type, $item, $context );
- The following example is for adding a hook callback.
- // define the pre_auto_update callback
- function action_pre_auto_update( $type, $item, $context ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'pre_auto_update', 'action_pre_auto_update', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the action
- 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
- do_action( 'pre_auto_update', $type, $item, $context );