Filter hook 'update_plugins_{$hostname}'

in WP Core File wp-includes/update.php at line 524

View Source

update_plugins_{$hostname}

Filter Hook
Description
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. specified in the `Update URI` header field. Optional. List of translation updates for the plugin. This is not the version of the language file. Should be a date in the `YYYY-MM-DD HH:MM:SS` format. } }

Hook Information

File Location wp-includes/update.php View on GitHub
Hook Type Filter
Line Number 524

Hook Parameters

Type Name Description
array|false $update { The plugin update data with the latest details. Default false.
array $plugin_data Plugin headers.
string $plugin_file Plugin filename.
string[] $locales Installed locales to look up translations for.

Usage Examples

Basic Usage
<?php
// Hook into update_plugins_{$hostname}
add_filter('update_plugins_{$hostname}', 'my_custom_filter', 10, 4);

function my_custom_filter($update, $plugin_data, $plugin_file, $locales) {
    // Your custom filtering logic here
    return $update;
}

Source Code Context

wp-includes/update.php:524 - How this hook is used in WordPress core
<?php
 519  		 * }
 520  		 * @param array       $plugin_data      Plugin headers.
 521  		 * @param string      $plugin_file      Plugin filename.
 522  		 * @param string[]    $locales          Installed locales to look up translations for.
 523  		 */
 524  		$update = apply_filters( "update_plugins_{$hostname}", false, $plugin_data, $plugin_file, $locales );
 525  
 526  		if ( ! $update ) {
 527  			continue;
 528  		}
 529  

PHP Documentation

<?php
/**
		 * 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.
		 *
		 * @since 5.8.0
		 *
		 * @param array|false $update {
		 *     The plugin update data with the latest details. Default false.
		 *
		 *     @type string   $id           Optional. ID of the plugin for update purposes, should be a URI
		 *                                  specified in the `Update URI` header field.
		 *     @type string   $slug         Slug of the plugin.
		 *     @type string   $version      The version of the plugin.
		 *     @type string   $url          The URL for details of the plugin.
		 *     @type string   $package      Optional. The update ZIP for the plugin.
		 *     @type string   $tested       Optional. The version of WordPress the plugin is tested against.
		 *     @type string   $requires_php Optional. The version of PHP which the plugin requires.
		 *     @type bool     $autoupdate   Optional. Whether the plugin should automatically update.
		 *     @type string[] $icons        Optional. Array of plugin icons.
		 *     @type string[] $banners      Optional. Array of plugin banners.
		 *     @type string[] $banners_rtl  Optional. Array of plugin RTL banners.
		 *     @type array    $translations {
		 *         Optional. List of translation updates for the plugin.
		 *
		 *         @type string $language   The language the translation update is for.
		 *         @type string $version    The version of the plugin this translation is for.
		 *                                  This is not the version of the language file.
		 *         @type string $updated    The update timestamp of the translation file.
		 *                                  Should be a date in the `YYYY-MM-DD HH:MM:SS` format.
		 *         @type string $package    The ZIP location containing the translation update.
		 *         @type string $autoupdate Whether the translation should be automatically installed.
		 *     }
		 * }
		 * @param array       $plugin_data      Plugin headers.
		 * @param string      $plugin_file      Plugin filename.
		 * @param string[]    $locales          Installed locales to look up translations for.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 4
  • File: wp-includes/update.php
Related Hooks

Related hooks will be displayed here in future updates.