gglplsn_return_button

The Google +1 by BestWebSoft gglplsn return button function.

Description

gglplsn_return_button( $request, $options ); 

Parameters (2)

0. $request
The request.
1. $options
The options.

Usage

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

Defined (1)

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

/google-plus-one.php  
  1. function gglplsn_return_button( $request, $options ) { 
  2. extract( $options ); 
  3. if ( 'plusone' == $request ) { 
  4. switch( $plus_one_size ) { 
  5. case 'standard' : 
  6. $plus_one_width = ( 'standard' == $plus_one_annotation_type ) ? 189 : 139; 
  7. break; 
  8. case 'small' : 
  9. $plus_one_width = ( 'standard' == $plus_one_annotation_type ) ? 185 : 129; 
  10. break; 
  11. case 'medium' : 
  12. $plus_one_width = ( 'standard' == $plus_one_annotation_type ) ? 183 : 133; 
  13. break; 
  14. case 'tall' : 
  15. $plus_one_width = ( 'standard' == $plus_one_annotation_type ) ? 201 : 151; 
  16. break; 
  17.  
  18. $plus_one = '<span class="gglplsn_plus_one"><g:plusone 
  19. size="' . $plus_one_size . '" 
  20. '. ( ( 'inline' == $plus_one_annotation ) ? 'width="' . $plus_one_width . '"' : "" ) . 
  21. 'annotation="' . $plus_one_annotation . '" 
  22. callback="on" 
  23. href="' . get_permalink() . '"></g:plusone></span>'; 
  24. return $plus_one; 
  25.  
  26. if ( 'share' == $request ) { 
  27. switch( $share_size ) { 
  28. case 20 : 
  29. $share_width = ( 'standard' == $share_annotation_type ) ? 200 : 150; 
  30. break; 
  31. case 15 : 
  32. $share_width = ( 'standard' == $share_annotation_type ) ? 205 : 140; 
  33. break; 
  34. case 24 : 
  35. $share_width = ( 'standard' == $share_annotation_type ) ? 206 : 150; 
  36. break; 
  37.  
  38. $share = '<span class="gglplsn_share"><g:plus action="share" 
  39. href="'. get_permalink() . '" 
  40. '. ( ( 'vertical-bubble' != $share_annotation ) ? 'height="' . $share_size . '"' : "" ) . ' 
  41. annotation="' . $share_annotation .'" 
  42. '. ( ( 'inline' == $share_annotation ) ? 'width="' . $share_width . '"' : "" ) . '> </span></span>'; 
  43. return $share; 
  44.  
  45. if ( 'follow' == $request ) { 
  46. $follow_id = sanitize_text_field( $follow_id ); 
  47. if ( ! empty( $follow_id ) ) { 
  48. $href = 'https://plus.google.com/' . $follow_id; 
  49. $follow = '<span class="gglplsn_follow"><g:follow 
  50. href="' . esc_url( $href ) . '" 
  51. height="' . intval( $follow_size ) . '" 
  52. annotation="' . $follow_annotation .'" 
  53. rel="' . $follow_relationship . '"></g:follow></span>'; 
  54. return $follow; 
  55. } else { 
  56. return ''; 
  57.  
  58. if ( 'hangout' == $request ) { 
  59. $hangout_topic_string = ( 1 == $hangout_topic_title ) ? get_the_title() : sanitize_text_field( $hangout_topic ); 
  60. $hangout_invite = ""; 
  61. if ( ! empty( $hangout_invite_type ) ) { 
  62. foreach( $hangout_invite_type as $key => $value ) { 
  63. $hangout_invite .= "{ id : '" . $hangout_invite_id[ $key ] . "', invite_type : '" . sanitize_text_field( $value ) . "' }, "; 
  64. if ( 'standard' != $hangout_size ) { 
  65. $hangout_width = ( 'narrow' == $hangout_size ) ? 72 : 175; 
  66.  
  67. $hangout = '<span class="gglplsn_hangout"><g:hangout 
  68. render="createhangout" 
  69. topic="' . $hangout_topic_string . '" 
  70. hangout_type="' . $hangout_type . '" 
  71. '. ( ( 'standard' != $hangout_size ) ? 'widget_size="' . $hangout_width . '"' : "" ) . ' 
  72. invites="[' . $hangout_invite . ']"></g:hangout></span>'; 
  73. return $hangout; 
  74.  
  75. if ( 'badge' == $request ) { 
  76. $badge_id = esc_html( $badge_id ); 
  77. if ( ! empty( $badge_id ) ) { 
  78. $href = 'https://plus.google.com/' . ( 'community' == $badge_type ? 'communities/': '' ) . $badge_id; 
  79. $photo = ( ( 'community' != $badge_type ) ? 'showcoverphoto="' : 'showphoto="' ) . $badge_show_cover . '"'; 
  80. $badge_width = intval( $badge_width ); 
  81. if ( $badge_width < 180 && 'portrait' == $badge_layout ) { 
  82. $badge_width = 180; 
  83. } elseif ( $badge_width < 273 && 'landscape' == $badge_layout ) { 
  84. $badge_width = 273; 
  85. } elseif ( $badge_width > 450 ) { 
  86. $badge_width = 450; 
  87.  
  88. $badge = '<p class="gglplsn_badge"><g:' . $badge_type . ' 
  89. href="' . esc_url( $href ) . '" 
  90. layout="' . $badge_layout . '" 
  91. width="' . $badge_width . '" 
  92. theme="' . $badge_theme . '" 
  93. ' . $photo . ' 
  94. showowners="' . $badge_show_owners . '" 
  95. showtagline="' . $badge_show_tagline . '"></g:' . $badge_type . '></p>'; 
  96. return $badge; 
  97. } else { 
  98. return '';