/** * Generate label, description, sub description for the field * * @since 1.0 * * @param array $field Field options * @param string $value Field value * * @return string */ function element($field, $value = '') { if (!$value) { $value = TA_Theme_Options::get_option($field['name']); } $attr = array('class' => "field field-{$field['type']} clearfix "); if (isset($field['id'])) { $attr['id'] = $field['id']; } if (isset($field['class'])) { $attr['class'] .= $field['class']; } return $this->tag('div', $attr, $this->label($field), $this->tag('div', array('class' => 'input'), $this->{$field['type']}($field, $value), $this->suffix($field), $this->subdesc($field))); }
/** * Initialize framework * * @since 1.0 * * @return void */ public static function init() { // Define constants self::constants(); // Theme options self::$options = apply_filters('ta_theme_options', null); if (empty(self::$options)) { return; } // Default settings self::default_settings(); // Register auto loader spl_autoload_register(array(__CLASS__, 'autoload')); if (is_admin()) { new TA_Theme_Options_Admin(self::$options); } }