filtrod 5.1.0
pre_unschedule_hook
Opis — z kodu źródłowego
Filter to override clearing all events attached to the hook.
Returning a non-null value will short-circuit the normal unscheduling process, causing the function to return the filtered value instead.
For plugins replacing wp-cron, return the number of events successfully unscheduled (zero if no events were registered with the hook). If unscheduling one or more events fails then return either a WP_Error object or false depending on the value of the $wp_error parameter.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$pre | null | int | false | \WP_Error | Value to return instead. Default null to continue unscheduling the hook. |
$hook | string | Action hook, the execution of which will be unscheduled. |
$wp_error | bool | Whether to return a WP_Error on failure. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_unschedule_hook', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_unschedule_hook', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii