/** * @package Kopa * @subpackage Core * @author thethangtran <*****@*****.**> * @since 1.0.0 */ static function get_theme_option_fields() { $tabs = array(); $tabs['general-setting'] = array('title' => __('General Setting', kopa_get_domain()), 'groups' => kopa_options_general(), 'icon' => 'fa fa-gear'); $tabs['blog-posts'] = array('title' => __('Blog Posts', kopa_get_domain()), 'groups' => kopa_options_blog_posts(), 'icon' => 'fa fa-folder-open-o'); $tabs['single-post'] = array('title' => __('Single Post', kopa_get_domain()), 'groups' => kopa_options_single_post(), 'icon' => 'fa fa-file-text-o'); $tabs['contact'] = array('title' => __('Contact', kopa_get_domain()), 'groups' => kopa_options_contact(), 'icon' => 'fa fa-envelope-o'); $tabs['social-links'] = array('title' => __('Social Links', kopa_get_domain()), 'groups' => kopa_options_social_links(), 'icon' => 'fa fa-share-square-o'); $tabs['typography'] = array('title' => __('Typography', kopa_get_domain()), 'groups' => kopa_options_typography(), 'icon' => 'fa fa-text-height'); $tabs['color-scheme'] = array('title' => __('Color Scheme', kopa_get_domain()), 'groups' => kopa_options_color_scheme(), 'icon' => 'fa fa-tint'); $tabs['custom-css'] = array('title' => __('Custom CSS', kopa_get_domain()), 'groups' => kopa_options_custom_css(), 'icon' => 'fa fa-code'); $tabs['shortcode'] = array('title' => __('Shortcode', kopa_get_domain()), 'groups' => kopa_options_shortcode(), 'icon' => 'fa fa-gift'); $tabs['seo'] = array('title' => __('SEO', kopa_get_domain()), 'groups' => kopa_options_seo(), 'icon' => 'fa fa-star-o'); return $tabs; }
/** * Enqueue custom font - selected by admin * * @package Kopa * @subpackage Core * @author thethangtran <*****@*****.**> * @since 1.0.0 * * @return NULl */ function load_font() { global $google_font; $character_sets = KopaOptions::get_option('character_sets', array()); $subset = ''; if (!empty($character_sets)) { $subset = sprintf('&subset=%s', implode(',', $character_sets)); } $typos = kopa_options_typography(); foreach ($typos as $group) { foreach ($group['fields'] as $field) { if ('font' == $field['type']) { $value = KopaOptions::get_option($field['name'], $field['default']); if (isset($value) || !empty($value)) { if ('off' != $value['family']) { $font_family = str_replace(' ', '+', $google_font['items'][$value['family']]['family']); $cssID = sprintf('css-dynamic-%s-family', $field['name']); $tmp = sprintf('http://fonts.googleapis.com/css?family=%s:%s%s', $font_family, $value['weight'], $subset); wp_enqueue_style($cssID, $tmp, array(), NULL); $this->typography[$field['name']] = $value; $this->typography[$field['name']]['family'] = $google_font['items'][$value['family']]['family']; } } } } } }