add_section('general_settings_section', array( 'priority' => 20, 'title' => __('General Settings', 'andrina-lite'), 'description' => '' )); /** * control and setting for logo */ $wp_customize->add_setting('inkthemes_options[inkthemes_logo]', array( 'default' => get_template_directory_uri() . '/images/logo.png', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'inkthemes_sanitize_url', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Image_Control( $wp_customize, 'custom_logo_control', array( 'label' => __('Upload a logo', 'andrina-lite'), 'description' => 'Choose your own logo. Optimal Size: 221px Wide by 84px Height.', 'section' => 'general_settings_section', 'settings' => 'inkthemes_options[inkthemes_logo]' ) )); /** * control and setting for favicon */ $wp_customize->add_setting('inkthemes_options[inkthemes_favicon]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_url', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Image_Control( $wp_customize, 'custom_fevicon_control', array( 'label' => __('Upload a favicon', 'andrina-lite'), 'description' => 'Specify a 16px x 16px image that will represent your website's favicon.', 'section' => 'general_settings_section', 'settings' => 'inkthemes_options[inkthemes_favicon]' ) )); /* * ******************************************************* * Home Page Setting section * *********************************************************** */ $wp_customize->add_section('home_page_settings_section', array( 'priority' => 21, 'title' => __('Top Feature Area', 'andrina-lite'), 'description' => '', )); /** * control and setting for first slider Image */ $wp_customize->add_setting('inkthemes_options[inkthemes_slideimage1]', array( 'default' => get_template_directory_uri() . '/images/slideimg.jpg', 'sanitize_callback' => 'inkthemes_sanitize_url', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'slider_image_control', array( 'label' => __('Top Feature Image', 'andrina-lite'), 'description' => 'Choose your image for first slider. Optimal size is 950px wide and 460px height.', 'section' => 'home_page_settings_section', 'settings' => 'inkthemes_options[inkthemes_slideimage1]' ) )); /** * control and setting for slider heading */ $wp_customize->add_setting('inkthemes_options[inkthemes_slider_heading1]', array( 'default' => 'Theme Heading', 'sanitize_callback' => 'inkthemes_sanitize_text', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'slider_image_heading_control', array( 'label' => __('Top Feature Heading', 'andrina-lite'), 'description' => 'Enter your text heading for top feature.', 'section' => 'home_page_settings_section', 'settings' => 'inkthemes_options[inkthemes_slider_heading1]', 'type' => 'text' ) )); /** * control and setting for slider description */ $wp_customize->add_setting('inkthemes_options[inkthemes_slider_des1]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'slider_image_desc_control', array( 'label' => __('Top Feature Description', 'andrina-lite'), 'description' => 'Enter your text description for top feature.', 'section' => 'home_page_settings_section', 'settings' => 'inkthemes_options[inkthemes_slider_des1]', 'type' => 'textarea' ) )); /** * control and setting for Front Page Main heading */ $wp_customize->add_setting('inkthemes_options[inkthemes_main_head]', array( 'default' => 'Main Heading', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'home_page_main_heading_control', array( 'label' => __('Home Page Main Heading', 'andrina-lite'), 'description' => 'Enter your text heading for homepage main heading', 'section' => 'home_page_settings_section', 'settings' => 'inkthemes_options[inkthemes_main_head]', 'type' => 'textarea' ) )); /* * ******************************************************* * Panel for Home Page Feature area * *********************************************************** */ $wp_customize->add_panel('feature_area_option', array( 'priority' => 22, 'title' => __('Feature area setting', 'andrina-lite'), 'description' => __('You can easily set the theme option from here', 'andrina-lite'), )); /* * ******************************************************* * Feature area Setting section,there settings and controls * *********************************************************** */ /* * First feature area setion */ $wp_customize->add_section('feature_area1_section', array( 'priority' => 10, 'title' => __('First Feature area Settings', 'andrina-lite'), 'description' => '', 'panel' => 'feature_area_option', )); /** * control and setting for first feature image */ $wp_customize->add_setting('inkthemes_options[inkthemes_feature_img1]', array( 'default' => get_template_directory_uri() . '/images/img1.jpg', 'sanitize_callback' => 'inkthemes_sanitize_url', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'feature_image1_control', array( 'label' => __('First Feature Image', 'andrina-lite'), 'description' => 'Choose your image for first feature section. Optimal size is 202px x 134px.', 'section' => 'feature_area1_section', 'settings' => 'inkthemes_options[inkthemes_feature_img1]' ) )); /** * control and setting for first feature heading */ $wp_customize->add_setting('inkthemes_options[inkthemes_f_head1]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_text', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'feature_head1_control', array( 'label' => __('First Feature Heading', 'andrina-lite'), 'description' => 'Enter your text heading for first feature section.', 'section' => 'feature_area1_section', 'settings' => 'inkthemes_options[inkthemes_f_head1]', 'type' => 'text' ) )); /** * control and setting for first feature description */ $wp_customize->add_setting('inkthemes_options[inkthemes_f_des1]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'feature_desc1_control', array( 'label' => __('First Feature description', 'andrina-lite'), 'description' => 'Enter your text description for first feature section.', 'section' => 'feature_area1_section', 'settings' => 'inkthemes_options[inkthemes_f_des1]', 'type' => 'textarea' ) )); /** * control and setting for first feature link url */ $wp_customize->add_setting('inkthemes_options[inkthemes_link1]', array( 'default' => '#', 'sanitize_callback' => 'inkthemes_sanitize_url', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'feature_link1_control', array( 'label' => __('First Feature Link URL', 'andrina-lite'), 'description' => 'Enter your link url for first feature section.', 'section' => 'feature_area1_section', 'settings' => 'inkthemes_options[inkthemes_link1]', 'type' => 'text' ) )); /* * ********* End of first feature area section ********* */ /* * ******************************************************* * Second feature area setion * *********************************************************** */ $wp_customize->add_section('feature_area2_section', array( 'priority' => 10, 'title' => __('Second Feature area Settings', 'andrina-lite'), 'description' => '', 'panel' => 'feature_area_option', )); /** * control and setting for second feature image */ $wp_customize->add_setting('inkthemes_options[inkthemes_feature_img2]', array( 'default' => get_template_directory_uri() . '/images/img2.jpg', 'sanitize_callback' => 'inkthemes_sanitize_url', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'feature_image2_control', array( 'label' => __('Second Feature Image', 'andrina-lite'), 'description' => 'Choose your image for second feature section. Optimal size is 202px x 134px.', 'section' => 'feature_area2_section', 'settings' => 'inkthemes_options[inkthemes_feature_img2]' ) )); /** * control and setting for second feature heading */ $wp_customize->add_setting('inkthemes_options[inkthemes_f_head2]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_text', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'feature_head2_control', array( 'label' => __('Second Feature Heading', 'andrina-lite'), 'description' => 'Enter your text heading for second feature section.', 'section' => 'feature_area2_section', 'settings' => 'inkthemes_options[inkthemes_f_head2]', 'type' => 'text' ) )); /** * control and setting for second feature description */ $wp_customize->add_setting('inkthemes_options[inkthemes_f_des2]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'feature_desc2_control', array( 'label' => __('Second Feature description', 'andrina-lite'), 'description' => 'Enter your text description for second feature section.', 'section' => 'feature_area2_section', 'settings' => 'inkthemes_options[inkthemes_f_des2]', 'type' => 'textarea' ) )); /** * control and setting for second feature link url */ $wp_customize->add_setting('inkthemes_options[inkthemes_link2]', array( 'default' => '#', 'sanitize_callback' => 'inkthemes_sanitize_url', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'feature_link2_control', array( 'label' => __('Second Feature Link URL', 'andrina-lite'), 'description' => 'Enter your link url for second feature section.', 'section' => 'feature_area2_section', 'settings' => 'inkthemes_options[inkthemes_link2]', 'type' => 'text' ) )); /* * ********* End of Second feature area section ********* */ /* * ******************************************************* * Third feature area setion * *********************************************************** */ $wp_customize->add_section('feature_area3_section', array( 'priority' => 10, 'title' => __('Third Feature area Settings', 'andrina-lite'), 'description' => '', 'panel' => 'feature_area_option', )); /** * control and setting for third feature image */ $wp_customize->add_setting('inkthemes_options[inkthemes_feature_img3]', array( 'default' => get_template_directory_uri() . '/images/img3.jpg', 'sanitize_callback' => 'inkthemes_sanitize_url', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'feature_image3_control', array( 'label' => __('Thired Feature Image', 'andrina-lite'), 'description' => 'Choose your image for third feature section. Optimal size is 202px x 134px.', 'section' => 'feature_area3_section', 'settings' => 'inkthemes_options[inkthemes_feature_img3]' ) )); /** * control and setting for third feature heading */ $wp_customize->add_setting('inkthemes_options[inkthemes_f_head3]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_text', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'feature_head3_control', array( 'label' => __('Third Feature Heading', 'andrina-lite'), 'description' => 'Enter your text description for third feature section.', 'section' => 'feature_area3_section', 'settings' => 'inkthemes_options[inkthemes_f_head3]', 'type' => 'text' ) )); /** * control and setting for third feature description */ $wp_customize->add_setting('inkthemes_options[inkthemes_f_des3]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'feature_desc3_control', array( 'label' => __('Third Feature description', 'andrina-lite'), 'description' => 'Enter your text description for third feature section.', 'section' => 'feature_area3_section', 'settings' => 'inkthemes_options[inkthemes_f_des3]', 'type' => 'textarea' ) )); /** * control and setting for third feature link url */ $wp_customize->add_setting('inkthemes_options[inkthemes_link3]', array( 'default' => '#', 'sanitize_callback' => 'inkthemes_sanitize_url', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'feature_link3_control', array( 'label' => __('Third Feature Link URL', 'andrina-lite'), 'description' => 'Enter your link url for third feature section.', 'section' => 'feature_area3_section', 'settings' => 'inkthemes_options[inkthemes_link3]', 'type' => 'text' ) )); /* * ********* Third of Second feature area section ********* */ /* * ******************************************************* * Fourth feature area setion * *********************************************************** */ $wp_customize->add_section('feature_area4_section', array( 'priority' => 10, 'title' => __('Fourth Feature area Settings', 'andrina-lite'), 'description' => '', 'panel' => 'feature_area_option', )); /** * control and setting for fourth feature image */ $wp_customize->add_setting('inkthemes_options[inkthemes_feature_img4]', array( 'default' => get_template_directory_uri() . '/images/img4.jpg', 'sanitize_callback' => 'inkthemes_sanitize_url', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'feature_image4_control', array( 'label' => __('Fourth Feature Image', 'andrina-lite'), 'description' => 'Choose your image for fourth feature section. Optimal size is 202px x 134px.', 'section' => 'feature_area4_section', 'settings' => 'inkthemes_options[inkthemes_feature_img4]' ) )); /** * control and setting for fourth feature heading */ $wp_customize->add_setting('inkthemes_options[inkthemes_f_head4]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_text', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'feature_head4_control', array( 'label' => __('Fourth Feature Heading', 'andrina-lite'), 'description' => 'Enter your text heading for fourth feature section.', 'section' => 'feature_area4_section', 'settings' => 'inkthemes_options[inkthemes_f_head4]', 'type' => 'text' ) )); /** * control and setting for fourth feature description */ $wp_customize->add_setting('inkthemes_options[inkthemes_f_des4]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'feature_desc4_control', array( 'label' => __('fourth Feature description', 'andrina-lite'), 'description' => 'Enter your text description for fourt feature section.', 'section' => 'feature_area4_section', 'settings' => 'inkthemes_options[inkthemes_f_des4]', 'type' => 'textarea' ) )); /** * control and setting for fourth feature link url */ $wp_customize->add_setting('inkthemes_options[inkthemes_link4]', array( 'default' => '#', 'sanitize_callback' => 'inkthemes_sanitize_url', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'feature_link4_control', array( 'label' => __('Fourth Feature Link URL', 'andrina-lite'), 'description' => 'Enter your link url for fourth feature section.', 'section' => 'feature_area4_section', 'settings' => 'inkthemes_options[inkthemes_link4]', 'type' => 'text' ) )); /* * ********* Fourth of Second feature area section ********* */ /* * ******************************************************* * Home Page two column area setion * *********************************************************** */ $wp_customize->add_section('home_page_col', array( 'priority' => 30, 'title' => __('Homepage Two Columns', 'andrina-lite'), 'description' => '' )); /** * control and setting for left column heading */ $wp_customize->add_setting('inkthemes_options[inkthemes_left_head]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_text', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'left_col_head_control', array( 'label' => __('Left Column Heading', 'andrina-lite'), 'description' => 'Enter your text heading for left column heading.', 'section' => 'home_page_col', 'settings' => 'inkthemes_options[inkthemes_left_head]', 'type' => 'text' ) )); /** * control and setting for right column heading */ $wp_customize->add_setting('inkthemes_options[inkthemes_right_head]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_text', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'right_col_head_control', array( 'label' => __('Right Column Heading', 'andrina-lite'), 'description' => 'Enter your text heading for right column heading.', 'section' => 'home_page_col', 'settings' => 'inkthemes_options[inkthemes_right_head]', 'type' => 'text' ) )); /** * control and setting for right column description */ $wp_customize->add_setting('inkthemes_options[inkthemes_right_des]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'right_col_desc_control', array( 'label' => __('Right Column Description', 'andrina-lite'), 'description' => 'Enter your text description for right section. You can put your html code in this section', 'section' => 'home_page_col', 'settings' => 'inkthemes_options[inkthemes_right_des]', 'type' => 'textarea' ) )); /* * ********* home page two column area section ********* */ /* * ******************************************************* * Home Page contact area setion * *********************************************************** */ $wp_customize->add_section('home_contact_area_section', array( 'priority' => 40, 'title' => __('Homepage Contact Area', 'andrina-lite'), 'description' => '' )); /** * control and setting for contact number */ $wp_customize->add_setting('inkthemes_options[inkthemes_contact_no]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_number', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'contact_number_control', array( 'label' => __('Contact Number', 'andrina-lite'), 'description' => 'Enter your contact number.', 'section' => 'home_contact_area_section', 'settings' => 'inkthemes_options[inkthemes_contact_no]', 'type' => 'text' ) )); /** * control and setting for email field */ $wp_customize->add_setting('inkthemes_options[inkthemes_email_add]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_email', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'contact_email_control', array( 'label' => __('Email Address', 'andrina-lite'), 'description' => 'Enter your email address.', 'section' => 'home_contact_area_section', 'settings' => 'inkthemes_options[inkthemes_email_add]', 'type' => 'text' ) )); /** * control and setting for date field */ $wp_customize->add_setting('inkthemes_options[inkthemes_date]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'contact_date_control', array( 'label' => __('Date and Timings', 'andrina-lite'), 'description' => 'Enter your dates.', 'section' => 'home_contact_area_section', 'settings' => 'inkthemes_options[inkthemes_date]', 'description' => 'Enter your date and time here', 'type' => 'text' ) )); /* * ********* home page two column area section ********* */ /* * ******************************************************* * Styling Setting section,there settings and controls * *********************************************************** */ $wp_customize->add_section('styling_setting_section', array( 'priority' => 50, 'title' => __('Styling Setting', 'andrina-lite'), 'description' => '' )); /** * control and setting for custom css */ $wp_customize->add_setting('inkthemes_options[inkthemes_customcss]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'custom_css_control', array( 'label' => __('Custom Css', 'andrina-lite'), 'description' => 'Quickly add some CSS to your theme by adding it to this block.', 'section' => 'styling_setting_section', 'settings' => 'inkthemes_options[inkthemes_customcss]', 'type' => 'textarea', ) )); /* * ********* Styling setting section section ********* */ /* * ******************************************************* * Social Icons section,there settings and controls * *********************************************************** */ $wp_customize->add_section('social_icon_settings', array( 'title' => __('Social Icons', 'andrina-lite'), 'description' => __('Allows you to setup social site link for Andrina-lite Theme.', 'andrina-lite'), 'priority' => '14', 'capability' => 'edit_theme_options' ) ); /** * control and setting for facebook */ $wp_customize->add_setting('inkthemes_options[inkthemes_facebook]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'facebook_control', array( 'label' => __('Facebook URL', 'andrina-lite'), 'description' => 'Enter your Facebook URL if you have one.', 'section' => 'social_icon_settings', 'settings' => 'inkthemes_options[inkthemes_facebook]', 'type' => 'link', ) )); /** * control and setting for Twitter */ $wp_customize->add_setting('inkthemes_options[inkthemes_twitter]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'twitter_control', array( 'label' => __('Twitter URL', 'andrina-lite'), 'description' => 'Enter your Twitter URL if you have one.', 'section' => 'social_icon_settings', 'settings' => 'inkthemes_options[inkthemes_twitter]', 'type' => 'link', ) )); /** * control and setting for Yahoo */ $wp_customize->add_setting('inkthemes_options[inkthemes_yahoo]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'yahoo_control', array( 'label' => __('Yahoo URL', 'andrina-lite'), 'description' => 'Enter your Yahoo URL if you have one.', 'section' => 'social_icon_settings', 'settings' => 'inkthemes_options[inkthemes_yahoo]', 'type' => 'link', ) )); /** * control and setting for rss */ $wp_customize->add_setting('inkthemes_options[inkthemes_rss]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'rss_control', array( 'label' => __('RSS URL', 'andrina-lite'), 'description' => 'Enter your RSS URL if you have one.', 'section' => 'social_icon_settings', 'settings' => 'inkthemes_options[inkthemes_rss]', 'type' => 'link', ) )); /** * control and setting for Digg */ $wp_customize->add_setting('inkthemes_options[inkthemes_digg]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'digg_control', array( 'label' => __('Digg URL', 'andrina-lite'), 'description' => 'Enter your Digg URL if you have one.', 'section' => 'social_icon_settings', 'settings' => 'inkthemes_options[inkthemes_digg]', 'type' => 'link', ) )); /** * control and setting for Pinterest */ $wp_customize->add_setting('inkthemes_options[inkthemes_pinterest]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'pinterest_control', array( 'label' => __('Pinterest URL', 'andrina-lite'), 'description' => 'Enter your Pinterest URL if you have one.', 'section' => 'social_icon_settings', 'settings' => 'inkthemes_options[inkthemes_pinterest]', 'type' => 'link', ) )); /** * control and setting for Linkedin */ $wp_customize->add_setting('inkthemes_options[inkthemes_linkedin]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'linkedin_control', array( 'label' => __('Linkedin URL', 'andrina-lite'), 'description' => 'Enter your Linkedin URL if you have one.', 'section' => 'social_icon_settings', 'settings' => 'inkthemes_options[inkthemes_linkedin]', 'type' => 'link', ) )); /** * control and setting for Google+ */ $wp_customize->add_setting('inkthemes_options[inkthemes_google]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'google_control', array( 'label' => __('Google+ URL', 'andrina-lite'), 'description' => 'Enter your Google+ URL if you have one.', 'section' => 'social_icon_settings', 'settings' => 'inkthemes_options[inkthemes_google]', 'type' => 'link', ) )); /** * control and setting for Instagram */ $wp_customize->add_setting('inkthemes_options[inkthemes_instagram]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'instagram_control', array( 'label' => __('Instagram URL', 'andrina-lite'), 'description' => 'Enter your Instagram URL if you have one.', 'section' => 'social_icon_settings', 'settings' => 'inkthemes_options[inkthemes_instagram]', 'type' => 'link', ) )); /** * control and setting for Youtube */ $wp_customize->add_setting('inkthemes_options[inkthemes_youtube]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'youtube_control', array( 'label' => __('Youtube URL', 'andrina-lite'), 'description' => 'Enter your Youtube URL if you have one.', 'section' => 'social_icon_settings', 'settings' => 'inkthemes_options[inkthemes_youtube]', 'type' => 'link', ) )); /** * control and setting for Tumblr */ $wp_customize->add_setting('inkthemes_options[inkthemes_tumblr]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'tumblr_control', array( 'label' => __('Tumblr URL', 'andrina-lite'), 'description' => 'Enter your Tumblr URL if you have one.', 'section' => 'social_icon_settings', 'settings' => 'inkthemes_options[inkthemes_tumblr]', 'type' => 'link', ) )); /** * control and setting for Flickr */ $wp_customize->add_setting('inkthemes_options[inkthemes_flickr]', array( 'default' => '', 'sanitize_callback' => 'inkthemes_sanitize_textarea', 'type' => 'option' )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'flickr_control', array( 'label' => __('Flickr URL', 'andrina-lite'), 'description' => 'Enter your Flickr URL if you have one.', 'section' => 'social_icon_settings', 'settings' => 'inkthemes_options[inkthemes_flickr]', 'type' => 'link', ) )); /* * ********* Social Icons setting section ********* */ } add_action('customize_register', 'inktheme_customize_register'); /* * ************************************************************* * SANITIZATION FUNCTIONS * ************************************************************* */ /** * adds sanitization callback funtion : textarea * @package Andrina Lite * @since Andrina Lite 2.6.1 */ function inkthemes_sanitize_textarea($value) { $array = wp_kses_allowed_html('post'); $allowedtags = array( 'iframe' => array( 'width' => array(), 'height' => array(), 'frameborder' => array(), 'scrolling' => array(), 'src' => array(), 'marginwidth' => array(), 'marginheight' => array() ) ); $data = array_merge($allowedtags, $array); $value = wp_kses($value, $data); return $value; } /** * adds sanitization callback funtion : url * @package Andrina Lite * @since Andrina Lite 2.7 */ function inkthemes_sanitize_url($value) { $value = esc_url($value); return $value; } /** * adds sanitization callback funtion : text * @package Andrina Lite * @since Andrina Lite 2.7 */ function inkthemes_sanitize_text($value) { $value = sanitize_text_field($value); return $value; } /** * adds sanitization callback funtion : email * @package Andrina Lite * @since Andrina Lite 2.7 */ function inkthemes_sanitize_email($value) { $value = sanitize_email($value); return $value; } /** * adds sanitization callback funtion : number * @package Andrina Lite * @since Andrina Lite 2.7 */ function inkthemes_sanitize_number($value) { $value = preg_replace("/[^0-9+ ]/", "", $value); return $value; } function inkthemes_registers() { wp_register_script('inkthemes-customizer', get_template_directory_uri() . '/functions/js/customizer.js', array("jquery", "jquery-ui-core"), '', true); wp_localize_script('inkthemes-customizer', 'ink_advert', array( 'pro' => __('View PRO version', 'andrina-lite'), 'url' => esc_url('https://www.inkthemes.com/market/fashion-wordpress-theme/'), 'support_text' => __('Need Help!', 'andrina-lite'), 'support_url' => esc_url('https://www.inkthemes.com/contact-us/') ) ); wp_enqueue_script('inkthemes-customizer'); } add_action('customize_controls_enqueue_scripts', 'inkthemes_registers');