array( 'id' => 'before_primary', 'name' => esc_html__( 'Before Primary ( Wrapper )', Ace::TEXTDOMAIN ), ), 'before_content' => array( 'id' => 'before_content', 'name' => esc_html__( 'Before Content ( Wrapper )', Ace::TEXTDOMAIN ), ), 'beginning_of_content' => array( 'id' => 'beginning_of_content', 'name' => esc_html__( 'Beginning of the Content ( Wrapper )', Ace::TEXTDOMAIN ), ), 'before_1st_h2_of_content' => array( 'id' => 'before_1st_h2_of_content', 'name' => esc_html__( 'Before the First H2 tag of the Content ( Wrapper )', Ace::TEXTDOMAIN ), ), 'end_of_content' => array( 'id' => 'end_of_content', 'name' => esc_html__( 'End of the Content ( Wrapper )', Ace::TEXTDOMAIN ), ), 'after_content' => array( 'id' => 'after_content', 'name' => esc_html__( 'After Content ( Wrapper )', Ace::TEXTDOMAIN ), ), 'after_primary' => array( 'id' => 'after_primary', 'name' => esc_html__( 'After Primary ( Wrapper )', Ace::TEXTDOMAIN ), ), 'in_footer' => array( 'id' => 'in_footer', 'name' => esc_html__( 'In the Footer ( Wrapper )', Ace::TEXTDOMAIN ), ), ); foreach( $optional_widget_areas_args as $name => $data ) { $section_id = 'owa_' . $data['id']; $wp_customize->add_section( $section_id, array( 'title' => $data['name'], 'panel' => 'owa', )); $setting_id_prefix = $section_id . '_wrapper_'; // Wrapper Background // Background Color $wp_customize->add_setting( $setting_id_prefix . 'background_color', array( 'default' => 'rgba(255,255,255,0)', 'transport' => 'postMessage', 'sanitize_callback' => array( 'AceSanitizeMethods', 'sanitizeColorValue' ), 'sanitize_js_callback' => array( 'AceSanitizeMethods', 'sanitizeColorValue' ), )); $wp_customize->add_control( new AceCustomizerAlphaColorControl( $wp_customize, $setting_id_prefix . 'background_color', array( 'label' => esc_html__( 'Background Color ( Area Wrapper )', Ace::TEXTDOMAIN ), 'section' => $section_id, 'settings' => $setting_id_prefix . 'background_color', 'palette' => $this->palletColorSet, ))); // Background Image $wp_customize->add_setting( $setting_id_prefix . 'background_image', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', 'sanitize_js_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, $setting_id_prefix . 'background_image', array( 'label' => esc_html__( 'Background Image ( Area Wrapper )', Ace::TEXTDOMAIN ), 'section' => $section_id, 'settings' => $setting_id_prefix . 'background_image', ) )); // Background Image Size $wp_customize->add_setting( $setting_id_prefix . 'background_image_size', array( 'default' => 'auto', 'capability' => 'edit_theme_options', 'transport'=> 'postMessage', 'sanitize_callback' => array( 'AceSanitizeMethods', 'sanitizeBackgroundImageSize' ), 'sanitize_js_callback' => array( 'AceSanitizeMethods', 'sanitizeBackgroundImageSize' ), )); $wp_customize->add_control( $setting_id_prefix . 'background_image_size', array( 'section' => $section_id, 'settings' => $setting_id_prefix . 'background_image_size', 'label' => esc_html__( 'Background Size ( Area Wrapper )', Ace::TEXTDOMAIN ), 'description' => __( 'Enter the value like "Horizontal Vertical" with units', Ace::TEXTDOMAIN ), 'type' => 'select', 'choices' => $this->backgroundImageSizes, )); // Background Image Position Row $wp_customize->add_setting( $setting_id_prefix . 'background_image_position_row', array( 'default' => 'center', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => array( 'AceSanitizeMethods', 'sanitizeBackgroundPositionRow' ), 'sanitize_js_callback' => array( 'AceSanitizeMethods', 'sanitizeBackgroundPositionRow' ), )); $wp_customize->add_control( $setting_id_prefix . 'background_image_position_row', array( 'section' => $section_id, 'settings' => $setting_id_prefix . 'background_image_position_row', 'label' => esc_html__( 'Background Position Row ( Area Wrapper )', Ace::TEXTDOMAIN ), 'type' => 'select', 'choices' => $this->backgroundPositionRow, )); // Background Image Position Column $wp_customize->add_setting( $setting_id_prefix . 'background_image_position_column', array( 'default' => 'center', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => array( 'AceSanitizeMethods', 'sanitizeBackgroundPositionColumn' ), 'sanitize_js_callback' => array( 'AceSanitizeMethods', 'sanitizeBackgroundPositionColumn' ), )); $wp_customize->add_control( $setting_id_prefix . 'background_image_position_column', array( 'section' => $section_id, 'settings' => $setting_id_prefix . 'background_image_position_column', 'label' => esc_html__( 'Background Position Column ( Area Wrapper )', Ace::TEXTDOMAIN ), 'type' => 'select', 'choices' => $this->backgroundPositionColumn, )); // Background Image Repeat $wp_customize->add_setting( $setting_id_prefix . 'background_image_repeat', array( 'default' => 'no-repeat', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => array( 'AceSanitizeMethods', 'sanitizeBackgroundRepeat' ), 'sanitize_js_callback' => array( 'AceSanitizeMethods', 'sanitizeBackgroundRepeat' ), )); $wp_customize->add_control( $setting_id_prefix . 'background_image_repeat', array( 'section' => $section_id, 'settings' => $setting_id_prefix . 'background_image_repeat', 'label' => esc_html__( 'Background Repeat ( Area Wrapper )', Ace::TEXTDOMAIN ), 'type' => 'select', 'choices' => $this->backgroundRepeats, )); // Background Image Attacment $wp_customize->add_setting( $setting_id_prefix . 'background_image_attachment', array( 'default' => 'scroll', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => array( 'AceSanitizeMethods', 'sanitizeBackgroundAttachment' ), 'sanitize_js_callback' => array( 'AceSanitizeMethods', 'sanitizeBackgroundAttachment' ), )); $wp_customize->add_control( $setting_id_prefix . 'background_image_attachment', array( 'section' => $section_id, 'settings' => $setting_id_prefix . 'background_image_attachment', 'label' => esc_html__( 'Background Attachment ( Area Wrapper )', Ace::TEXTDOMAIN ), 'type' => 'select', 'choices' => $this->backgroundAttachments, )); } unset( $optional_widget_areas_args );