| @@ -10,9 +10,9 @@ | ||
| 10 | 10 | |
| 11 | 11 | $current_user = wp_get_current_user(); |
| 12 | 12 | |
| 13 | 13 | if ( is_user_logged_in() ) : |
| 14 | - $user_id = get_current_user_id(); | |
| 14 | + $user_id = get_current_user_id(); | |
| 15 | 15 | $first_name = get_user_meta( $user_id, 'first_name', true ); |
| 16 | 16 | $last_name = get_user_meta( $user_id, 'last_name', true ); |
| 17 | 17 | $last_name = get_user_meta( $user_id, 'last_name', true ); |
| 18 | 18 | $display_name = $current_user->display_name; |
| @@ -44,9 +44,9 @@ | ||
| 44 | 44 | <fieldset> |
| 45 | 45 | <legend id="give_profile_name_label"><?php _e( 'Profile', 'give' ); ?></legend> |
| 46 | 46 | |
| 47 | 47 | <h3 id="give_personal_information_label" |
| 48 | - class="give-section-break"><?php _e( 'Change your Name', 'give' ); ?></h3> | |
| 48 | + class="give-section-break"><?php _e( 'Change your Name', 'give' ); ?></h3> | |
| 49 | 49 | |
| 50 | 50 | <p id="give_profile_first_name_wrap" class="form-row form-row-first form-row-responsive"> |
| 51 | 51 | <label for="give_first_name"> |
| 52 | 52 | <?php _e( 'First Name', 'give' ); ?> |
| @@ -52,15 +52,15 @@ | ||
| 52 | 52 | <?php _e( 'First Name', 'give' ); ?> |
| 53 | 53 | <span class="give-required-indicator ">*</span> |
| 54 | 54 | </label> |
| 55 | 55 | <input name="give_first_name" id="give_first_name" class="text give-input" type="text" |
| 56 | - value="<?php echo esc_attr( $first_name ); ?>"/> | |
| 56 | + value="<?php echo esc_attr( $first_name ); ?>"/> | |
| 57 | 57 | </p> |
| 58 | 58 | |
| 59 | 59 | <p id="give_profile_last_name_wrap" class="form-row form-row-last form-row-responsive"> |
| 60 | 60 | <label for="give_last_name"><?php _e( 'Last Name', 'give' ); ?></label> |
| 61 | 61 | <input name="give_last_name" id="give_last_name" class="text give-input" type="text" |
| 62 | - value="<?php echo esc_attr( $last_name ); ?>"/> | |
| 62 | + value="<?php echo esc_attr( $last_name ); ?>"/> | |
| 63 | 63 | </p> |
| 64 | 64 | |
| 65 | 65 | <?php if ( ! empty( $company_name ) ) : ?> |
| 66 | 66 | <p id="give_profile_company_name_wrap" class="form-row form-row-wide"> |
| @@ -65,9 +65,9 @@ | ||
| 65 | 65 | <?php if ( ! empty( $company_name ) ) : ?> |
| 66 | 66 | <p id="give_profile_company_name_wrap" class="form-row form-row-wide"> |
| 67 | 67 | <label for="give_company_name"><?php _e( 'Company Name', 'give' ); ?></label> |
| 68 | 68 | <input name="give_company_name" id="give_company_name" class="text give-input" type="text" |
| 69 | - value="<?php echo esc_attr( $company_name ); ?>"/> | |
| 69 | + value="<?php echo esc_attr( $company_name ); ?>"/> | |
| 70 | 70 | </p> |
| 71 | 71 | <?php endif; ?> |
| 72 | 72 | |
| 73 | 73 | <p id="give_profile_display_name_wrap" class="form-row form-row-first form-row-responsive"> |
| @@ -72,19 +72,19 @@ | ||
| 72 | 72 | |
| 73 | 73 | <p id="give_profile_display_name_wrap" class="form-row form-row-first form-row-responsive"> |
| 74 | 74 | <label for="give_display_name"><?php _e( 'Display Name', 'give' ); ?></label> |
| 75 | 75 | <select name="give_display_name" id="give_display_name" class="select give-select"> |
| 76 | - <?php if ( ! empty( $current_user->first_name ) ): ?> | |
| 76 | + <?php if ( ! empty( $current_user->first_name ) ) : ?> | |
| 77 | 77 | <option <?php selected( $display_name, $current_user->first_name ); ?> |
| 78 | 78 | value="<?php echo esc_attr( $current_user->first_name ); ?>"><?php echo esc_html( $current_user->first_name ); ?></option> |
| 79 | 79 | <?php endif; ?> |
| 80 | 80 | <option <?php selected( $display_name, $current_user->user_nicename ); ?> |
| 81 | 81 | value="<?php echo esc_attr( $current_user->user_nicename ); ?>"><?php echo esc_html( $current_user->user_nicename ); ?></option> |
| 82 | - <?php if ( ! empty( $current_user->last_name ) ): ?> | |
| 82 | + <?php if ( ! empty( $current_user->last_name ) ) : ?> | |
| 83 | 83 | <option <?php selected( $display_name, $current_user->last_name ); ?> |
| 84 | 84 | value="<?php echo esc_attr( $current_user->last_name ); ?>"><?php echo esc_html( $current_user->last_name ); ?></option> |
| 85 | 85 | <?php endif; ?> |
| 86 | - <?php if ( ! empty( $current_user->first_name ) && ! empty( $current_user->last_name ) ): ?> | |
| 86 | + <?php if ( ! empty( $current_user->first_name ) && ! empty( $current_user->last_name ) ) : ?> | |
| 87 | 87 | <option <?php selected( $display_name, $current_user->first_name . ' ' . $current_user->last_name ); ?> |
| 88 | 88 | 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> |
| 89 | 89 | <option <?php selected( $display_name, $current_user->last_name . ' ' . $current_user->first_name ); ?> |
| 90 | 90 | 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> |
| @@ -118,9 +118,9 @@ | ||
| 118 | 118 | <?php _e( 'Email Address', 'give' ); ?> |
| 119 | 119 | <span class="give-required-indicator ">*</span> |
| 120 | 120 | </label> |
| 121 | 121 | <input name="give_email" id="give_email" class="text give-input required" type="email" |
| 122 | - value="<?php echo esc_attr( $current_user->user_email ); ?>" required aria-required="true"/> | |
| 122 | + value="<?php echo esc_attr( $current_user->user_email ); ?>" required aria-required="true"/> | |
| 123 | 123 | <?php |
| 124 | 124 | /** |
| 125 | 125 | * Fires in the profile editor shortcode, to the email section. |
| 126 | 126 | * |
| @@ -143,21 +143,21 @@ | ||
| 143 | 143 | do_action( 'give_profile_editor_after_email' ); |
| 144 | 144 | ?> |
| 145 | 145 | |
| 146 | 146 | <h3 id="give_profile_password_label" |
| 147 | - class="give-section-break"><?php _e( 'Change your Password', 'give' ); ?></h3> | |
| 147 | + class="give-section-break"><?php _e( 'Change your Password', 'give' ); ?></h3> | |
| 148 | 148 | |
| 149 | 149 | <div id="give_profile_password_wrap" class="give-clearfix"> |
| 150 | 150 | <p id="give_profile_password_wrap_1" class="form-row form-row-first form-row-responsive"> |
| 151 | 151 | <label for="give_new_user_pass1"><?php _e( 'New Password', 'give' ); ?></label> |
| 152 | 152 | <input name="give_new_user_pass1" id="give_new_user_pass1" class="password give-input" |
| 153 | - type="password"/> | |
| 153 | + type="password"/> | |
| 154 | 154 | </p> |
| 155 | 155 | |
| 156 | 156 | <p id="give_profile_password_wrap_2" class="form-row form-row-last form-row-responsive"> |
| 157 | 157 | <label for="give_new_user_pass2"><?php _e( 'Re-enter Password', 'give' ); ?></label> |
| 158 | 158 | <input name="give_new_user_pass2" id="give_new_user_pass2" class="password give-input" |
| 159 | - type="password"/> | |
| 159 | + type="password"/> | |
| 160 | 160 | <?php |
| 161 | 161 | /** |
| 162 | 162 | * Fires in the profile editor shortcode, to the password section. |
| 163 | 163 | * |
| @@ -184,14 +184,14 @@ | ||
| 184 | 184 | ?> |
| 185 | 185 | |
| 186 | 186 | <p id="give_profile_submit_wrap"> |
| 187 | 187 | <input type="hidden" name="give_profile_editor_nonce" |
| 188 | - value="<?php echo wp_create_nonce( 'give-profile-editor-nonce' ); ?>"/> | |
| 188 | + value="<?php echo wp_create_nonce( 'give-profile-editor-nonce' ); ?>"/> | |
| 189 | 189 | <input type="hidden" name="give_action" value="edit_user_profile"/> |
| 190 | 190 | <input type="hidden" name="give_redirect" |
| 191 | - value="<?php echo esc_url( give_get_current_page_url() ); ?>"/> | |
| 191 | + value="<?php echo esc_url( give_get_current_page_url() ); ?>"/> | |
| 192 | 192 | <input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit" |
| 193 | - class="give_submit" value="<?php _e( 'Save Changes', 'give' ); ?>"/> | |
| 193 | + class="give_submit" value="<?php _e( 'Save Changes', 'give' ); ?>"/> | |
| 194 | 194 | </p> |
| 195 | 195 | |
| 196 | 196 | </fieldset> |
| 197 | 197 | |
| @@ -207,22 +207,26 @@ | ||
| 207 | 207 | */ |
| 208 | 208 | do_action( 'give_profile_editor_after' ); |
| 209 | 209 | ?> |
| 210 | 210 | |
| 211 | -<?php | |
| 211 | + <?php | |
| 212 | 212 | else : |
| 213 | - if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) { | |
| 213 | + if ( | |
| 214 | + isset( $_GET['updated'] ) | |
| 215 | + && 'true' === $_GET['updated'] | |
| 216 | + && ! give_get_errors() | |
| 217 | + ) { | |
| 214 | 218 | if ( isset( $_GET['update_code'] ) ) { |
| 215 | 219 | switch ( $_GET['update_code'] ) { |
| 216 | 220 | case '2': |
| 217 | 221 | 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' ) ); |
| 218 | - _e( 'Login with your new credentials.', 'give' ); | |
| 222 | + _e( 'Log in with your new credentials.', 'give' ); | |
| 219 | 223 | echo give_login_form(); |
| 220 | 224 | break; |
| 221 | 225 | |
| 222 | 226 | case '3': |
| 223 | 227 | printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your password has been updated.', 'give' ) ); |
| 224 | - _e( 'Login with your new credentials.', 'give' ); | |
| 228 | + _e( 'Log in with your new credentials.', 'give' ); | |
| 225 | 229 | echo give_login_form(); |
| 226 | 230 | break; |
| 227 | 231 | |
| 228 | 232 | default: |
| @@ -229,8 +233,8 @@ | ||
| 229 | 233 | break; |
| 230 | 234 | } |
| 231 | 235 | } |
| 232 | 236 | } else { |
| 233 | - _e( 'You need to login to edit your profile.', 'give' ); | |
| 237 | + _e( 'You need to log in to edit your profile.', 'give' ); | |
| 234 | 238 | echo give_login_form(); |
| 235 | 239 | } |
| 236 | 240 | endif; |