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

PHP ttfmake_get_default函数代码示例

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

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



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

示例1: ttfmake_customizer_sitetitletagline

 /**
  * Configure settings and controls for the Site Title & Tagline section.
  *
  * @since  1.0.0.
  *
  * @return void
  */
 function ttfmake_customizer_sitetitletagline()
 {
     global $wp_customize;
     $priority = new TTFMAKE_Prioritizer(10, 1);
     $control_prefix = 'ttfmake_';
     $section = 'title_tagline';
     // Site title color
     $setting_id = 'color-site-title';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'maybe_hash_hex_color'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Site Title Color', 'make'), 'priority' => $priority->add())));
     // Change priority for Site Title
     $site_title = $wp_customize->get_control('blogname');
     $site_title->priority = $priority->add();
     // Hide Site Title
     $setting_id = 'hide-site-title';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'absint'));
     $wp_customize->add_control($control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Hide Site Title', 'make'), 'type' => 'checkbox', 'priority' => $priority->add()));
     // Change priority for Tagline
     $site_description = $wp_customize->get_control('blogdescription');
     $site_description->priority = $priority->add();
     // Hide Tagline
     $setting_id = 'hide-tagline';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'absint'));
     $wp_customize->add_control($control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Hide Tagline', 'make'), 'type' => 'checkbox', 'priority' => $priority->add()));
 }
开发者ID:marceloroberto,项目名称:make,代码行数:32,代码来源:site-title-tagline.php


示例2: ttfmake_customizer_logo

 /**
  * Configure settings and controls for the Logo section.
  *
  * @since  1.0.0.
  *
  * @param  object    $wp_customize    The global customizer object.
  * @param  string    $section         The section name.
  * @return void
  */
 function ttfmake_customizer_logo($wp_customize, $section)
 {
     $priority = new TTFMAKE_Prioritizer();
     $control_prefix = 'ttfmake_';
     $setting_prefix = str_replace($control_prefix, '', $section);
     // Regular Logo
     $setting_id = $setting_prefix . '-regular';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw'));
     $wp_customize->add_control(new TTFMAKE_Customize_Image_Control($wp_customize, $control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Regular Logo', 'make'), 'priority' => $priority->add(), 'context' => $control_prefix . $setting_id)));
     // Retina Logo
     $setting_id = $setting_prefix . '-retina';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw'));
     $wp_customize->add_control(new TTFMAKE_Customize_Image_Control($wp_customize, $control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Retina Logo (2x)', 'make'), 'priority' => $priority->add(), 'context' => $control_prefix . $setting_id)));
     // Retina info
     $setting_id = $setting_prefix . '-retina-info';
     $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'text', 'description' => __('The Retina Logo should be twice the size of the Regular Logo.', 'make'), 'priority' => $priority->add())));
     // Favicon
     $setting_id = $setting_prefix . '-favicon';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw'));
     $wp_customize->add_control(new TTFMAKE_Customize_Image_Control($wp_customize, $control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Favicon', 'make'), 'priority' => $priority->add(), 'context' => $control_prefix . $setting_id, 'extensions' => array('png', 'ico'))));
     // Favicon info
     $setting_id = $setting_prefix . '-favicon-info';
     $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'text', 'description' => __('File must be <strong>.png</strong> or <strong>.ico</strong> format. Optimal dimensions: <strong>32px x 32px</strong>.', 'make'), 'priority' => $priority->add())));
     // Apple Touch Icon
     $setting_id = $setting_prefix . '-apple-touch';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw'));
     $wp_customize->add_control(new TTFMAKE_Customize_Image_Control($wp_customize, $control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Apple Touch Icon', 'make'), 'priority' => $priority->add(), 'context' => $control_prefix . $setting_id, 'extensions' => array('png'))));
     // Apple Touch Icon info
     $setting_id = $setting_prefix . '-apple-touch-info';
     $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'text', 'description' => __('File must be <strong>.png</strong> format. Optimal dimensions: <strong>152px x 152px</strong>.', 'make'), 'priority' => $priority->add())));
 }
