add_section( 'buzzhub_service', array( 'title' => esc_html__( 'Service', 'buzzhub' ), 'panel' => 'buzzhub_home_panel', ) ); // service enable settings $wp_customize->add_setting( 'buzzhub_service', array( 'sanitize_callback' => 'buzzhub_sanitize_select', 'default' => 'disable' ) ); $wp_customize->add_control( 'buzzhub_service', array( 'section' => 'buzzhub_service', 'label' => esc_html__( 'Content type:', 'buzzhub' ), 'description' => esc_html__( 'Choose where you want to render the content from.', 'buzzhub' ), 'type' => 'select', 'choices' => array( 'disable' => esc_html__( '--Disable--', 'buzzhub' ), 'page' => esc_html__( 'Page', 'buzzhub' ), ) ) ); $wp_customize->add_setting( 'buzzhub_service_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html__( 'What We Do', 'buzzhub' ), 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'buzzhub_service_title', array( 'section' => 'buzzhub_service', 'label' => esc_html__( 'Title:', 'buzzhub' ), 'active_callback' => 'buzzhub_if_service_enabled', ) ); $wp_customize->selective_refresh->add_partial( 'buzzhub_service_title', array( 'selector' => '#our-services h2.section-title', 'render_callback' => 'buzzhub_service_partial_title', ) ); $service_num = 3; for ($i=1; $i <= $service_num ; $i++) { $wp_customize->add_setting( 'buzzhub_service_icon_'.$i, array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'buzzhub_service_icon_'.$i, array( 'label' => __('Icon ', 'buzzhub').$i, 'description' => sprintf( __('Please input icon as eg: fa-archive. Find Font-awesome icons %1$shere%2$s', 'buzzhub'), '', '' ), 'section' => 'buzzhub_service', 'type' => 'text', 'active_callback' => 'buzzhub_if_service_enabled', ) ); // service page setting $wp_customize->add_setting( 'buzzhub_service_page_'.$i, array( 'sanitize_callback' => 'buzzhub_sanitize_dropdown_pages', 'default' => 0, ) ); $wp_customize->add_control( 'buzzhub_service_page_'.$i, array( 'section' => 'buzzhub_service', 'label' => esc_html__( 'Page ', 'buzzhub' ).$i, 'type' => 'dropdown-pages', 'active_callback' => 'buzzhub_if_service_page' ) ); } $wp_customize->add_setting( 'buzzhub_enable_service_position_relative', array( 'sanitize_callback' => 'buzzhub_sanitize_checkbox', 'default' => true, ) ); $wp_customize->add_control( 'buzzhub_enable_service_position_relative', array( 'section' => 'buzzhub_service', 'label' => esc_html__( 'Enable Position Relative.', 'buzzhub' ), 'type' => 'checkbox', 'active_callback' => 'buzzhub_if_service_enabled', ) );