upgrader_source_selection WordPress Filter Hook
The upgrader_source_selection hook is called when the upgrader is about to select a source from which to upgrade a plugin or theme. It allows for the selection of a new source to be overridden. This hook is useful for overriding the default behavior of the WordPress upgrader, which is to select the first available update source. For example, if you have a plugin that is available from multiple sources, you can use this hook to specify which source should be used for the update.
apply_filters( 'upgrader_source_selection', string $source , string $remote_source , WP_Upgrader $upgrader , array $hook_extra ) #
Filters the source file location for the upgrade package.
Parameters
- $source
(string)File source location.
- $remote_source
(string)Remote file source location.
- $upgrader
(WP_Upgrader)WP_Upgrader instance.
- $hook_extra
(array)Extra arguments passed to hooked filters.
Source
Changelog
Version | Description |
---|---|
4.4.0 | The $hook_extra parameter became available. |
2.8.0 | Introduced. |