WP HOOKS
filtrod 4.9.0

pre_get_main_site_id

Args 2Plik wp-includes/class-wp-network.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the main site ID.

Returning a positive integer will effectively short-circuit the function.

Parametry

ParametrTypOpis
$main_site_idint | nullIf a positive integer is returned, it is interpreted as the main site ID.
$network\WP_NetworkThe network object for which the main site was detected.

Wywołanie

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

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

Popularne w tej kategorii