PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 3.9.6
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v3.9.6
4.0.3 4.0.2 4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 341 releases
profile-builder / assets / misc / elementor / widgets / class-pb-widget-rp.php

class-pb-widget-rp.php in User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor 3.9.6, at assets/misc/elementor/widgets/class-pb-widget-rp.php

135 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Exit if accessed directly
4 if ( ! defined( 'ABSPATH' ) ) exit;
5
6 require_once "class-pb-widget-base.php";
7
8 /**
9 * Elementor widget for our wppb-recover-password shortcode
10 */
11 class PB_Elementor_Recover_Password_Widget extends PB_Elementor_Widget {
12
13 /**
14 * Get widget name.
15 *
16 */
17 public function get_name() {
18 return 'wppb-recover-password';
19 }
20
21 /**
22 * Get widget title.
23 *
24 */
25 public function get_title() {
26 return __( 'Recover Password', 'profile-builder' );
27 }
28
29 /**
30 * Get widget icon.
31 *
32 */
33 public function get_icon() {
34 return 'eicon-shortcode';
35 }
36
37 /**
38 * Register widget controls.
39 *
40 */
41 protected function register_controls() {
42
43 $this->start_controls_section(
44 'pb_content_section',
45 array(
46 'label' => __( 'Form Settings', 'profile-builder' ),
47 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
48 )
49 );
50
51 $this->add_control(
52 'pb_recovery_no_controls_text',
53 array(
54 'type' => \Elementor\Controls_Manager::RAW_HTML,
55 'raw' => __( 'There are no available controls for the Password Recovery form', 'profile-builder' ),
56 )
57 );
58
59 $this->end_controls_section();
60
61 // Instructions Paragraph tab
62 $this->add_styling_control_group(
63 'Instructions Paragraph',
64 '',
65 'pb_recover_password_instructions',
66 [
67 'paragraph' => [
68 'selector' => '#wppb-recover-password p',
69 'section_name' => 'Paragraph',
70 ]
71 ]
72 );
73
74 // User Login Style tab
75 if( !$this->is_placeholder_labels_active() ) {
76 $sections['label'] = [
77 'selector' => '.wppb-username-email label',
78 'section_name' => 'Label',
79 ];
80 }
81 $sections['input'] = [
82 'selector' => '.wppb-username-email input',
83 'section_name' => 'Input',
84 ];
85 $this->add_styling_control_group(
86 'User Login',
87 '',
88 'pb_recover_password_username',
89 $sections
90 );
91 unset($sections);
92
93 // reCAPTCHA Style tab
94 if( !$this->is_placeholder_labels_active() ) {
95 include_once(WPPB_PLUGIN_DIR . '/front-end/default-fields/recaptcha/recaptcha.php');
96 $field = wppb_get_recaptcha_field();
97 if (!empty($field) && isset($field['captcha-pb-forms']) && (strpos($field['captcha-pb-forms'], 'pb_recover_password') !== false)) {
98 $this->add_styling_control_group(
99 'reCAPTCHA',
100 '',
101 'pb_recover_password_recaptcha',
102 [
103 'label' => [
104 'selector' => '.wppb-form-field.wppb-recaptcha label',
105 'section_name' => 'Label',
106 ]
107 ]
108 );
109 }
110 }
111
112 // Submit Button Style tab
113 $this->add_styling_control_group(
114 'Submit Button',
115 '',
116 'pb_recover_password_button',
117 [
118 'input' => [
119 'selector' => '.form-submit input#wppb-recover-password-button',
120 'section_name' => 'Input',
121 ]
122 ]
123 );
124 }
125
126 /**
127 * Render widget output in the front-end.
128 *
129 */
130 protected function render() {
131 echo $this->render_widget( 'rp' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
132 }
133
134 }
135