ID] = $posts->post_title;
}
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
class callcenter_Customize_slider_Color_Control extends WP_Customize_Control {
public $type = 'alphacolor';
//public $palette = '#3FADD7,#555555,#666666, #F5f5f5,#333333,#404040,#2B4267';
public $palette = true;
public $default = '#3FADD7';
protected function render() {
$id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) );
$class = 'customize-control customize-control-' . $this->type; ?>
render_content(); ?>
cats = get_categories($options);
parent::__construct( $wp_customize, $id, $args );
}
public function render_content()
{
if(!empty($this->cats))
{
?>
id ) );
$class = 'customize-control customize-control-' . $this->type; ?>
render_content(); ?>
id ) );
$class = 'customize-control customize-control-' . $this->type; ?>
render_content(); ?>
add_panel( 'homepage_setting', array(
'priority' => 500,
'capability' => 'edit_theme_options',
'title' => __('Homepage Settings', 'callcenter'),
) );
/* --------------------------------------
=========================================
Slider Section
=========================================
-----------------------------------------*/
$wp_customize->add_section(
'callcenter_slider_section_settings', array(
'title' => __('Slider Setting','callcenter'),
'description' => '',
'panel' => 'homepage_setting',
) );
//Enable service
$wp_customize->add_setting(
'callcenter_slider_enable', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_slider_enable', array(
'label' => __('Enable Slider Section','callcenter'),
'section' => 'callcenter_slider_section_settings',
'type' => 'checkbox',
) );
//Select Post One
$wp_customize->add_setting('slider_post_one',array(
'capability'=>'edit_theme_options',
'sanitize_callback'=>'sanitize_text_field',
));
$wp_customize->add_control('slider_post_one',array(
'label' => __('Select Post One','callcenter'),
'section'=>'callcenter_slider_section_settings',
'type'=>'select',
'choices'=>$options_posts,
));
//Select Post Two
$wp_customize->add_setting('slider_post_two',array(
'capability'=>'edit_theme_options',
'sanitize_callback'=>'sanitize_text_field',
));
$wp_customize->add_control('slider_post_two',array(
'label' => __('Select Post Two','callcenter'),
'section'=>'callcenter_slider_section_settings',
'type'=>'select',
'choices'=>$options_posts,
));
//Select Post Three
$wp_customize->add_setting('slider_post_three',array(
'capability'=>'edit_theme_options',
'sanitize_callback'=>'sanitize_text_field',
));
$wp_customize->add_control('slider_post_three',array(
'label' => __('Select Post Three','callcenter'),
'section'=>'callcenter_slider_section_settings',
'type'=>'select',
'choices'=>$options_posts,
));
/* --------------------------------------
=========================================
Service Section
=========================================
-----------------------------------------*/
// add section to manage Services
$wp_customize->add_section(
'callcenter_service_section_settings', array(
'title' => __('Service Setting','callcenter'),
'description' => '',
'panel' => 'homepage_setting',
) );
//Enable service
$wp_customize->add_setting(
'callcenter_service_enable', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_service_enable', array(
'label' => __('Enable Service Section','callcenter'),
'section' => 'callcenter_service_section_settings',
'type' => 'checkbox',
) );
//Service Title setting
$wp_customize->add_setting(
'callcenter_service_title', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_service_title',array(
'label' => __('Service Title','callcenter'),
'section' => 'callcenter_service_section_settings',
'type' => 'text',
) );
//Service SubTitle setting
$wp_customize->add_setting(
'callcenter_service_subtitle', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( 'callcenter_service_subtitle', array(
'label' => __('Service Subtitle','callcenter'),
'section' => 'callcenter_service_section_settings',
'type' => 'textarea',
) );
//Service Load More Button setting
$wp_customize->add_setting(
'callcenter_service_button', array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_service_button', array(
'type' => 'text',
'label' => __('Button Label','callcenter'),
'section' => 'callcenter_service_section_settings',
) );
/* --------------------------------------
=========================================
About Section
=========================================
-----------------------------------------*/
// add section to manage Services
$wp_customize->add_section(
'callcenter_about_section_settings', array(
'title' => __('About Setting','callcenter'),
'description' => '',
'panel' => 'homepage_setting',
) );
/* --------------------------------------
=========================================
Callout Section
=========================================
-----------------------------------------*/
// add section to manage Callout
$wp_customize->add_section(
'callcenter_callout_section_settings', array(
'title' => __('Callout Setting','callcenter'),
'description' => '',
'panel' => 'homepage_setting',
) );
//Enable contact
$wp_customize->add_setting(
'callcenter_callout_enable', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_callout_enable', array(
'label' => __('Enable Callout Section','callcenter'),
'section' => 'callcenter_callout_section_settings',
'type' => 'checkbox',
) );
//Callout Background image
$wp_customize->add_setting(
'callcenter_callout_background', array(
'sanitize_callback' => 'esc_url_raw',
) );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize,
'callcenter_callout_background', array(
'label' => __( 'Choose Background Image', 'callcenter' ),
'section' => 'callcenter_callout_section_settings',
'settings' => 'callcenter_callout_background',)
) );
//Callout Overlay
$wp_customize->add_setting(
'callcenter_overlay_callout_color_control',
array('sanitize_callback' => 'esc_url_raw',)
);
$wp_customize->add_control( new callcenter_Customize_contact_color_Control( $wp_customize,
'callcenter_overlay_callout_color_control', array(
'label' => 'Overlay Color',
'palette' => true,
'section' => 'callcenter_callout_section_settings')
) );
// Callout Title Setting
$wp_customize->add_setting(
'callcenter_callout_title', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_callout_title', array(
'label' => __('Callout Title','callcenter'),
'section' => 'callcenter_callout_section_settings',
'type' => 'text',
) );
// Callout Description Setting
$wp_customize->add_setting(
'callcenter_callout_description', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_callout_description', array(
'label' => __('Callout Description','callcenter'),
'section' => 'callcenter_callout_section_settings',
'type' => 'textarea',
) );
// Callout Button One Label Setting
$wp_customize->add_setting(
'callcenter_callout_button_one_label', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_callout_button_one_label', array(
'label' => __('Button One Title','callcenter'),
'section' => 'callcenter_callout_section_settings',
'type' => 'text',
) );
//Callout Button One Link Setting
$wp_customize->add_setting(
'callcenter_callout_button_one_link', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_callout_button_one_link',array(
'label' => __('Button One URL','callcenter'),
'section' => 'callcenter_callout_section_settings',
'type' => 'text',
) );
//Callout Button One Target Setting
$wp_customize->add_setting(
'callcenter_callout_button_one_target', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_callout_button_one_target',array(
'label' => __('Open Link New window','callcenter'),
'section' => 'callcenter_callout_section_settings',
'type' => 'checkbox',
) );
//Callout Button Two Label Setting
$wp_customize->add_setting(
'callcenter_callout_button_two_label', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_callout_button_two_label', array(
'label' => __('Button Two Title','callcenter'),
'section' => 'callcenter_callout_section_settings',
'type' => 'text',
) );
//Callout Button Two Link Setting
$wp_customize->add_setting(
'callcenter_callout_button_two_link', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_callout_button_two_link', array(
'label' => __('Button Two URL','callcenter'),
'type' => 'text',
'section' => 'callcenter_callout_section_settings',
) );
//Callout Button Two Target Setting
$wp_customize->add_setting(
'callcenter_callout_button_two_target', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_callout_button_two_target', array(
'label' => __('Open Link New window','callcenter'),
'section' => 'callcenter_callout_section_settings',
'type' => 'checkbox',
) );
/* --------------------------------------
=========================================
Latest News Section
=========================================
-----------------------------------------*/
// add section to manage Latest News
$wp_customize->add_section(
'news_section_settings', array(
'title' => __('News & Events Setting','callcenter'),
'description' => '',
'panel' => 'homepage_setting'
) );
//Enable news
$wp_customize->add_setting(
'callcenter_news_enable', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_news_enable', array(
'label' => __('Enable News Section','callcenter'),
'section' => 'news_section_settings',
'type' => 'checkbox',
) );
//Latest News Background Image
$wp_customize->add_setting(
'news_background', array(
'sanitize_callback' => 'esc_url_raw',
) );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize,
'news_background', array(
'label' => __( 'Choose Background Image', 'callcenter' ),
'section' => 'news_section_settings',
'settings' => 'news_background', )
) );
//Latest News Overlay Image
$wp_customize->add_setting(
'news_section_color',array(
'default' => '#f5f5f5',
'sanitize_callback' => 'esc_url_raw',
) );
$wp_customize->add_control( new callcenter_Customize_Color_Control( $wp_customize,
'news_section_color', array(
'label' => 'Overlay Color',
'palette' => true,
'section' => 'news_section_settings')
) );
// hide meta content
$wp_customize->add_setting(
'disable_news_meta', array(
'default' => 'false',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'disable_news_meta', array(
'label' => __('Hide/Show Blog Meta:- Like author name,categories', 'callcenter'),
'description' => __('Hide / Show Blog Meta:- Like author name,categories', 'callcenter'),
'section' => 'news_section_settings',
'type' => 'radio',
'choices' => array('true'=>'On','false'=>'Off'),
) );
// Latest News Title Setting
$wp_customize->add_setting(
'callcenter_news_title', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_news_title',array(
'label' => __('Latest News Title','callcenter'),
'section' => 'news_section_settings',
'type' => 'text',
) );
// Latest News Subtitle Setting
$wp_customize->add_setting(
'callcenter_news_subtitle', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_news_subtitle',array(
'label' => __('Latest News Subtitle','callcenter'),
'section' => 'news_section_settings',
'type' => 'textarea',
) );
$wp_customize->add_setting( 'callcenter_news_section', array(
'sanitize_callback' => 'callcenter_pro_version_sanitize_text'
) );
$wp_customize->add_control( new callcenter_Theme_Support_news( $wp_customize, 'callcenter_news_section', array(
'section' => 'news_section_settings',)
) );
/* --------------------------------------
=========================================
Contact Section
=========================================
-----------------------------------------*/
//Contact settings
$wp_customize->add_section(
'callcenter_contact_section_settings', array(
'title' => __('Contact Setting','callcenter'),
'description' => '',
'panel' => 'homepage_setting',
) );
//Enable contact
$wp_customize->add_setting(
'callcenter_contact_enable', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_contact_enable', array(
'label' => __('Enable Contact Section','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'checkbox',
) );
//Contact Background Image
$wp_customize->add_setting(
'callcenter_contact_background', array(
'sanitize_callback' => 'esc_url_raw',
) );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize,
'callcenter_contact_background', array(
'label' => __( 'Choose Background Image', 'callcenter' ),
'section' => 'callcenter_contact_section_settings',
'settings' => 'callcenter_contact_background', )
) );
//Contact Overlay
$wp_customize->add_setting(
'callcenter_overlay_contact_color_control',
array(
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control( new callcenter_Customize_Color_Control( $wp_customize,
'callcenter_overlay_contact_color_control', array(
'label' => 'Overlay Color',
'palette' => true,
'section' => 'callcenter_contact_section_settings' )
) );
//Contact Title setting
$wp_customize ->add_setting (
'callcenter_contact_title', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_contact_title', array(
'label' => __('Contact Title','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'text',
) );
//Contact Subtitle Setting
$wp_customize->add_setting(
'callcenter_contact_subtitle', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_contact_subtitle', array(
'label' => __('Contact Subtitle','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'textarea',
) );
//Contact Form Title Setting
$wp_customize ->add_setting(
'callcenter_contact_form_title', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control(
'callcenter_contact_form_title', array(
'label' => __('Contact Form Title','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'text',
) );
//Contact Form Shortcode Setting
$wp_customize ->add_setting(
'callcenter_contact_form_shortcode', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control (
'callcenter_contact_form_shortcode', array(
'label' => __('Contact Form Shortcode','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'textarea',
) );
//Contact Info Title Setting
$wp_customize ->add_setting (
'callcenter_contact_info_title', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control (
'callcenter_contact_info_title', array(
'label' => __('Contact Info Title','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'text',
) );
//contact Details Info1 Icon
$wp_customize ->add_setting (
'callcenter_contact_info1_icon', array(
'default' => __('','callcenter'),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control (
'callcenter_contact_info1_icon', array(
'label' => __('Contact Details Info1 Icon','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'text',
) );
// contact Details Info1 label
$wp_customize ->add_setting (
'callcenter_contact_info1_label', array(
'default' =>'',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control (
'callcenter_contact_info1_label', array(
'label' => __('Contact Info1 Label','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'text',
) );
//contact Details Info1
$wp_customize ->add_setting (
'callcenter_contact_info1', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control (
'callcenter_contact_info1', array(
'label' => __('Contact Info1','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'text',
) );
//contact Details Info2 Icon
$wp_customize ->add_setting (
'callcenter_contact_info2_icon', array(
'default' =>'',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control (
'callcenter_contact_info2_icon', array(
'label' => __('Contact Info2 Icon','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'text',
) );
//contact Details Info2 label
$wp_customize ->add_setting (
'callcenter_contact_info2_label', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control (
'callcenter_contact_info2_label', array(
'label' => __('Contact Info2 Label','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'text',
) );
//contact Details Info2
$wp_customize ->add_setting (
'callcenter_contact_info2', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control (
'callcenter_contact_info2', array(
'label' => __('Contact Info2 Detail','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'text',
) );
//contact Details Info3 Icon
$wp_customize ->add_setting (
'callcenter_contact_info3_icon', array(
'default' =>'',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control (
'callcenter_contact_info3_icon', array(
'label' => __('Contact Info3 Icon','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'text',
) );
//contact Details Info3 label
$wp_customize ->add_setting (
'callcenter_contact_info3_label', array(
'default' =>'',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control (
'callcenter_contact_info3_label', array(
'label' => __('Contact Info3 Label','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'text',
) );
//contact Details Info3
$wp_customize ->add_setting (
'callcenter_contact_info3', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control (
'callcenter_contact_info3', array(
'label' => __('Contact Info3 Detail','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'text',
) );
//contact Details Info4 Icon
$wp_customize ->add_setting (
'callcenter_contact_info4_icon', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control (
'callcenter_contact_info4_icon', array(
'label' => __('Contact Info4 Icon','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'text',
) );
//contact Details Info4 label
$wp_customize ->add_setting (
'callcenter_contact_info4_label', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control (
'callcenter_contact_info4_label', array(
'label' => __('Contact Info4 Label','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'text',
) );
//contact Details Info4
$wp_customize ->add_setting (
'callcenter_contact_info4', array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control (
'callcenter_contact_info4', array(
'label' => __('Contact Info4 Detail','callcenter'),
'section' => 'callcenter_contact_section_settings',
'type' => 'textarea',
) );
function callcenter_pro_version_sanitize_text( $input ) {
return wp_kses_post( force_balance_tags( $input ) );
}
function callcenter_pro_version_sanitize_html( $input ) {
return force_balance_tags( $input );
}
function callcenter_homepage_title_sanitize_text ( $input ) {
return wp_kses_post( force_balance_tags( $input ) );
}
function callcenter_homepage_title_sanitize_html( $input ) {
return force_balance_tags( $input );
}
}
add_action( 'customize_register', 'callcenter_homepage_setting' );
?>