add_section('page_boxes',array( 'title' => __('Home Boxes','beautystyle'), 'description' => __('Images dimensions: ( 270 X 170 ) - the posts thumbnails image for these pages will be selected', 'beautystyle'), 'priority' => 101 )); /* box 1 */ $wp_customize->add_setting('page-setting1',array( 'sanitize_callback' => 'beautystyle_sanitize_integer' )); $wp_customize->add_control('page-setting1',array( 'type' => 'dropdown-pages', 'label' => __('Select pages for box 1:','beautystyle'), 'section' => 'page_boxes' )); $wp_customize->add_setting('page-extract1',array( 'default' => 'Insert a short summary', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('page-extract1',array( 'type' => 'textarea', 'label' => __('Insert a short summary','beautystyle'), 'section' => 'page_boxes' )); /* box 2 */ $wp_customize->add_setting('page-setting2',array( 'sanitize_callback' => 'beautystyle_sanitize_integer' )); $wp_customize->add_control('page-setting2',array( 'type' => 'dropdown-pages', 'label' => __('Select pages for box 2:','beautystyle'), 'section' => 'page_boxes' )); $wp_customize->add_setting('page-extract2',array( 'default' => 'Insert a short summary', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('page-extract2',array( 'type' => 'textarea', 'label' => __('Insert a short summary','beautystyle'), 'section' => 'page_boxes' )); /* box 3 */ $wp_customize->add_setting('page-setting3',array( 'sanitize_callback' => 'beautystyle_sanitize_integer' )); $wp_customize->add_control('page-setting3',array( 'type' => 'dropdown-pages', 'label' => __('Select pages for box 3:','beautystyle'), 'section' => 'page_boxes' )); $wp_customize->add_setting('page-extract3',array( 'default' => 'Insert a short summary', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('page-extract3',array( 'type' => 'textarea', 'label' => __('Insert a short summary','beautystyle'), 'section' => 'page_boxes' )); /* hide box */ $wp_customize->add_setting('hide_boxes',array( 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('hide_boxes', array( 'section' => 'page_boxes', 'label' => __('Hide this section','beautystyle'), 'type' => 'checkbox' )); /* Slider box ----------- */ $wp_customize->add_section('slider_box',array( 'title' => __('Slider Box','beautystyle'), 'description' => __('Slider images: Images must have same dimensions - recommended 1400x550', 'beautystyle'), 'priority' => 100, )); /* Slide 1 */ $wp_customize->add_setting('custom_slide1',array( 'default' => get_template_directory_uri() . '/assets/img/environment.jpg', 'transport' => 'refresh', 'height' => 550, 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'custom_slide1' ,array( 'label' => __('Slider Image 1', 'beautystyle'), 'section' => 'slider_box', 'settings' => 'custom_slide1' ))); $wp_customize->add_setting('slide_title1',array( 'default' => __('Making Everyone Beautiful','beautystyle'), 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('slide_title1' ,array( 'type' => 'textarea', 'label' => __('Slider description 1', 'beautystyle'), 'section' => 'slider_box', 'settings' => 'slide_title1' )); /* Slide 2 */ $wp_customize->add_setting('custom_slide2',array( 'default' => get_template_directory_uri() . '/assets/img/environment.jpg', 'transport' => 'refresh', 'height' => 550, 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'custom_slide2' ,array( 'label' => __('Slider Image 2', 'beautystyle'), 'section' => 'slider_box', 'settings' => 'custom_slide2' ))); $wp_customize->add_setting('slide_title2',array( 'default' => __('Restoring Balance & Natural Health','beautystyle'), 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('slide_title2' ,array( 'type' => 'textarea', 'label' => __('Slider description 2', 'beautystyle'), 'section' => 'slider_box', 'settings' => 'slide_title2' )); /* Slide 3 */ $wp_customize->add_setting('custom_slide3',array( 'default' => get_template_directory_uri() . '/assets/img/environment.jpg', 'transport' => 'refresh', 'height' => 550, 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'custom_slide3' ,array( 'label' => __('Slider Image 3', 'beautystyle'), 'section' => 'slider_box', 'settings' => 'custom_slide3' ))); $wp_customize->add_setting('slide_title3',array( 'default' => __('Spa Renewal','beautystyle'), 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('slide_title3' ,array( 'type' => 'textarea', 'label' => __('Slider description 3', 'beautystyle'), 'section' => 'slider_box', 'settings' => 'slide_title3' )); /* hide slide box */ $wp_customize->add_setting('slider_hide_box',array( 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('slider_hide_box', array( 'section' => 'slider_box', 'label' => __('Hide this section','beautystyle'), 'type' => 'checkbox' )); /* Home posts ----------- */ $wp_customize->add_section('posts_section',array( 'title' => __('Posts Section','beautystyle'), 'description' => __( 'Show or hide posts section', 'beautystyle' ), 'priority' => 102 )); $wp_customize->add_setting('hide_posts_section',array( 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('hide_posts_section', array( 'section' => 'posts_section', 'label' => __('Hide this section','beautystyle'), 'type' => 'checkbox' )); /* Footer ------- */ $wp_customize->add_section('footer_box',array( 'title' => __('Footer Text Box','beautystyle'), 'description' => __('Company description', 'beautystyle' ), 'priority' => 103 )); /* Title and description */ $wp_customize->add_setting('TextBox_title',array( 'default' => 'Title here', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('TextBox_title',array( 'type' => 'text', 'label' => __('Add title','beautystyle'), 'setting' => 'TextBox_title', 'section' => 'footer_box', )); $wp_customize->add_setting('TextBox_desc',array( 'default' => 'Description here', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('TextBox_desc',array( 'type' => 'textarea', 'label' => __('Add about description here','beautystyle'), 'setting' => 'TextBox_desc', 'section' => 'footer_box' )); /* Contact Details */ $wp_customize->add_section('footer_contact',array( 'title' => __('Footer Contact Details','beautystyle'), 'description' => __('Add your contact details here', 'beautystyle' ), 'priority' => 104 )); $wp_customize->add_setting('contact_title',array( 'default' => 'Contact Us', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('contact_title',array( 'type' => 'text', 'label' => __('Add contact title','beautystyle'), 'setting' => 'contact_title', 'section' => 'footer_contact' )); $wp_customize->add_setting('contact_address',array( 'default' => 'Beauty Street', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('contact_address',array( 'type' => 'text', 'label' => __('Add address','beautystyle'), 'setting' => 'contact_address', 'section' => 'footer_contact' )); $wp_customize->add_setting('contact_phone',array( 'default' => '+123456789', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('contact_phone',array( 'type' => 'text', 'label' => __('Add telephone number','beautystyle'), 'setting' => 'contact_phone', 'section' => 'footer_contact' )); $wp_customize->add_setting('contact_mail',array( 'default' => 'info@beautystyle.com', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('contact_mail',array( 'type' => 'text', 'label' => __('Add e-mail','beautystyle'), 'setting' => 'contact_mail', 'section' => 'footer_contact' )); /* Social link settings */ $wp_customize->add_section('social_sec',array( 'title' => __('Footer Social Settings','beautystyle'), 'description' => __( 'Add social icons link here', 'beautystyle' ), 'priority' => 105 )); $wp_customize->add_setting('fb_link',array( 'default' => '#facebook', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('fb_link',array( 'label' => __('Add Facebook link here','beautystyle'), 'setting' => 'fb_link', 'section' => 'social_sec' )); $wp_customize->add_setting('twitt_link',array( 'default' => '#twitter', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('twitt_link',array( 'label' => __('Add Twitter link here','beautystyle'), 'setting' => 'twitt_link', 'section' => 'social_sec' )); $wp_customize->add_setting('ig_link',array( 'default' => '#ig', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('ig_link',array( 'label' => __('Add Instagram plus link here','beautystyle'), 'setting' => 'ig_link', 'section' => 'social_sec' )); $wp_customize->add_setting('linked_link',array( 'default' => '#linkedin', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('linked_link',array( 'label' => __('Add Linkedin link here','beautystyle'), 'setting' => 'linked_link', 'section' => 'social_sec' )); $wp_customize->add_setting('wha_link',array( 'default' => '#whatsapp', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('wha_link',array( 'label' => __('Add Whatsapp link here','beautystyle'), 'setting' => 'wha_link', 'section' => 'social_sec' )); $wp_customize->add_setting('tiktok_link',array( 'default' => '#tiktok', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('tiktok_link',array( 'label' => __('Add TikTok link here','beautystyle'), 'setting' => 'tiktok_link', 'section' => 'social_sec' )); /* Sanitizes functions ------------------- */ /* Sanitize text */ function sanitize_text( $text ) { return sanitize_text_field( $text ); } /* integer number */ function beautystyle_sanitize_integer( $input ) { if( is_numeric( $input ) ) { return intval( $input ); } }