remove_control('background_image'); $wp_customize->remove_section('background_image'); // Load custom controls require_once( THEMEORA_FRAMEWORK_DIR . '/themeora-admin-customizer-controls.php' ); /* Fonts ---------------------------------------------------------------------------------------------------- */ $fonts = ''; $font_size_range = ''; $font_lineheight_range = ''; $font_letterspacing_range = ''; $font_weight_range = ''; //Load font list $fonts = themeora_fonts(); $font_size_range = array( 'min' => '10', 'max' => '80', 'step' => '1', ); $font_lineheight_range = array( 'min' => '10', 'max' => '80', 'step' => '1', ); $font_letterspacing_range = array( 'min' => '-5', 'max' => '20', 'step' => '1', ); $font_weight_range = array( 'bold' => 'bold', 'normal' => 'normal', ); /* Pro options ---------------------------------------------------------------------------------------------------- */ $wp_customize->add_section('pro_options', array( 'title' => __('Pro Upgrade', 'ascent-free'), 'priority' => 1, ) ); $wp_customize->add_setting( 'pro_options_text', array( 'sanitize_callback' => 'themeora_sanitize_text', ) ); $wp_customize->add_control( new Optimizer_Controls_Info_Control( $wp_customize, 'pro_options_text', array( 'type' => 'info', 'label' => __('Pro upgrade available','ascent-free'), 'description' => __('

Upgrade today for loads more options to make your online store more succesful and unique. Get premium email support and boost your sales with a premium, easy to setup version of Ascent.

Go Pro

