add_section( 'service', array( 'title' => __( 'Service Section', 'blossom-floral-pro' ), 'priority' => 30, 'panel' => 'frontpage_settings', ) ); /** Service Title */ $wp_customize->add_setting( 'service_title', array( 'default' => __( 'I want to ...', 'blossom-floral-pro' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'service_title', array( 'label' => __( 'Section Title', 'blossom-floral-pro' ), 'section' => 'service', 'priority' => -1 ) ); $wp_customize->selective_refresh->add_partial( 'service_title', array( 'selector' => '.service-section .section-header h2.section-title', 'render_callback' => 'blossom_floral_pro_get_service_title', ) ); /**Background image */ $wp_customize->add_setting( 'service_bg_image', array( 'default' => get_template_directory_uri() . '/images/flower.png', 'sanitize_callback' => 'blossom_floral_pro_sanitize_image', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'service_bg_image', array( 'label' => esc_html__( 'Background Image', 'blossom-floral-pro' ), 'description' => esc_html__( 'Choose background Image of your choice. The recommended size for the image is 156px by 206px in JPG format.', 'blossom-floral-pro' ), 'section' => 'service', 'type' => 'image', 'priority' => -1 ) ) ); $wp_customize->add_setting( new Blossom_Floral_Pro_Repeater_Setting( $wp_customize, 'service_repeater', array( 'default' => '', 'sanitize_callback' => array( 'Blossom_Floral_Pro_Repeater_Setting', 'sanitize_repeater_setting' ), ) ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Control_Repeater( $wp_customize, 'service_repeater', array( 'section' => 'service', 'label' => esc_html__( 'Services', 'blossom-floral-pro' ), 'description' => __( 'The recommended size for service icon images are 30px by 36px in PNG format', 'blossom-floral-pro' ), 'fields' => array( 'image' => array( 'type' => 'image', 'label' => esc_html__( 'Upload image', 'blossom-floral-pro' ), ), 'content' => array( 'type' => 'text', 'label' => esc_html__( 'Title', 'blossom-floral-pro' ), ), 'link' => array( 'type' => 'url', 'label' => esc_html__( 'Link', 'blossom-floral-pro' ), 'description' => esc_html__( 'Example: https://facebook.com', 'blossom-floral-pro' ), ), 'new_tab' => array( 'type' => 'checkbox', 'label' => esc_html__( 'Open link in a new tab', 'blossom-floral-pro' ), ) ), 'row_label' => array( 'type' => 'field', 'value' => esc_html__( 'Services', 'blossom-floral-pro' ), 'field' => 'content' ), ) ) ); /**Service View ALl Button */ $wp_customize->add_setting( 'service_btn_label', array( 'default' => __( 'View All Services', 'blossom-floral-pro' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'service_btn_label', array( 'section' => 'service', 'label' => __( 'Button Label', 'blossom-floral-pro' ), 'type' => 'text', ) ); $wp_customize->selective_refresh->add_partial( 'service_btn_label', array( 'selector' => '.service-section .section-button-wrapper a', 'render_callback' => 'blossom_floral_pro_get_service_btn_label', ) ); /** Service View ALL Button Link */ $wp_customize->add_setting( 'service_url', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'service_url', array( 'section' => 'service', 'label' => __( 'Button Link', 'blossom-floral-pro' ), 'type' => 'url', ) ); /** Service Section Ends */ } add_action( 'customize_register', 'blossom_floral_pro_customize_register_frontpage_service' );