[WORDPRESS] [Funzione] get_avatar()

get_avatar() (funzione WordPress) restituisce l’immagine di un avatar.

tips&tricks

Sintassi

get_avatar($gravatar, $size[facoltativo], $default[facoltativo], $alt[facoltativo], $argomenti[facoltativo])
parametro descrizione
$gravatar Il Gravatar per recuperare l’URL: accetta l’ID dell’utente, l’e-mail utente, gravatar md5 hash, un oggetto WP_User, WP_Post o WP_Comment.
$size Le dimensioni, in pixel, della larghezza ed altezza dell’avatar (default 96)
$default Accetta quale immagine di default ‘404’ (restituisce 404 al posto dell’immagine di default), ‘retro’ (8bit), ‘monsterid’ (monster), ‘wavatar’ (cartoon face), ‘indenticon’ (the “quilt”), ‘mystery’, ‘mm’, or ‘mysteryman’ (The Oyster Man), ‘blank’ (transparent GIF), or ‘gravatar_default’ (the Gravatar logo). Default is the value of the ‘avatar_default’ option, with a fallback of ‘mystery’.
$alt Il testo alternativa (attributo HTML alt) dell’immagine dell’avatar
$argomenti Può avere i seguenti elementi:
‘height’ => accetta un numero intero quale altezza dell’avatar in pixels; default $size
‘weight’ => accetta un numero intero quale larghezza dell’avatar in pixels; default $size
‘force_default’ => accetta un valore booleano: se true, mostra sempre l’immagine predefinita, mai il Gravatar; default false
‘rating’=> accetta una stringa What rating to display avatars up to. Accepts ‘G’, ‘PG’, ‘R’, ‘X’, and are judged in that order. Default is the value of the ‘avatar_rating’ option.
‘scheme’ => accetta una stringa quale schema dell’URL da usare (http, https, ecc.).
‘class’ => (array|string) Array or string of additional classes to add to the element.
‘force_display’ => (bool) Whether to always show the avatar – ignores the show_avatars option. Default false.
‘extra_attr’ => (string) HTML attributes to insert in the IMG element. Is not sanitized. Default empty.

Esempi

get_avatar();
/* RISULTATO
XXX
*/

Contenuti correlati

Fonti esterne

funzioni wordpress, wordpress

Related Articles

0 Comment

Rispondi