开发者ID:marceloroberto,项目名称:make,代码行数:40,代码来源:logo.php


示例3: ttfmake_customizer_main

 /**
  * Configure settings and controls for the Main section.
  *
  * @since  1.0.0.
  *
  * @param  object    $wp_customize    The global customizer object.
  * @param  string    $section         The section name.
  * @return void
  */
 function ttfmake_customizer_main($wp_customize, $section)
 {
     $priority = new TTFMAKE_Prioritizer();
     $control_prefix = 'ttfmake_';
     $setting_prefix = str_replace($control_prefix, '', $section);
     // Background color
     $setting_id = $setting_prefix . '-background-color';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'maybe_hash_hex_color'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Background Color', 'make'), 'priority' => $priority->add())));
     // Background Image
     $setting_id = $setting_prefix . '-background-image';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw'));
     $wp_customize->add_control(new TTFMAKE_Customize_Image_Control($wp_customize, $control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Background Image', 'make'), 'priority' => $priority->add(), 'context' => $control_prefix . $setting_id)));
     // Background Repeat
     $setting_id = $setting_prefix . '-background-repeat';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'ttfmake_sanitize_choice'));
     $wp_customize->add_control($control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Background Repeat', 'make'), 'type' => 'radio', 'choices' => ttfmake_get_choices($setting_id), 'priority' => $priority->add()));
     // Background Position
     $setting_id = $setting_prefix . '-background-position';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'ttfmake_sanitize_choice'));
     $wp_customize->add_control($control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Background Position', 'make'), 'type' => 'radio', 'choices' => ttfmake_get_choices($setting_id), 'priority' => $priority->add()));
     // Background Size
     $setting_id = $setting_prefix . '-background-size';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'ttfmake_sanitize_choice'));
     $wp_customize->add_control($control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Background Size', 'make'), 'type' => 'radio', 'choices' => ttfmake_get_choices($setting_id), 'priority' => $priority->add()));
     // Content options heading
     $setting_id = $setting_prefix . '-content-heading';
     $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'heading', 'label' => __('Content Options', 'make'), 'priority' => $priority->add())));
     // Underline content links
     $setting_id = $setting_prefix . '-content-link-underline';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'absint'));
     $wp_customize->add_control($control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Underline links in content', 'make'), 'type' => 'checkbox', 'priority' => $priority->add()));
 }
开发者ID:marceloroberto,项目名称:make,代码行数:42,代码来源:main.php


示例4: ttfmake_maybe_add_with_avatar_class

 /**
  * Add a class to the bounding div if a post uses an avatar with the author byline.
  *
  * @since  1.0.11.
  *
  * @param  array     $classes    An array of post classes.
  * @param  string    $class      A comma-separated list of additional classes added to the post.
  * @param  int       $post_ID    The post ID.
  * @return array                 The modified post class array.
  */
 function ttfmake_maybe_add_with_avatar_class($classes, $class, $post_ID)
 {
     $author_key = 'layout-' . ttfmake_get_view() . '-post-author';
     $author_option = ttfmake_sanitize_choice(get_theme_mod($author_key, ttfmake_get_default($author_key)), $author_key);
     if ('avatar' === $author_option) {
         $classes[] = 'has-author-avatar';
     }
     return $classes;
 }
开发者ID:fovoc,项目名称:make,代码行数:19,代码来源:layout.php


示例5: ttfmake_customizer_navigation

 /**
  * Configure settings and controls for the Navigation section.
  *
  * @since  1.0.0.
  *
  * @return void
  */
 function ttfmake_customizer_navigation()
 {
     global $wp_customize;
     $priority = new TTFMAKE_Prioritizer();
     $control_prefix = 'ttfmake_';
     $section = 'nav';
     // Menu Label
     $setting_id = 'navigation-mobile-label';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_html', 'theme_supports' => 'menus', 'transport' => 'postMessage'));
     $wp_customize->add_control($control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Mobile Menu Label', 'make'), 'type' => 'text', 'priority' => $priority->add()));
     // Menu Label info
     $setting_id = 'navigation-mobile-lable-info';
     $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'text', 'description' => __('Resize your browser window to preview the mobile menu label.', 'make'), 'priority' => $priority->add())));
 }
开发者ID:marceloroberto,项目名称:make,代码行数:21,代码来源:navigation.php


示例6: ttfmake_customizer_general

 /**
  * Configure settings and controls for the General section
  *
  * @since  1.0.0.
  *
  * @param  object    $wp_customize    The global customizer object.
  * @param  string    $section         The section name.
  * @return void
  */
 function ttfmake_customizer_general($wp_customize, $section)
 {
     $priority = new TTFMAKE_Prioritizer();
     $control_prefix = 'ttfmake_';
     $setting_prefix = str_replace($control_prefix, '', $section);
     // Site Layout
     $setting_id = $setting_prefix . '-layout';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'ttfmake_sanitize_choice'));
     $wp_customize->add_control($control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Site Layout', 'make'), 'type' => 'radio', 'choices' => ttfmake_get_choices($setting_id), 'priority' => $priority->add()));
     // Sticky label
     $setting_id = $setting_prefix . '-sticky-label';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_html', 'transport' => 'postMessage'));
     $wp_customize->add_control($control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Sticky Label', 'make'), 'type' => 'text', 'priority' => $priority->add()));
 }
开发者ID:marceloroberto,项目名称:make,代码行数:23,代码来源:general.php


示例7: ttfmake_maybe_show_site_region

/**
 * Output the site region (header or footer) markup if the current view calls for it.
 * ADD some hooks that I can use before and after
 *
 * @since  1.0.0.
 *
 * @param  string    $region    Region to maybe show.
 * @return void
 */
function ttfmake_maybe_show_site_region($region)
{
    if (!in_array($region, array('header', 'footer'))) {
        return;
    }
    // Get the view
    $view = ttfmake_get_view();
    // Get the relevant option
    $hide_region = (bool) get_theme_mod('layout-' . $view . '-hide-' . $region, ttfmake_get_default('layout-' . $view . '-hide-' . $region));
    do_action('ttfmake_before_' . $region, $hide_region);
    if (true !== $hide_region) {
        get_template_part('partials/' . $region . '-layout', get_theme_mod($region . '-layout', ttfmake_get_default($region . '-layout')));
    }
    do_action('ttfmake_after_' . $region, $hide_region);
}
开发者ID:helgatheviking,项目名称:criticalink,代码行数:24,代码来源:functions.php


示例8: ttfmake_jetpack_infinite_scroll_has_footer_widgets

 /**
  * Determine whether any footer widgets are actually showing.
  *
  * @since  1.0.0.
  *
  * @return bool    Whether or not infinite scroll has footer widgets.
  */
 function ttfmake_jetpack_infinite_scroll_has_footer_widgets()
 {
     // Get the view
     $view = ttfmake_get_view();
     // Get the relevant options
     $hide_footer = (bool) get_theme_mod('layout-' . $view . '-hide-footer', ttfmake_get_default('layout-' . $view . '-hide-footer'));
     $widget_areas = (int) get_theme_mod('footer-widget-areas', ttfmake_get_default('footer-widget-areas'));
     // No widget areas are visible
     if (true === $hide_footer || $widget_areas < 1) {
         return false;
     }
     // Check for active widgets in visible widget areas
     $i = 1;
     while ($i <= $widget_areas) {
         if (is_active_sidebar('footer-' . $i)) {
             return true;
         }
         $i++;
     }
     // Still here? No footer widgets.
     return false;
 }
开发者ID:fovoc,项目名称:make,代码行数:29,代码来源:jetpack.php


示例9: ttfmake_customizer_color

 /**
  * Configure settings and controls for the Colors section.
  *
  * @since  1.0.0.
  *
  * @param  object    $wp_customize    The global customizer object.
  * @param  string    $section         The section name.
  * @return void
  */
 function ttfmake_customizer_color($wp_customize, $section)
 {
     $priority = new TTFMAKE_Prioritizer();
     $control_prefix = 'ttfmake_';
     $setting_prefix = str_replace($control_prefix, '', $section);
     // Primary Color
     $setting_id = $setting_prefix . '-primary';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'maybe_hash_hex_color'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Primary Color', 'make'), 'priority' => $priority->add())));
     // Secondary Color
     $setting_id = $setting_prefix . '-secondary';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'maybe_hash_hex_color'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Secondary Color', 'make'), 'priority' => $priority->add())));
     // Text Color
     $setting_id = $setting_prefix . '-text';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'maybe_hash_hex_color'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Text Color', 'make'), 'priority' => $priority->add())));
     // Detail Color
     $setting_id = $setting_prefix . '-detail';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'maybe_hash_hex_color'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Detail Color', 'make'), 'priority' => $priority->add())));
 }
开发者ID:marceloroberto,项目名称:make,代码行数:31,代码来源:color.php


示例10: ttfmake_customizer_background

 /**
  * Configure settings and controls for the Background section.
  *
  * @since  1.0.0.
  *
  * @return void
  */
 function ttfmake_customizer_background()
 {
     global $wp_customize;
     $priority = new TTFMAKE_Prioritizer(10, 5);
     $control_prefix = 'ttfmake_';
     $section = 'background_image';
     // Rename Background Image section to Background
     $wp_customize->get_section($section)->title = __('Background', 'make');
     // Move Background Color to Background section
     $wp_customize->get_control('background_color')->section = $section;
     // Background note
     $setting_id = 'background-info';
     $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'text', 'description' => __('With the Site Layout option (under <em>General</em>) set to "Full Width", the background color and image will not be visible.', 'make'), 'priority' => $priority->add())));
     // Reset priorities on existing controls
     $wp_customize->get_control('background_color')->priority = $priority->add();
     $wp_customize->get_control('background_image')->priority = $priority->add();
     $wp_customize->get_control('background_repeat')->priority = $priority->add();
     $wp_customize->get_control('background_position_x')->priority = $priority->add();
     $wp_customize->get_control('background_attachment')->priority = $priority->add();
     // Background Size
     $setting_id = 'background_size';
     $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'ttfmake_sanitize_choice'));
     $wp_customize->add_control($control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Background Size', 'make'), 'type' => 'radio', 'choices' => ttfmake_get_choices($setting_id), 'priority' => $priority->add()));
 }
