Advertisement
emcniece

SeedProd Framework.php with updated google fonts

Mar 12th, 2013
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 32.31 KB | None | 0 0
  1. <?php
  2. /**
  3.  * SeedProd Framework - Inspired by Yoast's Plugins and WooThemes Framework
  4.  *
  5.  * @package WordPress
  6.  * @subpackage Ultimate_Coming_Soon_Page
  7.  * @since 0.1
  8.  */
  9. if (!class_exists('SeedProd_Framework')) {
  10.     class SeedProd_Framework {
  11.    
  12.         /**
  13.          * Define the Version of the Plugin
  14.          */
  15.         public $plugin_version = '';
  16.         public $plugin_type = ''; // free,lite and pro
  17.         public $plugin_name = '';
  18.         public $plugin_support_url = '';
  19.         public $plugin_short_url = '';
  20.         public $plugin_seedprod_url = '';
  21.         public $plugin_donate_url = '';
  22.         public $plugin_official_url = '';
  23.         private $framework_version = '0.1';
  24.  
  25.         /**
  26.          * Define if we are deploying a theme and add the theme params
  27.          */
  28.         public $deploy_theme = 0;
  29.         public $deploy_theme_name = array('template' =>'', 'stylesheet' => '');
  30.  
  31.         /**
  32.          * Global we set in seedprod_admin_enqueue_scripts and use in create_menu
  33.          */
  34.         public $pages = array();
  35.  
  36.         /**
  37.          *  Define the menus that will be rendered.
  38.          *  Do not replace callback function.
  39.          */
  40.         public $menu = array();
  41.        
  42.         /**
  43.          *  Define options, sections and fields
  44.          */
  45.         public $options = array();
  46.    
  47.         /**
  48.          * Load Hooks
  49.          */
  50.         function __construct() {
  51.             add_action('admin_enqueue_scripts', array(&$this,'admin_enqueue_scripts'));
  52.             add_action('admin_menu',array(&$this,'create_menu'));
  53.             add_action('admin_init', array(&$this,'set_settings'));
  54.         }
  55.        
  56.         /**
  57.          * Set the base url to use in the plugin
  58.          *
  59.          * @since  0.1
  60.          * @return string
  61.          */
  62.         function base_url(){
  63.             return plugins_url('',dirname(__FILE__));
  64.         }
  65.            
  66.    
  67.         /**
  68.          * Properly enqueue styles and scripts for our theme options page.
  69.          *
  70.          * This function is attached to the admin_enqueue_scripts action hook.
  71.          *
  72.          * @since  0.1
  73.          * @param string $hook_suffix The name of the current page we are on.
  74.          */
  75.         function admin_enqueue_scripts( $hook_suffix ) {
  76.             wp_enqueue_style( 'seedprod_mm_plugin', plugins_url('inc/css/admin-style.css',dirname(__FILE__)), false, $this->plugin_version );
  77.             if(!in_array($hook_suffix, $this->pages))
  78.                 return;
  79.             wp_enqueue_script('dashboard');
  80.             wp_enqueue_script( 'seedprod_framework', plugins_url('framework.js',__FILE__), array( 'jquery','media-upload','thickbox','farbtastic' ), $this->plugin_version );
  81.             wp_enqueue_style( 'seedprod_framework', plugins_url('framework.css',__FILE__), false, $this->plugin_version );
  82.             wp_enqueue_script( 'seedprod_plugin', plugins_url('inc/js/admin-script.js',dirname(__FILE__)), array( 'jquery','media-upload','thickbox','farbtastic' ), $this->plugin_version );
  83.             wp_enqueue_style( 'seedprod_plugin', plugins_url('inc/css/admin-style.css',dirname(__FILE__)), false, $this->plugin_version );
  84.             wp_enqueue_style('thickbox');
  85.             wp_enqueue_script( 'theme-preview' );
  86.             wp_enqueue_style('farbtastic');
  87.         }
  88.  
  89.         /**
  90.          * Creates WordPress Menu pages from an array in the config file.
  91.          *
  92.          * This function is attached to the admin_menu action hook.
  93.          *
  94.          * @since 0.1
  95.          */
  96.         function create_menu(){
  97.             foreach ($this->menu as $v) {
  98.                 $this->pages[] = call_user_func_array($v['type'],array($v['page_name'],$v['menu_name'],$v['capability'],$v['menu_slug'],$v['callback'],$v['icon_url']));
  99.             }
  100.    
  101.         }
  102.  
  103.         /**
  104.          * Render the option pages.
  105.          *
  106.          * @since 0.1
  107.          */
  108.         function option_page() {
  109.             $page = $_REQUEST['page'];
  110.             ?>
  111.             <div class="wrap seedprod">
  112.                 <?php screen_icon(); ?>
  113.                 <h2><?php echo $this->plugin_name; ?> </h2>
  114.                 <a href="http://www.seedprod.com/ultimate-coming-soon-page-vs-coming-soon-pro/?utm_source=plugin&utm_medium=banner&utm_campaign=coming-soon-pro-in-plugin-banner" target="_blank">
  115.                 <img src="http://static.seedprod.com.s3.amazonaws.com/ads/ultimate-coming-soon-page-banner-772x250.jpg" style="max-width:100%">
  116.                 </a>
  117.                 <?php //settings_errors(); ?>
  118.                 <h2 class="nav-tab-wrapper" style="padding-left:20px">
  119.                     <a class="nav-tab seed_csp3-support" href="options-general.php?page=seedprod_coming_soon"><?php _e('Settings','ultimate-coming-soon-page') ?></a>
  120.                     <a class="nav-tab seed_csp3-preview thickbox-preview" href="<?php echo home_url(); ?>?cs_preview=true&TB_iframe=true&width=640&height=632" title="<?php _e('&larr; Close Window','ultimate-coming-soon-page') ?>"><?php _e('Live Preview','ultimate-coming-soon-page'); ?></a>
  121.                 </h2>
  122.                 <div id="poststuff" class="metabox-holder">
  123.                     <!--<div id="side-info-column" class="inner-sidebar">
  124.                         <div id="side-sortables" class="meta-box-sortables ui-sortable">
  125.                             <a href="http://www.seedprod.com/plugins/wordpress-coming-soon-pro-plugin/?utm_source=plugin&utm_medium=banner&utm_campaign=coming-soon-pro-in-plugin-banner" target="_blank"><img src="http://static.seedprod.com/ads/coming-soon-pro-sidebar.png" /></a>
  126.                             <br><br>
  127.                             <div class="postbox support-postbox">
  128.                                 <div class="handlediv" title="Click to toggle"><br /></div>
  129.                                 <h3 class="hndle"><span><?php _e('Plugin Support', 'ultimate-coming-soon-page') ?></span></h3>
  130.                                 <div class="inside">
  131.                                     <div class="support-widget">
  132.                                     <p>
  133.                                        <?php _e('Got a Question, Idea, Problem or Praise?') ?>
  134.                                     </p>
  135.                                     <ul>
  136.                                         <li>&raquo; <a href="<?php echo (empty($this->plugin_support_url) ? 'http://seedprod.com/support/' : $this->plugin_support_url) ?>" target="_blank"><?php _e('Support Request', 'ultimate-coming-soon-page') ?></a></li>
  137.                                     </ul>
  138.                                    
  139.                                     </div>
  140.                                 </div>
  141.                             </div>
  142.                             <?php if($this->plugin_type != 'pro'){ ?>
  143.                             <div class="postbox like-postbox">
  144.                                 <div class="handlediv" title="Click to toggle"><br /></div>
  145.                                 <h3 class="hndle"><span><?php _e('Show Some Love', 'ultimate-coming-soon-page') ?></span></h3>
  146.                                 <div class="inside">
  147.                                     <div class="like-widget">
  148.                                     <p><?php _e('Like this plugin? Show your support by:', 'ultimate-coming-soon-page')?></p>
  149.                                     <ul>
  150.                                         <li>&raquo; <a href="https://www.seedprod.com/submit-site/"><?php _e('Submit your site to the Showcase', 'ultimate-coming-soon-page') ?></a></li>
  151.                                         <li>&raquo; <a target="_blank" href="http://wordpress.org/extend/plugins/ultimate-coming-soon-page/"><?php _e('Rating It', 'ultimate-coming-soon-page') ?></a></li>
  152.                                         <li>&raquo; <a target="_blank" href="<?php echo "http://twitter.com/share?url={$this->plugin_seedprod_url}&text=Check out this awesome WordPress Plugin I'm using, 'Ultimate Coming Soon Page' by SeedProd {$this->plugin_short_url}"; ?>"><?php _e('Tweet It', 'ultimate-coming-soon-page') ?></a></li>
  153.                                        
  154.                                        
  155.                                        
  156.                                     </ul>
  157.                                     </div>
  158.                                 </div>
  159.                             </div>
  160.                             <?php } ?>
  161.                             <div class="postbox rss-postbox">
  162.                                 <div class="handlediv" title="Click to toggle"><br /></div>
  163.                                 <h3 class="hndle"><span><?php _e('SeedProd Blog', 'ultimate-coming-soon-page') ?></span></h3>
  164.                                 <div class="inside">
  165.                                     <div class="rss-widget">
  166.                                     <?php
  167.                                     wp_widget_rss_output(array(
  168.                                        'url' => 'http://seedprod.com/feed/',
  169.                                        'title' => 'SeedProd Blog',
  170.                                        'items' => 3,
  171.                                        'show_summary' => 0,
  172.                                        'show_author' => 0,
  173.                                        'show_date' => 1,
  174.                                     ));
  175.                                     ?>
  176.                                     <ul>
  177.                                         <li>&raquo; <a href="http://seedprod.com/subscribe/"><?php _e('Subscribe by Email', 'ultimate-coming-soon-page') ?></a></li>
  178.                                     </ul>
  179.                                     </div>
  180.                                 </div>
  181.                             </div>
  182.                            
  183.                         </div>
  184.                     </div>-->
  185.                     <div id="post-body">
  186.                         <div id="post-body-content" >
  187.                             <div class="meta-box-sortables ui-sortable">
  188.                                 <form action="options.php" method="post">
  189.                                 <?php
  190.                                 foreach ($this->options as $v) {
  191.                                     if(isset($v['menu_slug'])){
  192.                                         if($v['menu_slug'] == $page){
  193.                                             switch ($v['type']) {
  194.                                                 case 'setting':
  195.                                                     settings_fields($v['id']);
  196.                                                     break;
  197.                                                 case 'section':
  198.                                                     echo '<div class="postbox seedprod-postbox"><div class="handlediv" title="Click to toggle"><br /></div>';
  199.                                                     $this->seedprod_do_settings_sections($v['id']);
  200.                                                     echo '</div>';
  201.                                                     break;
  202.                                    
  203.                                             }
  204.                                         }
  205.                                     }
  206.                                 }
  207.                                 ?>
  208.                                
  209.                                 </form>
  210.                             </div>
  211.                         </div>
  212.                     </div>
  213.                 </div>
  214.             </div> 
  215.             <?php
  216.         }
  217.  
  218.         /**
  219.          * Create the settings options, sections and fields via the WordPress Settings API
  220.          *
  221.          * This function is attached to the admin_init action hook.
  222.          *
  223.          * @since 0.1
  224.          */
  225.         function set_settings(){
  226.             foreach ($this->options as $k) {
  227.                 switch ($k['type']) {
  228.                     case 'setting':
  229.                         if(empty($k['validate_function'])){
  230.                             $k['validate_function'] = array(&$this,'validate_machine');
  231.                         }
  232.                         register_setting(
  233.                             $k['id'],
  234.                             $k['id'],
  235.                             $k['validate_function']
  236.                         );
  237.                         break;
  238.                     case 'section':
  239.                         if(empty($k['desc_callback'])){
  240.                             $k['desc_callback'] = array(&$this,'section_dummy_desc');
  241.                         }else{
  242.                             $k['desc_callback'] = array(&$this, $k['desc_callback']);
  243.                         }
  244.                         add_settings_section(
  245.                             $k['id'],
  246.                             $k['label'],
  247.                             $k['desc_callback'],
  248.                             $k['id']
  249.                         );
  250.                         break;
  251.                     default:
  252.                         if(empty($k['callback'])){
  253.                             $k['callback'] = array(&$this,'field_machine');
  254.                         }
  255.                         add_settings_field(
  256.                             $k['id'],
  257.                             $k['label'],
  258.                             $k['callback'],
  259.                             $k['section_id'],
  260.                             $k['section_id'],
  261.                             array('id' => $k['id'],
  262.                             'desc' => (isset($k['desc']) ? $k['desc'] : ''),
  263.                             'setting_id' => $k['setting_id'],
  264.                             'class' => (isset($k['class']) ? $k['class'] : ''),
  265.                             'type' => $k['type'],
  266.                             'default_value' => (isset($k['default_value']) ? $k['default_value'] : ''),
  267.                             'option_values' => (isset($k['option_values']) ? $k['option_values'] : ''))
  268.                         );
  269.                        
  270.                 }
  271.             }
  272.         }
  273.  
  274.         /**
  275.          * Create a field based on the field type passed in.
  276.          *
  277.          * @since 0.1
  278.          */
  279.         function field_machine($args) {
  280.             extract($args);
  281.             $options = get_option( $setting_id );
  282.             switch($type){
  283.                 case 'textbox':
  284.                     echo "<input id='$id' class='".(empty($class) ? 'regular-text' : $class)."' name='{$setting_id}[$id]' type='text' value='".esc_attr(empty($options[$id]) ? $default_value : $options[$id])."' />
  285.                     <br><small class='description'>".(empty($desc) ? '' : $desc)."</small>";
  286.                     break;
  287.                 case 'image':
  288.                     echo "<input id='$id' class='".(empty($class) ? 'regular-text' : $class)."' name='{$setting_id}[$id]' type='text' value='".(empty($options[$id]) ? $default_value : $options[$id])."' />
  289.                     <input id='{$id}_upload_image_button' class='button-secondary upload-button' type='button' value='". __('Media Image Library', 'ultimate-coming-soon-page')."' />
  290.                     <br><small class='description'>".(empty($desc) ? '' : $desc)."</small>
  291.                     ";
  292.                     break;
  293.                 case 'select':
  294.                     echo "<select id='$id' class='".(empty($class) ? '' : $class)."' name='{$setting_id}[$id]'>";
  295.                     foreach($option_values as $k=>$v){
  296.                         if(preg_match("/optgroupend/i",$k)){
  297.                             echo "</optgroup>";
  298.                         }else{
  299.                             if(preg_match("/optgroup/i",$k)){
  300.                                 echo "<optgroup label='$v'>";
  301.                             }else{
  302.  
  303.                                 if(preg_match("/empty/i",$k) && empty($default_value)){            
  304.                                     echo "<option value=''>$v</option>";
  305.                                 }else{
  306.                                     echo "<option value='$k' ".((preg_match("/empty/i",$options[$id] || isset($options[$id]) === false) ? $default_value : $options[$id]) == $k ? 'selected' : '').">$v</option>";
  307.                                 }
  308.                             }
  309.                         }
  310.  
  311.                     }
  312.                     echo "</select>
  313.                    <br><small class='description'>".(empty($desc) ? '' : $desc)."</small>";
  314.                     break;
  315.                 case 'textarea':
  316.                     echo "<textarea id='$id' class='".(empty($class) ? '' : $class)."' name='{$setting_id}[$id]'>".(empty($options[$id]) ? $default_value : $options[$id])."</textarea>
  317.                     <br><small class='description'>".(empty($desc) ? '' : $desc)."</small>";
  318.                     break;
  319.  
  320.                 case 'wpeditor':
  321.                     $content   = $options[ $id ];
  322.                     $editor_id = $id;
  323.                     $args      = array(
  324.                          'textarea_name' => "{$setting_id}[$id]"
  325.                     );
  326.  
  327.                     wp_editor( $content, $editor_id, $args );
  328.  
  329.                     break;
  330.                 case 'radio':
  331.                     foreach($option_values as $k=>$v){
  332.                         echo "<input type='radio' name='{$setting_id}[$id]' value='$k'".((empty($options[$id]) ? $default_value : $options[$id]) == $k ? 'checked' : '')."  /> $v<br/>";
  333.                     }
  334.                     echo "<small class='description'>".(empty($desc) ? '' : $desc)."</small>";
  335.                     break;
  336.                 case 'checkbox':
  337.                     $count = 0;
  338.                     foreach($option_values as $k=>$v){
  339.                         echo "<input type='checkbox' name='{$setting_id}[$id][]' value='$k'".(in_array($k,(empty($options[$id]) ? (empty($default_value) ? array(): $default_value) : $options[$id])) ? 'checked' : '')."  /> $v<br/>";
  340.                         $count++;
  341.                     }
  342.                     echo "<small class='description'>".(empty($desc) ? '' : $desc)."</small>";
  343.                     break;
  344.                 case 'color':
  345.                     echo "
  346.                         <input id='$id' type='text' name='{$setting_id}[$id]' value='".(empty($options[$id]) ? $default_value : $options[$id])."' style='background-color:".(empty($options[$id]) ? $default_value : $options[$id]).";' />
  347.                        <input type='button' class='pickcolor button-secondary' value='Select Color'>
  348.                        <div id='colorpicker' style='z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;'></div>
  349.                        <br />
  350.                        <small class='description'>".(empty($desc) ? '' : $desc)."</small>
  351.                        ";
  352.                     break;
  353.             }
  354.    
  355.         }
  356.  
  357.         /**
  358.          * Validates user input before we save it via the Options API. If error add_setting_error
  359.          *
  360.          * @since 0.1
  361.          * @param array $input Contains all the values submited to the POST.
  362.          * @return array $input Contains sanitized values.
  363.          * @todo Figure out best way to validate values.
  364.          */
  365.         function validate_machine($input) {
  366.             $error = false;
  367.             foreach ($this->options as $k) {
  368.                 switch($k['type']){
  369.                     case 'setting':
  370.                         break;
  371.                     case 'section':
  372.                         break;
  373.                     default:
  374.                         // Validate a pattern
  375.                         if(isset($pattern) && $pattern){
  376.                             if(!preg_match( $pattern, $input[$k['id']])) {
  377.                                 $error = true;
  378.                                 add_settings_error(
  379.                                     $k['id'],
  380.                                     'seedprod_error',
  381.                                     $k['error_msg'],
  382.                                     'error'
  383.                                 );
  384.                                 unset($input[$k['id']]);
  385.                             }      
  386.                         }
  387.                         // Sanitize
  388.                         if($k['type'] == 'image'){
  389.                             $input[$k['id']] = esc_url_raw($input[$k['id']]);
  390.                         }
  391.                 }
  392.             }
  393.             if(!$error){
  394.                 global $wp_settings_errors;
  395.                 $display = true;
  396.                 if(!empty($wp_settings_errors)){
  397.                     foreach($wp_settings_errors as $k=>$v){
  398.                         if($v['code'] == 'seedprod_settings_updated')
  399.                             $display = false;
  400.                     }
  401.                 }
  402.                 if($display)
  403.                     add_settings_error('general', 'seedprod_settings_updated', sprintf(__("Settings saved.  <a href='%s/?cs_preview=true'>Preview &raquo;</a>", 'ultimate-coming-soon-page'),home_url()), 'updated');
  404.             }
  405.             return $input;
  406.         }
  407.  
  408.         /**
  409.          * Dummy function to be called by all sections from the Settings API. Define a custom function in the config.
  410.          *
  411.          * @since 0.1
  412.          * @return string Empty
  413.          */
  414.         function section_dummy_desc() {
  415.             echo '';
  416.         }
  417.        
  418.         /**
  419.          * Returns Font Families
  420.          *
  421.          * @since 0.1
  422.          * @return string or array
  423.          */
  424.         function font_families($family=null) {
  425.             $fonts = array();
  426.             $fonts['_arial'] = 'Helvetica, Arial, sans-serif';
  427.             $fonts['_arial_black'] = 'Arial Black, Arial Black, Gadget, sans-serif';
  428.             $fonts['_georgia'] = 'Georgia,serif';
  429.             $fonts['_helvetica_neue'] = '"Helvetica Neue", Helvetica, Arial, sans-serif';
  430.             $fonts['_impact'] = 'Charcoal,Impact,sans-serif';
  431.             $fonts['_lucida'] = 'Lucida Grande,Lucida Sans Unicode, sans-serif';
  432.             $fonts['_palatino'] = 'Palatino,Palatino Linotype, Book Antiqua, serif';
  433.             $fonts['_tahoma'] = 'Geneva,Tahoma,sans-serif';
  434.             $fonts['_times'] = 'Times,Times New Roman, serif';
  435.             $fonts['_trebuchet'] = 'Trebuchet MS, sans-serif';
  436.             $fonts['_verdana'] = 'Verdana, Geneva, sans-serif';
  437.             if($family){
  438.                 $font_family=$fonts[$family];
  439.                 if(empty($font_family)){
  440.                     $font_family = '"'. urldecode($family) . '",sans-serif' ;
  441.                 }
  442.             }else{
  443.                 $font_family=$fonts;  
  444.             }
  445.             return $font_family;
  446.         }
  447.        
  448.         /**
  449.          * Get list of fonts from google and web safe fonts.
  450.          *
  451.          * @since 0.1
  452.          * @return array
  453.          */
  454.          function font_field_list($show_google_fonts = true){
  455.               $fonts = false; //unserialize(get_transient('seedprod_fonts'));
  456.               if($fonts === false){
  457.                   if($show_google_fonts){
  458.                       //$query = urlencode('select * from html where url="http://www.google.com/webfonts" and xpath=\'//div[@class="preview"]/span\'');
  459.                       //$request = "http://query.yahooapis.com/v1/public/yql?q={$query}&format=json";
  460.                       //$reponse = wp_remote_get($request);
  461.                       //$result = json_decode($reponse['body']);
  462.                       $result = array("ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alegreya","Alegreya SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Anaheim","Andada","Andika","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Asap","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Baumans","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Bitter","Black Ops One","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Caudex","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dawning of a New Day","Days One","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Federant","Federo","Felipa","Fenix","Finger Paint","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Fresca","Frijole","Fruktur","Fugaz One","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Habibi","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Irish Grover","Istok Web","Italiana","Italianno","Jacques Francois","Jacques Francois Shadow","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kameron","Karla","Kaushan Script","Kavoon","Keania One","Kelly Slab","Kenia","Kite One","Knewave","Kotta One","Kranky","Kreon","Kristi","Krona One","La Belle Aurore","Lancelot","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modern Antiqua","Molengo","Molle","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Norican","Nosifer","Nothing You Could Do","Noticia Text","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Paprika","Parisienne","Passero One","Passion One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Port Lligat Sans","Port Lligat Slab","Prata","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Raleway","Raleway Dots","Rambla","Rammetto One","Ranchers","Rancho","Rationale","Redressed","Reenie Beanie","Revalia","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarina","Satisfy","Scada","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slackey","Smokum","Smythe","Sniglet","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sunshiney","Supermercado One","Swanky and Moo Moo","Syncopate","Tangerine","Tauri","Telex","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Yanone Kaffeesatz","Yellowtail","Yeseva One","Yesteryear","Zeyada");
  463.                       foreach($result as $v){
  464.                          $google_fonts[urlencode($v)] = $v;
  465.                       }
  466.                       asort($google_fonts);
  467.                       $pre2["optgroup_2"] = "Google Fonts";
  468.                       $post2["optgroupend_2"] = "";
  469.                  }
  470.                  $post1["optgroupend_1"] = "";
  471.                  $system_fonts['_arial'] = 'Arial';
  472.                  $system_fonts['_arial_black'] = 'Arial Black';
  473.                  $system_fonts['_georgia'] = 'Georgia';
  474.                  $system_fonts['_helvetica_neue'] = 'Helvetica Neue';
  475.                  $system_fonts['_impact'] = 'Impact';
  476.                  $system_fonts['_lucida'] = 'Lucida Grande';
  477.                  $system_fonts['_palatino'] = 'Palatino';
  478.                  $system_fonts['_tahoma'] = 'Tahoma';
  479.                  $system_fonts['_times'] = 'Times New Roman';
  480.                  $system_fonts['_trebuchet'] = 'Trebuchet';
  481.                  $system_fonts['_verdana'] = 'Verdana';
  482.                  $pre0["empty_0"] = "Select a Font";
  483.                  $pre1["optgroup_1"] = "System Fonts";
  484.                  $pre2["optgroup_2"] = "Google Fonts";
  485.                  $fonts =  $pre0 + $pre1 + $system_fonts+ $post1+ $pre2 + $google_fonts + $post2;
  486.                  if(!empty($google_fonts)){
  487.                      set_transient('seedprod_fonts',serialize( $fonts ),86400);
  488.                 }
  489.              }
  490.              return $fonts;
  491.          }
  492.          
  493.          /**
  494.           * SeedProd version of WP's do_settings_sections
  495.           *
  496.           * @since 0.1
  497.           */
  498.          function seedprod_do_settings_sections($page) {
  499.              global $wp_settings_sections, $wp_settings_fields;
  500.  
  501.              if ( !isset($wp_settings_sections) || !isset($wp_settings_sections[$page]) )
  502.                  return;
  503.  
  504.              foreach ( (array) $wp_settings_sections[$page] as $section ) {
  505.                  echo "<h3 class='hndle'>{$section['title']}</h3>\n";
  506.                  echo '<div class="inside">';
  507.                  call_user_func($section['callback'], $section);
  508.                  if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section['id']]) )
  509.                      continue;
  510.                  echo '<table class="form-table">';
  511.                  do_settings_fields($page, $section['id']);
  512.                  echo '</table>';
  513.                  echo '<p>';
  514.                  echo "<input name=\"Submit\" type=\"submit\" value=\"". __('Save Changes', 'ultimate-coming-soon-page') ."\" class=\"button-primary\"/>";
  515.                  echo '</p>';
  516.                  echo '</div>';
  517.              }
  518.          }
  519.  
  520.     }
  521. }
  522. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement