本文整理汇总了PHP中ttfmake_get_default函数的典型用法代码示例。如果您正苦于以下问题:PHP ttfmake_get_default函数的具体用法?PHP ttfmake_get_default怎么用?PHP ttfmake_get_default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ttfmake_get_default函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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()));
}
示例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())));
}
示例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()));
}
示例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;
}
示例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())));
}
示例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()));
}
示例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);
}
示例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;
}
示例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())));
}
示例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()));
}
示例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);
}
示例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();
}
示例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();
}
示例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
}
}
}
}
示例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);
}
}