grofiles_setting_callback

HTML for Gravatar Hovercard setting.

Description

grofiles_setting_callback(); 

Usage

  1. if ( !function_exists( 'grofiles_setting_callback' ) ) { 
  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_setting_callback(); 
  7.  

Defined (1)

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

/modules/gravatar-hovercards.php  
  1. function grofiles_setting_callback() { 
  2. global $current_user; 
  3.  
  4. $checked = 'disabled' == get_option( 'gravatar_disable_hovercards' ) ? '' : 'checked="checked" '; 
  5.  
  6. echo "<label id='gravatar-hovercard-options'><input {$checked}name='gravatar_disable_hovercards' id='gravatar_disable_hovercards' type='checkbox' value='enabled' class='code' /> " . __( "View people's profiles when you mouse over their Gravatars", jetpack ) . "</label>"; 
  7. ?> 
  8. <style type="text/css"> 
  9. #grav-profile-example img { 
  10. float: left; 
  11. #grav-profile-example span { 
  12. padding: 0 1em; 
  13. </style> 
  14. <script type="text/javascript"> 
  15. // <![CDATA[ 
  16. jQuery( function($) { 
  17. var tr = $( '#gravatar_disable_hovercards' ).change( function() { 
  18. if ( $( this ).is( ':checked' ) ) { 
  19. $( '#grav-profile-example' ).slideDown( 'fast' ); 
  20. } else { 
  21. $( '#grav-profile-example' ).slideUp( 'fast' ); 
  22. } ).parents( 'tr' ); 
  23. var ftr = tr.parents( 'table' ).find( 'tr:first' ); 
  24. if ( ftr.size() && !ftr.find( '#gravatar_disable_hovercards' ).size() ) { 
  25. ftr.after( tr ); 
  26. } ); 
  27. // ]]> 
  28. </script> 
  29. <p id="grav-profile-example" class="hide-if-no-js"<?php if ( !$checked ) echo ' style="display:none"'; ?>><?php echo get_avatar( $current_user->ID, 64 ); ?> <span><?php _e( 'Put your mouse over your Gravatar to check out your profile.', jetpack ); ?> <br class="clear" /></span></p> 
  30. <?php