开发者ID:marceloroberto,项目名称:make,代码行数:31,代码来源:background.php


示例11: ttfmake_get_view

<?php

/**
 * @package Make
 */
$taxonomy_view = ttfmake_get_view();
$category_key = 'layout-' . $taxonomy_view . '-show-categories';
$tag_key = 'layout-' . $taxonomy_view . '-show-tags';
$category_option = (bool) get_theme_mod($category_key, ttfmake_get_default($category_key));
$tag_option = (bool) get_theme_mod($tag_key, ttfmake_get_default($tag_key));
?>

<?php 
if (($category_option || $tag_option) && (has_category() && ttfmake_categorized_blog() || has_tag())) {
    ?>
	<?php 
    $category_list = get_the_category_list();
    $tag_list = get_the_tag_list('<ul class="post-tags"><li>', "</li>\n<li>", '</li></ul>');
    // Replicates category output
    $taxonomy_output = '';
    // Categories
    if ($category_option && $category_list) {
        $taxonomy_output .= __('<i class="fa fa-file"></i> ', 'make') . '%1$s';
    }
    // Tags
    if ($tag_option && $tag_list) {
        $taxonomy_output .= __('<i class="fa fa-tag"></i> ', 'make') . '%2$s';
    }
    // Output
    printf($taxonomy_output, $category_list, $tag_list);
}
开发者ID:marceloroberto,项目名称:make,代码行数:31,代码来源:entry-taxonomy.php


