Пример #1
0
function wpgrade_callback_load_google_fonts_api_rosa()
{
    $fonts_array = array('google_titles_font', 'google_subtitles_font', 'google_nav_font', 'google_body_font');
    $families = array();
    foreach ($fonts_array as $font) {
        $clean_font = wpgrade::get_google_font_name($font);
        if (!empty($clean_font)) {
            $families[] = $clean_font;
        }
    }
    $families = apply_filters('wpgrade_google_fonts', $families);
    if (!empty($families) || is_preview()) {
        //only enqueue the api is we actually have webfonts
        wp_enqueue_script('webfont-script');
    }
}
Пример #2
0
function wpgrade_callback_load_google_fonts()
{
    if (wpgrade::option('use_google_fonts')) {
        $fonts_array = array('google_titles_font', 'google_second_font', 'google_nav_font', 'google_body_font');
        $families = array();
        foreach ($fonts_array as $font) {
            $clean_font = wpgrade::get_google_font_name($font);
            if (!empty($clean_font)) {
                $families[] = $clean_font;
            }
        }
        if (!empty($families)) {
            // any variables in scope will be available in the partial
            include wpgrade::themefilepath('wpgrade-core/resources/views/google-fonts-script' . EXT);
        }
    }
}