Loading...
on a:hover' => 'background-color: {{VALUE}}', '{{WRAPPER}} .wpr-comments-navigation span.current' => 'background-color: {{VALUE}}', ] ] ); $this->add_control( 'navigation_border_color_hr', [ 'label' => esc_html__( 'Border Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .wpr-comments-navigation a:hover' => 'border-color: {{VALUE}}', '{{WRAPPER}} .wpr-comments-navigation span.current' => 'border-color: {{VALUE}}', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'navigation_padding', [ 'label' => esc_html__( 'Padding', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'default' => [ 'top' => 0, 'right' => 0, 'bottom' => 0, 'left' => 0, ], 'selectors' => [ '{{WRAPPER}} .wpr-comments-navigation a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-comments-navigation span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before' ] ); $this->add_control( 'navigation_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-comments-navigation a' => 'border-style: {{VALUE}};', '{{WRAPPER}} .wpr-comments-navigation span' => 'border-style: {{VALUE}};', ], 'separator' => 'before', ] ); $this->add_control( 'navigation_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-comments-navigation a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-comments-navigation span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'navigation_border_type!' => 'none', ], ] ); $this->add_control( 'navigation_radius', [ 'label' => esc_html__( 'Border Radius', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'default' => [ 'top' => 0, 'right' => 0, 'bottom' => 0, 'left' => 0, ], 'selectors' => [ '{{WRAPPER}} .wpr-comments-navigation a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-comments-navigation span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); // Styles ==================== // Section: Comment Form Title $this->start_controls_section( 'section_style_cf_title', [ 'label' => esc_html__( 'Comment Form Title', 'wpr-addons' ), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, ] ); $this->add_control( 'cf_title_color', [ 'label' => esc_html__( 'Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#222222', 'selectors' => [ '{{WRAPPER}} .wpr-comment-reply-title' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'cf_title_bd_color', [ 'label' => esc_html__( 'Border Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#e8e8e8', 'selectors' => [ '{{WRAPPER}} .wpr-comment-reply-title' => 'border-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'cf_title_typography', 'selector' => '{{WRAPPER}} .wpr-comment-reply-title', 'fields_options' => [ 'typography' => [ 'default' => 'custom', ], 'font_family' => [ 'default' => 'Raleway', ], 'font_weight' => [ 'default' => '500', ], 'letter_spacing' => [ 'default' => [ 'size' => '0.5' ] ], 'font_size' => [ 'default' => [ 'size' => '17', 'unit' => 'px', ], ] ] ] ); $this->add_control( 'cf_title_bd_type', [ 'label' => esc_html__( 'Border Style', '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-comment-reply-title' => 'border-style: {{VALUE}};', ], 'separator' => 'before' ] ); $this->add_control( 'cf_title_bd_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-comment-reply-title' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'cf_title_bd_type!' => 'none', ], ] ); $this->add_responsive_control( 'cf_title_top_space', [ 'label' => esc_html__( 'Top Space', 'wpr-addons' ), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 85, ], 'selectors' => [ '{{WRAPPER}} .wpr-comment-reply-title' => 'margin-top: {{SIZE}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->add_responsive_control( 'cf_title_bottom_space', [ 'label' => esc_html__( 'Bottom Space', 'wpr-addons' ), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 20, ], 'selectors' => [ '{{WRAPPER}} .wpr-comment-reply-title' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'cf_title_align', [ 'label' => esc_html__( 'Align', 'wpr-addons' ), 'type' => Controls_Manager::CHOOSE, 'label_block' => false, 'default' => 'left', 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'wpr-addons' ), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'wpr-addons' ), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'wpr-addons' ), 'icon' => 'eicon-h-align-right', ] ], 'selectors' => [ '{{WRAPPER}} .wpr-comment-reply-title' => 'text-align: {{VALUE}}', ], 'separator' => 'before' ] ); $this->end_controls_section(); // Styles ==================== // Section: Comment Form ----- $this->start_controls_section( 'section_style_comment_form', [ 'label' => esc_html__( 'Comment Form', 'wpr-addons' ), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, ] ); $this->start_controls_tabs( 'tabs_comment_form_style' ); $this->start_controls_tab( 'tab_comment_form_normal', [ 'label' => __( 'Normal', 'wpr-addons' ), ] ); $this->add_control( 'comment_form_color', [ 'label' => esc_html__( 'Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#666666', 'selectors' => [ '{{WRAPPER}} .wpr-comment-form input[type=text]' => 'color: {{VALUE}};', '{{WRAPPER}} .wpr-comment-form textarea' => 'color: {{VALUE}};', '{{WRAPPER}} .wpr-comment-form label' => 'color: {{VALUE}}', '{{WRAPPER}} .wpr-comment-form .logged-in-as a' => 'color: {{VALUE}};', '{{WRAPPER}} .wpr-comment-form .logged-in-as .required-field-message' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'comment_form_placeholder_color', [ 'label' => esc_html__( 'Placeholder Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#B8B8B8', 'selectors' => [ '{{WRAPPER}} .wpr-comment-form input[type=text]::placeholder' => 'color: {{VALUE}}; opacity: 1;', '{{WRAPPER}} .wpr-comment-form textarea::placeholder' => 'color: {{VALUE}}; opacity: 1;', '{{WRAPPER}} .wpr-comment-form input[type=text]::-ms-input-placeholder' => 'color: {{VALUE}};', '{{WRAPPER}} .wpr-comment-form textarea::-ms-input-placeholder' => 'color: {{VALUE}};', ], 'condition' => [ 'comment_form_placeholders' => 'yes' ] ] ); $this->add_control( 'comment_form_bg_color', [ 'label' => esc_html__( 'Background Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .wpr-comment-form input[type=text]' => 'background-color: {{VALUE}}', '{{WRAPPER}} .wpr-comment-form textarea' => 'background-color: {{VALUE}}', ] ] ); $this->add_control( 'comment_form_border_color', [ 'label' => esc_html__( 'Border Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#DBDBDB', 'selectors' => [ '{{WRAPPER}} .wpr-comment-form input[type=text]' => 'border-color: {{VALUE}}', '{{WRAPPER}} .wpr-comment-form textarea' => 'border-color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'comment_form_typography', 'selector' => '{{WRAPPER}} .wpr-comment-form label, {{WRAPPER}} .wpr-comment-form input[type=text], {{WRAPPER}} .wpr-comment-form textarea, {{WRAPPER}} .wpr-comment-form .logged-in-as', 'fields_options' => [ 'typography' => [ 'default' => 'custom', ], 'font_size' => [ 'default' => [ 'size' => '14', 'unit' => 'px', ], ] ] ] ); $this->add_control( 'comment_form_transition_duration', [ 'label' => esc_html__( 'Transition Duration', 'wpr-addons' ), 'type' => Controls_Manager::NUMBER, 'default' => 0.6, 'min' => 0, 'max' => 5, 'step' => 0.1, 'selectors' => [ '{{WRAPPER}} .wpr-comment-form input[type=text]' => 'transition-duration: {{VALUE}}s', '{{WRAPPER}} .wpr-comment-form input[type=text]::placeholder' => 'transition-duration: {{VALUE}}s', '{{WRAPPER}} .wpr-comment-form input[type=text]::-ms-input-placeholder' => 'transition-duration: {{VALUE}}s', '{{WRAPPER}} .wpr-comment-form textarea' => 'transition-duration: {{VALUE}}s', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_comment_form_hover', [ 'label' => __( 'Focus', 'wpr-addons' ), ] ); $this->add_control( 'comment_form_color_hr', [ 'label' => esc_html__( 'Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#666666', 'selectors' => [ '{{WRAPPER}} .wpr-comment-form input[type=text]:focus' => 'color: {{VALUE}};', '{{WRAPPER}} .wpr-comment-form textarea:focus' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'comment_form_placeholder_color_hr', [ 'label' => esc_html__( 'Placeholder Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#B8B8B8', 'selectors' => [ '{{WRAPPER}} .wpr-comment-form input[type=text]:focus::placeholder' => 'color: {{VALUE}}; opacity: 1;', '{{WRAPPER}} .wpr-comment-form textarea:focus::placeholder' => 'color: {{VALUE}}; opacity: 1;', '{{WRAPPER}} .wpr-comment-form input[type=text]:focus::-ms-input-placeholder' => 'color: {{VALUE}};', '{{WRAPPER}} .wpr-comment-form textarea:focus::-ms-input-placeholder' => 'color: {{VALUE}};', ], 'condition' => [ 'comment_form_placeholders' => 'yes' ] ] ); $this->add_control( 'comment_form_bg_color_hr', [ 'label' => esc_html__( 'Background Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .wpr-comment-form input[type=text]:focus' => 'background-color: {{VALUE}};', '{{WRAPPER}} .wpr-comment-form textarea:focus' => 'background-color: {{VALUE}};', ] ] ); $this->add_control( 'comment_form_border_color_hr', [ 'label' => esc_html__( 'Border Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .wpr-comment-form input[type=text]:focus' => 'border-color: {{VALUE}};', '{{WRAPPER}} .wpr-comment-form textarea:focus' => 'border-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'comment_form_padding', [ 'label' => esc_html__( 'Padding', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'default' => [ 'top' => 10, 'right' => 0, 'bottom' => 10, 'left' => 10, ], 'selectors' => [ '{{WRAPPER}} .wpr-comment-form input[type=text]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-comment-form textarea' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before' ] ); $this->add_control( 'comment_form_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' => 'solid', 'selectors' => [ '{{WRAPPER}} .wpr-comment-form input[type=text]' => 'border-style: {{VALUE}}', '{{WRAPPER}} .wpr-comment-form textarea' => 'border-style: {{VALUE}}', ], 'separator' => 'before', ] ); $this->add_control( 'comment_form_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-comment-form input[type=text]' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-comment-form textarea' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'comment_form_border_type!' => 'none', ], ] ); $this->add_control( 'comment_form_radius', [ 'label' => esc_html__( 'Border Radius', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'default' => [ 'top' => 0, 'right' => 0, 'bottom' => 0, 'left' => 0, ], 'selectors' => [ '{{WRAPPER}} .wpr-comment-form input[type=text]' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-comment-form textarea' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'comment_form_gutter', [ 'label' => esc_html__( 'Gutter', 'wpr-addons' ), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 30, ], ], 'default' => [ 'unit' => 'px', 'size' => 10, ], 'selectors' => [ '{{WRAPPER}} .wpr-comment-form-author' => 'margin-bottom: {{SIZE}}{{UNIT}}; margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-comment-form-email' => 'margin-bottom: {{SIZE}}{{UNIT}}; margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-comment-form-url' => 'margin-bottom: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-comment-form-text' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], 'separator' => 'before' ] ); $this->end_controls_section(); // Styles ==================== // Section: Submit Button ---- $this->start_controls_section( 'section_style_submit_button', [ 'label' => esc_html__( 'Submit Button', 'wpr-addons' ), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, ] ); $this->start_controls_tabs( 'tabs_submit_button_style' ); $this->start_controls_tab( 'tab_submit_button_normal', [ 'label' => __( 'Normal', 'wpr-addons' ), ] ); $this->add_control( 'submit_button_color', [ 'label' => esc_html__( 'Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .wpr-submit-comment' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'submit_button_bg_color', [ 'label' => esc_html__( 'Background Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#605BE5', 'selectors' => [ '{{WRAPPER}} .wpr-submit-comment' => 'background-color: {{VALUE}}', ] ] ); $this->add_control( 'submit_button_border_color', [ 'label' => esc_html__( 'Border Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#DBDBDB', 'selectors' => [ '{{WRAPPER}} .wpr-submit-comment' => 'border-color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'submit_button_typography', 'selector' => '{{WRAPPER}} .wpr-submit-comment', 'fields_options' => [ 'typography' => [ 'default' => 'custom', ], 'letter_spacing' => [ 'default' => [ 'size' => '0.5' ] ], 'font_size' => [ 'default' => [ 'size' => '15', 'unit' => 'px', ], ] ] ] ); $this->add_control( 'submit_button_transition_duration', [ 'label' => esc_html__( 'Transition Duration', 'wpr-addons' ), 'type' => Controls_Manager::NUMBER, 'default' => 0.7, 'min' => 0, 'max' => 5, 'step' => 0.1, 'selectors' => [ '{{WRAPPER}} .wpr-submit-comment' => 'transition-duration: {{VALUE}}s', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_submit_button_hover', [ 'label' => __( 'Hover', 'wpr-addons' ), ] ); $this->add_control( 'submit_button_color_hr', [ 'label' => esc_html__( 'Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#FFFFFF', 'selectors' => [ '{{WRAPPER}} .wpr-submit-comment:hover' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'submit_button_bg_color_hr', [ 'label' => esc_html__( 'Background Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#4C48BD', 'selectors' => [ '{{WRAPPER}} .wpr-submit-comment:hover' => 'background-color: {{VALUE}}', ] ] ); $this->add_control( 'submit_button_border_color_hr', [ 'label' => esc_html__( 'Border Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .wpr-submit-comment:hover' => 'border-color: {{VALUE}}', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'submit_button_padding', [ 'label' => esc_html__( 'Padding', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'default' => [ 'top' => 10, 'right' => 45, 'bottom' => 10, 'left' => 45, ], 'selectors' => [ '{{WRAPPER}} .wpr-submit-comment' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before' ] ); $this->add_responsive_control( 'submit_button_margin', [ 'label' => esc_html__( 'Margin', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'default' => [ 'top' => 25, 'right' => 0, 'bottom' => 0, 'left' => 0, ], 'selectors' => [ '{{WRAPPER}} .wpr-submit-comment' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'submit_button_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-submit-comment' => 'border-style: {{VALUE}};', ], 'separator' => 'before', ] ); $this->add_control( 'submit_button_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-submit-comment' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'submit_button_border_type!' => 'none', ], ] ); $this->add_control( 'submit_button_radius', [ 'label' => esc_html__( 'Border Radius', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'default' => [ 'top' => 0, 'right' => 0, 'bottom' => 0, 'left' => 0, ], 'selectors' => [ '{{WRAPPER}} .wpr-submit-comment' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'submit_button_align', [ 'label' => esc_html__( 'Align', 'wpr-addons' ), 'type' => Controls_Manager::CHOOSE, 'label_block' => false, 'default' => 'left', 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'wpr-addons' ), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'wpr-addons' ), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'wpr-addons' ), 'icon' => 'eicon-h-align-right', ] ], 'selectors' => [ '{{WRAPPER}} .form-submit' => 'text-align: {{VALUE}}', ], 'separator' => 'before' ] ); $this->end_controls_section(); } // Outputs a comment in the HTML5 format public static function html5_comment( $comment, $args, $depth ) { // Get Settings $this_widget = $GLOBALS['wpr_post_comments_widget']; $settings = $this_widget->get_settings(); if ( !wpr_fs()->can_use_premium_code() ) { $settings['comments_avatar_size'] = 60; } // Class, URL, Name $comment_class = implode( ' ', get_comment_class( $comment->has_children ? 'parent' : '', $comment ) ); $author_url = get_comment_author_url( $comment ); $author_name = get_comment_author( $comment ); // Comment HTML echo '
  • '; echo '
    '; // Comment Avatar if ( 'yes' === $settings['comments_avatar'] ) { echo '
    '; echo get_avatar( $comment, $settings['comments_avatar_size'] ); echo '
    '; } // Comment Meta echo '
    '; // Comment Author echo '
    '; if ( '' === $author_url ) { echo ''. esc_html( $author_name ) .''; } else { echo ''. esc_html( $author_name ) .''; } echo '
    '; // Comment Metadata echo ''; echo '
    '; // Comment Content echo '
    '; comment_text( $comment ); echo '
    '; // Reply Button if ( 'separate' === $settings['comments_reply_location'] ) { comment_reply_link( array_merge( $args, [ 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '
    ', 'after' => '
    ', ] ) ); } echo '
    '; echo '
  • '; } protected function render() { $is_editor = \Elementor\Plugin::$instance->editor->is_edit_mode(); // Temp log out user if ( $is_editor ) { $store_current_user = wp_get_current_user()->ID; wp_set_current_user( 0 ); } // Get Settings $settings = $this->get_settings(); $GLOBALS['wpr_post_comments_widget'] = $this; if ( ! comments_open( get_the_ID() ) ) { return; } // Comments Count $count = get_comments_number( get_the_ID() ); // Comments Wrapper echo '
    '; // If comments are open or we have at least one comment if ( $count ) { if ( $count == 1 ) { $text = $count .' '. $settings['comments_text_1']; } elseif ( $count > 1 ) { $text = $count .' '. $settings['comments_text_2']; } // Comments if ( 'yes' === $settings['section_title'] ) { echo '

    '. esc_html($text) .'

    '; } // Get Post Comments $get_comments = get_comments( [ 'post_id' => get_the_ID() ] ); // Comments List HTML echo ''; unset( $GLOBALS['wpr_post_comments_widget'] ); // Comments Navigation if ( get_comment_pages_count($get_comments) > 1 && get_option( 'page_comments' ) ) { echo '
    '; paginate_comments_links([ 'base' => add_query_arg( 'cpage', '%#%' ), 'format' => '', 'total' => get_comment_pages_count($get_comments), 'echo' => true, 'add_fragment' => '#comments', 'prev_text' => ' '. esc_html__( 'Previous', 'wpr-addons' ), 'next_text' => esc_html__( 'Next', 'wpr-addons' ) .' ', ]); echo '
    '; } } // Comment Form: Author, Email and Website Fields add_filter( 'comment_form_default_fields', function( $defaults ) { $settings = $this->get_settings(); $author_label = $email_label = $url_label = ''; $author_ph = $email_ph = $url_ph = ''; $req = get_option( 'require_name_email' ); // Labels if ( 'yes' === $settings['comment_form_labels'] ) { $author_label = ''; $email_label = ''; $url_label = ''; } if ( !wpr_fs()->can_use_premium_code() ) { $settings['comment_form_placeholders'] = ''; } // Placeholders if ( 'yes' === $settings['comment_form_placeholders'] ) { $author_ph = esc_html__( 'Name', 'wpr-addons' ) . ($req ? '*' : ''); $email_ph = esc_html__( 'Email', 'wpr-addons' ) . ($req ? '*' : ''); $url_ph = esc_html__( 'Website', 'wpr-addons' ); } $fields = [ // name 'author' => '
    '. $author_label . '
    ', // Email 'email' => '', // Website 'url' => '
    '. $url_label . '
    ', ]; // Remove Website Field if ( '' === $settings['comment_form_website'] ) { $fields['url'] = '
    '; } return $fields; } ); // Comment Form Defaults add_filter( 'comment_form_defaults', function( $defaults ) { $settings = $this->get_settings(); $text_label = $text_ph = ''; $req = get_option( 'require_name_email' ); // Text Input Label if ( 'yes' === $settings['comment_form_labels'] ) { $text_label = ''; } if ( !wpr_fs()->can_use_premium_code() ) { $settings['comment_form_placeholders'] = ''; } // Text Input Placeholder if ( 'yes' === $settings['comment_form_placeholders'] ) { $text_ph = esc_html__( 'Message', 'wpr-addons' ) . ($req ? '*' : ''); } // Form $defaults['id_form'] = 'wpr-comment-form'; $defaults['class_form'] = 'wpr-comment-form wpr-cf-'. esc_attr($settings['comments_form_layout']); // No Website Filed Class if ( '' === $settings['comment_form_website'] ) { $defaults['class_form'] .= ' wpr-cf-no-url'; } // Title $defaults['title_reply'] = $settings['comment_form_title']; $defaults['title_reply_before'] = '

    '; $defaults['title_reply_after'] = '

    '; // Text Field $defaults['comment_field'] = '
    '. $text_label; $defaults['comment_field'] .= ''; $defaults['comment_field'] .= '
    '; // Submit Button $defaults['id_submit'] = 'wpr-submit-comment'; $defaults['class_submit'] = 'wpr-submit-comment'; $defaults['label_submit'] = $settings['comment_form_submit_text']; return $defaults; } ); // Form Output comment_form(); echo '
    '; // End .wpr-comments-wrap // Logged-in user back. if ( $is_editor ) { wp_set_current_user( $store_current_user ); } } }