update_themes_(hostname) хук-фильтрWP 6.1.0

Filters the update response for a given theme 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_themes_(hostname)', 'wp_kama_update_themes_hostname_filter', 10, 4 );

/**
 * Function for `update_themes_(hostname)` filter-hook.
 * 
 * @param array|false $update           The theme update data with the latest details.
 * @param array       $theme_data       Theme headers.
 * @param string      $theme_stylesheet Theme stylesheet.
 * @param string[]    $locales          Installed locales to look up translations for.
 *
 * @return array|false
 */
function wp_kama_update_themes_hostname_filter( $update, $theme_data, $theme_stylesheet, $locales ){

	// filter...
	return $update;
}
$update(массив|false)

The theme update data with the latest details.

По умолчанию: false

  • id(строка)
    Optional. ID of the theme for update purposes, should be a URI specified in the Update URI header field.

  • theme(строка)
    Directory name of the theme.

  • version(строка)
    The version of the theme.

  • url(строка)
    The URL for details of the theme.

  • package(строка)
    Optional. The update ZIP for the theme.

  • tested(строка)
    Optional. The version of WordPress the theme is tested against.

  • requires_php(строка)
    Optional. The version of PHP which the theme requires.

  • autoupdate(true|false)
    Optional. Whether the theme should automatically update.

  • translations(массив)
    Optional. List of translation updates for the theme.

    • language(строка)
      The language the translation update is for.

    • version(строка)
      The version of the theme 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.
$theme_data(массив)
Theme headers.
$theme_stylesheet(строка)
Theme stylesheet.
$locales(string[])
Installed locales to look up translations for.

Список изменений

С версии 6.1.0 Введена.

Где вызывается хук

wp_update_themes()
update_themes_(hostname)
wp-includes/update.php 793
$update = apply_filters( "update_themes_{$hostname}", false, $theme_data, $theme_stylesheet, $locales );

Где используется хук в WordPress

Использование не найдено.