• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP et_get_google_fonts函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中et_get_google_fonts函数的典型用法代码示例。如果您正苦于以下问题:PHP et_get_google_fonts函数的具体用法?PHP et_get_google_fonts怎么用?PHP et_get_google_fonts使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了et_get_google_fonts函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: et_divi_customize_register

function et_divi_customize_register($wp_customize)
{
    $google_fonts = et_get_google_fonts();
    $font_choices = array();
    $font_choices['none'] = 'Default Theme Font';
    foreach ($google_fonts as $google_font_name => $google_font_properties) {
        $font_choices[$google_font_name] = $google_font_name;
    }
    $wp_customize->remove_section('title_tagline');
    $wp_customize->add_section('et_divi_settings', array('title' => __('Theme Settings', 'Divi'), 'priority' => 40));
    $wp_customize->add_section('et_google_fonts', array('title' => __('Fonts', 'Divi'), 'priority' => 50));
    $wp_customize->add_section('et_color_schemes', array('title' => __('Schemes', 'Divi'), 'priority' => 60, 'description' => __('Note: Color settings set above should be applied to the Default color scheme.', 'Divi')));
    $wp_customize->add_setting('et_divi[link_color]', array('default' => '#2EA3F2', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[link_color]', array('label' => __('Link Color', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[link_color]')));
    $wp_customize->add_setting('et_divi[font_color]', array('default' => '#666666', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[font_color]', array('label' => __('Main Font Color', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[font_color]')));
    $wp_customize->add_setting('et_divi[accent_color]', array('default' => '#2EA3F2', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[accent_color]', array('label' => __('Accent Color', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[accent_color]')));
    $wp_customize->add_setting('et_divi[footer_bg]', array('default' => '#222222', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[footer_bg]', array('label' => __('Footer Background Color', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[footer_bg]')));
    $wp_customize->add_setting('et_divi[menu_link]', array('default' => '#666666', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[menu_link]', array('label' => __('Menu Links Color', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[menu_link]')));
    $wp_customize->add_setting('et_divi[menu_link_active]', array('default' => '#2EA3F2', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[menu_link_active]', array('label' => __('Active Menu Link Color', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[menu_link_active]')));
    $wp_customize->add_setting('et_divi[boxed_layout]', array('type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control('et_divi[boxed_layout]', array('label' => __('Boxed Layout', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'checkbox', 'priority' => 10));
    $wp_customize->add_setting('et_divi[cover_background]', array('default' => 'on', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control('et_divi[cover_background]', array('label' => __('Stretch Background Image', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'checkbox', 'priority' => 10));
    $wp_customize->add_setting('et_divi[vertical_nav]', array('type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control('et_divi[vertical_nav]', array('label' => __('Vertical Navigation', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'checkbox', 'priority' => 20));
    $wp_customize->add_setting('et_divi[show_header_social_icons]', array('type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control('et_divi[show_header_social_icons]', array('label' => __('Show Social Icons in Header', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'checkbox', 'priority' => 30));
    $wp_customize->add_setting('et_divi[show_footer_social_icons]', array('default' => 'on', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control('et_divi[show_footer_social_icons]', array('label' => __('Show Social Icons in Footer', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'checkbox', 'priority' => 40));
    $wp_customize->add_setting('et_divi[show_search_icon]', array('default' => 'on', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control('et_divi[show_search_icon]', array('label' => __('Show Search Icon', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'checkbox', 'priority' => 50));
    $wp_customize->add_setting('et_divi[header_style]', array('default' => 'left', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control('et_divi[header_style]', array('label' => __('Header Style', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'select', 'choices' => array('left' => __('Default', 'Divi'), 'centered' => __('Centered', 'Divi')), 'priority' => 55));
    $wp_customize->add_setting('et_divi[phone_number]', array('type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control('et_divi[phone_number]', array('label' => __('Phone Number', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'text', 'priority' => 60));
    $wp_customize->add_setting('et_divi[header_email]', array('type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control('et_divi[header_email]', array('label' => __('Email', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'text', 'priority' => 70));
    $wp_customize->add_setting('et_divi[primary_nav_bg]', array('default' => '#ffffff', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[primary_nav_bg]', array('label' => __('Primary Navigation Background', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[primary_nav_bg]', 'priority' => 80)));
    $wp_customize->add_setting('et_divi[primary_nav_text_color]', array('default' => 'dark', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control('et_divi[primary_nav_text_color]', array('label' => __('Primary Navigation Text Color', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'select', 'choices' => array('dark' => __('Dark', 'Divi'), 'light' => __('Light', 'Divi')), 'priority' => 90));
    $wp_customize->add_setting('et_divi[secondary_nav_bg]', array('default' => et_get_option('accent_color', '#2EA3F2'), 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[secondary_nav_bg]', array('label' => __('Secondary Navigation Background', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[secondary_nav_bg]', 'priority' => 100)));
    $wp_customize->add_setting('et_divi[secondary_nav_text_color]', array('default' => 'light', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control('et_divi[secondary_nav_text_color]', array('label' => __('Secondary Navigation Text Color', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'select', 'choices' => array('dark' => __('Dark', 'Divi'), 'light' => __('Light', 'Divi')), 'priority' => 110));
    $wp_customize->add_setting('et_divi[heading_font]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control('et_divi[heading_font]', array('label' => __('Header Font', 'Divi'), 'section' => 'et_google_fonts', 'settings' => 'et_divi[heading_font]', 'type' => 'select', 'choices' => $font_choices));
    $wp_customize->add_setting('et_divi[body_font]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control('et_divi[body_font]', array('label' => __('Body Font', 'Divi'), 'section' => 'et_google_fonts', 'settings' => 'et_divi[body_font]', 'type' => 'select', 'choices' => $font_choices));
    $wp_customize->add_setting('et_divi[color_schemes]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control('et_divi[color_schemes]', array('label' => __('Color Schemes', 'Divi'), 'section' => 'et_color_schemes', 'settings' => 'et_divi[color_schemes]', 'type' => 'select', 'choices' => array('none' => __('Default', 'Divi'), 'green' => __('Green', 'Divi'), 'orange' => __('Orange', 'Divi'), 'pink' => __('Pink', 'Divi'), 'red' => __('Red', 'Divi'))));
}
开发者ID:ahmedghazi,项目名称:tpls,代码行数:57,代码来源:functions.php


示例2: et_gf_enqueue_fonts

 /**
  * Enqueues Google Fonts
  *
  */
 function et_gf_enqueue_fonts($et_gf_font_names)
 {
     global $shortname;
     if (!is_array($et_gf_font_names) || empty($et_gf_font_names)) {
         return;
     }
     $google_fonts = et_get_google_fonts();
     $protocol = is_ssl() ? 'https' : 'http';
     foreach ($et_gf_font_names as $et_gf_font_name) {
         $google_font_character_set = $google_fonts[$et_gf_font_name]['character_set'];
         // By default, only latin and latin-ext subsets are loaded, all available subsets can be enabled in ePanel
         if ('false' == et_get_option("{$shortname}_gf_enable_all_character_sets", 'false')) {
             $latin_ext = '';
             if (false !== strpos($google_fonts[$et_gf_font_name]['character_set'], 'latin-ext')) {
                 $latin_ext = ',latin-ext';
             }
             $google_font_character_set = "latin{$latin_ext}";
         }
         $query_args = array('family' => sprintf('%s:%s', str_replace(' ', '+', $et_gf_font_name), apply_filters('et_gf_set_styles', $google_fonts[$et_gf_font_name]['styles'], $et_gf_font_name)), 'subset' => apply_filters('et_gf_set_character_set', $google_font_character_set, $et_gf_font_name));
         $et_gf_font_name_slug = strtolower(str_replace(' ', '-', $et_gf_font_name));
         wp_enqueue_style('et-gf-' . $et_gf_font_name_slug, esc_url(add_query_arg($query_args, "{$protocol}://fonts.googleapis.com/css")), array(), null);
     }
 }
开发者ID:acchs,项目名称:test,代码行数:27,代码来源:custom_functions.php


示例3: et_dailyjournal_customize_register

 function et_dailyjournal_customize_register($wp_customize)
 {
     $google_fonts = et_get_google_fonts();
     $font_choices = array();
     $font_choices['none'] = 'Default Theme Font';
     foreach ($google_fonts as $google_font_name => $google_font_properties) {
         $font_choices[$google_font_name] = $google_font_name;
     }
     $wp_customize->remove_section('title_tagline');
     $wp_customize->remove_section('background_image');
     $wp_customize->remove_section('colors');
     $wp_customize->add_section('et_google_fonts', array('title' => __('Fonts', 'DailyJournal'), 'priority' => 50));
     $wp_customize->add_setting('dailyjournal_heading_font', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('dailyjournal_heading_font', array('label' => __('Header Font', 'DailyJournal'), 'section' => 'et_google_fonts', 'settings' => 'dailyjournal_heading_font', 'type' => 'select', 'choices' => $font_choices));
     $wp_customize->add_setting('dailyjournal_body_font', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('dailyjournal_body_font', array('label' => __('Body Font', 'DailyJournal'), 'section' => 'et_google_fonts', 'settings' => 'dailyjournal_body_font', 'type' => 'select', 'choices' => $font_choices));
 }
开发者ID:damiansu,项目名称:wordpress-es,代码行数:17,代码来源:functions.php


示例4: et_vertex_customize_register

function et_vertex_customize_register($wp_customize)
{
    $google_fonts = et_get_google_fonts();
    $font_choices = array();
    $font_choices['none'] = 'Default Theme Font';
    foreach ($google_fonts as $google_font_name => $google_font_properties) {
        $font_choices[$google_font_name] = $google_font_name;
    }
    $wp_customize->remove_section('title_tagline');
    $wp_customize->remove_section('background_image');
    $wp_customize->add_section('et_google_fonts', array('title' => __('Fonts', 'Vertex'), 'priority' => 50));
    $wp_customize->add_section('et_color_schemes', array('title' => __('Schemes', 'Vertex'), 'priority' => 60, 'description' => __('Note: Color settings set above should be applied to the Default color scheme.', 'Vertex')));
    $wp_customize->add_setting('et_vertex[link_color]', array('default' => '#4bb6f5', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_vertex[link_color]', array('label' => __('Link Color', 'Vertex'), 'section' => 'colors', 'settings' => 'et_vertex[link_color]')));
    $wp_customize->add_setting('et_vertex[font_color]', array('default' => '#959494', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_vertex[font_color]', array('label' => __('Main Font Color', 'Vertex'), 'section' => 'colors', 'settings' => 'et_vertex[font_color]')));
    $wp_customize->add_setting('et_vertex[accent_color_1]', array('default' => '#25383b', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_vertex[accent_color_1]', array('label' => __('Accent Color #1', 'Vertex'), 'section' => 'colors', 'settings' => 'et_vertex[accent_color_1]')));
    $wp_customize->add_setting('et_vertex[accent_color_2]', array('default' => '#c24c4c', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_vertex[accent_color_2]', array('label' => __('Accent Color #2', 'Vertex'), 'section' => 'colors', 'settings' => 'et_vertex[accent_color_2]')));
    $wp_customize->add_setting('et_vertex[menu_link]', array('default' => '#ffffff', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_vertex[menu_link]', array('label' => __('Menu Links Color', 'Vertex'), 'section' => 'colors', 'settings' => 'et_vertex[menu_link]')));
    $wp_customize->add_setting('et_vertex[menu_link_active]', array('default' => '#ffffff', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_vertex[menu_link_active]', array('label' => __('Active Menu Link Color', 'Vertex'), 'section' => 'colors', 'settings' => 'et_vertex[menu_link_active]')));
    $wp_customize->add_setting('et_vertex[heading_font]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options'));
    $wp_customize->add_control('et_vertex[heading_font]', array('label' => __('Header Font', 'Vertex'), 'section' => 'et_google_fonts', 'settings' => 'et_vertex[heading_font]', 'type' => 'select', 'choices' => $font_choices));
    $wp_customize->add_setting('et_vertex[body_font]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options'));
    $wp_customize->add_control('et_vertex[body_font]', array('label' => __('Body Font', 'Vertex'), 'section' => 'et_google_fonts', 'settings' => 'et_vertex[body_font]', 'type' => 'select', 'choices' => $font_choices));
    $wp_customize->add_setting('et_vertex[color_schemes]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control('et_vertex[color_schemes]', array('label' => __('Color Schemes', 'Vertex'), 'section' => 'et_color_schemes', 'settings' => 'et_vertex[color_schemes]', 'type' => 'select', 'choices' => array('none' => __('Default', 'Vertex'), 'blue' => __('Blue', 'Vertex'), 'green' => __('Green', 'Vertex'), 'purple' => __('Purple', 'Vertex'), 'red' => __('Red', 'Vertex'))));
}
开发者ID:iinspiration,项目名称:theme,代码行数:31,代码来源:functions.php


示例5: et_fusion_customize_register

 function et_fusion_customize_register($wp_customize)
 {
     $google_fonts = et_get_google_fonts();
     $font_choices = array();
     $font_choices['none'] = 'Default Theme Font';
     foreach ($google_fonts as $google_font_name => $google_font_properties) {
         $font_choices[$google_font_name] = $google_font_name;
     }
     $wp_customize->remove_section('title_tagline');
     $wp_customize->add_section('et_google_fonts', array('title' => __('Fonts', 'Fusion'), 'priority' => 50));
     $wp_customize->add_section('et_color_schemes', array('title' => __('Schemes', 'Fusion'), 'priority' => 60, 'description' => __('Note: Color settings set above should be applied to the Default color scheme.', 'Fusion')));
     $wp_customize->add_setting('et_fusion[highlight_color]', array('default' => '#c3e54b', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_fusion[highlight_color]', array('label' => __('Highlight Color', 'Fusion'), 'section' => 'colors', 'settings' => 'et_fusion[highlight_color]')));
     $wp_customize->add_setting('et_fusion[link_color]', array('default' => '#FFA300', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_fusion[link_color]', array('label' => __('Link Color', 'Fusion'), 'section' => 'colors', 'settings' => 'et_fusion[link_color]')));
     $wp_customize->add_setting('et_fusion[font_color]', array('default' => '#454545', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_fusion[font_color]', array('label' => __('Main Font Color', 'Fusion'), 'section' => 'colors', 'settings' => 'et_fusion[font_color]')));
     $wp_customize->add_setting('et_fusion[headings_color]', array('default' => '#454545', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_fusion[headings_color]', array('label' => __('Headings Color', 'Fusion'), 'section' => 'colors', 'settings' => 'et_fusion[headings_color]')));
     $wp_customize->add_setting('et_fusion[heading_font]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('et_fusion[heading_font]', array('label' => __('Header Font', 'Fusion'), 'section' => 'et_google_fonts', 'settings' => 'et_fusion[heading_font]', 'type' => 'select', 'choices' => $font_choices));
     $wp_customize->add_setting('et_fusion[body_font]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('et_fusion[body_font]', array('label' => __('Body Font', 'Fusion'), 'section' => 'et_google_fonts', 'settings' => 'et_fusion[body_font]', 'type' => 'select', 'choices' => $font_choices));
     $wp_customize->add_setting('et_fusion[color_schemes]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
     $wp_customize->add_control('et_fusion[color_schemes]', array('label' => __('Color Schemes', 'Fusion'), 'section' => 'et_color_schemes', 'settings' => 'et_fusion[color_schemes]', 'type' => 'select', 'choices' => array('none' => __('Default', 'Fusion'), 'blue' => __('Blue', 'Fusion'), 'green' => __('Green', 'Fusion'), 'purple' => __('Purple', 'Fusion'), 'red' => __('Red', 'Fusion'))));
 }
开发者ID:iinspiration,项目名称:theme,代码行数:26,代码来源:functions.php


示例6: et_sanitize_font_choices

/**
 * Sanitize font choice
 * @param string
 * @return string|bool
 */
function et_sanitize_font_choices($choosen)
{
    return et_sanitize_key_based_option($choosen, et_get_google_fonts());
}
开发者ID:GermaineMills,项目名称:gm-subs,代码行数:9,代码来源:sanitization.php


示例7: et_harmony_customize_register

 function et_harmony_customize_register($wp_customize)
 {
     $google_fonts = et_get_google_fonts();
     $font_choices = array();
     $font_choices['none'] = 'Default Theme Font';
     foreach ($google_fonts as $google_font_name => $google_font_properties) {
         $font_choices[$google_font_name] = $google_font_name;
     }
     $wp_customize->add_section('et_google_fonts', array('title' => __('Fonts', 'Harmony'), 'priority' => 50));
     $wp_customize->add_setting('et_harmony[link_color]', array('default' => '#FFA300', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_harmony[link_color]', array('label' => __('Link Color', 'Harmony'), 'section' => 'colors', 'settings' => 'et_harmony[link_color]')));
     $wp_customize->add_setting('et_harmony[font_color]', array('default' => '#3D5054', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_harmony[font_color]', array('label' => __('Main Font Color', 'Harmony'), 'section' => 'colors', 'settings' => 'et_harmony[font_color]')));
     $wp_customize->add_setting('et_harmony[logo_color]', array('default' => '#ffffff', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_harmony[logo_color]', array('label' => __('Logo Color', 'Harmony'), 'section' => 'colors', 'settings' => 'et_harmony[logo_color]')));
     $wp_customize->add_setting('et_harmony[heading_font]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('et_harmony[heading_font]', array('label' => __('Header Font', 'Harmony'), 'section' => 'et_google_fonts', 'settings' => 'et_harmony[heading_font]', 'type' => 'select', 'choices' => $font_choices));
     $wp_customize->add_setting('et_harmony[body_font]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('et_harmony[body_font]', array('label' => __('Body Font', 'Harmony'), 'section' => 'et_google_fonts', 'settings' => 'et_harmony[body_font]', 'type' => 'select', 'choices' => $font_choices));
 }
开发者ID:Acens,项目名称:jao2015,代码行数:20,代码来源:functions.php


示例8: et_foxy_customize_register

 function et_foxy_customize_register($wp_customize)
 {
     $google_fonts = et_get_google_fonts();
     $font_choices = array();
     $font_choices['none'] = 'Default Theme Font';
     foreach ($google_fonts as $google_font_name => $google_font_properties) {
         $font_choices[$google_font_name] = $google_font_name;
     }
     $wp_customize->remove_section('title_tagline');
     $wp_customize->remove_section('background_image');
     $wp_customize->add_section('et_google_fonts', array('title' => __('Fonts', 'Foxy'), 'priority' => 50));
     $wp_customize->add_section('et_color_schemes', array('title' => __('Schemes', 'Foxy'), 'priority' => 60, 'description' => __('Note: Color settings set above should be applied to the Default color scheme.', 'Foxy')));
     $wp_customize->add_setting('et_foxy[link_color]', array('default' => '#4bb6f5', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_foxy[link_color]', array('label' => __('Link Color', 'Foxy'), 'section' => 'colors', 'settings' => 'et_foxy[link_color]')));
     $wp_customize->add_setting('et_foxy[font_color]', array('default' => '#878787', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_foxy[font_color]', array('label' => __('Main Font Color', 'Foxy'), 'section' => 'colors', 'settings' => 'et_foxy[font_color]')));
     $wp_customize->add_setting('et_foxy[slider_bg]', array('default' => '#f7a13c', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_foxy[slider_bg]', array('label' => __('Slider Background Color', 'Foxy'), 'section' => 'colors', 'settings' => 'et_foxy[slider_bg]')));
     $wp_customize->add_setting('et_foxy[slider_shadow]', array('default' => '#bd3905', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_foxy[slider_shadow]', array('label' => __('Slider Shadow Color', 'Foxy'), 'section' => 'colors', 'settings' => 'et_foxy[slider_shadow]')));
     $wp_customize->add_setting('et_foxy[button_bg]', array('default' => '#ff8a1d', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_foxy[button_bg]', array('label' => __('Button / Tab Background Color', 'Foxy'), 'section' => 'colors', 'settings' => 'et_foxy[button_bg]')));
     $wp_customize->add_setting('et_foxy[button_shadow]', array('default' => '#d9531f', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_foxy[button_shadow]', array('label' => __('Button / Tab Shadow Color', 'Foxy'), 'section' => 'colors', 'settings' => 'et_foxy[button_shadow]')));
     $wp_customize->add_setting('et_foxy[widget_highlight]', array('default' => '#ed6f1d', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_foxy[widget_highlight]', array('label' => __('Widget Hightlight Color / Progress Bar Color', 'Foxy'), 'section' => 'colors', 'settings' => 'et_foxy[widget_highlight]')));
     $wp_customize->add_setting('et_foxy[heading_font]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'et_sanitize_font_choices'));
     $wp_customize->add_control('et_foxy[heading_font]', array('label' => __('Header Font', 'Foxy'), 'section' => 'et_google_fonts', 'settings' => 'et_foxy[heading_font]', 'type' => 'select', 'choices' => $font_choices));
     $wp_customize->add_setting('et_foxy[body_font]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'et_sanitize_font_choices'));
     $wp_customize->add_control('et_foxy[body_font]', array('label' => __('Body Font', 'Foxy'), 'section' => 'et_google_fonts', 'settings' => 'et_foxy[body_font]', 'type' => 'select', 'choices' => $font_choices));
     $wp_customize->add_setting('et_foxy[color_schemes]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'et_sanitize_color_scheme'));
     $wp_customize->add_control('et_foxy[color_schemes]', array('label' => __('Color Schemes', 'Foxy'), 'section' => 'et_color_schemes', 'settings' => 'et_foxy[color_schemes]', 'type' => 'select', 'choices' => et_theme_color_scheme_choices()));
 }
开发者ID:shimion,项目名称:simfoxy,代码行数:33,代码来源:functions.php


示例9: et_divi_customize_register

function et_divi_customize_register($wp_customize)
{
    $site_domain = get_locale();
    $google_fonts = et_get_google_fonts();
    $et_domain_fonts = array('ru_RU' => 'cyrillic', 'uk' => 'cyrillic', 'bg_BG' => 'cyrillic', 'vi' => 'vietnamese', 'el' => 'greek');
    $et_one_font_languages = et_get_one_font_languages();
    $font_choices = array();
    $font_choices['none'] = 'Default Theme Font';
    foreach ($google_fonts as $google_font_name => $google_font_properties) {
        if ('' !== $site_domain && isset($et_domain_fonts[$site_domain]) && false === strpos($google_font_properties['character_set'], $et_domain_fonts[$site_domain])) {
            continue;
        }
        $font_choices[$google_font_name] = $google_font_name;
    }
    $wp_customize->remove_section('title_tagline');
    $wp_customize->add_section('et_divi_settings', array('title' => __('Theme Settings', 'Divi'), 'priority' => 40));
    $wp_customize->add_section('et_google_fonts', array('title' => __('Fonts', 'Divi'), 'priority' => 50));
    $wp_customize->add_section('et_color_schemes', array('title' => __('Schemes', 'Divi'), 'priority' => 60, 'description' => __('Note: Color settings set above should be applied to the Default color scheme.', 'Divi')));
    $wp_customize->add_setting('et_divi[link_color]', array('default' => '#2EA3F2', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[link_color]', array('label' => __('Link Color', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[link_color]')));
    $wp_customize->add_setting('et_divi[font_color]', array('default' => '#666666', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[font_color]', array('label' => __('Main Font Color', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[font_color]')));
    $wp_customize->add_setting('et_divi[accent_color]', array('default' => '#2EA3F2', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[accent_color]', array('label' => __('Accent Color', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[accent_color]')));
    $wp_customize->add_setting('et_divi[footer_bg]', array('default' => '#222222', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[footer_bg]', array('label' => __('Footer Background Color', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[footer_bg]')));
    $wp_customize->add_setting('et_divi[menu_link]', array('default' => '#666666', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[menu_link]', array('label' => __('Menu Links Color', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[menu_link]')));
    $wp_customize->add_setting('et_divi[menu_link_active]', array('default' => '#2EA3F2', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[menu_link_active]', array('label' => __('Active Menu Link Color', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[menu_link_active]')));
    $wp_customize->add_setting('et_divi[boxed_layout]', array('type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'wp_validate_boolean'));
    $wp_customize->add_control('et_divi[boxed_layout]', array('label' => __('Boxed Layout', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'checkbox', 'priority' => 10));
    $wp_customize->add_setting('et_divi[cover_background]', array('default' => 'on', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'wp_validate_boolean'));
    $wp_customize->add_control('et_divi[cover_background]', array('label' => __('Stretch Background Image', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'checkbox', 'priority' => 10));
    $wp_customize->add_setting('et_divi[vertical_nav]', array('type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'wp_validate_boolean'));
    $wp_customize->add_control('et_divi[vertical_nav]', array('label' => __('Vertical Navigation', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'checkbox', 'priority' => 20));
    $wp_customize->add_setting('et_divi[show_header_social_icons]', array('type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'wp_validate_boolean'));
    $wp_customize->add_control('et_divi[show_header_social_icons]', array('label' => __('Show Social Icons in Header', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'checkbox', 'priority' => 30));
    $wp_customize->add_setting('et_divi[show_footer_social_icons]', array('default' => 'on', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'wp_validate_boolean'));
    $wp_customize->add_control('et_divi[show_footer_social_icons]', array('label' => __('Show Social Icons in Footer', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'checkbox', 'priority' => 40));
    $wp_customize->add_setting('et_divi[show_search_icon]', array('default' => 'on', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'wp_validate_boolean'));
    $wp_customize->add_control('et_divi[show_search_icon]', array('label' => __('Show Search Icon', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'checkbox', 'priority' => 50));
    $wp_customize->add_setting('et_divi[header_style]', array('default' => 'left', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'et_divi_legacy_sanitize_header_styles'));
    $wp_customize->add_control('et_divi[header_style]', array('label' => __('Header Style', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'select', 'choices' => et_divi_legacy_get_header_styles(), 'priority' => 55));
    $wp_customize->add_setting('et_divi[phone_number]', array('type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('et_divi[phone_number]', array('label' => __('Phone Number', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'text', 'priority' => 60));
    $wp_customize->add_setting('et_divi[header_email]', array('type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_email'));
    $wp_customize->add_control('et_divi[header_email]', array('label' => __('Email', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'text', 'priority' => 70));
    $wp_customize->add_setting('et_divi[primary_nav_bg]', array('default' => '#ffffff', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[primary_nav_bg]', array('label' => __('Primary Navigation Background', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[primary_nav_bg]', 'priority' => 80)));
    $wp_customize->add_setting('et_divi[primary_nav_text_color]', array('default' => 'dark', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'et_divi_legacy_sanitize_dark_light_colors'));
    $wp_customize->add_control('et_divi[primary_nav_text_color]', array('label' => __('Primary Navigation Text Color', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'select', 'choices' => et_divi_legacy_get_dark_light_color(), 'priority' => 90));
    $wp_customize->add_setting('et_divi[secondary_nav_bg]', array('default' => et_get_option('accent_color', '#2EA3F2'), 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'et_divi[secondary_nav_bg]', array('label' => __('Secondary Navigation Background', 'Divi'), 'section' => 'colors', 'settings' => 'et_divi[secondary_nav_bg]', 'priority' => 100)));
    $wp_customize->add_setting('et_divi[secondary_nav_text_color]', array('default' => 'light', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'et_divi_legacy_sanitize_dark_light_colors'));
    $wp_customize->add_control('et_divi[secondary_nav_text_color]', array('label' => __('Secondary Navigation Text Color', 'Divi'), 'section' => 'et_divi_settings', 'type' => 'select', 'choices' => et_divi_legacy_get_dark_light_color(), 'priority' => 110));
    if (!isset($et_one_font_languages[$site_domain])) {
        $wp_customize->add_setting('et_divi[heading_font]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'et_sanitize_font_choices'));
        $wp_customize->add_control('et_divi[heading_font]', array('label' => __('Header Font', 'Divi'), 'section' => 'et_google_fonts', 'settings' => 'et_divi[heading_font]', 'type' => 'select', 'choices' => $font_choices));
        $wp_customize->add_setting('et_divi[body_font]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'et_sanitize_font_choices'));
        $wp_customize->add_control('et_divi[body_font]', array('label' => __('Body Font', 'Divi'), 'section' => 'et_google_fonts', 'settings' => 'et_divi[body_font]', 'type' => 'select', 'choices' => $font_choices));
    }
    $wp_customize->add_setting('et_divi[color_schemes]', array('default' => 'none', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'et_sanitize_color_scheme'));
    $wp_customize->add_control('et_divi[color_schemes]', array('label' => __('Color Schemes', 'Divi'), 'section' => 'et_color_schemes', 'settings' => 'et_divi[color_schemes]', 'type' => 'select', 'choices' => et_theme_color_scheme_choices()));
}
开发者ID:GermaineMills,项目名称:gm-subs,代码行数:65,代码来源:functions.php



注:本文中的et_get_google_fonts函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP et_get_link_url函数代码示例发布时间:2022-05-15
下一篇:
PHP et_get_first_video函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap