WP HOOKS
filtrod 5.1.0

pre_clear_scheduled_hook

Args 4Plik wp-includes/cron.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filter to override clearing a scheduled 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) or false or a WP_Error if unscheduling one or more events fails.

Parametry

ParametrTypOpis
$prenull | int | false | \WP_ErrorValue to return instead. Default null to continue unscheduling the event.
$hookstringAction hook, the execution of which will be unscheduled.
$argsarrayArguments to pass to the hook's callback function.
$wp_errorboolWhether to return a WP_Error on failure.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_clear_scheduled_hook', 'twoja_funkcja', 10, 4 );

function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
	// Twój kod
}

Popularne w tej kategorii