/** * Define the sections and settings for the General panel * * @since 1.3.0. * * @param array $sections The master array of Customizer sections * @return array The augmented master array */ function ttfmake_customizer_define_typography_sections($sections) { $panel = 'ttfmake_typography'; $typography_sections = array(); /** * Typekit */ if (!ttfmake_is_plus()) { $typography_sections['font-typekit'] = array('panel' => $panel, 'title' => __('Typekit', 'make'), 'description' => __('Looking to add premium fonts from Typekit to your website?', 'make'), 'options' => array('font-typekit-update-text' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'type' => 'text', 'description' => sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(ttfmake_get_plus_link('typekit')), sprintf(__('Upgrade to %1$s', 'make'), 'Make Plus')))))); } /** * Google Web Fonts */ $typography_sections['font-google'] = array('panel' => $panel, 'title' => __('Google Web Fonts', 'make'), 'options' => array('font-subset' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_font_subset'), 'control' => array('label' => __('Character Subset', 'make'), 'type' => 'select', 'choices' => ttfmake_get_google_font_subsets())), 'font-subset-text' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'type' => 'text', 'description' => __('Not all fonts provide each of these subsets.', 'make'))))); /** * Site Title & Tagline */ $typography_sections['font-site-title-tagline'] = array('panel' => $panel, 'title' => __('Site Title & Tagline', 'make'), 'options' => array('font-family-site-title' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_font_choice'), 'control' => array('label' => __('Site Title Font Family', 'make'), 'type' => 'select', 'choices' => ttfmake_font_choices_placeholder())), 'font-size-site-title' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('Site Title Font Size (in px)', 'make'), 'type' => ttfmake_customizer_supports_panels() ? 'number' : 'text')), 'font-family-site-tagline' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_font_choice'), 'control' => array('label' => __('Site Tagline Font Family', 'make'), 'type' => 'select', 'choices' => ttfmake_font_choices_placeholder())), 'font-size-site-tagline' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('Site Tagline Font Size (in px)', 'make'), 'type' => ttfmake_customizer_supports_panels() ? 'number' : 'text')))); /** * Main Navigation */ $typography_sections['font-main-menu'] = array('panel' => $panel, 'title' => __('Main Menu', 'make'), 'options' => array('font-family-nav' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_font_choice'), 'control' => array('label' => __('Menu Item Font Family', 'make'), 'type' => 'select', 'choices' => ttfmake_font_choices_placeholder())), 'font-size-nav' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('Menu Item Font Size (in px)', 'make'), 'type' => ttfmake_customizer_supports_panels() ? 'number' : 'text')), 'font-family-subnav' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_font_choice'), 'control' => array('label' => __('Sub-Menu Item Font Family', 'make'), 'type' => 'select', 'choices' => ttfmake_font_choices_placeholder())), 'font-size-subnav' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('Sub-Menu Item Font Size (in px)', 'make'), 'type' => ttfmake_customizer_supports_panels() ? 'number' : 'text')), 'font-subnav-option-heading' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'type' => 'heading', 'label' => __('Sub-Menu Item Options', 'make'))), 'font-subnav-mobile' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('Use Menu Item styles in mobile view', 'make'), 'type' => 'checkbox')))); /** * Widgets */ $typography_sections['font-widget'] = array('panel' => $panel, 'title' => __('Widgets', 'make'), 'options' => array('font-family-widget' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_font_choice'), 'control' => array('label' => __('Widget Font Family', 'make'), 'type' => 'select', 'choices' => ttfmake_font_choices_placeholder())), 'font-size-widget' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('Widget Font Size (in px)', 'make'), 'type' => ttfmake_customizer_supports_panels() ? 'number' : 'text')))); /** * Headers & Body */ $typography_sections['font'] = array('panel' => $panel, 'title' => __('Headers & Body', 'make'), 'options' => array('font-family-h1' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_font_choice'), 'control' => array('label' => __('H1 Font Family', 'make'), 'type' => 'select', 'choices' => ttfmake_font_choices_placeholder())), 'font-size-h1' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('H1 Font Size (in px)', 'make'), 'type' => ttfmake_customizer_supports_panels() ? 'number' : 'text')), 'font-family-h2' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_font_choice'), 'control' => array('label' => __('H2 Font Family', 'make'), 'type' => 'select', 'choices' => ttfmake_font_choices_placeholder())), 'font-size-h2' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('H2 Font Size (in px)', 'make'), 'type' => ttfmake_customizer_supports_panels() ? 'number' : 'text')), 'font-family-h3' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_font_choice'), 'control' => array('label' => __('H3 Font Family', 'make'), 'type' => 'select', 'choices' => ttfmake_font_choices_placeholder())), 'font-size-h3' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('H3 Font Size (in px)', 'make'), 'type' => ttfmake_customizer_supports_panels() ? 'number' : 'text')), 'font-family-h4' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_font_choice'), 'control' => array('label' => __('H4 Font Family', 'make'), 'type' => 'select', 'choices' => ttfmake_font_choices_placeholder())), 'font-size-h4' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('H4 Font Size (in px)', 'make'), 'type' => ttfmake_customizer_supports_panels() ? 'number' : 'text')), 'font-family-h5' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_font_choice'), 'control' => array('label' => __('H5 Font Family', 'make'), 'type' => 'select', 'choices' => ttfmake_font_choices_placeholder())), 'font-size-h5' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('H5 Font Size (in px)', 'make'), 'type' => ttfmake_customizer_supports_panels() ? 'number' : 'text')), 'font-family-h6' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_font_choice'), 'control' => array('label' => __('H6 Font Family', 'make'), 'type' => 'select', 'choices' => ttfmake_font_choices_placeholder())), 'font-size-h6' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('H6 Font Size (in px)', 'make'), 'type' => ttfmake_customizer_supports_panels() ? 'number' : 'text')), 'font-family-body' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_font_choice'), 'control' => array('label' => __('Body Font Family', 'make'), 'type' => 'select', 'choices' => ttfmake_font_choices_placeholder())), 'font-size-body' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('Body Font Size (in px)', 'make'), 'type' => ttfmake_customizer_supports_panels() ? 'number' : 'text')))); // Filter the definitions $typography_sections = apply_filters('make_customizer_typography_sections', $typography_sections); // Merge with master array return array_merge($sections, $typography_sections); }
/** * Define the sections and settings for the Footer panel * * @since 1.3.0. * * @param array $sections The master array of Customizer sections * @return array The augmented master array */ function ttfmake_customizer_define_footer_sections($sections) { $theme_prefix = 'ttfmake_'; $panel = 'ttfmake_footer'; $footer_sections = array(); /** * Background Image */ $footer_sections['footer-background'] = array('panel' => $panel, 'title' => __('Background Image', 'make'), 'options' => array('footer-background-image' => array('setting' => array('sanitize_callback' => 'esc_url_raw'), 'control' => array('control_type' => 'TTFMAKE_Customize_Image_Control', 'label' => __('Footer Background Image', 'make'), 'context' => $theme_prefix . 'footer-background-image')), 'footer-background-repeat' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_choice'), 'control' => array('label' => __('Footer Background Repeat', 'make'), 'type' => 'radio', 'choices' => ttfmake_get_choices('footer-background-repeat'))), 'footer-background-position' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_choice'), 'control' => array('label' => __('Footer Background Position', 'make'), 'type' => 'radio', 'choices' => ttfmake_get_choices('footer-background-position'))), 'footer-background-size' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_choice'), 'control' => array('label' => __('Footer Background Size', 'make'), 'type' => 'radio', 'choices' => ttfmake_get_choices('footer-background-size'))))); /** * Widget Areas */ $footer_sections['footer-widget'] = array('panel' => $panel, 'title' => __('Widget Areas', 'make'), 'options' => array('footer-widget-areas' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_choice'), 'control' => array('label' => __('Number of Widget Areas', 'make'), 'type' => 'select', 'choices' => ttfmake_get_choices('footer-widget-areas'))))); /** * Layout */ $footer_sections['footer'] = array('panel' => $panel, 'title' => __('Layout', 'make'), 'options' => array('footer-layout' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_choice'), 'control' => array('label' => __('Footer Layout', 'make'), 'type' => 'select', 'choices' => ttfmake_get_choices('footer-layout'))), 'footer-layout-line' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'type' => 'line')), 'footer-text' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_text', 'transport' => 'postMessage'), 'control' => array('label' => __('Footer Text', 'make'), 'type' => 'text')), 'footer-options-heading' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'type' => 'heading', 'label' => __('Social Icons', 'make'))), 'footer-show-social' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('Show social icons in footer', 'make'), 'type' => 'checkbox')))); /** * White Label */ if (!ttfmake_is_plus()) { $footer_sections['footer-white-label'] = array('panel' => $panel, 'title' => __('White Label', 'make'), 'description' => __('Want to remove the theme byline from your website’s footer?', 'make'), 'options' => array('footer-white-label-text' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'type' => 'text', 'description' => sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(ttfmake_get_plus_link('white-label')), sprintf(__('Upgrade to %1$s', 'make'), 'Make Plus')))))); } // Filter the definitions $footer_sections = apply_filters('make_customizer_footer_sections', $footer_sections); // Merge with master array return array_merge($sections, $footer_sections); }
/** * Render the Make Plus metabox. * * @since 1.0.6. * * @param object $post The current post object. * @return void */ function ttfmake_render_plus_metabox($post) { // Get the post type label $post_type = get_post_type_object($post->post_type); $label = isset($post_type->labels->singular_name) ? $post_type->labels->singular_name : __('Post', 'make'); echo '<p class="howto">'; printf(__('Looking to configure a unique layout for this %1$s? %2$s.', 'make'), esc_html(strtolower($label)), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(ttfmake_get_plus_link('layout-settings')), sprintf(__('Upgrade to %s', 'make'), 'Make Plus'))); echo '</p>'; }
/** * Define the sections and settings for the General panel * * @since 1.3.0. * * @param array $sections The master array of Customizer sections * @return array The augmented master array */ function ttfmake_customizer_define_typography_sections($sections) { $panel = 'ttfmake_typography'; $typography_sections = array(); /** * Global */ $typography_sections['font'] = array('panel' => $panel, 'title' => __('Global', 'make'), 'options' => array_merge(ttfmake_customizer_typography_group_definitions('body', __('Default', 'make')), array('body-link-group' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'label' => __('Links', 'make'), 'type' => 'group-title')), 'font-weight-body-link' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_choice'), 'control' => array('control_type' => 'TTFMAKE_Customize_Radio_Control', 'label' => __('Font Weight', 'make'), 'type' => 'radio', 'mode' => 'buttonset', 'choices' => ttfmake_get_choices('font-weight-body-link')))))); /** * Text Headers */ $typography_sections['font-headers'] = array('panel' => $panel, 'title' => __('Text Headers', 'make'), 'options' => array_merge(ttfmake_customizer_typography_group_definitions('h1', __('H1', 'make')), ttfmake_customizer_typography_group_definitions('h2', __('H2', 'make')), ttfmake_customizer_typography_group_definitions('h3', __('H3', 'make')), ttfmake_customizer_typography_group_definitions('h4', __('H4', 'make')), ttfmake_customizer_typography_group_definitions('h5', __('H5', 'make')), ttfmake_customizer_typography_group_definitions('h6', __('H6', 'make')))); /** * Site Title & Tagline */ $typography_sections['font-site-title-tagline'] = array('panel' => $panel, 'title' => __('Site Title & Tagline', 'make'), 'options' => array_merge(ttfmake_customizer_typography_group_definitions('site-title', __('Site Title', 'make')), ttfmake_customizer_typography_group_definitions('site-tagline', __('Tagline', 'make')))); /** * Main Navigation */ $typography_sections['font-main-menu'] = array('panel' => $panel, 'title' => __('Main Menu', 'make'), 'options' => array_merge(ttfmake_customizer_typography_group_definitions('nav', __('Menu Items', 'make')), ttfmake_customizer_typography_group_definitions('subnav', __('Sub-Menu Items', 'make')), array('font-nav-mobile-option-heading' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'type' => 'heading', 'label' => __('Mobile', 'make'))), 'font-subnav-mobile' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('Use Menu Item styles in mobile view', 'make'), 'type' => 'checkbox')), 'font-nav-current-item-option-heading' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'type' => 'group-title', 'label' => __('Current Item', 'make'))), 'font-weight-nav-current-item' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_choice'), 'control' => array('control_type' => 'TTFMAKE_Customize_Radio_Control', 'label' => __('Font Weight', 'make'), 'type' => 'radio', 'mode' => 'buttonset', 'choices' => ttfmake_get_choices('font-weight-nav-current-item')))))); /** * Header Bar */ $typography_sections['font-header-bar'] = array('panel' => $panel, 'title' => __('Header Bar', 'make'), 'options' => ttfmake_customizer_typography_group_definitions('header-bar-text', __('Header Bar Text', 'make'), __('Includes Header Text, Header Bar Menu items, and the search field.', 'make'))); /** * Sidebars */ $typography_sections['font-sidebar'] = array('panel' => $panel, 'title' => __('Sidebars', 'make'), 'options' => array_merge(ttfmake_customizer_typography_group_definitions('widget-title', __('Widget Title', 'make')), ttfmake_customizer_typography_group_definitions('widget', __('Widget Body', 'make')))); /** * Footer */ $typography_sections['font-footer'] = array('panel' => $panel, 'title' => __('Footer', 'make'), 'options' => array_merge(ttfmake_customizer_typography_group_definitions('footer-widget-title', __('Widget Title', 'make')), ttfmake_customizer_typography_group_definitions('footer-widget', __('Widget Body', 'make')), ttfmake_customizer_typography_group_definitions('footer-text', __('Footer Text', 'make')))); /** * Google Font Subsets */ $typography_sections['font-google'] = array('panel' => $panel, 'title' => __('Google Font Subsets', 'make'), 'options' => array('font-subset' => array('setting' => array('sanitize_callback' => 'ttfmake_sanitize_font_subset'), 'control' => array('label' => __('Character Subset', 'make'), 'type' => 'select', 'choices' => ttfmake_get_google_font_subsets())), 'font-subset-text' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'type' => 'text', 'description' => sprintf(__('Not all fonts provide each of these subsets. Please visit the %s to see which subsets are available for each font.', 'make'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url('https://www.google.com/fonts'), __('Google Fonts website', 'make'))))))); /** * Typekit */ if (!ttfmake_is_plus()) { $typography_sections['font-typekit'] = array('panel' => $panel, 'title' => __('Typekit', 'make'), 'description' => __('Looking to add premium fonts from Typekit to your website?', 'make'), 'options' => array('font-typekit-update-text' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'type' => 'text', 'description' => sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(ttfmake_get_plus_link('typekit')), sprintf(__('Upgrade to %1$s', 'make'), 'Make Plus')))))); } /** * Filter the definitions for the controls in the Typography panel of the Customizer. * * @since 1.3.0. * * @param array $typography_sections The array of definitions. */ $typography_sections = apply_filters('make_customizer_typography_sections', $typography_sections); // Merge with master array return array_merge($sections, $typography_sections); }
/** * Filter to add a new Customizer section * * This function takes the main array of Customizer sections and adds a new one * right before the first panel. * * @since 1.3.0. * * @param array $sections The array of sections to add to the Customizer. * @return array The modified array of sections. */ function ttfmake_customizer_stylekit($sections) { global $wp_customize; $theme_prefix = 'ttfmake_'; // Get priority of General panel $general_priority = $wp_customize->get_panel($theme_prefix . 'general')->priority; $sections['stylekit'] = array('title' => __('Style Kits', 'make'), 'description' => sprintf(__('%s to quickly apply designer-picked style choices (fonts, layout, colors) to your website.', 'make'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(ttfmake_get_plus_link('style-kits')), __('Upgrade to Make Plus', 'make'))), 'priority' => $general_priority - 10, 'options' => array('stylekit-heading' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'label' => __('Kits', 'make-plus'), 'type' => 'heading')), 'stylekit-dropdown' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'type' => 'text', 'description' => ' <select> <option selected="selected" disabled="disabled">--- ' . __("Choose a kit", "make") . ' ---</option> <option disabled="disabled">' . __("Light", "make") . '</option> <option disabled="disabled">' . __("Dark", "make") . '</option> <option disabled="disabled">' . __("Modern", "make") . '</option> <option disabled="disabled">' . __("Creative", "make") . '</option> <option disabled="disabled">' . __("Vintage", "make") . '</option> </select> ')))); return $sections; }
/** * Configure settings and controls for the Kits section. * * @since 1.0.3. * * @param object $wp_customize The global customizer object. * @param string $section The section name. * @return void */ function ttfmake_customizer_stylekit($wp_customize, $section) { $priority = new TTFMAKE_Prioritizer(); $control_prefix = 'ttfmake_'; $setting_prefix = str_replace($control_prefix, '', $section); // Style Kits info $setting_id = $setting_prefix . '-info'; $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'text', 'description' => sprintf(__('%s to quickly apply designer-picked style choices (fonts, layout, colors) to your website.', 'make'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(ttfmake_get_plus_link('style-kits')), __('Upgrade to Make Plus', 'make'))), 'priority' => $priority->add()))); // Style Kits heading $setting_id = $setting_prefix . '-heading'; $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'heading', 'label' => __('Kits', 'make'), 'priority' => $priority->add()))); // Style Kits dropdown $setting_id = $setting_prefix . '-dropdown'; $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'text', 'description' => ' <select> <option selected="selected" disabled="disabled">--- ' . __("Choose a kit", "make") . ' ---</option> <option disabled="disabled">' . __("Light", "make") . '</option> <option disabled="disabled">' . __("Dark", "make") . '</option> <option disabled="disabled">' . __("Modern", "make") . '</option> <option disabled="disabled">' . __("Creative", "make") . '</option> <option disabled="disabled">' . __("Vintage", "make") . '</option> </select> ', 'priority' => $priority->add()))); }
<li class="ttfmake-menu-list-item make-plus-products"> <div class="ttfmake-menu-list-item-link-icon-wrapper clear" style="background-image: url('<?php echo addcslashes(esc_url_raw(get_template_directory_uri() . '/inc/builder/sections/css/images/woocommerce.png'), '"'); ?> ');"> <span class="ttfmake-menu-list-item-link-icon "></span> </div> <div class="section-type-description"> <h4> <?php _e('Downloads', 'make'); ?> </h4> <p> <?php printf(__('%s and feature your Easy Digital Downloads products in a grid layout.', 'make'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(ttfmake_get_plus_link('edd-section')), sprintf(__('Upgrade to %s', 'make'), 'Make Plus'))); ?> </p> </div> </li> <?php } ?> </ul> </div> <div class="ttfmake-menu-tab"> <a href="#" class="ttfmake-menu-tab-link"> <span><?php _e('Add New Section', 'make'); ?> </span>
</a> <?php } ?> <?php if (!ttfmake_is_plus()) { ?> <li id="ttfmake-menu-list-item-link-plus" class="ttfmake-menu-list-item"> <div> <h4><?php esc_html_e('Get more.', 'make'); ?> </h4> <p class="howto"> <?php printf(esc_html__('Looking for more sections and options? %s', 'make'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', ttfmake_get_plus_link(), esc_html__('Upgrade to Make Plus.', 'make'))); ?> </p> </div> </li> <?php } ?> <?php /** * Execute code after the builder menu items are displayed. * * @since 1.2.3. */ do_action('make_after_builder_menu'); ?>
/** * Define the sections and settings for the General panel * * @since 1.3.0. * * @param array $sections The master array of Customizer sections * @return array The augmented master array */ function ttfmake_customizer_define_general_sections($sections) { $theme_prefix = 'ttfmake_'; $panel = 'ttfmake_general'; $general_sections = array(); /** * Site Title & Tagline * * This is a built-in section. */ /** * Logo */ $general_sections['logo'] = array('panel' => $panel, 'title' => __('Logo', 'make'), 'options' => array('logo-regular' => array('setting' => array('sanitize_callback' => 'esc_url_raw'), 'control' => array('control_type' => 'TTFMAKE_Customize_Image_Control', 'label' => __('Regular Logo', 'make'), 'context' => $theme_prefix . 'logo-regular')), 'logo-retina' => array('setting' => array('sanitize_callback' => 'esc_url_raw'), 'control' => array('control_type' => 'TTFMAKE_Customize_Image_Control', 'label' => __('Retina Logo (2x)', 'make'), 'description' => __('The Retina Logo should be twice the size of the Regular Logo.', 'make'), 'context' => $theme_prefix . 'logo-retina')), 'logo-favicon' => array('setting' => array('sanitize_callback' => 'esc_url_raw'), 'control' => array('control_type' => 'TTFMAKE_Customize_Image_Control', 'label' => __('Favicon', 'make'), 'description' => __('File must be <strong>.png</strong> or <strong>.ico</strong> format. Optimal dimensions: <strong>32px x 32px</strong>.', 'make'), 'context' => $theme_prefix . 'logo-favicon', 'extensions' => array('png', 'ico'))), 'logo-apple-touch' => array('setting' => array('sanitize_callback' => 'esc_url_raw'), 'control' => array('control_type' => 'TTFMAKE_Customize_Image_Control', 'label' => __('Apple Touch Icon', 'make'), 'description' => __('File must be <strong>.png</strong> format. Optimal dimensions: <strong>152px x 152px</strong>.', 'make'), 'context' => $theme_prefix . 'logo-apple-touch', 'extensions' => array('png'))))); /** * Navigation * * This is a built-in section. */ /** * Labels */ $general_sections['labels'] = array('panel' => $panel, 'title' => __('Labels', 'make'), 'options' => array('navigation-mobile-label' => array('setting' => array('sanitize_callback' => 'esc_html', 'theme_supports' => 'menus', 'transport' => 'postMessage'), 'control' => array('label' => __('Mobile Menu Label', 'make'), 'description' => __('Resize your browser window to preview the mobile menu label.', 'make'), 'type' => 'text')), 'general-sticky-label' => array('setting' => array('sanitize_callback' => 'esc_html', 'transport' => 'postMessage'), 'control' => array('label' => __('Sticky Label', 'make'), 'type' => 'text')))); // Only show the Read More label option if no filters have been added to the deprecated filter hook. /** This filter is documented in inc/template-tags.php */ if (false === apply_filters('make_read_more_text', false)) { $general_sections['labels']['options']['label-read-more'] = array('setting' => array('sanitize_callback' => 'esc_html', 'transport' => 'postMessage'), 'control' => array('label' => __('Read More Label', 'make'), 'type' => 'text')); } /** * Social Profiles */ $general_sections['social'] = array('panel' => $panel, 'title' => __('Social Profiles', 'make'), 'description' => __('Enter the complete URL to your profile for each service below that you would like to share.', 'make'), 'options' => array('social-facebook-official' => array('setting' => array('sanitize_callback' => 'esc_url_raw'), 'control' => array('label' => 'Facebook', 'type' => 'text')), 'social-twitter' => array('setting' => array('sanitize_callback' => 'esc_url_raw'), 'control' => array('label' => 'Twitter', 'type' => 'text')), 'social-google-plus-square' => array('setting' => array('sanitize_callback' => 'esc_url_raw'), 'control' => array('label' => 'Google +', 'type' => 'text')), 'social-linkedin' => array('setting' => array('sanitize_callback' => 'esc_url_raw'), 'control' => array('label' => 'LinkedIn', 'type' => 'text')), 'social-instagram' => array('setting' => array('sanitize_callback' => 'esc_url_raw'), 'control' => array('label' => 'Instagram', 'type' => 'text')), 'social-flickr' => array('setting' => array('sanitize_callback' => 'esc_url_raw'), 'control' => array('label' => 'Flickr', 'type' => 'text')), 'social-youtube' => array('setting' => array('sanitize_callback' => 'esc_url_raw'), 'control' => array('label' => 'YouTube', 'type' => 'text')), 'social-vimeo-square' => array('setting' => array('sanitize_callback' => 'esc_url_raw'), 'control' => array('label' => 'Vimeo', 'type' => 'text')), 'social-pinterest' => array('setting' => array('sanitize_callback' => 'esc_url_raw'), 'control' => array('label' => 'Pinterest', 'type' => 'text')), 'social-custom-menu-text' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'type' => 'text', 'description' => sprintf(__('If you would like to add a social profile that is not listed above, or change the order of the icons, create a custom menu %s.', 'make'), sprintf('<a href="' . esc_url('https://thethemefoundry.com/docs/make-docs/tutorials/set-social-profile-links-using-custom-menu/') . '">%s</a>', __('as described here', 'make'))))))); /** * Email */ $general_sections['email'] = array('panel' => $panel, 'title' => __('Email', 'make'), 'description' => __('Enter an email address to add an email icon link to your social profile icons.', 'make'), 'options' => array('social-email' => array('setting' => array('sanitize_callback' => 'sanitize_email'), 'control' => array('label' => 'Email', 'type' => 'text')))); /** * RSS */ $general_sections['rss'] = array('panel' => $panel, 'title' => __('RSS', 'make'), 'description' => __('If configured, an RSS icon will appear with your social profile icons.', 'make'), 'options' => array('social-rss-heading' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'type' => 'heading', 'label' => __('Default RSS', 'make'))), 'social-hide-rss' => array('setting' => array('sanitize_callback' => 'absint'), 'control' => array('label' => __('Hide default RSS feed link', 'make'), 'type' => 'checkbox')), 'social-custom-rss' => array('setting' => array('sanitize_callback' => 'esc_url_raw'), 'control' => array('label' => __('Custom RSS URL (replaces default)', 'make'), 'type' => 'text')))); /** * Static Front Page * * This is a built-in section. */ /** * White Label */ if (!ttfmake_is_plus()) { $general_sections['footer-white-label'] = array('panel' => $panel, 'title' => __('White Label', 'make'), 'description' => __('Want to remove the theme byline from your website’s footer?', 'make'), 'options' => array('footer-white-label-text' => array('control' => array('control_type' => 'TTFMAKE_Customize_Misc_Control', 'type' => 'text', 'description' => sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(ttfmake_get_plus_link('white-label')), sprintf(__('Upgrade to %1$s', 'make'), 'Make Plus')))))); } /** * Filter the definitions for the controls in the General panel of the Customizer. * * @since 1.3.0. * * @param array $general_sections The array of definitions. */ $general_sections = apply_filters('make_customizer_general_sections', $general_sections); // Merge with master array return array_merge($sections, $general_sections); }
/** * Enqueue customizer sections script * * Hooked to 'customize_controls_enqueue_scripts' via ttfmake_customizer_init() * * @since 1.5.0. * * @return void */ function ttfmake_customizer_scripts() { // Styles wp_enqueue_style('ttfmake-customizer-jquery-ui', get_template_directory_uri() . '/inc/customizer/css/jquery-ui/jquery-ui-1.10.4.custom.css', array(), '1.10.4'); wp_enqueue_style('ttfmake-customizer-chosen', get_template_directory_uri() . '/inc/customizer/css/chosen/chosen.css', array(), '1.3.0'); // Custom styling depends on version of WP // Nav menu panel was introduced in 4.3 $suffix = ''; if (!class_exists('WP_Customize_Nav_Menus')) { $suffix = '-legacy'; } wp_enqueue_style('ttfmake-customizer-sections', get_template_directory_uri() . "/inc/customizer/css/customizer-sections{$suffix}.css", array('ttfmake-customizer-jquery-ui', 'ttfmake-customizer-chosen'), TTFMAKE_VERSION); // Scripts wp_enqueue_script('ttfmake-customizer-chosen', get_template_directory_uri() . '/inc/customizer/js/chosen.jquery.js', array('jquery', 'customize-controls'), '1.3.0', true); wp_enqueue_script('ttfmake-customizer-sections', get_template_directory_uri() . '/inc/customizer/js/customizer-sections' . TTFMAKE_SUFFIX . '.js', array('customize-controls', 'ttfmake-customizer-chosen'), TTFMAKE_VERSION, true); // Collect localization data $data = array('fontOptions' => ttfmake_get_font_property_option_keys('font-family'), 'allFontChoices' => ttfmake_all_font_choices_js()); // Add localization strings if (!ttfmake_is_plus()) { $localize = array('chosen_no_results_default' => esc_html__('No results match', 'make'), 'chosen_no_results_fonts' => esc_html__('No matching fonts', 'make'), 'plusURL' => esc_url(ttfmake_get_plus_link('customize-head')), 'plusLabel' => esc_html__('Upgrade to Make Plus', 'make')); $data = $data + $localize; } // Localize the script wp_localize_script('ttfmake-customizer-sections', 'ttfmakeCustomizerL10n', $data); }
/** * Enqueue customizer sections script * * Hooked to 'customize_controls_enqueue_scripts' via ttfmake_customizer_init() * * @since 1.0.0. * * @return void */ function ttfmake_customizer_sections_script() { wp_enqueue_script('ttfmake-customizer-sections', get_template_directory_uri() . '/inc/customizer/js/customizer-sections' . TTFMAKE_SUFFIX . '.js', array('customize-controls'), TTFMAKE_VERSION, true); // Collect localization data $data = array('fontOptions' => ttfmake_get_font_property_option_keys('family'), 'allFontChoices' => ttfmake_all_font_choices_js()); // Add localization strings for Upgrade button if (!ttfmake_is_plus()) { $localize = array('plusURL' => esc_url(ttfmake_get_plus_link('customize-head')), 'plusLabel' => __('Upgrade to Make Plus', 'make')); $data = $data + $localize; } // Localize the script wp_localize_script('ttfmake-customizer-sections', 'ttfmakeCustomizerL10n', $data); }
/** * Display information about duplicating posts. * * @since 1.1.0. * * @return void */ public function post_submitbox_misc_actions() { global $typenow; if ('page' === $typenow) { ?> <div class="misc-pub-section ttfmake-duplicator"> <p style="font-style:italic;margin:0 0 7px 3px;"> <?php printf(esc_html__('Duplicate this page with %s.', 'make'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(ttfmake_get_plus_link('duplicator')), 'Make Plus')); ?> </p> <div class="clear"></div> </div> <?php } }
ttfmake_load_section_header(); global $ttfmake_section_data, $ttfmake_is_js_template; $section_name = ttfmake_get_section_name($ttfmake_section_data, $ttfmake_is_js_template); $columns_number = isset($ttfmake_section_data['data']['columns-number']) ? $ttfmake_section_data['data']['columns-number'] : 3; $section_order = !empty($ttfmake_section_data['data']['columns-order']) ? $ttfmake_section_data['data']['columns-order'] : range(1, 4); $columns_class = in_array($columns_number, range(1, 4)) && true !== $ttfmake_is_js_template ? $columns_number : 3; ?> <?php if (false === ttfmake_is_plus()) { ?> <div class="ttfmake-plus-info"> <p> <em> <?php printf(__('%s and convert any column into an area for widgets.', 'make'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(ttfmake_get_plus_link('widget-area')), sprintf(__('Upgrade to %s', 'make'), 'Make Plus'))); ?> </em> </p> </div> <?php } ?> <?php /** * Execute code before the columns select input is displayed. * * @since 1.2.3. * * @param array $ttfmake_section_data The data for the section.
/** * Configure settings and controls for the Footer section * * @since 1.0.0. * * @param object $wp_customize The global customizer object. * @param string $section The section name. * @return void */ function ttfmake_customizer_footer($wp_customize, $section) { $priority = new TTFMAKE_Prioritizer(); $control_prefix = 'ttfmake_'; $setting_prefix = str_replace($control_prefix, '', $section); // Footer 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' => __('Footer Layout', 'make'), 'type' => 'select', 'choices' => ttfmake_get_choices($setting_id), 'priority' => $priority->add())); // Footer layout line $setting_id = $setting_prefix . '-layout-line'; $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'line', 'priority' => $priority->add()))); // Footer text $setting_id = $setting_prefix . '-text'; $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'ttfmake_sanitize_text', 'transport' => 'postMessage')); $wp_customize->add_control($control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Footer Text', 'make'), 'type' => 'text', 'priority' => $priority->add())); // Footer text color $setting_id = $setting_prefix . '-text-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' => __('Footer Text Color', 'make'), 'priority' => $priority->add()))); // Footer border color $setting_id = $setting_prefix . '-border-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' => __('Footer Border Color', 'make'), 'priority' => $priority->add()))); // 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' => __('Footer 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' => __('Footer 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())); // Footer background line $setting_id = $setting_prefix . '-background-line'; $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'line', 'priority' => $priority->add()))); // Footer widget areas $setting_id = $setting_prefix . '-widget-areas'; $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' => __('Footer Widget Areas', 'make'), 'type' => 'select', 'choices' => ttfmake_get_choices($setting_id), 'priority' => $priority->add())); // Footer options heading $setting_id = $setting_prefix . '-options-heading'; $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'heading', 'label' => __('Footer Options', 'make'), 'priority' => $priority->add()))); // Show social icons $setting_id = $setting_prefix . '-show-social'; $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' => __('Show social icons', 'make'), 'type' => 'checkbox', 'priority' => $priority->add())); if (!ttfmake_is_plus()) { // White Label line $setting_id = $setting_prefix . '-whitelabel-line'; $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'line', 'priority' => $priority->add()))); // White Label heading $setting_id = $setting_prefix . '-whitelabel-heading'; $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'heading', 'label' => __('White Label', 'make'), 'priority' => $priority->add()))); // White Label info $setting_id = $setting_prefix . '-whitelabel-make-plus'; $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'text', 'description' => sprintf(__('Want to remove the theme byline from your website’s footer? %s.', 'make'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(ttfmake_get_plus_link('white-label')), sprintf(__('Upgrade to %1$s', 'make'), 'Make Plus'))), 'priority' => $priority->add()))); } }
/** * Configure settings and controls for the Fonts section. * * @since 1.0.0. * * @param object $wp_customize The global customizer object. * @param string $section The section name. * @return void */ function ttfmake_customizer_font($wp_customize, $section) { $priority = new TTFMAKE_Prioritizer(); $control_prefix = 'ttfmake_'; $setting_prefix = str_replace($control_prefix, '', $section); // Google font info $setting_id = $setting_prefix . '-google-font-info'; $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'text', 'description' => sprintf(__('The list of Google fonts is long! You can %s before making your choices.', 'make'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url('http://www.google.com/fonts/'), __('preview', 'make'))), 'priority' => $priority->add()))); // Site title font $setting_id = $setting_prefix . '-site-title'; $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'ttfmake_sanitize_font_choice')); $wp_customize->add_control($control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Site Title', 'make'), 'type' => 'select', 'choices' => ttfmake_all_font_choices(), 'priority' => $priority->add())); // Header font $setting_id = $setting_prefix . '-header'; $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'ttfmake_sanitize_font_choice')); $wp_customize->add_control($control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Headers', 'make'), 'type' => 'select', 'choices' => ttfmake_all_font_choices(), 'priority' => $priority->add())); // Body font $setting_id = $setting_prefix . '-body'; $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'ttfmake_sanitize_font_choice')); $wp_customize->add_control($control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Body', 'make'), 'type' => 'select', 'choices' => ttfmake_all_font_choices(), 'priority' => $priority->add())); if (false === ttfmake_is_plus()) { // Typekit information $setting_id = $setting_prefix . '-typekit-font-heading'; $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'heading', 'label' => __('Typekit', 'make'), 'priority' => 450))); $setting_id = $setting_prefix . '-typekit-font-info'; $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'text', 'description' => sprintf(__('Looking to add premium fonts from Typekit to your website? %s.', 'make'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(ttfmake_get_plus_link('typekit')), sprintf(__('Upgrade to %1$s', 'make'), 'Make Plus'))), 'priority' => 460))); } // Font family line $setting_id = $setting_prefix . '-family-line'; $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'line', 'priority' => $priority->add()))); // Site title font size $setting_id = $setting_prefix . '-site-title-size'; $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' => __('Site Title Font Size (in px)', 'make'), 'type' => 'text', 'priority' => $priority->add())); // Site title font size $setting_id = $setting_prefix . '-site-tagline-size'; $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' => __('Site Tagline Font Size (in px)', 'make'), 'type' => 'text', 'priority' => $priority->add())); // Navigation font size $setting_id = $setting_prefix . '-nav-size'; $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' => __('Navigation Font Size (in px)', 'make'), 'type' => 'text', 'priority' => $priority->add())); // Header font size $setting_id = $setting_prefix . '-header-size'; $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' => __('Header Font Size (in px)', 'make'), 'type' => 'text', 'priority' => $priority->add())); // Widget font size $setting_id = $setting_prefix . '-widget-size'; $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' => __('Widget Font Size (in px)', 'make'), 'type' => 'text', 'priority' => $priority->add())); // Body font size $setting_id = $setting_prefix . '-body-size'; $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' => __('Body Font Size (in px)', 'make'), 'type' => 'text', 'priority' => $priority->add())); // Font size line $setting_id = $setting_prefix . '-size-line'; $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'line', 'priority' => $priority->add()))); // Character Subset $setting_id = $setting_prefix . '-subset'; $wp_customize->add_setting($setting_id, array('default' => ttfmake_get_default($setting_id), 'type' => 'theme_mod', 'sanitize_callback' => 'ttfmake_sanitize_font_subset')); $wp_customize->add_control($control_prefix . $setting_id, array('settings' => $setting_id, 'section' => $section, 'label' => __('Character Subset', 'make'), 'type' => 'select', 'choices' => ttfmake_get_google_font_subsets(), 'priority' => $priority->add())); // Character subset info $setting_id = $setting_prefix . '-subset-info'; $wp_customize->add_control(new TTFMAKE_Customize_Misc_Control($wp_customize, $control_prefix . $setting_id, array('section' => $section, 'type' => 'text', 'description' => __('Not all fonts provide each of these subsets.', 'make'), 'priority' => $priority->add()))); }