Example #1
0
 /**
  * Initialize the class
  *
  * @since Fastfood 0.37
  */
 function init()
 {
     $this->theme_options = FastfoodOptions::get_coa();
     $this->theme_mods = fastfood_register_theme_mods();
     $this->options_hierarchy = FastfoodOptions::get_hierarchy();
     $this->prefix_global = 'fastfood_options';
     $this->prefix_panel = $this->prefix_global . '_panel_';
     $this->prefix_section = $this->prefix_global . '_section_';
     if (version_compare($GLOBALS['wp_version'], '4.1-alpha', '<')) {
         $this->force_refresh = true;
     }
 }
Example #2
0
 public static function theme_mod($value, $option)
 {
     $_value = NULL;
     if (!self::$theme_mods) {
         self::$theme_mods = fastfood_register_theme_mods();
     }
     $mod = isset(self::$theme_mods[$option->id]) ? self::$theme_mods[$option->id] : false;
     if ($mod) {
         switch ($mod['setting']['sanitize_method']) {
             case 'checkbox':
                 $_value = self::checkbox($value, $mod);
                 break;
             case 'select':
                 $_value = self::select($value, $mod);
                 break;
             case 'radio':
                 $_value = self::radio($value, $mod);
                 break;
             case 'color':
                 $_value = self::color($value, $mod);
                 break;
             case 'url':
                 $_value = self::url($value, $mod);
                 break;
             case 'text':
                 $_value = self::text($value, $mod);
                 break;
             case 'number':
                 $_value = self::number($value, $mod);
                 break;
             case 'textarea':
                 $_value = self::textarea($value, $mod);
                 break;
         }
     }
     return $_value;
 }