grofiles_attach_cards

Loads Gravatar Hovercard script.

Description

grofiles_attach_cards(); 

Usage

  1. if ( !function_exists( 'grofiles_attach_cards' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/gravatar-hovercards.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = grofiles_attach_cards(); 
  7.  

Defined (1)

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

/modules/gravatar-hovercards.php  
  1. function grofiles_attach_cards() { 
  2. global $blog_id; 
  3.  
  4. // Is the display of Avatars disabled? 
  5. if ( ! get_option( 'show_avatars' ) ) { 
  6. return; 
  7.  
  8. // Is the display of Gravatar Hovercards disabled? 
  9. if ( 'disabled' == get_option( 'gravatar_disable_hovercards' ) ) { 
  10. return; 
  11.  
  12. wp_enqueue_script( 'grofiles-cards', ( is_ssl() ? 'https://secure' : 'http://s' ) . '.gravatar.com/js/gprofiles.js', array( 'jquery' ), GROFILES__CACHE_BUSTER, true ); 
  13. wp_enqueue_script( 'wpgroho', plugins_url( 'wpgroho.js', __FILE__ ), array( 'grofiles-cards' ), false, true ); 
  14. if ( is_user_logged_in() ) { 
  15. $cu = wp_get_current_user(); 
  16. $my_hash = md5( $cu->user_email ); 
  17. } else if ( !empty( $_COOKIE['comment_author_email_' . COOKIEHASH] ) ) { 
  18. $my_hash = md5( $_COOKIE['comment_author_email_' . COOKIEHASH] ); 
  19. } else { 
  20. $my_hash = ''; 
  21. wp_localize_script( 'wpgroho', 'WPGroHo', compact( 'my_hash' ) );