{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .caldera-grid textarea.form-control' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'input_spacing',
[
'label' => esc_html__( 'Vertical Gutter', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 50,
],
],
'default' => [
'unit' => 'px',
'size' => 10,
],
'selectors' => [
'{{WRAPPER}} .wpcf7-form-control' => 'margin-bottom: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .nf-field-container' => 'margin-bottom: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpforms-field' => 'margin-bottom: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpforms-field-address .wpforms-field-row' => 'margin-bottom: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .caldera-grid .form-group' => 'margin-bottom: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .caldera-grid .wpr-caldera-html' => 'margin-bottom: {{SIZE}}{{UNIT}};',
],
'separator' => 'before'
]
);
$this->end_controls_section(); // End Controls Section
// Styles ====================
// Section: Submit Button ----
$this->start_controls_section(
'section_style_submit_btn',
[
'label' => esc_html__( 'Submit Button', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->add_control(
'submit_btn_align',
[
'label' => esc_html__( 'Alignment', 'wpr-addons' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => esc_html__( 'Left', 'wpr-addons' ),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => esc_html__( 'Center', 'wpr-addons' ),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => esc_html__( 'Right', 'wpr-addons' ),
'icon' => 'eicon-text-align-right',
],
'justify' => [
'title' => esc_html__( 'Justified', 'wpr-addons' ),
'icon' => 'eicon-text-align-justify',
],
],
'prefix_class' => 'wpr-forms-submit-',
'default' => 'left',
]
);
$this->add_control(
'submit_btn_align_divider',
[
'type' => Controls_Manager::DIVIDER,
'style' => 'thick',
]
);
$this->start_controls_tabs( 'tabs_submit_btn_style' );
$this->start_controls_tab(
'tab_submit_btn_normal',
[
'label' => esc_html__( 'Normal', 'wpr-addons' ),
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'submit_btn_bg_color',
'label' => esc_html__( 'Background', 'wpr-addons' ),
'types' => [ 'classic', 'gradient' ],
'fields_options' => [
'color' => [
'default' => '#605BE5',
],
],
'selector' => '{{WRAPPER}} .wpcf7-submit, {{WRAPPER}} .submit-wrap .ninja-forms-field, {{WRAPPER}} .submit-wrap .ninja-forms-field, {{WRAPPER}} .wpforms-submit, {{WRAPPER}} .wpforms-page-next, {{WRAPPER}} .wpforms-page-previous, {{WRAPPER}} .caldera-grid .btn-default, {{WRAPPER}} .caldera-grid .cf2-dropzone button'
]
);
$this->add_control(
'submit_btn_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#ffffff',
'selectors' => [
'{{WRAPPER}} .wpcf7-submit' => 'color: {{VALUE}}',
'{{WRAPPER}} .submit-wrap .ninja-forms-field' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpforms-submit' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpforms-page-next' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpforms-page-previous' => 'color: {{VALUE}}',
'{{WRAPPER}} .caldera-grid .btn-default' => 'color: {{VALUE}}',
'{{WRAPPER}} .caldera-grid .cf2-dropzone button' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'submit_btn_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpcf7-submit' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .submit-wrap .ninja-forms-field' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .submit-wrap .ninja-forms-field' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpforms-submit' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpforms-page-next' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpforms-page-previous' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .caldera-grid .cf2-dropzone button' => 'border-color: {{VALUE}}',
],
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'submit_btn_box_shadow',
'selector' => '{{WRAPPER}} .wpcf7-submit, {{WRAPPER}} .submit-wrap .ninja-forms-field, {{WRAPPER}} .wpforms-submit, {{WRAPPER}} .wpforms-page-next, {{WRAPPER}} .wpforms-page-previous, {{WRAPPER}} .caldera-grid .btn-default:not(a), {{WRAPPER}} .caldera-grid .cf2-dropzone button',
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_submit_btn_hover',
[
'label' => esc_html__( 'Hover', 'wpr-addons' ),
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'read_more_bg_color_hr',
'label' => esc_html__( 'Background', 'wpr-addons' ),
'types' => [ 'classic', 'gradient' ],
'fields_options' => [
'color' => [
'default' => '#4A45D2',
],
],
'selector' => '{{WRAPPER}} .wpcf7-submit:hover, {{WRAPPER}} .submit-wrap .ninja-forms-field:hover, {{WRAPPER}} .wpforms-submit:hover, {{WRAPPER}} .wpforms-page-next:hover, {{WRAPPER}} .wpforms-page-previous:hover, {{WRAPPER}} .caldera-grid .btn-default:hover, {{WRAPPER}} .caldera-grid .btn-success, {{WRAPPER}} .caldera-grid .cf2-dropzone button:hover'
]
);
$this->add_control(
'submit_btn_color_hr',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#FFFFFF',
'selectors' => [
'{{WRAPPER}} .wpcf7-submit:hover' => 'color: {{VALUE}}',
'{{WRAPPER}} .submit-wrap .ninja-forms-field:hover' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpforms-submit:hover' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpforms-page-next:hover' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpforms-page-previous:hover' => 'color: {{VALUE}}',
'{{WRAPPER}} .caldera-grid .btn-default:hover' => 'color: {{VALUE}}',
'{{WRAPPER}} .caldera-grid .btn-success' => 'color: {{VALUE}}',
'{{WRAPPER}} .caldera-grid .cf2-dropzone button:hover' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'submit_btn_border_color_hr',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpcf7-submit:hover' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .submit-wrap .ninja-forms-field:hover' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpforms-submit:hover' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpforms-page-next:hover' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpforms-page-previous:hover' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .caldera-grid .btn-default:hover' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .caldera-grid .btn-success' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .caldera-grid .cf2-dropzone button:hover' => 'border-color: {{VALUE}}'
]
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'submit_btn_box_shadow_hr',
'selector' => '{{WRAPPER}} .wpcf7-submit:hover, {{WRAPPER}} .submit-wrap .ninja-forms-field:hover, {{WRAPPER}} .wpforms-submit:hover, {{WRAPPER}} .wpforms-page-next:hover, {{WRAPPER}} .wpforms-page-previous:hover, {{WRAPPER}} .caldera-grid .btn-default:not(a):hover, {{WRAPPER}} .caldera-grid .cf2-dropzone button:hover',
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_control(
'submit_btn_divider',
[
'type' => Controls_Manager::DIVIDER,
'style' => 'thick',
]
);
$this->add_control(
'submit_btn_transition_duration',
[
'label' => esc_html__( 'Transition Duration', 'wpr-addons' ),
'type' => Controls_Manager::NUMBER,
'default' => 0.1,
'min' => 0,
'max' => 5,
'step' => 0.1,
'selectors' => [
'{{WRAPPER}} .wpcf7-submit' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .submit-wrap .ninja-forms-field' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .wpforms-submit' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .wpforms-page-next' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .wpforms-page-previous' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .caldera-grid .btn-default' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .caldera-grid .cf2-dropzone button' => 'transition-duration: {{VALUE}}s',
],
'separator' => 'after',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'submit_btn_typography',
'selector' => '{{WRAPPER}} .wpcf7-submit, {{WRAPPER}} .submit-wrap .ninja-forms-field, {{WRAPPER}} .wpforms-submit, {{WRAPPER}} .wpforms-page-next, {{WRAPPER}} .wpforms-page-previous, {{WRAPPER}} .caldera-grid .btn-default, {{WRAPPER}} .caldera-grid .btn-success, {{WRAPPER}} .caldera-grid .cf2-dropzone button'
]
);
$this->add_control(
'submit_btn_border_type',
[
'label' => esc_html__( 'Border Type', 'wpr-addons' ),
'type' => Controls_Manager::SELECT,
'options' => [
'none' => esc_html__( 'None', 'wpr-addons' ),
'solid' => esc_html__( 'Solid', 'wpr-addons' ),
'double' => esc_html__( 'Double', 'wpr-addons' ),
'dotted' => esc_html__( 'Dotted', 'wpr-addons' ),
'dashed' => esc_html__( 'Dashed', 'wpr-addons' ),
'groove' => esc_html__( 'Groove', 'wpr-addons' ),
],
'default' => 'none',
'selectors' => [
'{{WRAPPER}} .wpr-forms-container .wpcf7-submit' => 'border-style: {{VALUE}};',
'{{WRAPPER}} .wpr-forms-container .submit-wrap .ninja-forms-field' => 'border-style: {{VALUE}};',
'{{WRAPPER}} .wpr-forms-container .wpforms-submit' => 'border-style: {{VALUE}};',
'{{WRAPPER}} .wpr-forms-container .wpforms-page-next' => 'border-style: {{VALUE}};',
'{{WRAPPER}} .wpr-forms-container .wpforms-page-previous' => 'border-style: {{VALUE}};',
'{{WRAPPER}} .caldera-grid .btn-default' => 'border-style: {{VALUE}}',
'{{WRAPPER}} .caldera-grid .btn-success' => 'border-style: {{VALUE}}',
'{{WRAPPER}} .caldera-grid .cf2-dropzone button' => 'border-style: {{VALUE}}',
],
'separator' => 'before',
]
);
$this->add_control(
'submit_btn_border_width',
[
'label' => esc_html__( 'Border Width', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px' ],
'default' => [
'top' => 1,
'right' => 1,
'bottom' => 1,
'left' => 1,
],
'selectors' => [
'{{WRAPPER}} .wpr-forms-container .wpcf7-submit' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .wpr-forms-container .submit-wrap .ninja-forms-field' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .wpr-forms-container .wpforms-submit' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .wpr-forms-container .wpforms-page-next' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .wpr-forms-container .wpforms-page-previous' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .caldera-grid .btn-default' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .caldera-grid .btn-success' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .caldera-grid .cf2-dropzone button' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'condition' => [
'submit_btn_border_type!' => 'none',
],
]
);
$this->add_responsive_control(
'submit_btn_padding',
[
'label' => esc_html__( 'Padding', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px' ],
'default' => [
'top' => 12,
'right' => 30,
'bottom' => 12,
'left' => 30,
],
'selectors' => [
'{{WRAPPER}} .wpcf7-submit' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .submit-wrap .ninja-forms-field' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .wpforms-submit' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .wpforms-page-next' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .wpforms-page-previous' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .caldera-grid .btn-default' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .caldera-grid .btn-success' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .caldera-grid .cf2-dropzone button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->add_control(
'submit_btn_radius',
[
'label' => esc_html__( 'Border Radius', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 2,
'right' => 2,
'bottom' => 2,
'left' => 2,
],
'selectors' => [
'{{WRAPPER}} .wpcf7-submit' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .nf-field-container .submit-wrap .ninja-forms-field' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .wpforms-submit' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .wpforms-page-next' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .wpforms-page-previous' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .caldera-grid .btn-default:not(a)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .caldera-grid .cf2-dropzone button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'submit_btn_spacing',
[
'label' => esc_html__( 'Top Distance', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 50,
],
],
'default' => [
'unit' => 'px',
'size' => 3,
],
'selectors' => [
'{{WRAPPER}} .wpr-forms-container .wpcf7-submit' => 'margin-top: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-forms-container .nf-field-container .submit-wrap' => 'margin-top: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-forms-container .wpforms-submit' => 'margin-top: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-forms-container .wpforms-page-next' => 'margin-top: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-forms-container .wpforms-page-previous' => 'margin-top: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpcf7-form .caldera-grid .btn-default:not(a)' => 'margin-top: {{SIZE}}{{UNIT}};',
],
'separator' => 'before'
]
);
$this->end_controls_section();
// Styles ====================
// Section: Checkboxes -------
$this->start_controls_section(
'section_style_checkbox_radio',
[
'label' => esc_html__( 'Checkbox & Radio', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
'condition' => [
'plugin_select!' => 'caldera'
]
]
);
$this->add_control(
'checkbox_radio_custom',
[
'label' => esc_html__( 'Use Custom Styles', 'wpr-addons' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'yes',
]
);
$this->add_control(
'checkbox_radio_static_color',
[
'label' => esc_html__( 'Static Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#FFFFFF',
'selectors' => [
'{{WRAPPER}} .wpr-custom-chk-radio .wpcf7-checkbox .wpcf7-list-item-label:before' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpcf7-radio .wpcf7-list-item-label:before' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpcf7-acceptance .wpcf7-list-item-label:before' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .listradio-wrap .nf-field-element label:after' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .listradio-wrap .nf-field-element label.nf-checked-label:after' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .checkbox-wrap .nf-field-label label:after' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .checkbox-container .nf-field-element label:after' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .listcheckbox-container .nf-field-element label:after' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-field-checkbox input + label:before' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-field-gdpr-checkbox input + label:before' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-field-radio input + label:before' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-field-radio input + span:before' => 'background-color: {{VALUE}}',
],
'condition' => [
'checkbox_radio_custom' => 'yes'
]
]
);
$this->add_control(
'checkbox_radio_active_color',
[
'label' => esc_html__( 'Active Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#605BE5',
'selectors' => [
'{{WRAPPER}} .wpr-custom-chk-radio .wpcf7-checkbox input:checked + .wpcf7-list-item-label:before' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpcf7-radio input:checked + .wpcf7-list-item-label:before' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpcf7-acceptance input:checked + .wpcf7-list-item-label:before' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .checkbox-wrap .nf-field-label label.nf-checked-label:before' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .listcheckbox-wrap .nf-field-element label.nf-checked-label:before' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .listradio-wrap .nf-field-element label.nf-checked-label:before' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-field-checkbox input:checked + label:before' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-field-gdpr-checkbox input:checked + label:before' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-field-radio input:checked + label:before' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-image-choices input:checked + span:before' => 'color: {{VALUE}}',
],
'condition' => [
'checkbox_radio_custom' => 'yes'
]
]
);
$this->add_control(
'checkbox_radio_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-custom-chk-radio .wpcf7-checkbox .wpcf7-list-item-label:before' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpcf7-radio .wpcf7-list-item-label:before' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpcf7-acceptance .wpcf7-list-item-label:before' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .listradio-wrap .nf-field-element label:after' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .listradio-wrap .nf-field-element label.nf-checked-label:after' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .checkbox-wrap .nf-field-label label:after' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .checkbox-container .nf-field-element label:after' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .listcheckbox-container .nf-field-element label:after' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-field-checkbox label:before' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-field-gdpr-checkbox label:before' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-field-radio label:before' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-field-radio input + span:before' => 'border-color: {{VALUE}}',
],
'condition' => [
'checkbox_radio_custom' => 'yes'
]
]
);
$this->add_control(
'checkbox_radio_size',
[
'label' => esc_html__( 'Size', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 10,
'max' => 50,
],
],
'default' => [
'unit' => 'px',
'size' => 16,
],
'selectors' => [
'{{WRAPPER}} .wpr-custom-chk-radio .wpcf7-checkbox .wpcf7-list-item-label:before' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}}; font-size: calc({{SIZE}}{{UNIT}} / 1.3);',
'{{WRAPPER}} .wpr-custom-chk-radio .wpcf7-radio .wpcf7-list-item-label:before' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}}; font-size: calc({{SIZE}}{{UNIT}} / 1.3);',
'{{WRAPPER}} .wpr-custom-chk-radio .wpcf7-acceptance .wpcf7-list-item-label:before' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}}; font-size: calc({{SIZE}}{{UNIT}} / 1.3);',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-field-checkbox label:before' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}}; font-size: calc({{SIZE}}{{UNIT}} / 1.3);',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-field-gdpr-checkbox label:before' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}}; font-size: calc({{SIZE}}{{UNIT}} / 1.3);',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-field-radio label:before' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}}; font-size: calc({{SIZE}}{{UNIT}} / 1.3);',
'{{WRAPPER}} .wpr-custom-chk-radio .wpforms-field-radio input + span:before' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}}; font-size: calc({{SIZE}}{{UNIT}} / 1.3);',
],
'separator' => 'before',
'condition' => [
'plugin_select!' => 'ninja',
'checkbox_radio_custom' => 'yes',
]
]
);
$this->end_controls_section(); // End Controls Section
// Styles ====================
// Section: Custom HTML ------
$this->start_controls_section(
'section_style_html',
[
'label' => esc_html__( 'Custom HTML', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->add_control(
'html_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#333333',
'selectors' => [
'{{WRAPPER}} .wpforms-field-html' => 'color: {{VALUE}}',
'{{WRAPPER}} .nf-field-container .html-wrap' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-caldera-html' => 'color: {{VALUE}}',
],
'condition' => [
'plugin_select!' => 'cf-7'
]
]
);
$this->add_control(
'html_link_color',
[
'label' => esc_html__( 'Link Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#333333',
'selectors' => [
'{{WRAPPER}} .wpforms-field-html a' => 'color: {{VALUE}}',
'{{WRAPPER}} .nf-field-container .html-wrap a' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-caldera-html a' => 'color: {{VALUE}}',
]
]
);
$this->add_control(
'html_divider_color',
[
'label' => esc_html__( 'Divider Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#999999',
'selectors' => [
'{{WRAPPER}} .nf-field-container .hr-wrap hr' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-caldera-html hr' => 'border-color: {{VALUE}}',
]
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'html_typography',
'selector' => '{{WRAPPER}} .wpforms-field-html, {{WRAPPER}} .nf-field-container .html-wrap, {{WRAPPER}} .wpr-caldera-html',
]
);
$this->end_controls_section(); // End Controls Section
// Styles ====================
// Section: Notices ----------
$this->start_controls_section(
'section_style_notices',
[
'label' => esc_html__( 'Notices', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
'condition' => [
// 'plugin_select' => 'caldera'
]
]
);
$this->add_control(
'notice_error_text_color',
[
'label' => esc_html__( 'Error Text Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#FF348B',
'selectors' => [
'{{WRAPPER}} .wpr-forms-container .wpcf7-not-valid-tip' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .wpcf7-response-output' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container label.wpforms-error' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container label.wpforms-error a' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container label .wpforms-required-label' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .nf-error-msg' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .ninja-forms-req-symbol' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .caldera_ajax_error_block' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .caldera-grid .control-label .field_required' => 'color: {{VALUE}} !important',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'notice_error_text_typography',
'selector' => '{{WRAPPER}} .wpr-forms-container .wpcf7-not-valid-tip, {{WRAPPER}} .wpr-forms-container .wpcf7-response-output, {{WRAPPER}} .wpr-forms-container label.wpforms-error, {{WRAPPER}} .wpr-forms-container .caldera_ajax_error_block, {{WRAPPER}} .wpr-forms-container .nf-error-msg'
]
);
$this->add_control(
'notice_error_field_color',
[
'label' => esc_html__( 'Error Field Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#FF348B',
'selectors' => [
'{{WRAPPER}} .wpr-forms-container input.wpcf7-not-valid' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container textarea.wpcf7-not-valid' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container input.wpforms-error' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container textarea.wpforms-error' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .nf-error.field-wrap .nf-field-element:after' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .caldera-grid .parsley-error' => 'color: {{VALUE}}',
],
'separator' => 'before'
]
);
$this->add_control(
'notice_error_field_bg_color',
[
'label' => esc_html__( 'Error Field Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#FDD3D3',
'selectors' => [
'{{WRAPPER}} .wpr-forms-container input.wpcf7-not-valid' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container textarea.wpcf7-not-valid' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container input.wpforms-error' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container textarea.wpforms-error' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .nf-error.field-wrap .nf-field-element:after' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .caldera-grid .parsley-error:not(.checkbox-inline)' => 'background-color: {{VALUE}}',
],
]
);
$this->add_control(
'notice_error_field_bd_color',
[
'label' => esc_html__( 'Error Field Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-forms-container input.wpcf7-not-valid' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container textarea.wpcf7-not-valid' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container input.wpforms-error' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container textarea.wpforms-error' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .nf-error.field-wrap .ninja-forms-field' => 'border-color: {{VALUE}} !important',
'{{WRAPPER}} .wpr-forms-container .caldera-grid .parsley-error' => 'border-color: {{VALUE}}',
],
]
);
$this->add_control(
'notice_success_text_color',
[
'label' => esc_html__( 'Success Text Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#38DDD2',
'selectors' => [
'{{WRAPPER}} .wpr-forms-container .wpcf7-mail-sent-ok' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .wpforms-confirmation-container-full' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .nf-response-msg' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .caldera-grid .alert-success' => 'color: {{VALUE}}',
],
'separator' => 'before'
]
);
$this->add_control(
'notice_success_bg_color',
[
'label' => esc_html__( 'Success Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#FFFFFF',
'selectors' => [
'{{WRAPPER}} .wpr-forms-container .wpcf7-mail-sent-ok' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .wpforms-confirmation-container-full' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .nf-response-msg' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .caldera-grid .alert-success' => 'background-color: {{VALUE}}',
],
]
);
$this->add_control(
'notice_success_bd_color',
[
'label' => esc_html__( 'Success Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-forms-container .wpcf7-mail-sent-ok' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .wpforms-confirmation-container-full' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .nf-response-msg' => 'border-color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .nf-pass .ninja-forms-field' => 'border-color: {{VALUE}} !important',
'{{WRAPPER}} .wpr-forms-container .nf-pass.field-wrap .nf-field-element:after' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-forms-container .caldera-grid .alert-success' => 'border-color: {{VALUE}}',
],
]
);
$this->end_controls_section(); // End Controls Section
}
public function render_cf7_template( $settings ) {
echo do_shortcode( '[contact-form-7 id="'. esc_attr($settings['cf7_templates']) .'"]' );
}
public function render_wpforms_template( $settings ) {
echo wpforms_display( $settings['wpforms_templates'], $settings['show_form_title'], $settings['show_form_description'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
public function render_ninja_forms_template( $settings ) {
echo do_shortcode( '[ninja_form id="'. esc_attr($settings['ninja_forms_templates']) .'"]' );
}
public function render_caldera_forms_template( $settings ) {
echo do_shortcode( '[caldera_form id="'. esc_attr($settings['caldera_forms_templates']) .'"]' );
}
protected function render() {
// Get Settings
$settings = $this->get_settings();
// Custom Checkbox and Radio Buttons
$class = 'yes' === $settings['checkbox_radio_custom'] ? ' wpr-custom-chk-radio' : '';
// Form Container
echo '
';
switch ( $settings['plugin_select'] ) {
case 'cf-7':
$this->render_cf7_template( $settings );
break;
case 'wpforms':
$this->render_wpforms_template( $settings );
break;
case 'ninja':
$this->render_ninja_forms_template( $settings );
break;
case 'caldera':
$this->render_caldera_forms_template( $settings );
break;
default:
echo 'No Forms Selected';
break;
}
echo '
';
}
}