jetpack_extras_sharing_global_options

Admin Display Functions.

Description

jetpack_extras_sharing_global_options(); 

Usage

  1. if ( !function_exists( 'jetpack_extras_sharing_global_options' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'custom-tweaks-for-jetpack-by-barrycarlyon/modules/sharedaddy/admin.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = jetpack_extras_sharing_global_options(); 
  7.  

Defined (1)

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

/modules/sharedaddy/admin.php  
  1. function jetpack_extras_sharing_global_options() { 
  2. // display options 
  3. $global = get_option( 'jetpack_extras-options', array() ); 
  4. $shows = array_values( get_post_types( array( 'public' => true ) ) ); 
  5. array_unshift( $shows, 'index' ); 
  6.  
  7. foreach ( $shows as $show ) : 
  8. if ( 'index' == $show ) { 
  9. $label = __( 'Front Page, Archive Pages, and Search Results', 'jetpack' ); 
  10. } else { 
  11. $post_type_object = get_post_type_object( $show ); 
  12. $label = $post_type_object->labels->name; 
  13. ?> 
  14. <tr valign="top"> 
  15. <th scope="row"><label><?php echo sprintf(__( 'Button Placement (on %s)', 'jetpack' ), $label); ?></label></th> 
  16. <td> 
  17. <select name="jetpack_extras_placement[<?php echo $show; ?>]"> 
  18. <option value="below"<?php if ( $global['placement'][$show] == 'below' ) echo ' selected="selected"';?>><?php _e( 'Below Content', 'jetpack' ); ?></option> 
  19. <option value="above"<?php if ( $global['placement'][$show] == 'above' ) echo ' selected="selected"';?>><?php _e( 'Above Content', 'jetpack' ); ?></option> 
  20. <option value="both"<?php if ( $global['placement'][$show] == 'both' ) echo ' selected="selected"';?>><?php _e( 'Above and Below Content', 'jetpack' ); ?></option> 
  21. </select> 
  22. </td> 
  23. </tr> 
  24. <?php endforeach; ?> 
  25. <?php 
  26. // twitter options 
  27. ?> 
  28.  
  29. <tr valign="top"> 
  30. <td></td> 
  31. <th scope="row"><label><?php _e('Twitter Options'); ?></label></th> 
  32. </tr> 
  33.  
  34. <tr valign="top"> 
  35. <th scope="row"><label><?php _e('Share WP.me Link on Twitter Instead'); ?></label></th> 
  36. <td> 
  37. <input type="checkbox" name="jetpack_extras_use_wpme" <?php 
  38.  
  39. if ($global['use_wpme']) 
  40. echo 'checked="checked"'; 
  41. ?> /> 
  42. <small><em> 
  43. This shortens the link, (which is ultimatly wrapped in T.co anyway) 
  44. <br /> 
  45. To make Twitter previews work (with or without this option on), you need to Validate and Whitelist your Domain, grab a link to a blog post and paste it into the field on the <a href="https://cards-dev.twitter.com/validator">Twitter Card Validator</a>. Follow the instructions 
  46. </em></small> 
  47. </td> 
  48. </tr> 
  49. <!-- 
  50. <tr valign="top"> 
  51. <th scope="row"><label><?php _e('Enable DNT'); ?></label> 
  52. <br /> 
  53. <a href="https://dev.twitter.com/docs/tweet-button#optout">Twitter DNT Details</a> 
  54. </th> 
  55. <td> 
  56. <input type="checkbox" name="jetpack_extras_enable_dnt" <?php 
  57.  
  58. if ($global['enable_dnt']) 
  59. echo 'checked="checked"'; 
  60. ?> /> 
  61. </td> 
  62. </tr> 
  63. --> 
  64.  
  65. <tr valign="top"> 
  66. <th scope="row"><label>Related Twitter Handle and Optional Description</label></th> 
  67. <td><div id="jetpack_extras_twitter_related"> 
  68. <?php 
  69. if (count($global['twitter_related'])) { 
  70. foreach ($global['twitter_related'] as $related => $desc) { 
  71. echo '<div class="jetpack_extras_twitter_related_input" style="display: block; clear: left;">'; 
  72. echo '<table><tr><td>User:<input type="text" name="jetpack_extras_twitter_related[]" value="' . $related . '" /></td>'; 
  73. echo '<td>Desc:<input type="text" name="jetpack_extras_twitter_related_desc[]" value="' . $desc . '" /></td></tr></table>'; 
  74. echo '</div>'; 
  75. } else { 
  76. echo '<div class="jetpack_extras_twitter_related_input" style="display: block; clear: left;">'; 
  77. echo '<table><tr><td>User:<input type="text" name="jetpack_extras_twitter_related[]" value="" /></td>'; 
  78. echo '<td>Desc:<input type="text" name="jetpack_extras_twitter_related_desc[]" value="" /></td></tr></table>'; 
  79. echo '</div>'; 
  80. ?> 
  81. </div> 
  82. <a href="#" id="jetpack_extras_add_related">Add Another Related Handle</a> 
  83. </td> 
  84. </tr> 
  85.  
  86. <?php 
  87.  
  88. return;