upgrader_pre_download
Filters whether to return the package.
Использование
add_filter( 'upgrader_pre_download', 'wp_kama_upgrader_pre_download_filter', 10, 4 ); /** * Function for `upgrader_pre_download` filter-hook. * * @param bool $reply Whether to bail without returning the package. * @param string $package The package file name. * @param WP_Upgrader $upgrader The WP_Upgrader instance. * @param array $hook_extra Extra arguments passed to hooked filters. * * @return bool */ function wp_kama_upgrader_pre_download_filter( $reply, $package, $upgrader, $hook_extra ){ // filter... return $reply; }
- $reply(true|false)
- Whether to bail without returning the package.
По умолчанию: false - $package(строка)
- The package file name.
- $upgrader(WP_Upgrader)
- The WP_Upgrader instance.
- $hook_extra(массив)
- Extra arguments passed to hooked filters.
Список изменений
С версии 3.7.0 | Введена. |
С версии 5.5.0 | Added the $hook_extra parameter. |
Где вызывается хук
upgrader_pre_download
wp-admin/includes/class-wp-upgrader.php 318
$reply = apply_filters( 'upgrader_pre_download', false, $package, $this, $hook_extra );