示例12: ttfmake_customizer_add_section_options

 /**
  * Register settings and controls for a section.
  *
  * @since  1.3.0.
  *
  * @param  string    $section             Section ID
  * @param  array     $args                Array of setting and control definitions
  * @param  int       $initial_priority    The initial priority to use for controls
  * @return int                            The last priority value assigned
  */
 function ttfmake_customizer_add_section_options($section, $args, $initial_priority = 100)
 {
     global $wp_customize;
     $priority = new TTFMAKE_Prioritizer($initial_priority, 5);
     $theme_prefix = 'ttfmake_';
     foreach ($args as $setting_id => $option) {
         // Add setting
         if (isset($option['setting'])) {
             $defaults = array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'default' => ttfmake_get_default($setting_id), 'transport' => 'refresh', 'sanitize_callback' => '', 'sanitize_js_callback' => '');
             $setting = wp_parse_args($option['setting'], $defaults);
             // Add the setting arguments inline so Theme Check can verify the presence of sanitize_callback
             $wp_customize->add_setting($setting_id, array('type' => $setting['type'], 'capability' => $setting['capability'], 'theme_supports' => $setting['theme_supports'], 'default' => $setting['default'], 'transport' => $setting['transport'], 'sanitize_callback' => $setting['sanitize_callback'], 'sanitize_js_callback' => $setting['sanitize_js_callback']));
         }
         // Add control
         if (isset($option['control'])) {
             $control_id = $theme_prefix . $setting_id;
             $defaults = array('settings' => $setting_id, 'section' => $section, 'priority' => $priority->add());
             if (!isset($option['setting'])) {
                 unset($defaults['settings']);
             }
             $control = wp_parse_args($option['control'], $defaults);
             // Check for a specialized control class
             if (isset($control['control_type'])) {
                 $class = $control['control_type'];
                 $control_path = apply_filters('make_customizer_control_path', get_template_directory() . '/inc/customizer/controls/', $control);
                 $control_file = $control_path . $class . '.php';
                 if (file_exists($control_file)) {
                     require_once $control_file;
                 }
                 if (class_exists($class)) {
                     unset($control['control_type']);
                     // Dynamically generate a new class instance
                     $reflection = new ReflectionClass($class);
                     $class_instance = $reflection->newInstanceArgs(array($wp_customize, $control_id, $control));
                     $wp_customize->add_control($class_instance);
                 }
             } else {
                 $wp_customize->add_control($control_id, $control);
             }
         }
     }
     return $priority->get();
 }
开发者ID:jalex403,项目名称:make,代码行数:53,代码来源:bootstrap.php


示例13: ttfmake_customizer_add_section_options

 /**
  * Register settings and controls for a section.
  *
  * @since  1.3.0.
  *
  * @param  string    $section             Section ID
  * @param  array     $args                Array of setting and control definitions
  * @param  int       $initial_priority    The initial priority to use for controls
  * @return int                            The last priority value assigned
  */
 function ttfmake_customizer_add_section_options($section, $args, $initial_priority = 100)
 {
     global $wp_customize;
     $priority = new TTFMAKE_Prioritizer($initial_priority, 5);
     $theme_prefix = 'ttfmake_';
     foreach ($args as $setting_id => $option) {
         // Add setting
         if (isset($option['setting'])) {
             $defaults = array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod');
             $setting = wp_parse_args($option['setting'], $defaults);
             $wp_customize->add_setting($setting_id, $setting);
         }
         // Add control
         if (isset($option['control'])) {
             $control_id = $theme_prefix . $setting_id;
             $defaults = array('settings' => $setting_id, 'section' => $section, 'priority' => $priority->add());
             if (!isset($option['setting'])) {
                 unset($defaults['settings']);
             }
             $control = wp_parse_args($option['control'], $defaults);
             // Check for a specialized control class
             if (isset($control['control_type'])) {
                 $class = $control['control_type'];
                 unset($control['control_type']);
                 $wp_customize->add_control(new $class($wp_customize, $control_id, $control));
             } else {
                 $wp_customize->add_control($control_id, $control);
             }
         }
     }
     return $priority->get();
 }
