/** * PressCore web fonts enqueue. * * @since: presscore 0.1 */ function presscore_enqueue_web_fonts() { // get web fonts from theme options $headers = presscore_themeoptions_get_headers_defaults(); $buttons = presscore_themeoptions_get_buttons_defaults(); $skin = of_get_option('preset'); $fonts = array(); // main fonts $fonts['dt-font-basic'] = of_get_option('fonts-font_family'); // h fonts foreach ($headers as $id => $opts) { $fonts['dt-font-' . $id] = of_get_option('fonts-' . $id . '_font_family'); } // buttons fonts foreach ($buttons as $id => $opts) { $fonts['dt-font-btn-' . $id] = of_get_option('buttons-' . $id . '_font_family'); } // menu font $fonts['dt-font-menu'] = of_get_option('header-font_family'); // we do not want duplicates $fonts = array_unique($fonts); foreach ($fonts as $id => $font) { if (dt_stylesheet_maybe_web_font($font) && ($font_uri = dt_make_web_font_uri($font))) { wp_enqueue_style($id . '-' . $skin, $font_uri); } } }
/** * Web fonts override. * */ function presscore_enqueue_web_fonts() { $fonts = array(); $options = _optionsframework_get_clean_options(); foreach ($options as $option) { if ('web_fonts' === $option['type']) { // Replace & coz in db value sanitized with esc_attr(). $fonts[] = str_replace('&', '&', of_get_option($option['id'])); } } $fonts_compressor = new Presscore_Web_Fonts_Compressor(); $compressed_fonts = $fonts_compressor->compress_fonts(presscore_filter_web_fonts($fonts)); wp_enqueue_style('dt-web-fonts', dt_make_web_font_uri($compressed_fonts)); }
/** * Web fonts override. * */ function presscore_enqueue_web_fonts() { // get web fonts from theme options $headers = presscore_themeoptions_get_headers_defaults(); $buttons = presscore_themeoptions_get_buttons_defaults(); $skin = of_get_option('preset'); $fonts = array(); // main fonts $fonts['dt-font-basic'] = of_get_option('fonts-font_family'); // h fonts foreach ($headers as $id => $opts) { $fonts['dt-font-' . $id] = of_get_option('fonts-' . $id . '_font_family'); } // buttons fonts foreach ($buttons as $id => $opts) { $fonts['dt-font-btn-' . $id] = of_get_option('buttons-' . $id . '_font_family'); } // menu font $fonts['dt-font-menu'] = of_get_option('menu-font_family'); // submenu font $fonts['dt-font-submenu'] = of_get_option('submenu-font_family'); // we do not want duplicates $fonts = array_unique($fonts); $fonts_compressor = new Presscore_Web_Fonts_Compressor(); $compressed_fonts = $fonts_compressor->compress_fonts(presscore_filter_web_fonts($fonts)); unset($fonts_compressor); wp_enqueue_style('dt-web-fonts', dt_make_web_font_uri($compressed_fonts)); }