filtrdynamicznyod 3.7.0
auto_update_{$type}
Args 2Plik wp-admin/includes/class-wp-automatic-updater.php
Opis — z kodu źródłowego
Filters whether to automatically update core, a plugin, a theme, or a language.
The dynamic portion of the hook name, $type, refers to the type of update being checked.
Possible hook names include:
auto_update_coreauto_update_pluginauto_update_themeauto_update_translationSince WordPress 3.7, minor and development versions of core, and translations have been auto-updated by default. New installs on WordPress 5.6 or higher will also auto-update major versions by default. Starting in 5.6, older sites can opt-in to major version auto-updates, and auto-updates for plugins and themes. See the {@see 'allow_dev_auto_core_updates'}, {@see 'allow_minor_auto_core_updates'}, and {@see 'allow_major_auto_core_updates'} filters for a more straightforward way to adjust core updates.
Hook dynamiczny — możliwe nazwy
auto_update_coreauto_update_pluginauto_update_themeauto_update_translationParametry
| Parametr | Typ | Opis |
|---|---|---|
$update | bool | null | Whether to update. The value of null is internally used to detect whether nothing has hooked into this filter. |
$item | object | The update offer. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'auto_update_{$type}', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'auto_update_{$type}', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}Popularne w tej kategorii