filtrod 4.2.0
pre_get_avatar
Opis — z kodu źródłowego
Allows the HTML for a user's avatar to be returned early.
Returning a non-null value will effectively short-circuit get_avatar(), passing the value through the {@see 'get_avatar'} filter and returning early.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$avatar | string | null | HTML for the user's avatar. Default null. |
$id_or_email | mixed | The avatar to retrieve. Accepts a user ID, Gravatar MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object. |
$args | array | Arguments passed to get_avatar_url(), after processing. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_get_avatar', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_get_avatar', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii