gglplsn_shortcode_button_content

The Google +1 by BestWebSoft gglplsn shortcode button content function.

Description

gglplsn_shortcode_button_content( $content ); 

Parameters (1)

0. $content
The content.

Usage

  1. if ( !function_exists( 'gglplsn_shortcode_button_content' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-1-by-bestwebsoft/google-plus-one.php'; 
  3.  
  4. // The content. 
  5. $content = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gglplsn_shortcode_button_content($content); 
  9.  

Defined (1)

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

/google-plus-one.php  
  1. function gglplsn_shortcode_button_content( $content ) { 
  2. global $wp_version, $gglplsn_options; 
  3. if ( empty( $gglplsn_options ) ) 
  4. $gglplsn_options = get_option( 'gglplsn_options' ); ?> 
  5. <div id="gglplsn" style="display:none;"> 
  6. <fieldset> 
  7. <?php _e( 'Add Google Buttons to your page or post', 'google-one' ); ?> 
  8. <br /> 
  9. <label> 
  10. <input type="checkbox" name="gglplsn_selected_plusone" value="plusone" checked="checked" /> 
  11. <?php _e( 'Google +1', 'google-one' ) ?> 
  12. </label> 
  13. <br /> 
  14. <label> 
  15. <input type="checkbox" name="gglplsn_selected_share" value="share" /> 
  16. <?php _e( 'Share', 'google-one' ) ?> 
  17. </label> 
  18. <br /> 
  19. <label> 
  20. <input type="checkbox" name="gglplsn_selected_follow" value="follow" /> 
  21. <?php _e( 'Follow', 'google-one' ); ?> 
  22. <?php if ( empty( $gglplsn_options['follow_id'] ) ) { ?> 
  23. <span class="bws_info"> 
  24. (<?php _e( 'To see this button, please', 'google-one' ); ?> 
  25. <a style="color: #0073aa;" href="admin.php?page=google-plus-one.php"><?php _e( 'enter', 'google-one' ) ?></a> 
  26. <?php _e( 'the Google+ ID', 'google-one' ); ?>) 
  27. </span> 
  28. <?php } ?> 
  29. </label> 
  30. <br /> 
  31. <label> 
  32. <input type="checkbox" name="gglplsn_selected_hangout" value="hangout" /> 
  33. <?php _e( 'Hangout', 'google-one' ) ?> 
  34. </label> 
  35. <br /> 
  36. <label> 
  37. <input type="checkbox" name="gglplsn_selected_badge" value="badge" /> 
  38. <?php _e( 'Badge', 'google-one' ); ?> 
  39. <?php if ( empty( $gglplsn_options['badge_id'] ) ) { ?> 
  40. <span class="bws_info"> 
  41. (<?php _e( 'To see this button, please', 'google-one' ); ?> 
  42. <a style="color: #0073aa;" href="admin.php?page=google-plus-one.php"><?php _e( 'enter', 'google-one' ) ?></a> 
  43. <?php _e( 'the Google+ ID', 'google-one' ); ?>) 
  44. </span> 
  45. <?php } ?> 
  46. </label> 
  47. <input class="bws_default_shortcode" type="hidden" name="default" value="[bws_googleplusone]" /> 
  48. <div class="clear"></div> 
  49. </fieldset> 
  50. </div> 
  51. <script type="text/javascript"> 
  52. function gglplsn_shortcode_init() { 
  53. ( function( $ ) { 
  54. var current_object = '<?php echo ( $wp_version < 3.9 ) ? "#TB_ajaxContent" : ".mce-reset"; ?>'; 
  55. $( current_object + ' input[name^="gglplsn_selected"]' ).change( function() { 
  56. var result = ''; 
  57. $( current_object + ' input[name^="gglplsn_selected"]' ).each( function() { 
  58. if ( $( this ).is( ':checked' ) ) { 
  59. result += $( this ).val() + ', '; 
  60. } ); 
  61. if ( '' == result ) { 
  62. $( current_object + ' #bws_shortcode_display' ).text( '' ); 
  63. } else { 
  64. result = result.slice( 0, - 1 ); 
  65. $( current_object + ' #bws_shortcode_display' ).text( '[bws_googleplusone display="' + result + '"]' ); 
  66. } ); 
  67. } ) ( jQuery ); 
  68. </script> 
  69. <?php }