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.
Использование
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(массив|false)
The plugin update data with the latest details.
По умолчанию: false
-
id(строка)
Optional. ID of the plugin for update purposes, should be a URI specified in the Update URI header field. -
slug(строка)
Slug of the plugin. -
version(строка)
The version of the plugin. -
url(строка)
The URL for details of the plugin. -
package(строка)
Optional. The update ZIP for the plugin. -
tested(строка)
Optional. The version of WordPress the plugin is tested against. -
requires_php(строка)
Optional. The version of PHP which the plugin requires. -
autoupdate(true|false)
Optional. Whether the plugin should automatically update. -
icons(массив)
Optional. Array of plugin icons. -
banners(массив)
Optional. Array of plugin banners. -
banners_rtl(массив)
Optional. Array of plugin RTL banners. -
translations(массив)
Optional. List of translation updates for the plugin.-
language(строка)
The language the translation update is for. -
version(строка)
The version of the plugin this translation is for. This is not the version of the language file. -
updated(строка)
The update timestamp of the translation file. Should be a date in the YYYY-MM-DD HH:MM:SS format. -
package(строка)
The ZIP location containing the translation update. - autoupdate(строка)
Whether the translation should be automatically installed.
-
-
- $plugin_data(массив)
- Plugin headers.
- $plugin_file(строка)
- Plugin filename.
- $locales(string[])
- Installed locales to look up translations for.
Список изменений
С версии 5.8.0 | Введена. |
Где вызывается хук
$update = apply_filters( "update_plugins_{$hostname}", false, $plugin_data, $plugin_file, $locales );