array( 'title' => array( 'text' => __( 'Layout', 'brandy' ), 'type' => 'bold', 'show_devices' => true, ), 'type' => 'ButtonGroup', 'options' => array( array( 'label' => __( 'Horizontal', 'brandy' ), 'value' => 'horizontal', ), array( 'label' => __( 'Vertical', 'brandy' ), 'value' => 'vertical', ), ), 'default_value' => array( 'desktop' => 'vertical', 'tablet' => null, 'mobile' => null, ), 'value_path' => array( 'layout' ), 'render_options' => array( 'type' => 'data_attribute', 'data' => array( array( 'selector' => '.brandy-divider', 'name' => 'data-desktop-layout', 'value_path' => array( 'layout', 'desktop' ), ), array( 'selector' => '.brandy-divider', 'name' => 'data-tablet-layout', 'value_path' => array( 'layout', 'tablet' ), ), array( 'selector' => '.brandy-divider', 'name' => 'data-mobile-layout', 'value_path' => array( 'layout', 'mobile' ), ), ), ), ), 'vertical_height' => array( 'title' => array( 'text' => __( 'Height (px)', 'brandy' ), 'type' => 'bold', 'show_devices' => true, ), 'type' => 'Dimension', 'units' => array( 'px', '%' ), 'default_value' => array( 'desktop' => array( 'unit' => 'px', 'value' => 70, 'min' => 1, 'max' => 1000, ), 'tablet' => null, 'mobile' => null, ), 'value_path' => array( 'vertical_height' ), 'render_options' => array( 'type' => 'variable', 'data' => array( array( 'type' => 'dimension', 'name' => '--b-vertical-height', 'value_path' => array( 'vertical_height' ), ), ), ), 'visible_conditions' => array( array( 'value_path' => array( 'layout' ), 'value' => 'vertical', 'match_device' => true, ), ), ), 'vertical_width' => array( 'title' => array( 'text' => __( 'Width', 'brandy' ), 'type' => 'bold', 'show_devices' => true, ), 'type' => 'Dimension', 'units' => array( 'px' ), 'default_value' => array( 'desktop' => array( 'unit' => 'px', 'value' => 1, 'min' => 1, 'max' => 10, ), 'tablet' => null, 'mobile' => null, ), 'value_path' => array( 'vertical_width' ), 'render_options' => array( 'type' => 'variable', 'data' => array( array( 'type' => 'dimension', 'name' => '--b-vertical-width', 'value_path' => array( 'vertical_width' ), ), ), ), 'visible_conditions' => array( array( 'value_path' => array( 'layout' ), 'value' => 'vertical', 'match_device' => true, ), ), ), 'horizontal_height' => array( 'title' => array( 'text' => __( 'Height (px)', 'brandy' ), 'type' => 'bold', 'show_devices' => true, ), 'type' => 'Dimension', 'units' => array( 'px' ), 'default_value' => array( 'desktop' => array( 'unit' => 'px', 'value' => 1, 'min' => 1, 'max' => 10, ), 'tablet' => null, 'mobile' => null, ), 'value_path' => array( 'horizontal_height' ), 'render_options' => array( 'type' => 'variable', 'data' => array( array( 'type' => 'dimension', 'selector' => '.brandy-divider', 'name' => '--b-horizontal-height', 'value_path' => array( 'horizontal_height' ), ), ), ), 'visible_conditions' => array( array( 'value_path' => array( 'layout' ), 'value' => 'horizontal', 'match_device' => true, ), ), ), 'horizontal_width' => array( 'title' => array( 'text' => __( 'Width', 'brandy' ), 'type' => 'bold', 'show_devices' => true, ), 'type' => 'Dimension', 'units' => array( 'px', '%' ), 'default_value' => array( 'desktop' => array( 'unit' => 'px', 'value' => 100, 'min' => 1, 'max' => 1000, ), 'tablet' => null, 'mobile' => null, ), 'value_path' => array( 'horizontal_width' ), 'render_options' => array( 'type' => 'variable', 'data' => array( array( 'type' => 'dimension', 'name' => '--b-horizontal-width', 'value_path' => array( 'horizontal_width' ), ), ), ), 'visible_conditions' => array( array( 'value_path' => array( 'layout' ), 'value' => 'horizontal', 'match_device' => true, ), ), ), 'color' => array( 'title' => array( 'text' => __( 'Color', 'brandy' ), 'type' => 'bold', ), 'type' => 'ColorGroup', 'default_value' => array( 'normal' => 'var(--wp--preset--color--brandy-border)', ), 'value_path' => array( 'color' ), 'render_options' => array( 'type' => 'variable', 'data' => array( array( 'type' => 'color', 'name' => '--b-color', 'selector' => '.brandy-divider', 'value_path' => array( 'color' ), ), ), ), ), 'padding' => array( 'value_path' => array( 'padding' ), 'title' => array( 'text' => 'Padding', 'type' => 'bold', ), 'units' => array( 'px', '%' ), 'default_value' => array( 'unit' => 'px', 'top' => 10, 'right' => 10, 'bottom' => 10, 'left' => 10, 'is_constraints' => false, ), 'type' => array( 'Spacing' ), 'render_options' => array( 'type' => 'variable', 'data' => array( array( 'type' => 'spacing', 'name' => 'padding', 'selector' => '.brandy-divider', 'value_path' => array( 'padding' ), ), ), ), ), 'margin' => array( 'value_path' => array( 'margin' ), 'title' => array( 'text' => 'Margin', 'type' => 'bold', 'show_devices' => true, ), 'units' => array( 'px', '%' ), 'default_value' => array( 'desktop' => array( 'unit' => 'px', 'top' => 0, 'right' => 0, 'bottom' => 0, 'left' => 0, 'is_constraints' => false, ), 'tablet' => null, 'mobile' => null, ), 'type' => 'Spacing', 'render_options' => array( 'type' => 'variable', 'data' => array( array( 'type' => 'spacing', 'name' => 'margin', 'selector' => '.brandy-divider', 'value_path' => array( 'margin' ), ), ), ), ), ); } public function register_element( $elements = array() ) { $elements[ $this->element_id ] = array( 'id' => $this->element_id, 'title' => $this->title, 'settings' => $this->get_settings(), 'builders' => $this->builders, 'icon' => ' ', ); return $elements; } public function add_layout( $layouts = array() ) { $layout = array( 'general' => array( 'sections' => array( array( 'components' => array( 'layout' ), ), array( 'components' => array( 'vertical_height', 'horizontal_height' ), ), array( 'components' => array( 'vertical_width', 'horizontal_width' ), ), ), ), 'designs' => array( 'sections' => array( array( 'components' => array( 'color' ), ), array( 'components' => array( 'padding' ), ), array( 'components' => array( 'margin' ), ), ), ), ); $mapped_layout = $this->map_layout( $layout ); $layouts[ $this->element_id ] = $mapped_layout; return $layouts; } }