gff_option_page

Option Page.

Description

gff_option_page(); 

Usage

  1. if ( !function_exists( 'gff_option_page' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-font-fix/google-font-fix-options.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = gff_option_page(); 
  7.  

Defined (1)

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

/google-font-fix-options.php  
  1. function gff_option_page() { 
  2. global $gff_options; 
  3.  
  4. $google_service = $_POST['google-service']; 
  5. $gravatar_service = $_POST['gravatar-service']; 
  6. if ( isset($google_service) ) { 
  7. update_option('google_service', $google_service); 
  8. $gff_options['google_service'] = $google_service; 
  9. if ( isset($gravatar_service) ) { 
  10. update_option('gravatar_service', $gravatar_service); 
  11. $gff_options['gravatar_service'] = $gravatar_service; 
  12. ?> 
  13. <div class="wrap"> 
  14. <h1><?php echo __('Google Font Fix Options', 'google-font-fix'); ?></h1> 
  15. <form method="POST" action="" novalidate="novalidate"> 
  16. <h2><?php echo __('Google Service'); ?></h2> 
  17. <table class="form-table"> 
  18. <tr> 
  19. <th scope="row"> 
  20. <label for="google-service"><?php echo __('Service Provider', 'google-font-fix'); ?></label> 
  21. </th> 
  22. <td> 
  23. <select name="google-service" id="google-service"> 
  24. <?php if ( !is_ssl() ): ?> 
  25. <option value="useso.com"><?php echo __('Qihoo 360 Technology Co. Ltd.', 'google-font-fix'); ?></option> 
  26. <?php endif; ?> 
  27. <option value="lug.ustc.edu.cn"><?php echo __('University of Science and Technology of China', 'google-font-fix'); ?></option> 
  28. <option value="css.network"><?php echo __('CSS.NET', 'google-font-fix'); ?></option> 
  29. </select> 
  30. </td> 
  31. </tr> 
  32. </table> <!-- .form-table --> 
  33. <h2><?php echo __('Gravatar Service'); ?></h2> 
  34. <table class="form-table"> 
  35. <tr> 
  36. <th scope="row"> 
  37. <label for="gravatar-service"><?php echo __('Service Provider', 'google-font-fix'); ?></label> 
  38. </th> 
  39. <td> 
  40. <select name="gravatar-service" id="gravatar-service"> 
  41. <option value="https://secure.gravatar.com/avatar"><?php echo __('Gravatar Secure Connection', 'google-font-fix'); ?></option> 
  42. <option value="//cn.gravatar.com/avatar"><?php echo __('Gravatar in China', 'google-font-fix'); ?></option> 
  43. <option value="//gravatar.css.network/avatar"><?php echo __('CSS.NET', 'google-font-fix'); ?></option> 
  44. <option value="//cdn.v2ex.com/gravatar"><?php echo __('V2EX', 'google-font-fix'); ?></option> 
  45. </select> 
  46. </td> 
  47. </tr> 
  48. </table> <!-- .form-table --> 
  49. <?php submit_button(); ?> 
  50. </form> 
  51. </div> <!-- .wrap --> 
  52. <script type="text/javascript"> 
  53. (function($) { 
  54. $(function() { 
  55. $('#google-service').val('<?php echo $gff_options['google_service']; ?>'); 
  56. $('#gravatar-service').val('<?php echo $gff_options['gravatar_service']; ?>'); 
  57. }); 
  58. })(jQuery); 
  59. </script> 
  60. <?php