add_section( 'aster_it_solutions_service_section', array( 'panel' => 'aster_it_solutions_front_page_options', 'title' => esc_html__( 'Services Section', 'aster-it-solutions' ), 'priority' => 10, ) ); //Service Section - Enable Section. $wp_customize->add_setting( 'aster_it_solutions_enable_service_section', array( 'default' => false, 'sanitize_callback' => 'aster_it_solutions_sanitize_switch', ) ); $wp_customize->add_control( new Aster_IT_Solutions_Toggle_Switch_Custom_Control( $wp_customize, 'aster_it_solutions_enable_service_section', array( 'label' => esc_html__( 'Enable Service Section', 'aster-it-solutions' ), 'section' => 'aster_it_solutions_service_section', 'settings' => 'aster_it_solutions_enable_service_section' ) ) ); // Services Section - Content Type. $wp_customize->add_setting( 'aster_it_solutions_service_content_type', array( 'default' => 'page', 'sanitize_callback' => 'aster_it_solutions_sanitize_select', ) ); $wp_customize->add_control( 'aster_it_solutions_service_content_type', array( 'label' => esc_html__( 'Select Content Type', 'aster-it-solutions' ), 'section' => 'aster_it_solutions_service_section', 'settings' => 'aster_it_solutions_service_content_type', 'type' => 'select', 'active_callback' => 'aster_it_solutions_is_service_section_enabled', 'choices' => array( 'page' => esc_html__( 'Page', 'aster-it-solutions' ), 'post' => esc_html__( 'Post', 'aster-it-solutions' ), ), ) ); for ( $i = 1; $i <= 6; $i++ ) { // Service Section - Select Post. $wp_customize->add_setting( 'aster_it_solutions_service_content_post_' . $i, array( 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( 'aster_it_solutions_service_content_post_' . $i, array( 'label' => esc_html__( 'Select Post ', 'aster-it-solutions' ) . $i, 'section' => 'aster_it_solutions_service_section', 'settings' => 'aster_it_solutions_service_content_post_' . $i, 'active_callback' => 'aster_it_solutions_is_service_section_and_content_type_post_enabled', 'type' => 'select', 'choices' => aster_it_solutions_get_post_choices(), ) ); // Service Section - Select Page. $wp_customize->add_setting( 'aster_it_solutions_service_content_page_' . $i, array( 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( 'aster_it_solutions_service_content_page_' . $i, array( 'label' => esc_html__( 'Select Page ', 'aster-it-solutions' ) . $i, 'section' => 'aster_it_solutions_service_section', 'settings' => 'aster_it_solutions_service_content_page_' . $i, 'active_callback' => 'aster_it_solutions_is_service_section_and_content_type_page_enabled', 'type' => 'select', 'choices' => aster_it_solutions_get_page_choices(), ) ); }