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.


Top ↑

Source

File: wp-admin/includes/class-wp-upgrader.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.4.0The $hook_extra parameter became available.
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.