WP HOOKS
filtrod 4.6.0

enable_maintenance_mode

Args 2Plik wp-includes/load.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters whether to enable maintenance mode.

This filter runs before it can be used by plugins. It is designed for non-web runtimes. If this filter returns true, maintenance mode will be active and the request will end. If false, the request will be allowed to continue processing even if maintenance mode should be active.

Parametry

ParametrTypOpis
$enable_checksboolWhether to enable maintenance mode. Default true.
$upgradingintThe timestamp set in the .maintenance file.

Wywołanie

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

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

Popularne w tej kategorii