add_section( 'buzzhub_team', array( 'title' => esc_html__( 'Team', 'buzzhub' ), 'panel' => 'buzzhub_home_panel', ) ); // team enable settings $wp_customize->add_setting( 'buzzhub_team', array( 'sanitize_callback' => 'buzzhub_sanitize_select', 'default' => 'disable' ) ); $wp_customize->add_control( 'buzzhub_team', array( 'section' => 'buzzhub_team', '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_team_title', array( 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', 'default' => __('Here is Our Awesome Team', 'buzzhub'), ) ); $wp_customize->add_control( 'buzzhub_team_title', array( 'section' => 'buzzhub_team', 'label' => esc_html__( 'Title:', 'buzzhub' ), 'active_callback' => 'buzzhub_if_team_enabled', ) ); $wp_customize->selective_refresh->add_partial( 'buzzhub_team_title', array( 'selector' => '#our-team h2.section-title', 'render_callback' => 'buzzhub_team_partial_title', ) ); $team_num = 3; for ($i=1; $i <= $team_num ; $i++) { // team page setting $wp_customize->add_setting( 'buzzhub_team_page_'.$i, array( 'sanitize_callback' => 'buzzhub_sanitize_dropdown_pages', 'default' => 0, ) ); $wp_customize->add_control( 'buzzhub_team_page_'.$i, array( 'section' => 'buzzhub_team', 'label' => esc_html__( 'Page ', 'buzzhub' ).$i, 'type' => 'dropdown-pages', 'active_callback' => 'buzzhub_if_team_page' ) ); $wp_customize->add_setting( 'buzzhub_team_position_'.$i, array( 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'buzzhub_team_position_'.$i, array( 'section' => 'buzzhub_team', 'label' => esc_html__( 'Members Position:', 'buzzhub' ). $i, 'active_callback' => 'buzzhub_if_team_enabled', ) ); $wp_customize->add_setting( 'buzzhub_team_social_link_'.$i, array( 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Buzzhub_Multi_Input_Custom_Control( $wp_customize, 'buzzhub_team_social_link_'.$i, array( 'section' => 'buzzhub_team', 'label' => esc_html__( 'Social Link', 'buzzhub' ), 'button_text' => esc_html__( 'Add More Social Link', 'buzzhub' ), 'active_callback' => 'buzzhub_if_team_enabled', 'type' => 'multi-input', ) ) ); }