get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->get_section( 'background_image' )->panel = 'allrounder_news_general_panel'; $wp_customize->get_section( 'title_tagline' )->panel = 'allrounder_news_general_panel'; $wp_customize->get_section( 'header_image' )->panel = 'allrounder_news_general_panel'; $wp_customize->get_section( 'colors' )->panel = 'allrounder_news_general_panel'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'allrounder_news_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'allrounder_news_customize_partial_blogdescription', ) ); } /** Cutomizer Pannel */ $wp_customize->add_panel( 'allrounder_news_general_panel', array( 'priority' => 1, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => esc_html__( 'General Settings', 'allrounder-news' ), ) ); $wp_customize->add_panel( 'allrounder_news_home_panel', array( 'priority' => 1, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => esc_html__( 'Front Page Settings', 'allrounder-news' ), ) ); /** Header Section **/ $wp_customize->add_section( 'allrounder_news_header_section', array( 'title' => esc_html__( 'Top Header Settings', 'allrounder-news' ), 'panel' => 'allrounder_news_general_panel', 'priority' => 1, ) ); $wp_customize->add_setting( 'allrounder_news_top_header_enable_disable', array( 'default' => 'disable', 'sanitize_callback' => 'allrounder_news_sanitize_enable_disable', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Switch_Control( $wp_customize, 'allrounder_news_top_header_enable_disable', array( 'type' => 'switch', 'label' => esc_html__( 'Enable / Disable Top Header', 'allrounder-news' ), 'section' => 'allrounder_news_header_section', 'choices' => array( 'enable' => esc_html__( 'Enable', 'allrounder-news' ), 'disable' => esc_html__( 'Disable', 'allrounder-news' ) ), 'priority' => 5, ) ) ); $wp_customize->add_setting( 'allrounder_news_top_header_text', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'allrounder_news_top_header_text', array( 'label' => esc_html__('Information Text','allrounder-news'), 'priority' => 10, 'type' => 'text', 'section' => 'allrounder_news_header_section' ) ); /** Header Section **/ $wp_customize->add_section( 'allrounder_news_mid_header_section', array( 'title' => esc_html__( 'Main Header Settings', 'allrounder-news' ), 'panel' => 'allrounder_news_general_panel', 'priority' => 1, ) ); $wp_customize->add_setting( 'allrounder_news_main_heade_search', array( 'default' => 'enable', 'sanitize_callback' => 'allrounder_news_sanitize_enable_disable', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Switch_Control( $wp_customize, 'allrounder_news_main_heade_search', array( 'type' => 'switch', 'label' => esc_html__( 'Enable / Disable Search', 'allrounder-news' ), 'section' => 'allrounder_news_mid_header_section', 'choices' => array( 'enable' => esc_html__( 'Enable', 'allrounder-news' ), 'disable' => esc_html__( 'Disable', 'allrounder-news' ) ), 'priority' => 5, ) ) ); /** Header Section **/ $wp_customize->add_section( 'allrounder_news_social_media_setting', array( 'title' => esc_html__( 'Social Media Settings', 'allrounder-news' ), 'panel' => 'allrounder_news_general_panel', 'priority' => 1, ) ); $wp_customize->add_setting( 'allrounder_news_top_header_social_icons', array( 'default' => 'disable', 'sanitize_callback' => 'allrounder_news_sanitize_enable_disable', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Switch_Control( $wp_customize, 'allrounder_news_top_header_social_icons', array( 'type' => 'switch', 'label' => esc_html__( 'Enable / Disable Top Header Social Icon', 'allrounder-news' ), 'section' => 'allrounder_news_social_media_setting', 'choices' => array( 'enable' => esc_html__( 'Enable', 'allrounder-news' ), 'disable' => esc_html__( 'Disable', 'allrounder-news' ) ), 'priority' => 5, ) ) ); $wp_customize->add_setting( 'allrounder_news_sidebar_social_icons', array( 'default' => 'disable', 'sanitize_callback' => 'allrounder_news_sanitize_enable_disable', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Switch_Control( $wp_customize, 'allrounder_news_sidebar_social_icons', array( 'type' => 'switch', 'label' => esc_html__( 'Enable / Disable Sidebar Social Icon', 'allrounder-news' ), 'section' => 'allrounder_news_social_media_setting', 'choices' => array( 'enable' => esc_html__( 'Enable', 'allrounder-news' ), 'disable' => esc_html__( 'Disable', 'allrounder-news' ) ), 'priority' => 5, ) ) ); $wp_customize->add_setting( 'allrounder_news_sidebar_social_icon_text', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'allrounder_news_sidebar_social_icon_text', array( 'label' => esc_html__('Right Sidebar Social Media Title','allrounder-news'), 'priority' => 6, 'type' => 'text', 'section' => 'allrounder_news_social_media_setting' ) ); $wp_customize->add_setting( 'allrounder_news_footer_social_icon_text', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'allrounder_news_footer_social_icon_text', array( 'label' => esc_html__('Footer Social Media Section Title','allrounder-news'), 'priority' => 10, 'type' => 'text', 'section' => 'allrounder_news_social_media_setting' ) ); $wp_customize->add_setting( 'allrounder_news_footer_social_icon_text_2', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'allrounder_news_footer_social_icon_text_2', array( 'label' => esc_html__('Footer Social Media Text','allrounder-news'), 'priority' => 10, 'type' => 'text', 'section' => 'allrounder_news_social_media_setting' ) ); $wp_customize->add_setting( 'allrounder_news_footer_social_icons', array( 'default' => 'disable', 'sanitize_callback' => 'allrounder_news_sanitize_enable_disable', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Switch_Control( $wp_customize, 'allrounder_news_footer_social_icons', array( 'type' => 'switch', 'label' => esc_html__( 'Enable / Disable Footer Social Icon', 'allrounder-news' ), 'section' => 'allrounder_news_social_media_setting', 'choices' => array( 'enable' => esc_html__( 'Enable', 'allrounder-news' ), 'disable' => esc_html__( 'Disable', 'allrounder-news' ) ), 'priority' => 5, ) ) ); $wp_customize->add_setting( 'allrounder_news_social_link_sep', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Section_Separator( $wp_customize, 'allrounder_news_social_link_sep', array( 'type' => 'allrounder_news_separator', 'label' => esc_html__( 'Social Media Links', 'allrounder-news' ), 'section' => 'allrounder_news_social_media_setting', 'priority' => 15, ) ) ); $wp_customize->add_setting( 'allrounder_news_facebook_link', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'allrounder_news_facebook_link', array( 'label' => esc_html__('Facebook Link','allrounder-news'), 'priority' => 20, 'type' => 'url', 'section' => 'allrounder_news_social_media_setting' ) ); $wp_customize->add_setting( 'allrounder_news_twitter_link', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'allrounder_news_twitter_link', array( 'label' => esc_html__('Twitter Link','allrounder-news'), 'priority' => 20, 'type' => 'url', 'section' => 'allrounder_news_social_media_setting' ) ); $wp_customize->add_setting( 'allrounder_news_youtube_link', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'allrounder_news_youtube_link', array( 'label' => esc_html__('Youtube Link','allrounder-news'), 'priority' => 20, 'type' => 'url', 'section' => 'allrounder_news_social_media_setting' ) ); $wp_customize->add_setting( 'allrounder_news_instagram_link', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'allrounder_news_instagram_link', array( 'label' => esc_html__('Instagram Link','allrounder-news'), 'priority' => 20, 'type' => 'url', 'section' => 'allrounder_news_social_media_setting' ) ); $wp_customize->add_setting( 'allrounder_news_google_plus_link', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'allrounder_news_google_plus_link', array( 'label' => esc_html__('Google Plus Link','allrounder-news'), 'priority' => 20, 'type' => 'url', 'section' => 'allrounder_news_social_media_setting' ) ); $wp_customize->add_setting( 'allrounder_news_pinterest_link', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'allrounder_news_pinterest_link', array( 'label' => esc_html__('Pinterest Link','allrounder-news'), 'priority' => 20, 'type' => 'url', 'section' => 'allrounder_news_social_media_setting' ) ); $wp_customize->add_setting( 'allrounder_news_linkedin_link', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'allrounder_news_linkedin_link', array( 'label' => esc_html__('LinkedIn Link','allrounder-news'), 'priority' => 20, 'type' => 'url', 'section' => 'allrounder_news_social_media_setting' ) ); $wp_customize->add_setting( 'allrounder_news_reddit_link', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'allrounder_news_reddit_link', array( 'label' => esc_html__('Reddit Link','allrounder-news'), 'priority' => 20, 'type' => 'url', 'section' => 'allrounder_news_social_media_setting' ) ); $wp_customize->add_setting( 'allrounder_news_tumblr_link', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'allrounder_news_tumblr_link', array( 'label' => esc_html__('Tumblr Link','allrounder-news'), 'priority' => 20, 'type' => 'url', 'section' => 'allrounder_news_social_media_setting' ) ); $wp_customize->add_setting( 'allrounder_news_vk_link', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'allrounder_news_vk_link', array( 'label' => esc_html__('VK Link','allrounder-news'), 'priority' => 20, 'type' => 'url', 'section' => 'allrounder_news_social_media_setting' ) ); /** Header Section **/ $wp_customize->add_section( 'allrounder_news_single_post_setting', array( 'title' => esc_html__( 'Single Post Settings', 'allrounder-news' ), 'panel' => 'allrounder_news_general_panel', 'priority' => 1, ) ); $wp_customize->add_setting( 'allrounder_news_single_post_ed_category', array( 'default' => 'enable', 'sanitize_callback' => 'allrounder_news_sanitize_enable_disable', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Switch_Control( $wp_customize, 'allrounder_news_single_post_ed_category', array( 'type' => 'switch', 'label' => esc_html__( 'Enable / Disable Post Category', 'allrounder-news' ), 'section' => 'allrounder_news_single_post_setting', 'choices' => array( 'enable' => esc_html__( 'Enable', 'allrounder-news' ), 'disable' => esc_html__( 'Disable', 'allrounder-news' ) ), 'priority' => 5, ) ) ); $wp_customize->add_setting( 'allrounder_news_single_post_ed_date', array( 'default' => 'enable', 'sanitize_callback' => 'allrounder_news_sanitize_enable_disable', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Switch_Control( $wp_customize, 'allrounder_news_single_post_ed_date', array( 'type' => 'switch', 'label' => esc_html__( 'Enable / Disable Post Date', 'allrounder-news' ), 'section' => 'allrounder_news_single_post_setting', 'choices' => array( 'enable' => esc_html__( 'Enable', 'allrounder-news' ), 'disable' => esc_html__( 'Disable', 'allrounder-news' ) ), 'priority' => 5, ) ) ); $wp_customize->add_setting( 'allrounder_news_single_post_ed_tags', array( 'default' => 'enable', 'sanitize_callback' => 'allrounder_news_sanitize_enable_disable', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Switch_Control( $wp_customize, 'allrounder_news_single_post_ed_tags', array( 'type' => 'switch', 'label' => esc_html__( 'Enable / Disable Post Tags', 'allrounder-news' ), 'section' => 'allrounder_news_single_post_setting', 'choices' => array( 'enable' => esc_html__( 'Enable', 'allrounder-news' ), 'disable' => esc_html__( 'Disable', 'allrounder-news' ) ), 'priority' => 5, ) ) ); $wp_customize->add_setting( 'allrounder_news_single_post_ed_author_section', array( 'default' => 'enable', 'sanitize_callback' => 'allrounder_news_sanitize_enable_disable', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Switch_Control( $wp_customize, 'allrounder_news_single_post_ed_author_section', array( 'type' => 'switch', 'label' => esc_html__( 'Enable / Disable Autor Section', 'allrounder-news' ), 'section' => 'allrounder_news_single_post_setting', 'choices' => array( 'enable' => esc_html__( 'Enable', 'allrounder-news' ), 'disable' => esc_html__( 'Disable', 'allrounder-news' ) ), 'priority' => 5, ) ) ); $wp_customize->add_setting( 'allrounder_news_single_post_ed_related_post', array( 'default' => 'enable', 'sanitize_callback' => 'allrounder_news_sanitize_enable_disable', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Switch_Control( $wp_customize, 'allrounder_news_single_post_ed_related_post', array( 'type' => 'switch', 'label' => esc_html__( 'Enable / Disable Related Posts', 'allrounder-news' ), 'section' => 'allrounder_news_single_post_setting', 'choices' => array( 'enable' => esc_html__( 'Enable', 'allrounder-news' ), 'disable' => esc_html__( 'Disable', 'allrounder-news' ) ), 'priority' => 5, ) ) ); $wp_customize->add_setting( 'allrounder_news_single_post_ed_sidebar', array( 'default' => 'enable', 'sanitize_callback' => 'allrounder_news_sanitize_enable_disable', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Switch_Control( $wp_customize, 'allrounder_news_single_post_ed_sidebar', array( 'type' => 'switch', 'label' => esc_html__( 'Enable / Disable Sidebar', 'allrounder-news' ), 'section' => 'allrounder_news_single_post_setting', 'choices' => array( 'enable' => esc_html__( 'Enable', 'allrounder-news' ), 'disable' => esc_html__( 'Disable', 'allrounder-news' ) ), 'priority' => 5, ) ) ); /** Header Section **/ $wp_customize->add_section( 'allrounder_news_archive_post_setting', array( 'title' => esc_html__( 'Post Archive Settings', 'allrounder-news' ), 'panel' => 'allrounder_news_general_panel', 'priority' => 1, ) ); $wp_customize->add_setting( 'allrounder_news_single_archive_ed_category', array( 'default' => 'enable', 'sanitize_callback' => 'allrounder_news_sanitize_enable_disable', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Switch_Control( $wp_customize, 'allrounder_news_single_archive_ed_category', array( 'type' => 'switch', 'label' => esc_html__( 'Enable / Disable Archive Child Category', 'allrounder-news' ), 'section' => 'allrounder_news_archive_post_setting', 'choices' => array( 'enable' => esc_html__( 'Enable', 'allrounder-news' ), 'disable' => esc_html__( 'Disable', 'allrounder-news' ) ), 'priority' => 5, ) ) ); $wp_customize->add_setting( 'allrounder_news_single_archive_ed_sidebar', array( 'default' => 'enable', 'sanitize_callback' => 'allrounder_news_sanitize_enable_disable', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Switch_Control( $wp_customize, 'allrounder_news_single_archive_ed_sidebar', array( 'type' => 'switch', 'label' => esc_html__( 'Enable / Disable Archive Sidebar', 'allrounder-news' ), 'section' => 'allrounder_news_archive_post_setting', 'choices' => array( 'enable' => esc_html__( 'Enable', 'allrounder-news' ), 'disable' => esc_html__( 'Disable', 'allrounder-news' ) ), 'priority' => 5, ) ) ); /** Home Slider Section **/ $wp_customize->add_section( 'allrounder_news_home_slider_section', array( 'title' => esc_html__( 'Slider Section', 'allrounder-news' ), 'panel' => 'allrounder_news_home_panel', 'priority' => 5, ) ); $wp_customize->add_setting( 'allrounder_news_slider_enable_disable', array( 'default' => 'disable', 'sanitize_callback' => 'allrounder_news_sanitize_enable_disable', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Switch_Control( $wp_customize, 'allrounder_news_slider_enable_disable', array( 'type' => 'switch', 'label' => esc_html__( 'Enable / Disable Slider Banner', 'allrounder-news' ), 'section' => 'allrounder_news_home_slider_section', 'choices' => array( 'enable' => esc_html__( 'Enable', 'allrounder-news' ), 'disable' => esc_html__( 'Disable', 'allrounder-news' ) ), 'priority' => 1, ) ) ); $wp_customize->add_setting( 'allrounder_news_slider_cat', array( 'default' => '', 'sanitize_callback' => 'allrounder_news_sanitize_post_cat_list', ) ); $wp_customize->add_control( 'allrounder_news_slider_cat', array( 'label' => esc_html__('Slider Category','allrounder-news'), 'priority' => 5, 'type' => 'select', 'choices' => $allrounder_news_Category_list, 'section' => 'allrounder_news_home_slider_section' ) ); $wp_customize->add_setting( 'allrounder_news_slider_feature_post_sep', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Allrounder_News_Customize_Section_Separator( $wp_customize, 'allrounder_news_slider_feature_post_sep', array( 'type' => 'allrounder_news_separator', 'label' => esc_html__( 'Slider Featured Posts', 'allrounder-news' ), 'section' => 'allrounder_news_home_slider_section', 'priority' => 10, ) ) ); $wp_customize->add_setting( 'allrounder_news_slider_features_post_1', array( 'default' => '', 'sanitize_callback' => 'allrounder_news_sanitize_post_list', ) ); $wp_customize->add_control( 'allrounder_news_slider_features_post_1', array( 'label' => esc_html__('Slider Featured Post One','allrounder-news'), 'priority' => 15, 'type' => 'select', 'choices' => $allrounder_news_Posts_list, 'section' => 'allrounder_news_home_slider_section' ) ); $wp_customize->add_setting( 'allrounder_news_slider_features_post_2', array( 'default' => '', 'sanitize_callback' => 'allrounder_news_sanitize_post_list', ) ); $wp_customize->add_control( 'allrounder_news_slider_features_post_2', array( 'label' => esc_html__('Slider Featured Post Two','allrounder-news'), 'priority' => 20, 'type' => 'select', 'choices' => $allrounder_news_Posts_list, 'section' => 'allrounder_news_home_slider_section' ) ); $wp_customize->add_setting( 'allrounder_news_slider_features_post_3', array( 'default' => '', 'sanitize_callback' => 'allrounder_news_sanitize_post_list', ) ); $wp_customize->add_control( 'allrounder_news_slider_features_post_3', array( 'label' => esc_html__('Slider Featured Post Three','allrounder-news'), 'priority' => 25, 'type' => 'select', 'choices' => $allrounder_news_Posts_list, 'section' => 'allrounder_news_home_slider_section' ) ); $wp_customize->add_setting( 'allrounder_news_slider_features_post_4', array( 'default' => '', 'sanitize_callback' => 'allrounder_news_sanitize_post_list', ) ); $wp_customize->add_control( 'allrounder_news_slider_features_post_4', array( 'label' => esc_html__('Slider Featured Post Four','allrounder-news'), 'priority' => 30, 'type' => 'select', 'choices' => $allrounder_news_Posts_list, 'section' => 'allrounder_news_home_slider_section' ) ); /** Footer Section **/ $wp_customize->add_section( 'allrounder_news_footer_setting', array( 'title' => esc_html__( 'Footer Seetings', 'allrounder-news' ), 'panel' => 'allrounder_news_general_panel', 'priority' => 1, ) ); $wp_customize->add_setting( 'allrounder_news_copyright_text', array( 'default' => esc_html__('Copyright 2019 AllRounder News','allrounder-news'), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'allrounder_news_copyright_text', array( 'label' => esc_html__('Footer Copyright Text','allrounder-news'), 'priority' => 1, 'type' => 'text', 'section' => 'allrounder_news_footer_setting' ) ); /** Home Page Sections **/ } add_action( 'customize_register', 'allrounder_news_customize_register' ); /** Customizer Custom Class **/ if ( class_exists( 'WP_Customize_Control' ) ) { /** Switch Button **/ class Allrounder_News_Customize_Switch_Control extends WP_Customize_Control { public $type = 'switch'; public function render_content() { ?>
esc_html__( 'Enable', 'allrounder-news' ), 'disable' => esc_html__( 'Disable', 'allrounder-news' ) ); if ( array_key_exists( $input, $valid_keys ) ) { return $input; } else { return ''; } }