Skip to main content

mbr_avatar

Usage​

This shortcode retrieves a registered gravatar from gravatar.com and displays it.

If a user is not logged in or hasn’t registered their gravatar, the default avatar specified in your WordPress settings is displayed.

Parameters​

ParametersDescription
emailSpecifies the email address of the gravatar to be displayed.
Default: The logged in user’s email address.
Required: no.
sizeSpecifies the desired height and width for the displayed avatar.
Default: As set in ActiveMember360, Settings, Miscellaneous, Default avatar size.
Required: no.
suppress_emptySpecifies whether to display a placebo avatar when the email address does not have an image registered at gravatar.com.
Permitted Values: yes, y, true, t, or 1.
Default: none.
Required: no.

Validity​

This shortcode is evaluated for any type of visitor.

Conditional Branching​

This shortcode does NOT support conditional branching with [ELSE_avatar].

Nesting​

Shortcode nesting within is NOT supported.

Examples​

Display the avatar registered at gravatar.com for the current logged in user's email address. If no avatar is registered the default image specified within WordPress, Settings, Discussion, Default avatar will be displayed. The avatar will be square with the size as specified within ActiveMember360, Settings, Miscellaneous, Default avatar size:

[mbr_avatar]

API​

For direct use in PHP code use the structure as illustrated here:

echo mbr_avatar( array( 'email'=>'john.smith@example.com', 'size'=>96 ) );