开发者ID:marceloroberto,项目名称:make,代码行数:42,代码来源:bootstrap.php


示例14: ttfmake_maybe_show_social_links

    /**
     * Show the social links markup if the theme options and/or menus are configured for it.
     *
     * @since  1.0.0.
     *
     * @param  string    $region    The site region (header or footer).
     * @return void
     */
    function ttfmake_maybe_show_social_links($region)
    {
        if (!in_array($region, array('header', 'footer'))) {
            return;
        }
        $show_social = (bool) get_theme_mod($region . '-show-social', ttfmake_get_default($region . '-show-social'));
        if (true === $show_social) {
            // First look for the alternate custom menu method
            if (has_nav_menu('social')) {
                wp_nav_menu(array('theme_location' => 'social', 'container' => false, 'menu_id' => '', 'menu_class' => 'social-menu social-links ' . $region . '-social-links', 'depth' => 1, 'fallback_cb' => ''));
            } else {
                $social_links = ttfmake_get_social_links();
                if (!empty($social_links)) {
                    ?>
				<ul class="social-customizer social-links <?php 
                    echo $region;
                    ?>
-social-links">
				<?php 
                    foreach ($social_links as $key => $link) {
                        ?>
					<li class="<?php 
                        echo esc_attr($key);
                        ?>
">
						<a href="<?php 
                        echo esc_url($link['url']);
                        ?>
">
							<i class="fa fa-fw <?php 
                        echo esc_attr($link['class']);
                        ?>
">
								<span><?php 
                        echo esc_html($link['title']);
                        ?>
</span>
							</i>
						</a>
					</li>
				<?php 
                    }
                    ?>
				</ul>
			<?php 
                }
            }
        }
    }
开发者ID:janladaking,项目名称:theme-maker,代码行数:57,代码来源:template-tags.php


示例15: enqueue_admin_scripts

 /**
  * Enqueue formatting scripts for Post/Page editing screens in the admin.
  *
  * @since 1.4.1.
  *
  * @param $hook_suffix
  */
 public function enqueue_admin_scripts($hook_suffix)
 {
     if (in_array($hook_suffix, array('post.php', 'post-new.php'))) {
         /**
          * Admin styles
          */
         wp_enqueue_style('ttfmake-formatting', trailingslashit(get_template_directory_uri()) . 'inc/formatting/formatting.css', array(), TTFMAKE_VERSION);
         /**
          * Format Builder
          */
         $dependencies = array('backbone', 'underscore', 'jquery');
         // Core
         wp_enqueue_script('ttfmake-format-builder-core', trailingslashit(get_template_directory_uri()) . 'inc/formatting/format-builder/format-builder.js', $dependencies, TTFMAKE_VERSION);
         wp_localize_script('ttfmake-format-builder-core', 'ttfmakeFormatBuilderVars', array('userSettings' => array('fontSizeBody' => get_theme_mod('font-size-body', ttfmake_get_default('font-size-body')), 'colorPrimary' => get_theme_mod('color-primary', ttfmake_get_default('color-primary')), 'colorSecondary' => get_theme_mod('color-secondary', ttfmake_get_default('color-secondary')))));
         // Base model
         wp_enqueue_script('ttfmake-format-builder-model-base', trailingslashit(get_template_directory_uri()) . 'inc/formatting/format-builder/models/base.js', $dependencies, TTFMAKE_VERSION);
         $dependencies[] = 'ttfmake-format-builder-model-base';
         // Format models
         $default_uri = trailingslashit(get_template_directory_uri()) . 'inc/formatting/format-builder/models';
         /**
          * Filter the format model definitions and their script locations.
          *
          * model => URI of the model's script file
          *
          * @since 1.4.1
          *
          * @param array    $models    The array of format models.
          */
         $models = apply_filters('make_format_builder_format_models', array('button' => array('uri' => $default_uri), 'list' => array('uri' => $default_uri), 'notice' => array('uri' => $default_uri)));
         foreach ($models as $model => $atts) {
             $handle = 'ttfmake-format-builder-model-' . $model;
             $url = trailingslashit($atts['uri']) . "{$model}.js";
             wp_enqueue_script($handle, $url, $dependencies, TTFMAKE_VERSION);
             $dependencies[] = $handle;
         }
         /**
          * Dynamic Stylesheet
          */
         wp_enqueue_script('ttfmake-dynamic-stylesheet', trailingslashit(get_template_directory_uri()) . 'inc/formatting/dynamic-stylesheet/dynamic-stylesheet.js', array('jquery', 'editor'), TTFMAKE_VERSION, true);
         wp_localize_script('ttfmake-dynamic-stylesheet', 'ttfmakeDynamicStylesheetVars', array('tinymce' => true));
         /**
          * Icon Picker
          */
         // Icon styles
         wp_enqueue_style('font-awesome', get_template_directory_uri() . '/css/font-awesome' . TTFMAKE_SUFFIX . '.css', array(), '4.5.0');
         // Icon definitions
         wp_enqueue_script('ttfmake-icon-picker-list', trailingslashit(get_template_directory_uri()) . 'inc/formatting/icon-picker/icons.js', array(), TTFMAKE_VERSION);
         // Icon Picker
         wp_enqueue_script('ttfmake-icon-picker', trailingslashit(get_template_directory_uri()) . 'inc/formatting/icon-picker/icon-picker.js', array('ttfmake-icon-picker-list', 'jquery'), TTFMAKE_VERSION);
     }
 }
