update_plugins_(hostname)
Filters the update response for a given plugin hostname.
The dynamic portion of the hook name, $hostname, refers to the hostname of the URI specified in the Update URI header field.
Usage
add_filter( 'update_plugins_(hostname)', 'wp_kama_update_plugins_hostname_filter', 10, 4 );
/**
* Function for `update_plugins_(hostname)` filter-hook.
*
* @param array|false $update The plugin update data with the latest details.
* @param array $plugin_data Plugin headers.
* @param string $plugin_file Plugin filename.
* @param string[] $locales Installed locales to look up translations for.
*
* @return array|false
*/
function wp_kama_update_plugins_hostname_filter( $update, $plugin_data, $plugin_file, $locales ){
// filter...
return $update;
}
- $update(array|false)
The plugin update data with the latest details.
Default: false
-
id(string)
Optional. ID of the plugin for update purposes, should be a URI specified in theUpdate URIheader field. -
slug(string)
Slug of the plugin. -
version(string)
The version of the plugin. -
url(string)
The URL for details of the plugin. -
package(string)
Optional. The update ZIP for the plugin. -
tested(string)
Optional. The version of WordPress the plugin is tested against. -
requires_php(string)
Optional. The version of PHP which the plugin requires. -
autoupdate(true|false)
Optional. Whether the plugin should automatically update. -
icons(string[])
Optional. Array of plugin icons. -
banners(string[])
Optional. Array of plugin banners. -
banners_rtl(string[])
Optional. Array of plugin RTL banners. -
translations(array)
Optional. List of translation updates for the plugin.-
language(string)
The language the translation update is for. -
version(string)
The version of the plugin this translation is for. This is not the version of the language file. -
updated(string)
The update timestamp of the translation file. Should be a date in theYYYY-MM-DD HH:MM:SSformat. -
package(string)
The ZIP location containing the translation update. - autoupdate(string)
Whether the translation should be automatically installed.
-
-
- $plugin_data(array)
- Plugin headers.
- $plugin_file(string)
- Plugin filename.
- $locales(string[])
- Installed locales to look up translations for.
Changelog
| Since 5.8.0 | Introduced. |
Where the hook is called
$update = apply_filters( "update_plugins_{$hostname}", false, $plugin_data, $plugin_file, $locales );