|
@@ -7,22 +7,22 @@ discard block |
|
|
block discarded – undo |
7
|
7
|
* @copyright Copyright (c) 2016, WordImpress |
8
|
8
|
* @license https://opensource.org/licenses/gpl-license GNU Public License |
9
|
9
|
*/ |
10
|
|
-$current_user = wp_get_current_user(); |
|
10
|
+$current_user = wp_get_current_user(); |
11
|
11
|
|
12
|
|
-if ( is_user_logged_in() ): |
|
12
|
+if (is_user_logged_in()): |
13
|
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 ); |
|
14
|
+ $first_name = get_user_meta($user_id, 'first_name', true); |
|
15
|
+ $last_name = get_user_meta($user_id, 'last_name', true); |
16
|
16
|
$display_name = $current_user->display_name; |
17
|
|
- $address = give_get_donor_address( $user_id ); |
|
17
|
+ $address = give_get_donor_address($user_id); |
18
|
18
|
|
19
|
|
- if ( isset( $_GET['updated'] ) && $_GET['updated'] == true && ! give_get_errors() ): ?> |
|
19
|
+ if (isset($_GET['updated']) && $_GET['updated'] == true && ! give_get_errors()): ?> |
20
|
20
|
<p class="give_success"> |
21
|
|
- <strong><?php esc_html_e( 'Success:', 'give' ); ?></strong> <?php esc_html_e( 'Your profile has been updated.', 'give' ); ?> |
|
21
|
+ <strong><?php esc_html_e('Success:', 'give'); ?></strong> <?php esc_html_e('Your profile has been updated.', 'give'); ?> |
22
|
22
|
</p> |
23
|
23
|
<?php endif; ?> |
24
|
24
|
|
25
|
|
- <?php Give()->notices->render_frontend_notices( 0 ); ?> |
|
25
|
+ <?php Give()->notices->render_frontend_notices(0); ?> |
26
|
26
|
|
27
|
27
|
<?php |
28
|
28
|
/** |
|
@@ -32,42 +32,42 @@ discard block |
|
|
block discarded – undo |
32
|
32
|
* |
33
|
33
|
* @since 1.0 |
34
|
34
|
*/ |
35
|
|
- do_action( 'give_profile_editor_before' ); |
|
35
|
+ do_action('give_profile_editor_before'); |
36
|
36
|
?> |
37
|
37
|
|
38
|
38
|
<form id="give_profile_editor_form" class="give-form" action="<?php echo give_get_current_page_url(); ?>" method="post"> |
39
|
39
|
|
40
|
40
|
<fieldset> |
41
|
|
- <legend id="give_profile_name_label"><?php _e( 'Profile', 'give' ); ?></legend> |
|
41
|
+ <legend id="give_profile_name_label"><?php _e('Profile', 'give'); ?></legend> |
42
|
42
|
|
43
|
|
- <h3 id="give_personal_information_label" class="give-section-break"><?php _e( 'Change your Name', 'give' ); ?></h3> |
|
43
|
+ <h3 id="give_personal_information_label" class="give-section-break"><?php _e('Change your Name', 'give'); ?></h3> |
44
|
44
|
|
45
|
45
|
<p id="give_profile_first_name_wrap" class="form-row form-row-first form-row-responsive"> |
46
|
46
|
<label for="give_first_name"> |
47
|
|
- <?php _e( 'First Name', 'give' ); ?> |
|
47
|
+ <?php _e('First Name', 'give'); ?> |
48
|
48
|
<span class="give-required-indicator ">*</span> |
49
|
49
|
</label> |
50
|
|
- <input name="give_first_name" id="give_first_name" class="text give-input" type="text" value="<?php echo esc_attr( $first_name ); ?>"/> |
|
50
|
+ <input name="give_first_name" id="give_first_name" class="text give-input" type="text" value="<?php echo esc_attr($first_name); ?>"/> |
51
|
51
|
</p> |
52
|
52
|
|
53
|
53
|
<p id="give_profile_last_name_wrap" class="form-row form-row-last form-row-responsive"> |
54
|
|
- <label for="give_last_name"><?php _e( 'Last Name', 'give' ); ?></label> |
55
|
|
- <input name="give_last_name" id="give_last_name" class="text give-input" type="text" value="<?php echo esc_attr( $last_name ); ?>"/> |
|
54
|
+ <label for="give_last_name"><?php _e('Last Name', 'give'); ?></label> |
|
55
|
+ <input name="give_last_name" id="give_last_name" class="text give-input" type="text" value="<?php echo esc_attr($last_name); ?>"/> |
56
|
56
|
</p> |
57
|
57
|
|
58
|
58
|
<p id="give_profile_display_name_wrap" class="form-row form-row-first form-row-responsive"> |
59
|
|
- <label for="give_display_name"><?php _e( 'Display Name', 'give' ); ?></label> |
|
59
|
+ <label for="give_display_name"><?php _e('Display Name', 'give'); ?></label> |
60
|
60
|
<select name="give_display_name" id="give_display_name" class="select give-select"> |
61
|
|
- <?php if ( ! empty( $current_user->first_name ) ): ?> |
62
|
|
- <option <?php selected( $display_name, $current_user->first_name ); ?> value="<?php echo esc_attr( $current_user->first_name ); ?>"><?php echo esc_html( $current_user->first_name ); ?></option> |
|
61
|
+ <?php if ( ! empty($current_user->first_name)): ?> |
|
62
|
+ <option <?php selected($display_name, $current_user->first_name); ?> value="<?php echo esc_attr($current_user->first_name); ?>"><?php echo esc_html($current_user->first_name); ?></option> |
63
|
63
|
<?php endif; ?> |
64
|
|
- <option <?php selected( $display_name, $current_user->user_nicename ); ?> value="<?php echo esc_attr( $current_user->user_nicename ); ?>"><?php echo esc_html( $current_user->user_nicename ); ?></option> |
65
|
|
- <?php if ( ! empty( $current_user->last_name ) ): ?> |
66
|
|
- <option <?php selected( $display_name, $current_user->last_name ); ?> value="<?php echo esc_attr( $current_user->last_name ); ?>"><?php echo esc_html( $current_user->last_name ); ?></option> |
|
64
|
+ <option <?php selected($display_name, $current_user->user_nicename); ?> value="<?php echo esc_attr($current_user->user_nicename); ?>"><?php echo esc_html($current_user->user_nicename); ?></option> |
|
65
|
+ <?php if ( ! empty($current_user->last_name)): ?> |
|
66
|
+ <option <?php selected($display_name, $current_user->last_name); ?> value="<?php echo esc_attr($current_user->last_name); ?>"><?php echo esc_html($current_user->last_name); ?></option> |
67
|
67
|
<?php endif; ?> |
68
|
|
- <?php if ( ! empty( $current_user->first_name ) && ! empty( $current_user->last_name ) ): ?> |
69
|
|
- <option <?php selected( $display_name, $current_user->first_name . ' ' . $current_user->last_name ); ?> 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> |
70
|
|
- <option <?php selected( $display_name, $current_user->last_name . ' ' . $current_user->first_name ); ?> 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> |
|
68
|
+ <?php if ( ! empty($current_user->first_name) && ! empty($current_user->last_name)): ?> |
|
69
|
+ <option <?php selected($display_name, $current_user->first_name.' '.$current_user->last_name); ?> 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> |
|
70
|
+ <option <?php selected($display_name, $current_user->last_name.' '.$current_user->first_name); ?> 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> |
71
|
71
|
<?php endif; ?> |
72
|
72
|
</select> |
73
|
73
|
<?php |
|
@@ -78,7 +78,7 @@ discard block |
|
|
block discarded – undo |
78
|
78
|
* |
79
|
79
|
* @since 1.0 |
80
|
80
|
*/ |
81
|
|
- do_action( 'give_profile_editor_name' ); |
|
81
|
+ do_action('give_profile_editor_name'); |
82
|
82
|
?> |
83
|
83
|
</p> |
84
|
84
|
|
|
@@ -90,15 +90,15 @@ discard block |
|
|
block discarded – undo |
90
|
90
|
* |
91
|
91
|
* @since 1.0 |
92
|
92
|
*/ |
93
|
|
- do_action( 'give_profile_editor_after_name' ); |
|
93
|
+ do_action('give_profile_editor_after_name'); |
94
|
94
|
?> |
95
|
95
|
|
96
|
96
|
<p class="form-row form-row-last form-row-responsive"> |
97
|
97
|
<label for="give_email"> |
98
|
|
- <?php _e( 'Email Address', 'give' ); ?> |
|
98
|
+ <?php _e('Email Address', 'give'); ?> |
99
|
99
|
<span class="give-required-indicator ">*</span> |
100
|
100
|
</label> |
101
|
|
- <input name="give_email" id="give_email" class="text give-input required" type="email" value="<?php echo esc_attr( $current_user->user_email ); ?>" required aria-required="true"/> |
|
101
|
+ <input name="give_email" id="give_email" class="text give-input required" type="email" value="<?php echo esc_attr($current_user->user_email); ?>" required aria-required="true"/> |
102
|
102
|
<?php |
103
|
103
|
/** |
104
|
104
|
* Fires in the profile editor shortcode, to the email section. |
|
@@ -107,7 +107,7 @@ discard block |
|
|
block discarded – undo |
107
|
107
|
* |
108
|
108
|
* @since 1.0 |
109
|
109
|
*/ |
110
|
|
- do_action( 'give_profile_editor_email' ); |
|
110
|
+ do_action('give_profile_editor_email'); |
111
|
111
|
?> |
112
|
112
|
</p> |
113
|
113
|
|
|
@@ -119,19 +119,19 @@ discard block |
|
|
block discarded – undo |
119
|
119
|
* |
120
|
120
|
* @since 1.0 |
121
|
121
|
*/ |
122
|
|
- do_action( 'give_profile_editor_after_email' ); |
|
122
|
+ do_action('give_profile_editor_after_email'); |
123
|
123
|
?> |
124
|
124
|
|
125
|
|
- <h3 id="give_profile_password_label" class="give-section-break"><?php _e( 'Change your Password', 'give' ); ?></h3> |
|
125
|
+ <h3 id="give_profile_password_label" class="give-section-break"><?php _e('Change your Password', 'give'); ?></h3> |
126
|
126
|
|
127
|
127
|
<div id="give_profile_password_wrap" class="give-clearfix"> |
128
|
128
|
<p id="give_profile_password_wrap_1" class="form-row form-row-first form-row-responsive"> |
129
|
|
- <label for="give_new_user_pass1"><?php _e( 'New Password', 'give' ); ?></label> |
|
129
|
+ <label for="give_new_user_pass1"><?php _e('New Password', 'give'); ?></label> |
130
|
130
|
<input name="give_new_user_pass1" id="give_new_user_pass1" class="password give-input" type="password"/> |
131
|
131
|
</p> |
132
|
132
|
|
133
|
133
|
<p id="give_profile_password_wrap_2" class="form-row form-row-last form-row-responsive"> |
134
|
|
- <label for="give_new_user_pass2"><?php _e( 'Re-enter Password', 'give' ); ?></label> |
|
134
|
+ <label for="give_new_user_pass2"><?php _e('Re-enter Password', 'give'); ?></label> |
135
|
135
|
<input name="give_new_user_pass2" id="give_new_user_pass2" class="password give-input" type="password"/> |
136
|
136
|
<?php |
137
|
137
|
/** |
|
@@ -141,12 +141,12 @@ discard block |
|
|
block discarded – undo |
141
|
141
|
* |
142
|
142
|
* @since 1.0 |
143
|
143
|
*/ |
144
|
|
- do_action( 'give_profile_editor_password' ); |
|
144
|
+ do_action('give_profile_editor_password'); |
145
|
145
|
?> |
146
|
146
|
</p> |
147
|
147
|
</div> |
148
|
148
|
|
149
|
|
- <p class="give_password_change_notice"><?php _e( 'Please note after changing your password, you must log back in.', 'give' ); ?></p> |
|
149
|
+ <p class="give_password_change_notice"><?php _e('Please note after changing your password, you must log back in.', 'give'); ?></p> |
150
|
150
|
|
151
|
151
|
<?php |
152
|
152
|
/** |
|
@@ -156,14 +156,14 @@ discard block |
|
|
block discarded – undo |
156
|
156
|
* |
157
|
157
|
* @since 1.0 |
158
|
158
|
*/ |
159
|
|
- do_action( 'give_profile_editor_after_password' ); |
|
159
|
+ do_action('give_profile_editor_after_password'); |
160
|
160
|
?> |
161
|
161
|
|
162
|
162
|
<p id="give_profile_submit_wrap"> |
163
|
|
- <input type="hidden" name="give_profile_editor_nonce" value="<?php echo wp_create_nonce( 'give-profile-editor-nonce' ); ?>"/> |
|
163
|
+ <input type="hidden" name="give_profile_editor_nonce" value="<?php echo wp_create_nonce('give-profile-editor-nonce'); ?>"/> |
164
|
164
|
<input type="hidden" name="give_action" value="edit_user_profile"/> |
165
|
|
- <input type="hidden" name="give_redirect" value="<?php echo esc_url( give_get_current_page_url() ); ?>"/> |
166
|
|
- <input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit" class="give_submit" value="<?php _e( 'Save Changes', 'give' ); ?>"/> |
|
165
|
+ <input type="hidden" name="give_redirect" value="<?php echo esc_url(give_get_current_page_url()); ?>"/> |
|
166
|
+ <input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit" class="give_submit" value="<?php _e('Save Changes', 'give'); ?>"/> |
167
|
167
|
</p> |
168
|
168
|
|
169
|
169
|
</fieldset> |
|
@@ -178,11 +178,11 @@ discard block |
|
|
block discarded – undo |
178
|
178
|
* |
179
|
179
|
* @since 1.0 |
180
|
180
|
*/ |
181
|
|
- do_action( 'give_profile_editor_after' ); |
|
181
|
+ do_action('give_profile_editor_after'); |
182
|
182
|
?> |
183
|
183
|
|
184
|
184
|
<?php |
185
|
185
|
else: |
186
|
|
- _e( 'You need to login to edit your profile.', 'give' ); |
|
186
|
+ _e('You need to login to edit your profile.', 'give'); |
187
|
187
|
echo give_login_form(); |
188
|
188
|
endif; |