开发者ID:fovoc,项目名称:make,代码行数:58,代码来源:formatting.php


示例16: ttfmake_get_social_links

 /**
  * Get the social links from options.
  *
  * @since  1.0.0.
  *
  * @return array    Keys are service names and the values are links.
  */
 function ttfmake_get_social_links()
 {
     // Define default services; note that these are intentionally non-translatable
     $default_services = array('facebook-official' => array('title' => 'Facebook', 'class' => 'fa-facebook-official'), 'twitter' => array('title' => 'Twitter', 'class' => 'fa-twitter'), 'google-plus-square' => array('title' => 'Google+', 'class' => 'fa-google-plus-square'), 'linkedin' => array('title' => 'LinkedIn', 'class' => 'fa-linkedin'), 'instagram' => array('title' => 'Instagram', 'class' => 'fa-instagram'), 'flickr' => array('title' => 'Flickr', 'class' => 'fa-flickr'), 'youtube' => array('title' => 'YouTube', 'class' => 'fa-youtube'), 'vimeo-square' => array('title' => 'Vimeo', 'class' => 'fa-vimeo-square'), 'pinterest' => array('title' => 'Pinterest', 'class' => 'fa-pinterest'), 'email' => array('title' => __('Email', 'make'), 'class' => 'fa-envelope'), 'rss' => array('title' => __('RSS', 'make'), 'class' => 'fa-rss'));
     // Set up the collector array
     $services_with_links = array();
     // Get the links for these services
     foreach ($default_services as $service => $details) {
         $url = get_theme_mod('social-' . $service, ttfmake_get_default('social-' . $service));
         if ('' !== $url) {
             $services_with_links[$service] = array('title' => $details['title'], 'url' => $url, 'class' => $details['class']);
         }
     }
     // Special handling for RSS
     $hide_rss = (int) get_theme_mod('social-hide-rss', ttfmake_get_default('social-hide-rss'));
     if (0 === $hide_rss) {
         $custom_rss = get_theme_mod('social-custom-rss', ttfmake_get_default('social-custom-rss'));
         if (!empty($custom_rss)) {
             $services_with_links['rss']['url'] = $custom_rss;
         } else {
             $services_with_links['rss']['url'] = get_feed_link();
         }
     } else {
         unset($services_with_links['rss']);
     }
     // Properly set the email
     if (isset($services_with_links['email']['url'])) {
         $services_with_links['email']['url'] = 'mailto:' . $services_with_links['email']['url'];
     }
     /**
      * Filter the social links added to the site.
      *
      * @since 1.2.3.
      *
      * @param array    $services_with_links    The social services and links.
      */
     return apply_filters('make_social_links', $services_with_links);
 }
