add_section( 'bizhunt_services_section', array( 'title' => esc_html__( 'Services Section', 'bizhunt' ), 'priority' => 40, 'capability' => 'edit_theme_options', 'panel' => 'bizhunt_front_option', ) ); //Enable services Section $wp_customize->add_setting( 'bizhunt_services_enable', array( 'default' => '', 'sanitize_callback' => 'bizhunt_sanitize_checkbox', ) ); $wp_customize->add_control( 'bizhunt_services_enable', array( 'label' => esc_html__( 'Enable Services Section', 'bizhunt' ), 'section' => 'bizhunt_services_section', 'type' => 'checkbox', 'priority' => 10, ) ); //Services Section Title $wp_customize->add_setting( 'bizhunt_services_title', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'bizhunt_services_title', array( 'label' => esc_html__( 'Services Section Title', 'bizhunt' ), 'section' => 'bizhunt_services_section', 'type' => 'text', 'priority' => 20, ) ); //Services Section Sub Title $wp_customize->add_setting( 'bizhunt_services_subtitle', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'bizhunt_services_subtitle', array( 'label' => esc_html__( 'Services Section Sub Title', 'bizhunt' ), 'section' => 'bizhunt_services_section', 'type' => 'text', 'priority' => 30, ) ); //Services Section Content $wp_customize->add_setting( 'bizhunt_services_content', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'bizhunt_services_content', array( 'label' => esc_html__( 'Services Section Content', 'bizhunt' ), 'section' => 'bizhunt_services_section', 'type' => 'text', 'priority' => 40, ) ); $services_no = 6; for( $i = 1; $i <= $services_no; $i++ ) { $bizhunt_services_icon = 'bizhunt_services_icon_' . $i; $bizhunt_services_page = 'bizhunt_services_page_' . $i; //Services Icon $wp_customize->add_setting( $bizhunt_services_icon, array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( $bizhunt_services_icon, array( 'label' => esc_html__( 'Services Icon ', 'bizhunt' ).$i, 'description' => esc_html__( 'Use FontAwesome icon class. Example: fa-pencil', 'bizhunt' ), 'section' => 'bizhunt_services_section', 'type' => 'text', 'priority' => 50, ) ); //Services Page $wp_customize->add_setting( $bizhunt_services_page, array( 'default' => '', 'sanitize_callback' => 'bizhunt_sanitize_dropdown_pages', ) ); $wp_customize->add_control( $bizhunt_services_page, array( 'label' => esc_html__( 'Services Page ', 'bizhunt' ).$i, 'section' => 'bizhunt_services_section', 'type' => 'dropdown-pages', 'priority' => 50, ) ); }