/** * 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); }
/** * 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); }
/** * Initiate actions. * * @since 1.0.0. * * @return TTFMAKE_Builder_Base */ public function __construct() { // Include the API require get_template_directory() . '/inc/builder/core/api.php'; // Add the core sections require get_template_directory() . '/inc/builder/sections/section-definitions.php'; // Include the save routines require get_template_directory() . '/inc/builder/core/save.php'; // Include the front-end helpers require get_template_directory() . '/inc/builder/sections/section-front-end-helpers.php'; // Set up actions add_action('admin_init', array($this, 'register_post_type_support_for_builder')); add_action('add_meta_boxes', array($this, 'add_meta_boxes'), 1); // Bias toward top of stack add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'), 11); add_action('admin_print_styles-post.php', array($this, 'admin_print_styles')); add_action('admin_print_styles-post-new.php', array($this, 'admin_print_styles')); add_filter('admin_body_class', array($this, 'admin_body_class')); add_action('admin_footer', array($this, 'print_templates')); add_action('tiny_mce_before_init', array($this, 'tiny_mce_before_init'), 15, 2); add_action('after_wp_tiny_mce', array($this, 'after_wp_tiny_mce')); add_action('post_submitbox_misc_actions', array($this, 'builder_toggle')); if (false === ttfmake_is_plus()) { add_action('post_submitbox_misc_actions', array($this, 'post_submitbox_misc_actions')); } }
/** * 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); }
/** * Add a Make Plus metabox to each qualified post type edit screen * * @since 1.0.6. * * @return void */ function ttfmake_add_plus_metabox() { if (ttfmake_is_plus() || !is_super_admin()) { return; } // Post types $post_types = get_post_types(array('public' => true, '_builtin' => false)); $post_types[] = 'post'; $post_types[] = 'page'; // Add the metabox for each type foreach ($post_types as $type) { add_meta_box('ttfmake-plus-metabox', __('Layout Settings', 'make'), 'ttfmake_render_plus_metabox', $type, 'side', 'default'); } }
/** * 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 the JS and CSS for the admin. * * @since 1.0.0. * * @param string $hook_suffix The suffix for the screen. * @return void */ public function admin_enqueue_scripts($hook_suffix) { // Only load resources if they are needed on the current page if (!in_array($hook_suffix, array('post.php', 'post-new.php')) || !ttfmake_post_type_supports_builder(get_post_type())) { return; } wp_register_script('ttfmake-sections/js/models/gallery-item.js', get_template_directory_uri() . '/inc/builder/sections/js/models/gallery-item.js', array(), TTFMAKE_VERSION, true); wp_register_script('ttfmake-sections/js/views/gallery-item.js', get_template_directory_uri() . '/inc/builder/sections/js/views/gallery-item.js', array(), TTFMAKE_VERSION, true); wp_register_script('ttfmake-sections/js/views/gallery.js', get_template_directory_uri() . '/inc/builder/sections/js/views/gallery.js', array(), TTFMAKE_VERSION, true); wp_register_script('ttfmake-sections/js/views/text.js', get_template_directory_uri() . '/inc/builder/sections/js/views/text.js', array(), TTFMAKE_VERSION, true); wp_register_script('ttfmake-sections/js/models/banner-slide.js', get_template_directory_uri() . '/inc/builder/sections/js/models/banner-slide.js', array(), TTFMAKE_VERSION, true); wp_register_script('ttfmake-sections/js/views/banner-slide.js', get_template_directory_uri() . '/inc/builder/sections/js/views/banner-slide.js', array(), TTFMAKE_VERSION, true); wp_register_script('ttfmake-sections/js/views/banner.js', get_template_directory_uri() . '/inc/builder/sections/js/views/banner.js', array(), TTFMAKE_VERSION, true); if (false === ttfmake_is_plus()) { wp_enqueue_script('ttfmake-sections/js/quick-start.js', get_template_directory_uri() . '/inc/builder/sections/js/quick-start.js', array('ttfmake-builder'), TTFMAKE_VERSION, true); } // Add additional dependencies to the Builder JS add_filter('ttfmake_builder_js_dependencies', array($this, 'add_js_dependencies')); // Add the section CSS wp_enqueue_style('ttfmake-sections/css/sections.css', get_template_directory_uri() . '/inc/builder/sections/css/sections.css', array(), TTFMAKE_VERSION, 'all'); }
/** * 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); }
/** * Add a class to indicate the current template being used. * * @since 1.0.4. * * @param array $classes The current classes. * @return array The modified classes. */ function admin_body_class($classes) { global $pagenow; // Do not complete the function if the product template is in use (i.e., the builder needs to be shown) if (ttfmake_post_type_supports_builder(get_post_type())) { if ('post-new.php' === $pagenow || 'post.php' === $pagenow && ttfmake_is_builder_page()) { $classes .= ' ttfmake-builder-active'; // Add a class to denote Make Plus if (ttfmake_is_plus()) { $classes .= ' make-plus-enabled'; } else { $classes .= ' make-plus-disabled'; } } else { $classes .= ' ttfmake-default-active'; } // Add a class to denote Make Plus if (ttfmake_is_plus()) { $classes .= ' make-plus-enabled'; } else { $classes .= ' make-plus-disabled'; } } return $classes; }
/** * 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()))); } }
/** * Upgrade notices related to Make Plus. * * @since 1.4.9. * * @return void */ function ttfmake_plus_upgrade_notices() { if (ttfmake_is_plus() && function_exists('ttfmp_get_app')) { $make_plus_version = ttfmp_get_app()->version; if (version_compare($make_plus_version, '1.4.7', '<=')) { ttfmake_register_admin_notice('make-plus-lte-147', sprintf(__('A new version of Make Plus is available. If you encounter problems updating through %1$s, please %2$s to update manually.', 'make'), sprintf('<a href="%1$s">%2$s</a>', admin_url('update-core.php'), __('the WordPress interface', 'make')), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url('https://thethemefoundry.com/tutorials/updating-your-existing-theme/'), __('follow these steps', 'make'))), array('cap' => 'update_plugins', 'screen' => array('dashboard', 'update-core.php', 'plugins.php'), 'type' => 'warning')); } } }
<?php /** * @package Make */ 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 /**
<div class="section-type-description"> <h4> <?php echo esc_html($item['label']); ?> </h4> </div> </div> </li> </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
/** * Add styles to admin head for Make Plus * * @since 1.0.6. * * @return void */ function ttfmake_plus_styles() { if (ttfmake_is_plus()) { return; } ?> <style type="text/css"> #ttfmake-plus-metabox h3:after, #customize-control-ttfmake_footer-whitelabel-heading span:after, #customize-control-ttfmake_font-typekit-font-heading span:after, .ttfmake-section-text .ttfmake-plus-info p:after, .make-plus-products .ttfmake-menu-list-item-link-icon-wrapper:before, .ttfmp-import-message strong:after, #accordion-section-ttfmake_stylekit h3:before, a.ttfmake-customize-plus, #ttfmake-menu-list-item-link-plus h4:after { content: "Plus"; position: relative; top: -1px; margin-left: 8px; padding: 3px 6px !important; line-height: 1.5 !important; font-size: 9px !important; color: #ffffff !important; background-color: #d54e21; letter-spacing: 1px; text-transform: uppercase; -webkit-font-smoothing: subpixel-antialiased !important; } .ttfmake-plus-info p { margin-top: 0; margin-left: 10px; } .ttfmake-section-text .ttfmake-titlediv { padding-right: 45px; } .edit-text-column-link { right: 0; } a.ttfmake-customize-plus { margin-left: 0; } #accordion-section-ttfmake_stylekit h3:before { float: right; top: 2px; margin-right: 30px; } .ttfmp-import-message strong { display: inline-block; font-size: 14px; margin-bottom: 4px; } .make-plus-products .ttfmake-menu-list-item-link-icon-wrapper:before { position: relative; top: 32px; margin-left: -2px; text-align: center; } .make-plus-products .section-type-description { color: #777777; } .ttfmake-menu-list-item.make-plus-products:hover .ttfmake-menu-list-item-link-icon-wrapper { border-color: #dfdfdf; } .make-plus-products .section-type-description a { color: #0074a2 !important; text-decoration: underline; } .make-plus-products .section-type-description a:hover, .make-plus-products .section-type-description a:focus { color: #2ea2cc !important; } </style> <?php }
<?php _e('Products', 'make'); ?> </h4> <p> <?php printf(__('%s and feature your WooCommerce products in a grid layout.', 'make'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(ttfmake_get_plus_link('woocommerce-section')), sprintf(__('Upgrade to %s', 'make'), 'Make Plus'))); ?> </p> </div> </li> <?php } ?> <?php if (!ttfmake_is_plus() && in_array('easy-digital-downloads/easy-digital-downloads.php', get_option('active_plugins'))) { ?> <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>
/** * 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()))); }