WP HOOKS
filtrod 4.6.0

pre_get_blogs_of_user

Args 3Plik wp-includes/user.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the list of a user's sites before it is populated.

Returning a non-null value from the filter will effectively short circuit get_blogs_of_user(), returning that value instead.

Parametry

ParametrTypOpis
$sitesnull | object[]An array of site objects of which the user is a member.
$user_idintUser ID.
$allboolWhether the returned array should contain all sites, including those marked 'deleted', 'archived', or 'spam'. Default false.

Wywołanie

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

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

Popularne w tej kategorii