WordPress at a glance
filter is not described

upgrader_pre_install filter-hook . WP 2.8.0

Filters the install response before the installation has started.

Returning a truthy value, or one that could be evaluated as a WP_Error will effectively short-circuit the installation, returning that value instead.

Usage

add_filter( 'upgrader_pre_install', 'filter_function_name_9100', 10, 2 );
function filter_function_name_9100( $response, $hook_extra ){
	// filter...

	return $response;
}
$response(true/false/WP_Error)
Response.
$hook_extra(array)
Extra arguments passed to hooked filters.

Changelog

Since 2.8.0 Introduced.

Where the hook is called

WP_Upgrader::install_package()
upgrader_pre_install
wp-admin/includes/class-wp-upgrader.php 487
$res = apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] );

Where in WP core the hook is used

wp-admin/includes/class-plugin-upgrader.php 169
add_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ), 10, 2 );
wp-admin/includes/class-plugin-upgrader.php 170
add_filter( 'upgrader_pre_install', array( $this, 'active_before' ), 10, 2 );
wp-admin/includes/class-plugin-upgrader.php 196
remove_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ) );
wp-admin/includes/class-plugin-upgrader.php 197
remove_filter( 'upgrader_pre_install', array( $this, 'active_before' ) );
wp-admin/includes/class-theme-upgrader.php 283
add_filter( 'upgrader_pre_install', array( $this, 'current_before' ), 10, 2 );
wp-admin/includes/class-theme-upgrader.php 306
remove_filter( 'upgrader_pre_install', array( $this, 'current_before' ) );
wp-admin/includes/class-theme-upgrader.php 347
add_filter( 'upgrader_pre_install', array( $this, 'current_before' ), 10, 2 );
wp-admin/includes/class-theme-upgrader.php 440
remove_filter( 'upgrader_pre_install', array( $this, 'current_before' ) );