WP HOOKS
filtrod 4.2.0

pre_get_avatar_data

Args 2Plik wp-includes/link-template.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters whether to retrieve the avatar URL early.

Passing a non-null value in the 'url' member of the return array will effectively short circuit get_avatar_data(), passing the value through the {@see 'get_avatar_data'} filter and returning early.

Parametry

ParametrTypOpis
$argsarrayArguments passed to get_avatar_data(), after processing.
$id_or_emailmixedThe avatar to retrieve. Accepts a user ID, Gravatar SHA-256 or MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.

Wywołanie

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

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

Popularne w tej kategorii