开发者ID:jalex403,项目名称:make,代码行数:45,代码来源:extras.php


示例17: ttfmake_sanitize_font_subset

 /**
  * Sanitize the Character Subset choice.
  *
  * @since  1.0.0
  *
  * @param  string    $value    The value to sanitize.
  * @return array               The sanitized value.
  */
 function ttfmake_sanitize_font_subset($value)
 {
     if (!array_key_exists($value, ttfmake_get_google_font_subsets())) {
         $value = ttfmake_get_default('font-subset');
     }
     /**
      * Filter the sanitized subset choice.
      *
      * @since 1.2.3.
      *
      * @param string    $value    The chosen subset value.
      */
     return apply_filters('make_sanitize_font_subset', $value);
 }
开发者ID:jalex403,项目名称:make,代码行数:22,代码来源:fonts.php


示例18: get_theme_mod

<?php

/**
 * @package Make
 */
// Header Options
$header_text = get_theme_mod('header-text', false);
$social_links = ttfmake_get_social_links();
$show_social = (int) get_theme_mod('header-show-social', ttfmake_get_default('header-show-social'));
$show_search = (int) get_theme_mod('header-show-search', ttfmake_get_default('header-show-search'));
$subheader_class = 1 === $show_social || 1 === $show_search ? ' right-content' : '';
$hide_site_title = (int) get_theme_mod('hide-site-title', ttfmake_get_default('hide-site-title'));
$hide_tagline = (int) get_theme_mod('hide-tagline', ttfmake_get_default('hide-tagline'));
$menu_label = get_theme_mod('navigation-mobile-label', ttfmake_get_default('navigation-mobile-label'));
$header_bar_menu = wp_nav_menu(array('theme_location' => 'header-bar', 'container_class' => 'header-bar-menu', 'depth' => 1, 'fallback_cb' => false, 'echo' => false));
?>

<header id="site-header" class="<?php 
echo esc_attr(ttfmake_get_site_header_class());
?>
" role="banner">
	<?php 
// Only show Sub Header if it has content
if (!empty($header_text) || 1 === $show_search || !empty($social_links) && 1 === $show_social || !empty($header_bar_menu)) {
    ?>
	<div class="header-bar<?php 
    echo esc_attr($subheader_class);
    ?>
">
		<div class="container">
			<a class="skip-link screen-reader-text" href="#site-content"><?php 
开发者ID:fovoc,项目名称:make,代码行数:31,代码来源:header-layout.php


示例19: get_theme_mod

<?php

/**
 * @package Make
 */
// Footer Options
$footer_layout = (int) get_theme_mod('footer-layout', ttfmake_get_default('footer-layout'));
$sidebar_count = (int) get_theme_mod('footer-widget-areas', ttfmake_get_default('footer-widget-areas'));
$social_links = ttfmake_get_social_links();
$show_social = (int) get_theme_mod('footer-show-social', ttfmake_get_default('footer-show-social'));
// Test for enabled sidebars that contain widgets
$has_active_sidebar = false;
if ($sidebar_count > 0) {
    $i = 1;
    while ($i <= $sidebar_count) {
        if (is_active_sidebar('footer-' . $i)) {
            $has_active_sidebar = true;
            break;
        }
        $i++;
    }
}
?>

<footer id="site-footer" class="site-footer footer-layout-<?php 
echo esc_attr($footer_layout);
?>
" role="contentinfo">
	<div class="container">
		<?php 
// Footer widget areas
开发者ID:fovoc,项目名称:make,代码行数:31,代码来源:footer-layout.php


示例20: get_logo_information

该文章已有0人参与评论

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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