PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 2.1.0
GiveWP – Donation Plugin and Fundraising Platform v2.1.0
4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / templates / shortcode-profile-editor.php
give / templates Last commit date
emails 8 years ago global 8 years ago single-give-form 8 years ago email-login-form.php 8 years ago give-rtl.css 8 years ago give-rtl.min.css 8 years ago give.css 8 years ago give.min.css 8 years ago history-donations.php 8 years ago payment-processing.php 8 years ago shortcode-form-grid.php 8 years ago shortcode-goal.php 8 years ago shortcode-login.php 8 years ago shortcode-profile-editor.php 8 years ago shortcode-receipt.php 8 years ago shortcode-register.php 8 years ago shortcode-totals-progress.php 8 years ago single-give-form.php 8 years ago
shortcode-profile-editor.php
245 lines
1 <?php
2 /**
3 * Profile Editor
4 *
5 * This template is used to display the profile editor with [give_profile_editor]
6 *
7 * @copyright Copyright (c) 2016, WordImpress
8 * @license https://opensource.org/licenses/gpl-license GNU Public License
9 */
10 $current_user = wp_get_current_user();
11
12 if ( is_user_logged_in() ) :
13 $user_id = get_current_user_id();
14 $first_name = get_user_meta( $user_id, 'first_name', true );
15 $last_name = get_user_meta( $user_id, 'last_name', true );
16 $last_name = get_user_meta( $user_id, 'last_name', true );
17 $display_name = $current_user->display_name;
18 $address = give_get_donor_address( $user_id, array( 'address_type' => 'personal' ) );
19
20 $donor = new Give_Donor( $user_id, true );
21 $company_name = $donor->get_meta( '_give_donor_company', true );
22
23 if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) :
24 if ( isset( $_GET['update_code'] ) ) :?>
25 <?php
26 switch ( $_GET['update_code'] ) {
27 case '1':
28 printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your profile has been updated.', 'give' ) );
29 break;
30 }
31 ?>
32 </p>
33 <?php endif; ?>
34 <?php endif; ?>
35
36 <?php Give()->notices->render_frontend_notices( 0 ); ?>
37
38 <?php
39 /**
40 * Fires in the profile editor shortcode, before the form.
41 *
42 * Allows you to add new elements before the form.
43 *
44 * @since 1.0
45 */
46 do_action( 'give_profile_editor_before' );
47 ?>
48
49 <form id="give_profile_editor_form" class="give-form" action="<?php echo give_get_current_page_url(); ?>"
50 method="post">
51
52 <fieldset>
53 <legend id="give_profile_name_label"><?php _e( 'Profile', 'give' ); ?></legend>
54
55 <h3 id="give_personal_information_label"
56 class="give-section-break"><?php _e( 'Change your Name', 'give' ); ?></h3>
57
58 <p id="give_profile_first_name_wrap" class="form-row form-row-first form-row-responsive">
59 <label for="give_first_name">
60 <?php _e( 'First Name', 'give' ); ?>
61 <span class="give-required-indicator ">*</span>
62 </label>
63 <input name="give_first_name" id="give_first_name" class="text give-input" type="text"
64 value="<?php echo esc_attr( $first_name ); ?>"/>
65 </p>
66
67 <p id="give_profile_last_name_wrap" class="form-row form-row-last form-row-responsive">
68 <label for="give_last_name"><?php _e( 'Last Name', 'give' ); ?></label>
69 <input name="give_last_name" id="give_last_name" class="text give-input" type="text"
70 value="<?php echo esc_attr( $last_name ); ?>"/>
71 </p>
72
73 <?php if ( ! empty( $company_name ) ) : ?>
74 <p id="give_profile_company_name_wrap" class="form-row form-row-wide">
75 <label for="give_company_name"><?php _e( 'Company Name', 'give' ); ?></label>
76 <input name="give_company_name" id="give_company_name" class="text give-input" type="text"
77 value="<?php echo esc_attr( $company_name ); ?>"/>
78 </p>
79 <?php endif; ?>
80
81 <p id="give_profile_display_name_wrap" class="form-row form-row-first form-row-responsive">
82 <label for="give_display_name"><?php _e( 'Display Name', 'give' ); ?></label>
83 <select name="give_display_name" id="give_display_name" class="select give-select">
84 <?php if ( ! empty( $current_user->first_name ) ): ?>
85 <option <?php selected( $display_name, $current_user->first_name ); ?>
86 value="<?php echo esc_attr( $current_user->first_name ); ?>"><?php echo esc_html( $current_user->first_name ); ?></option>
87 <?php endif; ?>
88 <option <?php selected( $display_name, $current_user->user_nicename ); ?>
89 value="<?php echo esc_attr( $current_user->user_nicename ); ?>"><?php echo esc_html( $current_user->user_nicename ); ?></option>
90 <?php if ( ! empty( $current_user->last_name ) ): ?>
91 <option <?php selected( $display_name, $current_user->last_name ); ?>
92 value="<?php echo esc_attr( $current_user->last_name ); ?>"><?php echo esc_html( $current_user->last_name ); ?></option>
93 <?php endif; ?>
94 <?php if ( ! empty( $current_user->first_name ) && ! empty( $current_user->last_name ) ): ?>
95 <option <?php selected( $display_name, $current_user->first_name . ' ' . $current_user->last_name ); ?>
96 value="<?php echo esc_attr( $current_user->first_name . ' ' . $current_user->last_name ); ?>"><?php echo esc_html( $current_user->first_name . ' ' . $current_user->last_name ); ?></option>
97 <option <?php selected( $display_name, $current_user->last_name . ' ' . $current_user->first_name ); ?>
98 value="<?php echo esc_attr( $current_user->last_name . ' ' . $current_user->first_name ); ?>"><?php echo esc_html( $current_user->last_name . ' ' . $current_user->first_name ); ?></option>
99 <?php endif; ?>
100 </select>
101 <?php
102 /**
103 * Fires in the profile editor shortcode, to the name section.
104 *
105 * Allows you to add new elements to the name section.
106 *
107 * @since 1.0
108 */
109 do_action( 'give_profile_editor_name' );
110 ?>
111 </p>
112
113 <?php
114 /**
115 * Fires in the profile editor shortcode, after the name field.
116 *
117 * Allows you to add new fields after the name field.
118 *
119 * @since 1.0
120 */
121 do_action( 'give_profile_editor_after_name' );
122 ?>
123
124 <p class="form-row form-row-last form-row-responsive">
125 <label for="give_email">
126 <?php _e( 'Email Address', 'give' ); ?>
127 <span class="give-required-indicator ">*</span>
128 </label>
129 <input name="give_email" id="give_email" class="text give-input required" type="email"
130 value="<?php echo esc_attr( $current_user->user_email ); ?>" required aria-required="true"/>
131 <?php
132 /**
133 * Fires in the profile editor shortcode, to the email section.
134 *
135 * Allows you to add new elements to the email section.
136 *
137 * @since 1.0
138 */
139 do_action( 'give_profile_editor_email' );
140 ?>
141 </p>
142
143 <?php
144 /**
145 * Fires in the profile editor shortcode, after the email field.
146 *
147 * Allows you to add new fields after the email field.
148 *
149 * @since 1.0
150 */
151 do_action( 'give_profile_editor_after_email' );
152 ?>
153
154 <h3 id="give_profile_password_label"
155 class="give-section-break"><?php _e( 'Change your Password', 'give' ); ?></h3>
156
157 <div id="give_profile_password_wrap" class="give-clearfix">
158 <p id="give_profile_password_wrap_1" class="form-row form-row-first form-row-responsive">
159 <label for="give_new_user_pass1"><?php _e( 'New Password', 'give' ); ?></label>
160 <input name="give_new_user_pass1" id="give_new_user_pass1" class="password give-input"
161 type="password"/>
162 </p>
163
164 <p id="give_profile_password_wrap_2" class="form-row form-row-last form-row-responsive">
165 <label for="give_new_user_pass2"><?php _e( 'Re-enter Password', 'give' ); ?></label>
166 <input name="give_new_user_pass2" id="give_new_user_pass2" class="password give-input"
167 type="password"/>
168 <?php
169 /**
170 * Fires in the profile editor shortcode, to the password section.
171 *
172 * Allows you to add new elements to the password section.
173 *
174 * @since 1.0
175 */
176 do_action( 'give_profile_editor_password' );
177 ?>
178 </p>
179 </div>
180
181 <p class="give_password_change_notice"><?php _e( 'Please note after changing your password, you must log back in.', 'give' ); ?></p>
182
183 <?php
184 /**
185 * Fires in the profile editor shortcode, after the password field.
186 *
187 * Allows you to add new fields after the password field.
188 *
189 * @since 1.0
190 */
191 do_action( 'give_profile_editor_after_password' );
192 ?>
193
194 <p id="give_profile_submit_wrap">
195 <input type="hidden" name="give_profile_editor_nonce"
196 value="<?php echo wp_create_nonce( 'give-profile-editor-nonce' ); ?>"/>
197 <input type="hidden" name="give_action" value="edit_user_profile"/>
198 <input type="hidden" name="give_redirect"
199 value="<?php echo esc_url( give_get_current_page_url() ); ?>"/>
200 <input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit"
201 class="give_submit" value="<?php _e( 'Save Changes', 'give' ); ?>"/>
202 </p>
203
204 </fieldset>
205
206 </form><!-- #give_profile_editor_form -->
207
208 <?php
209 /**
210 * Fires in the profile editor shortcode, after the form.
211 *
212 * Allows you to add new elements after the form.
213 *
214 * @since 1.0
215 */
216 do_action( 'give_profile_editor_after' );
217 ?>
218
219 <?php
220 else :
221 if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) {
222 if ( isset( $_GET['update_code'] ) ) {
223 switch ( $_GET['update_code'] ) {
224 case '2':
225 printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your profile and password has been updated.', 'give' ) );
226 _e( 'Login with your new credentials.', 'give' );
227 echo give_login_form();
228 break;
229
230 case '3':
231 printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your password has been updated.', 'give' ) );
232 _e( 'Login with your new credentials.', 'give' );
233 echo give_login_form();
234 break;
235
236 default:
237 break;
238 }
239 }
240 } else {
241 _e( 'You need to login to edit your profile.', 'give' );
242 echo give_login_form();
243 }
244 endif;
245