Action hook 'pre_auto_update'

in WP Core File wp-admin/includes/class-wp-automatic-updater.php at line 401

View Source

pre_auto_update

Action Hook
Description
Fires immediately prior to an auto-update.

Hook Information

File Location wp-admin/includes/class-wp-automatic-updater.php View on GitHub
Hook Type Action
Line Number 401

Hook Parameters

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

Usage Examples

Basic Usage
<?php
// Hook into pre_auto_update
add_action('pre_auto_update', 'my_custom_function', 10, 3);

function my_custom_function($type, $item, $context) {
    // Your custom code here
}

Source Code Context

wp-admin/includes/class-wp-automatic-updater.php:401 - How this hook is used in WordPress core
<?php
 396  		 * @param string $type    The type of update being checked: 'core', 'theme', 'plugin', or 'translation'.
 397  		 * @param object $item    The update offer.
 398  		 * @param string $context The filesystem context (a path) against which filesystem access and status
 399  		 *                        should be checked.
 400  		 */
 401  		do_action( 'pre_auto_update', $type, $item, $context );
 402  
 403  		$upgrader_item = $item;
 404  		switch ( $type ) {
 405  			case 'core':
 406  				/* translators: %s: WordPress version. */

PHP Documentation

<?php
/**
		 * 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.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 3
  • File: wp-admin/includes/class-wp-automatic-updater.php
Related Hooks

Related hooks will be displayed here in future updates.