remove_section( 'automobile_hub_topbar' ); $wp_customize->remove_setting( 'automobile_hub_sticky' ); $wp_customize->remove_control( 'automobile_hub_sticky' ); $wp_customize->remove_setting( 'automobile_hub_menu_font_size' ); $wp_customize->remove_control( 'automobile_hub_menu_font_size' ); $wp_customize->remove_setting( 'automobile_hub_footer_widget_image' ); $wp_customize->remove_control( 'automobile_hub_footer_widget_image' ); $wp_customize->remove_setting( 'automobile_hub_tp_footer_bg_color_option' ); $wp_customize->remove_control( 'automobile_hub_tp_footer_bg_color_option' ); $wp_customize->remove_setting( 'automobile_hub_tp_color_option_link' ); $wp_customize->remove_control( 'automobile_hub_tp_color_option_link' ); $wp_customize->remove_setting( 'automobile_hub_slider_icon' ); $wp_customize->remove_control( 'automobile_hub_slider_icon' ); $wp_customize->remove_setting( 'automobile_hub_about_icon' ); $wp_customize->remove_control( 'automobile_hub_about_icon' ); } add_action( 'customize_register', 'automotive_charging_station_remove_customize_register', 11 ); function automotive_charging_station_customize_register( $wp_customize ) { // Register the custom control type. $wp_customize->register_control_type( 'Automotive_Charging_Station_Toggle_Control' ); $wp_customize->add_section( 'automotive_charging_station_featured_car_section' , array( 'title' => __( 'Car Charging Services Settings', 'automotive-charging-station' ), 'panel' => 'automobile_hub_panel_id', 'priority' => 4, ) ); $wp_customize->add_setting( 'automotive_charging_station_featured_car_show_hide', array( 'default' => false, 'transport' => 'refresh', 'sanitize_callback' => 'automobile_hub_sanitize_checkbox', ) ); $wp_customize->add_control( new Automotive_Charging_Station_Toggle_Control( $wp_customize, 'automotive_charging_station_featured_car_show_hide', array( 'label' => esc_html__( 'Show / Hide section', 'automotive-charging-station' ), 'section' => 'automotive_charging_station_featured_car_section', 'type' => 'toggle', 'settings' => 'automotive_charging_station_featured_car_show_hide', ) ) ); $wp_customize->add_setting('automotive_charging_station_charging_services_section_tittle',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('automotive_charging_station_charging_services_section_tittle',array( 'label' => __('Section Title','automotive-charging-station'), 'section' => 'automotive_charging_station_featured_car_section', 'type' => 'text' )); $wp_customize->selective_refresh->add_partial( 'automotive_charging_station_charging_services_section_tittle', array( 'selector' => '#featured-car h2', 'render_callback' => 'automobile_hub_customize_partial_automotive_charging_station_charging_services_section_tittle', ) ); $categories = get_categories(); $cats = array(); $i = 0; $automotive_charging_station_offer_cat[]= 'select'; foreach($categories as $category){ if($i==0){ $default = $category->slug; $i++; } $automotive_charging_station_offer_cat[$category->slug] = $category->name; } $wp_customize->add_setting('automotive_charging_station_charging_services_section_category',array( 'default' => 'select', 'sanitize_callback' => 'automobile_hub_sanitize_choices', )); $wp_customize->add_control('automotive_charging_station_charging_services_section_category',array( 'type' => 'select', 'choices' => $automotive_charging_station_offer_cat, 'label' => __('Select Category','automotive-charging-station'), 'section' => 'automotive_charging_station_featured_car_section', )); } add_action( 'customize_register', 'automotive_charging_station_customize_register' );