filtrod 5.1.0
pre_unschedule_event
Opis — z kodu źródłowego
Filter to override unscheduling of events.
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 true if the event was successfully unscheduled, false or a WP_Error if not.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$pre | null | bool | \WP_Error | Value to return instead. Default null to continue unscheduling the event. |
$timestamp | int | Unix timestamp (UTC) for when to run the event. |
$hook | string | Action hook, the execution of which will be unscheduled. |
$args | array | Arguments to pass to the hook's callback function. |
$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_event', 'twoja_funkcja', 10, 5 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4, $param_5) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_unschedule_event', 'twoja_funkcja', 10, 5 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4, $param_5) {
// Twój kod
}Popularne w tej kategorii