WP HOOKS
filtrod 5.1.0

pre_get_scheduled_event

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

Opis — z kodu źródłowego

Filter to override retrieving a scheduled event.

Returning a non-null value will short-circuit the normal process, returning the filtered value instead. Return false if the event does not exist, otherwise an event object should be returned.

Parametry

ParametrTypOpis
$prenull | false | objectValue to return instead. Default null to continue retrieving the event.
$hookstringAction hook of the event.
$argsarrayArray containing each separate argument to pass to the hook's callback function. Although not passed to a callback, these arguments are used to uniquely identify the event.
$timestampint | nullUnix timestamp (UTC) of the event. Null to retrieve next scheduled event.

Wywołanie

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

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

Popularne w tej kategorii