jetpack_gravatar_shortcode

Get gravatar using the email provided at the specified size.

Description

(bool|string) jetpack_gravatar_shortcode( (array) $atts ); 

Returns (bool|string)

Parameters (1)

0. $atts (array)
Shortcode attributes.

Usage

  1. if ( !function_exists( 'jetpack_gravatar_shortcode' ) ) { 
  2. require_once '/modules/shortcodes/gravatar.php'; 
  3.  
  4. // Shortcode attributes. 
  5. $atts = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = jetpack_gravatar_shortcode($atts); 
  9.  

Defined (1)

The function is defined in the following location(s).

/modules/shortcodes/gravatar.php  
  1. function jetpack_gravatar_shortcode( $atts ) { 
  2. $atts = shortcode_atts( array( 
  3. 'email' => '',  
  4. 'size' => 96,  
  5. ), $atts ); 
  6.  
  7. if ( empty( $atts['email'] ) || ! is_email( $atts['email'] ) ) { 
  8. return false; 
  9.  
  10. $atts['size'] = intval( $atts['size'] ); 
  11. if ( 0 > $atts['size'] ) { 
  12. $atts['size'] = 96; 
  13.  
  14. return get_avatar( $atts['email'], $atts['size'] );