','ascent-free'), 'section' => 'pro_options', 'settings' => 'pro_options_text', )) ); /* Accent color ---------------------------------------------------------------------------------------------------- */ $wp_customize->add_setting('theme_accent_color', array( 'default' => '#17C69B', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'theme_accent_color', array( 'label' => __('Accent Color', 'ascent-free'), 'section' => 'colors', 'settings' => 'theme_accent_color', 'priority' => 1 ))); $wp_customize->add_section('image_logo_settings', array( 'title' => __('Image Logo Settings', 'ascent-free'), 'priority' => 2, ) ); /* Image logo settings ---------------------------------------------------------------------------------------------------- */ $wp_customize->add_section('image_logo_settings', array( 'title' => __('Image Logo Settings', 'ascent-free'), 'priority' => 2, ) ); $wp_customize->add_setting('themeora-img-upload-logo', array( 'sanitize_callback' => 'esc_url', )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'themeora-img-upload-logo', array( 'label' => __('Logo', 'ascent-free'), 'section' => 'image_logo_settings', 'settings' => 'themeora-img-upload-logo', 'priority' => 1 ))); $wp_customize->add_setting('themeora-img-upload-logo-width', array( 'default' => '', 'sanitize_callback' => 'themeora_sanitize_int', )); $wp_customize->add_control('themeora-img-upload-logo-width', array( 'label' => __('Logo width (px)', 'ascent-free'), 'section' => 'image_logo_settings', 'type' => 'text', 'priority' => 2, ) ); $wp_customize->add_setting('themeora-show-description-header', array( 'default' => 'No', 'sanitize_callback' => 'themeora_sanitize_text', )); $wp_customize->add_control('themeora-show-description-header', array( 'type' => 'select', 'label' => __('Show description in header', 'ascent-free'), 'section' => 'image_logo_settings', 'priority' => 3, 'choices' => array( 'No' => __('No', 'ascent-free'), 'Yes' => __('Yes', 'ascent-free'), ), )); $wp_customize->add_setting('footer-logo', array( 'sanitize_callback' => 'esc_url', )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'footer-logo', array( 'label' => __('Footer Logo', 'ascent-free'), 'section' => 'image_logo_settings', 'settings' => 'footer-logo', 'priority' => 5 ))); $wp_customize->add_setting('footer-logo-width', array( 'default' => '', 'sanitize_callback' => 'themeora_sanitize_int', )); $wp_customize->add_control('footer-logo-width', array( 'label' => __('Footer Logo width (px)', 'ascent-free'), 'section' => 'image_logo_settings', 'type' => 'text', 'priority' => 6, ) ); /* Typograpgy logo settings ---------------------------------------------------------------------------------------------------- */ $wp_customize->add_section('logo', array( 'title' => __('Logo Typography', 'ascent-free'), 'priority' => 3, ) ); $wp_customize->add_setting('type_select_logo', array( 'default' => 'Open Sans', 'sanitize_callback' => 'themeora_sanitize_fonts', )); $wp_customize->add_control('type_select_logo', array( 'type' => 'select', 'label' => __('Logo Font', 'ascent-free'), 'section' => 'logo', 'priority' => 3, 'choices' => $fonts ) ); $wp_customize->add_setting('type_logo_size', array( 'default' => '26', 'sanitize_callback' => 'themeora_sanitize_int', )); $wp_customize->add_control(new Themeora_Customize_Slider_Control($wp_customize, 'type_logo_size', array( 'type' => 'slider', 'label' => __('Logo Size', 'ascent-free'), 'section' => 'logo', 'settings' => 'type_logo_size', 'priority' => 4, 'choices' => $font_size_range ))); /* General settings ---------------------------------------------------------------------------------------------------- */ $wp_customize->add_section('general_settings', array( 'title' => __('General Settings', 'ascent-free'), 'priority' => 4, ) ); $wp_customize->add_setting('themeora-homepage-banner-image', array( 'sanitize_callback' => 'esc_url', )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'themeora-homepage-banner-image', array( 'label' => __('Banner image on homepage', 'ascent-free'), 'section' => 'general_settings', 'settings' => 'themeora-homepage-banner-image', 'priority' => 5 ))); $wp_customize->add_setting('themeora-homepage-banner-image-width', array( 'default' => '', 'sanitize_callback' => 'themeora_sanitize_int', )); $wp_customize->add_control('themeora-homepage-banner-image-width', array( 'label' => __('Banner image max-width (px)', 'ascent-free'), 'section' => 'general_settings', 'type' => 'text', 'priority' => 6, ) ); $wp_customize->add_setting('analytics_tracking_code', array( 'default' => '', 'sanitize_callback' => 'themeora_sanitize_text_field', )); $wp_customize->add_control('analytics_tracking_code', array( 'label' => __('Analytics tracking id ( example: UA-53267497-1 )', 'ascent-free'), 'section' => 'general_settings', 'settings' => 'analytics_tracking_code', 'priority' => 8 )); /* Background settings ---------------------------------------------------------------------------------------------------- */ $wp_customize->add_section('background', array( 'title' => __('Background', 'ascent-free'), 'priority' => 10, ) ); /* Transport for live previews ---------------------------------------------------------------------------------------------------- */ $wp_customize->get_setting('blogname')->transport = 'postMessage'; $wp_customize->get_setting('themeora-img-upload-logo-width')->transport = 'postMessage'; $wp_customize->get_setting('themeora-homepage-banner-image-width')->transport = 'postMessage'; $wp_customize->get_setting('footer-logo-width')->transport = 'postMessage'; $wp_customize->get_setting('type_logo_size')->transport = 'postMessage'; $wp_customize->get_setting('type_select_logo')->transport = 'postMessage'; $wp_customize->get_setting('theme_accent_color')->transport = 'postMessage'; } /* Sanetize callbacks ---------------------------------------------------------------------------------------------------- */ function themeora_sanitize_checkbox($input) { if ($input == 1) { return 1; } else { return ''; } } //Integers function themeora_sanitize_int($input) { if (is_numeric($input)) { return intval($input); } } //Text function themeora_sanitize_text($input) { return wp_kses_post(force_balance_tags($input)); } //Url function themeora_sanitize_url($input) { return esc_url($input); } function themeora_sanitize_text_field($input) { return wp_kses_post($input); } //Fonts function themeora_sanitize_fonts($input) { $valid = themeora_fonts(); if (array_key_exists($input, $valid)) { return $input; } else { return ''; } }