function inti_mce_google_fonts_array($initArray)
 {
     $googlefonts_array = inti_get_typography_google_fonts();
     $googlefonts_string = "";
     foreach ($googlefonts_array as $key => $value) {
         $googlefonts_string .= $value . "=" . $key . ";";
     }
     $initArray['font_formats'] = trim($googlefonts_string);
     //$initArray['font_formats'] = 'Lato=Lato;Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';
     return $initArray;
 }
Ejemplo n.º 2
0
/**
 * Create an array of fonts to be enqueued
 *
 * @since 1.0.0
 */
function inti_do_typography_google_fonts()
{
    $all_google_fonts = array_keys(inti_get_typography_google_fonts());
    // Get the font face for each option and put it in an array
    $title_font = get_inti_option('title_font', 'inti_customizer_options', "'Helvetica Neue', Helvetica, Arial, sans-serif");
    $paragraph_font = get_inti_option('paragraph_font', 'inti_customizer_options', "'Open Sans', sans-serif");
    $h1_font = get_inti_option('h1_font', 'inti_customizer_options', "'Open Sans', sans-serif");
    $h2_font = get_inti_option('h2_font', 'inti_customizer_options', "'Open Sans', sans-serif");
    $h3_font = get_inti_option('h3_font', 'inti_customizer_options', "'Open Sans', sans-serif");
    $h4_font = get_inti_option('h4_font', 'inti_customizer_options', "'Open Sans', sans-serif");
    $h5_font = get_inti_option('h5_font', 'inti_customizer_options', "'Open Sans', sans-serif");
    $h6_font = get_inti_option('h6_font', 'inti_customizer_options', "'Open Sans', sans-serif");
    $selected_fonts = array($title_font, $paragraph_font, $h1_font, $h2_font, $h3_font, $h4_font, $h5_font, $h6_font);
    // Remove any duplicates in the list
    $selected_fonts = array_unique($selected_fonts);
    // Check each of the unique fonts against the defined Google fonts
    // If it is a Google font, go ahead and call the function to enqueue it
    foreach ($selected_fonts as $font) {
        if (in_array($font, $all_google_fonts)) {
            inti_do_typography_enqueue_google_font($font);
        }
    }
}
Ejemplo n.º 3
0
 $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'inti_theme_color', array('label' => __('Theme Color', 'inti'), 'section' => 'inti_customizer_general', 'settings' => 'inti_customizer_options[theme_color]', 'priority' => 12)));
 // Posts & Pages
 $theme_layouts = inti_get_theme_layouts(false);
 $wp_customize->add_section('inti_customizer_posts', array('title' => __('Page Options', 'inti'), 'priority' => 20));
 $wp_customize->add_setting('inti_customizer_options[site_layout]', array('default' => '2c-l', 'type' => 'option', 'capability' => 'manage_options'));
 $wp_customize->add_control('inti_customizer_options[site_layout]', array('label' => __('Default Layout', 'inti'), 'description' => __('Default layout for all pages, posts, archives and custom types throughout the site if not individually changed or overwritten below', 'inti'), 'section' => 'inti_customizer_posts', 'type' => 'select', 'choices' => $theme_layouts, 'priority' => 4));
 $wp_customize->add_setting('inti_customizer_options[page_layout]', array('default' => '2c-l', 'type' => 'option', 'capability' => 'manage_options'));
 $wp_customize->add_control('inti_customizer_options[page_layout]', array('label' => __('Page Layout', 'inti'), 'description' => __('Default layout for static pages', 'inti'), 'section' => 'inti_customizer_posts', 'type' => 'select', 'choices' => $theme_layouts, 'priority' => 5));
 $wp_customize->add_setting('inti_customizer_options[post_layout]', array('default' => '2c-l', 'type' => 'option', 'capability' => 'manage_options'));
 $wp_customize->add_control('inti_customizer_options[post_layout]', array('label' => __('Single Post Layout', 'inti'), 'description' => __('Default layout for blog posts', 'inti'), 'section' => 'inti_customizer_posts', 'type' => 'select', 'choices' => $theme_layouts, 'priority' => 6));
 $wp_customize->add_setting('inti_customizer_options[archive_layout]', array('default' => '2c-l', 'type' => 'option', 'capability' => 'manage_options'));
 $wp_customize->add_control('inti_customizer_options[archive_layout]', array('label' => __('Post Archive Layout', 'inti'), 'description' => __('Default layout for blog post archives and index', 'inti'), 'section' => 'inti_customizer_posts', 'type' => 'select', 'choices' => $theme_layouts, 'priority' => 6));
 $wp_customize->add_setting('inti_customizer_options[sticky_sidebars]', array('default' => 'static', 'type' => 'option', 'capability' => 'manage_options', 'theme_supports' => 'inti-sticky-sidebars'));
 $wp_customize->add_control('inti_customizer_options[sticky_sidebars]', array('label' => __('Sticky Sidebars', 'inti'), 'description' => __('Keep sidebar widgets in view as you scroll down the page.', 'inti'), 'section' => 'inti_customizer_posts', 'type' => 'select', 'choices' => array('static' => __('Static', 'inti'), 'sticky' => __('Sticky', 'inti')), 'priority' => 7));
 // Fonts
 $font_faces = array_merge(inti_get_typography_os_fonts(), inti_get_typography_google_fonts());
 $font_sizes = inti_get_typography_font_sizes();
 $wp_customize->add_section('inti_customizer_main_styles', array('title' => __('Main Styles', 'inti'), 'priority' => 30, 'theme_supports' => 'inti-fonts'));
 $wp_customize->add_setting('inti_customizer_options[title_font]', array('default' => "'Helvetica Neue', Helvetica, Arial, sans-serif", 'type' => 'option', 'capability' => 'manage_options', 'theme_supports' => 'inti-fonts'));
 $wp_customize->add_control('inti_customizer_options[title_font]', array('label' => __('Page & Post Titles Font', 'inti'), 'section' => 'inti_customizer_main_styles', 'type' => 'select', 'choices' => $font_faces));
 $wp_customize->add_setting('inti_customizer_options[title_color]', array('default' => '', 'type' => 'option', 'capability' => 'manage_options', 'theme_supports' => 'inti-fonts', 'sanitize_callback' => 'maybe_hash_hex_color', 'sanitize_js_callback' => 'maybe_hash_hex_color'));
 $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'inti_title_color', array('label' => __('Page & Post Titles Color', 'inti'), 'section' => 'inti_customizer_main_styles', 'settings' => 'inti_customizer_options[title_color]')));
 $wp_customize->add_setting('inti_customizer_options[link_color]', array('default' => '', 'type' => 'option', 'capability' => 'manage_options', 'theme_supports' => 'inti-fonts', 'sanitize_callback' => 'maybe_hash_hex_color', 'sanitize_js_callback' => 'maybe_hash_hex_color'));
 $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'inti_link_color', array('label' => __('General Link Color', 'inti'), 'section' => 'inti_customizer_main_styles', 'settings' => 'inti_customizer_options[link_color]')));
 $wp_customize->add_setting('inti_customizer_options[link_hover_color]', array('default' => '', 'type' => 'option', 'capability' => 'manage_options', 'theme_supports' => 'inti-fonts', 'sanitize_callback' => 'maybe_hash_hex_color', 'sanitize_js_callback' => 'maybe_hash_hex_color'));
 $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'inti_link_hover_color', array('label' => __('General Link Hover Color', 'inti'), 'section' => 'inti_customizer_main_styles', 'settings' => 'inti_customizer_options[link_hover_color]')));
 $wp_customize->add_section('inti_customizer_content_styles', array('title' => __('Content Styles', 'inti'), 'priority' => 55, 'theme_supports' => 'inti-fonts'));
 $wp_customize->add_setting('inti_customizer_options[paragraph_font]', array('default' => "'Open Sans', sans-serif", 'type' => 'option', 'capability' => 'manage_options', 'theme_supports' => 'inti-fonts'));
 $wp_customize->add_control('inti_customizer_options[paragraph_font]', array('label' => __('Paragraph Font', 'inti'), 'section' => 'inti_customizer_content_styles', 'type' => 'select', 'choices' => $font_faces));
 $wp_customize->add_setting('inti_customizer_options[paragraph_size]', array('default' => "", 'type' => 'option', 'capability' => 'manage_options', 'theme_supports' => 'inti-fonts'));
 $wp_customize->add_control('inti_customizer_options[paragraph_size]', array('label' => __('Paragraph Size', 'inti'), 'section' => 'inti_customizer_content_styles', 'type' => 'select', 'choices' => $font_sizes));