WordPress at a glance
filter is not described

upgrader_source_selection filter-hook . WP 2.8.0

Filters the source file location for the upgrade package.

Usage

add_filter( 'upgrader_source_selection', 'filter_function_name_8090', 10, 4 );
function filter_function_name_8090( $source, $remote_source, $this, $hook_extra ){
	// filter...

	return $source;
}
$source(string)
File source location.
$remote_source(string)
Remote file source location.
$this(WP_Upgrader)
WP_Upgrader instance.
$hook_extra(array)
Extra arguments passed to hooked filters.

Notes

  • Since 4.4.0 The $hook_extra parameter became available.

Where the hook is called

WP_Upgrader::install_package()
upgrader_source_selection
wp-admin/includes/class-wp-upgrader.php 502
$source = apply_filters( 'upgrader_source_selection', $source, $remote_source, $this, $args['hook_extra'] );

Where the hook is used (in WP core)

wp-admin/includes/class-language-pack-upgrader.php 195
add_filter( 'upgrader_source_selection', array( $this, 'check_package' ), 10, 2 );
wp-admin/includes/class-language-pack-upgrader.php 289
remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
wp-admin/includes/class-theme-upgrader.php 198
add_filter('upgrader_source_selection', array($this, 'check_package') );
wp-admin/includes/class-theme-upgrader.php 217
remove_filter('upgrader_source_selection', array($this, 'check_package') );
wp-admin/includes/class-plugin-upgrader.php 100
add_filter('upgrader_source_selection', array($this, 'check_package') );
wp-admin/includes/class-plugin-upgrader.php 118
remove_filter('upgrader_source_selection', array($this, 'check_package') );