@@ -7,22 +7,22 @@ discard block |
||
| 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, array( 'address_type' => 'personal' ) ); |
|
| 17 | + $address = give_get_donor_address($user_id, array('address_type' => 'personal')); |
|
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -4,17 +4,17 @@ discard block |
||
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | |
| 7 | -if ( ! is_user_logged_in() ) { |
|
| 7 | +if ( ! is_user_logged_in()) { |
|
| 8 | 8 | |
| 9 | - if ( ! empty( $_GET['payment_key'] ) ) { |
|
| 10 | - $give_login_redirect = add_query_arg( 'payment_key', give_clean( $_GET['payment_key'] ) , give_get_history_page_uri() ); |
|
| 9 | + if ( ! empty($_GET['payment_key'])) { |
|
| 10 | + $give_login_redirect = add_query_arg('payment_key', give_clean($_GET['payment_key']), give_get_history_page_uri()); |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | // Show any error messages after form submission |
| 14 | - Give()->notices->render_frontend_notices( 0 ); ?> |
|
| 14 | + Give()->notices->render_frontend_notices(0); ?> |
|
| 15 | 15 | <form id="give-login-form" class="give-form" action="" method="post"> |
| 16 | 16 | <fieldset> |
| 17 | - <legend><?php _e( 'Log into Your Account', 'give' ); ?></legend> |
|
| 17 | + <legend><?php _e('Log into Your Account', 'give'); ?></legend> |
|
| 18 | 18 | <?php |
| 19 | 19 | /** |
| 20 | 20 | * Fires in the login shortcode, before the login fields. |
@@ -23,27 +23,27 @@ discard block |
||
| 23 | 23 | * |
| 24 | 24 | * @since 1.0 |
| 25 | 25 | */ |
| 26 | - do_action( 'give_login_fields_before' ); |
|
| 26 | + do_action('give_login_fields_before'); |
|
| 27 | 27 | ?> |
| 28 | 28 | <div class="give-login-username give-login"> |
| 29 | - <label for="give_user_login"><?php _e( 'Username', 'give' ); ?></label> |
|
| 29 | + <label for="give_user_login"><?php _e('Username', 'give'); ?></label> |
|
| 30 | 30 | <input name="give_user_login" id="give_user_login" class="give-required give-input" type="text" required aria-required="true" /> |
| 31 | 31 | </div> |
| 32 | 32 | |
| 33 | 33 | <div class="give-login-password give-login"> |
| 34 | - <label for="give_user_pass"><?php _e( 'Password', 'give' ); ?></label> |
|
| 34 | + <label for="give_user_pass"><?php _e('Password', 'give'); ?></label> |
|
| 35 | 35 | <input name="give_user_pass" id="give_user_pass" class="give-password give-required give-input" type="password" required aria-required="true" /> |
| 36 | 36 | </div> |
| 37 | 37 | |
| 38 | 38 | <div class="give-login-submit give-login"> |
| 39 | - <input type="hidden" name="give_login_redirect" value="<?php echo esc_url( $give_login_redirect ); ?>" /> |
|
| 40 | - <input type="hidden" name="give_login_nonce" value="<?php echo wp_create_nonce( 'give-login-nonce' ); ?>" /> |
|
| 39 | + <input type="hidden" name="give_login_redirect" value="<?php echo esc_url($give_login_redirect); ?>" /> |
|
| 40 | + <input type="hidden" name="give_login_nonce" value="<?php echo wp_create_nonce('give-login-nonce'); ?>" /> |
|
| 41 | 41 | <input type="hidden" name="give_action" value="user_login" /> |
| 42 | - <input id="give_login_submit" type="submit" class="give_submit" value="<?php _e( 'Log In', 'give' ); ?>" /> |
|
| 42 | + <input id="give_login_submit" type="submit" class="give_submit" value="<?php _e('Log In', 'give'); ?>" /> |
|
| 43 | 43 | </div> |
| 44 | 44 | |
| 45 | 45 | <div class="give-lost-password give-login"> |
| 46 | - <a href="<?php echo wp_lostpassword_url(); ?>"><?php _e( 'Reset Password', 'give' ); ?></a> |
|
| 46 | + <a href="<?php echo wp_lostpassword_url(); ?>"><?php _e('Reset Password', 'give'); ?></a> |
|
| 47 | 47 | </div> |
| 48 | 48 | <?php |
| 49 | 49 | /** |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | * |
| 54 | 54 | * @since 1.0 |
| 55 | 55 | */ |
| 56 | - do_action( 'give_login_fields_after' ); |
|
| 56 | + do_action('give_login_fields_after'); |
|
| 57 | 57 | ?> |
| 58 | 58 | </fieldset> |
| 59 | 59 | </form> |
| 60 | -<?php } elseif( isset( $_GET['give-login-success'] ) && true === (bool) $_GET['give-login-success'] ) { ?> |
|
| 61 | - <?php Give()->notices->print_frontend_notice( apply_filters('give_successful_login_message', __( 'Login successful. Welcome!', 'give' )), true, 'success' ); ?> |
|
| 60 | +<?php } elseif (isset($_GET['give-login-success']) && true === (bool) $_GET['give-login-success']) { ?> |
|
| 61 | + <?php Give()->notices->print_frontend_notice(apply_filters('give_successful_login_message', __('Login successful. Welcome!', 'give')), true, 'success'); ?> |
|
| 62 | 62 | <?php } else { ?> |
| 63 | - <?php Give()->notices->print_frontend_notice( apply_filters('give_already_logged_in_message', sprintf( __( 'You are already logged in to the site. <a href="%s">Click here</a> to logout.', 'give' ), esc_url( $give_logout_redirect ) ) ), true, 'warning' ); ?> |
|
| 63 | + <?php Give()->notices->print_frontend_notice(apply_filters('give_already_logged_in_message', sprintf(__('You are already logged in to the site. <a href="%s">Click here</a> to logout.', 'give'), esc_url($give_logout_redirect))), true, 'warning'); ?> |
|
| 64 | 64 | <?php } ?> |
| 65 | 65 | \ No newline at end of file |
@@ -9,26 +9,26 @@ discard block |
||
| 9 | 9 | global $give_access_form_outputted; |
| 10 | 10 | |
| 11 | 11 | // Only output the form once. |
| 12 | -if ( $give_access_form_outputted ) { |
|
| 12 | +if ($give_access_form_outputted) { |
|
| 13 | 13 | return; |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | -$recaptcha_key = give_get_option( 'recaptcha_key' ); |
|
| 17 | -$recaptcha_secret = give_get_option( 'recaptcha_secret' ); |
|
| 18 | -$enable_recaptcha = ! empty( $recaptcha_key ) && ! empty( $recaptcha_secret ) ? true : false; |
|
| 16 | +$recaptcha_key = give_get_option('recaptcha_key'); |
|
| 17 | +$recaptcha_secret = give_get_option('recaptcha_secret'); |
|
| 18 | +$enable_recaptcha = ! empty($recaptcha_key) && ! empty($recaptcha_secret) ? true : false; |
|
| 19 | 19 | |
| 20 | 20 | // Email already sent? |
| 21 | -if ( isset( $_POST['email-access-sent'] ) ) { |
|
| 22 | - Give()->notices->print_frontend_notice( __( 'Please check your email and click on the link to access your complete donation history.', 'give' ), true, 'success' ); |
|
| 21 | +if (isset($_POST['email-access-sent'])) { |
|
| 22 | + Give()->notices->print_frontend_notice(__('Please check your email and click on the link to access your complete donation history.', 'give'), true, 'success'); |
|
| 23 | 23 | |
| 24 | 24 | return; |
| 25 | -} elseif ( isset( $_POST['email-access-exhausted'] ) ) { |
|
| 25 | +} elseif (isset($_POST['email-access-exhausted'])) { |
|
| 26 | 26 | |
| 27 | 27 | // Too many emails sent? |
| 28 | 28 | Give()->notices->print_frontend_notice( |
| 29 | 29 | sprintf( |
| 30 | - __( 'Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give' ), |
|
| 31 | - sprintf( _n( '%s minute', '%s minutes', Give()->email_access->verify_throttle / 60, 'give' ), Give()->email_access->verify_throttle / 60 ) |
|
| 30 | + __('Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give'), |
|
| 31 | + sprintf(_n('%s minute', '%s minutes', Give()->email_access->verify_throttle / 60, 'give'), Give()->email_access->verify_throttle / 60) |
|
| 32 | 32 | ), |
| 33 | 33 | true, |
| 34 | 34 | 'error' |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * |
| 44 | 44 | * @since 1.8.17 |
| 45 | 45 | */ |
| 46 | -do_action( 'give_email_access_form_login' ); |
|
| 46 | +do_action('give_email_access_form_login'); |
|
| 47 | 47 | |
| 48 | 48 | // Print any other messages & errors. |
| 49 | 49 | Give()->notices->render_frontend_notices(); |
@@ -51,17 +51,17 @@ discard block |
||
| 51 | 51 | ?> |
| 52 | 52 | <div class="give-form"> |
| 53 | 53 | <form method="post" id="give-email-access-form"> |
| 54 | - <p><?php echo apply_filters( 'give_email_access_welcome_message', __( 'Please verify your email to access your donation history.', 'give' ) ); ?></p> |
|
| 54 | + <p><?php echo apply_filters('give_email_access_welcome_message', __('Please verify your email to access your donation history.', 'give')); ?></p> |
|
| 55 | 55 | |
| 56 | - <label for="give-email"><?php _e( 'Donation Email:', 'give' ); ?></label> |
|
| 56 | + <label for="give-email"><?php _e('Donation Email:', 'give'); ?></label> |
|
| 57 | 57 | <input id="give-email" type="email" name="give_email" value="" |
| 58 | - placeholder="<?php _e( 'Email Address', 'give' ); ?>"/> |
|
| 59 | - <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'give' ); ?>"/> |
|
| 58 | + placeholder="<?php _e('Email Address', 'give'); ?>"/> |
|
| 59 | + <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('give'); ?>"/> |
|
| 60 | 60 | <input type="hidden" name="give_action" value="email_access_form_login"/> |
| 61 | 61 | |
| 62 | 62 | <?php |
| 63 | 63 | // Enable reCAPTCHA? |
| 64 | - if ( $enable_recaptcha ) : |
|
| 64 | + if ($enable_recaptcha) : |
|
| 65 | 65 | ?> |
| 66 | 66 | <script> |
| 67 | 67 | // IP verify for reCAPTCHA. |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | <input type="hidden" name="give_ip" class="give_ip" value=""/> |
| 80 | 80 | <?php endif; ?> |
| 81 | 81 | |
| 82 | - <input type="submit" class="give-submit" value="<?php _e( 'Verify Email', 'give' ); ?>"/> |
|
| 82 | + <input type="submit" class="give-submit" value="<?php _e('Verify Email', 'give'); ?>"/> |
|
| 83 | 83 | </form> |
| 84 | 84 | </div> |
| 85 | 85 | <?php |
@@ -4,56 +4,56 @@ discard block |
||
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | $donations = array(); |
| 7 | -$donation_history_args = Give()->session->get( 'give_donation_history_args' ); |
|
| 7 | +$donation_history_args = Give()->session->get('give_donation_history_args'); |
|
| 8 | 8 | |
| 9 | 9 | // User's Donations. |
| 10 | -if ( is_user_logged_in() ) { |
|
| 11 | - $donations = give_get_users_donations( get_current_user_id(), 20, true, 'any' ); |
|
| 12 | -} elseif ( Give()->email_access->token_exists ) { |
|
| 10 | +if (is_user_logged_in()) { |
|
| 11 | + $donations = give_get_users_donations(get_current_user_id(), 20, true, 'any'); |
|
| 12 | +} elseif (Give()->email_access->token_exists) { |
|
| 13 | 13 | // Email Access Token? |
| 14 | - $donations = give_get_users_donations( 0, 20, true, 'any' ); |
|
| 14 | + $donations = give_get_users_donations(0, 20, true, 'any'); |
|
| 15 | 15 | } elseif ( |
| 16 | 16 | false !== Give()->session->get_session_expiration() || |
| 17 | 17 | true === give_get_history_session() |
| 18 | 18 | ) { |
| 19 | 19 | // Session active? |
| 20 | - $email = Give()->session->get( 'give_email' ); |
|
| 21 | - $donor = Give()->donors->get_donor_by( 'email', $email ); |
|
| 22 | - $donations_count = count( explode( ',', $donor->payment_ids ) ); |
|
| 20 | + $email = Give()->session->get('give_email'); |
|
| 21 | + $donor = Give()->donors->get_donor_by('email', $email); |
|
| 22 | + $donations_count = count(explode(',', $donor->payment_ids)); |
|
| 23 | 23 | |
| 24 | - if( $donations_count > give_get_limit_display_donations() ) { |
|
| 24 | + if ($donations_count > give_get_limit_display_donations()) { |
|
| 25 | 25 | |
| 26 | 26 | // Restrict Security Email Access option, if donation count of a donor is less than or equal to limit. |
| 27 | - if( true !== Give_Cache::get( "give_cache_email_throttle_limit_exhausted_{$donor->id}" ) ) { |
|
| 28 | - add_action( 'give_donation_history_table_end', 'give_donation_history_table_end' ); |
|
| 27 | + if (true !== Give_Cache::get("give_cache_email_throttle_limit_exhausted_{$donor->id}")) { |
|
| 28 | + add_action('give_donation_history_table_end', 'give_donation_history_table_end'); |
|
| 29 | 29 | } else { |
| 30 | 30 | $value = Give()->email_access->verify_throttle / 60; |
| 31 | 31 | |
| 32 | - give_set_error( 'give-limited-throttle', sprintf( |
|
| 33 | - __( 'Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give' ), |
|
| 34 | - sprintf( _n( '%s minute', '%s minutes', $value, 'give' ), $value ) |
|
| 35 | - ) ); |
|
| 32 | + give_set_error('give-limited-throttle', sprintf( |
|
| 33 | + __('Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give'), |
|
| 34 | + sprintf(_n('%s minute', '%s minutes', $value, 'give'), $value) |
|
| 35 | + )); |
|
| 36 | 36 | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - $donations = give_get_users_donations( $email, give_get_limit_display_donations(), true, 'any' ); |
|
| 39 | + $donations = give_get_users_donations($email, give_get_limit_display_donations(), true, 'any'); |
|
| 40 | 40 | } else { |
| 41 | - $donations = give_get_users_donations( $email, 20, true, 'any' ); |
|
| 41 | + $donations = give_get_users_donations($email, 20, true, 'any'); |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | -Give()->notices->render_frontend_notices( 0 ); |
|
| 45 | +Give()->notices->render_frontend_notices(0); |
|
| 46 | 46 | |
| 47 | -if ( $donations ) : ?> |
|
| 47 | +if ($donations) : ?> |
|
| 48 | 48 | <?php |
| 49 | 49 | $table_headings = array( |
| 50 | - 'id' => __( 'ID', 'give' ), |
|
| 51 | - 'date' => __( 'Date', 'give' ), |
|
| 52 | - 'donor' => __( 'Donor', 'give' ), |
|
| 53 | - 'amount' => __( 'Amount', 'give' ), |
|
| 54 | - 'status' => __( 'Status', 'give' ), |
|
| 55 | - 'payment_method' => __( 'Payment Method', 'give' ), |
|
| 56 | - 'details' => __( 'Details', 'give' ), |
|
| 50 | + 'id' => __('ID', 'give'), |
|
| 51 | + 'date' => __('Date', 'give'), |
|
| 52 | + 'donor' => __('Donor', 'give'), |
|
| 53 | + 'amount' => __('Amount', 'give'), |
|
| 54 | + 'status' => __('Status', 'give'), |
|
| 55 | + 'payment_method' => __('Payment Method', 'give'), |
|
| 56 | + 'details' => __('Details', 'give'), |
|
| 57 | 57 | ); |
| 58 | 58 | ?> |
| 59 | 59 | <div class="give_user_history_main" > |
@@ -69,14 +69,14 @@ discard block |
||
| 69 | 69 | * |
| 70 | 70 | * @since 1.7 |
| 71 | 71 | */ |
| 72 | - do_action( 'give_donation_history_header_before' ); |
|
| 72 | + do_action('give_donation_history_header_before'); |
|
| 73 | 73 | |
| 74 | - foreach ( $donation_history_args as $index => $value ) { |
|
| 75 | - if ( filter_var( $donation_history_args[ $index ], FILTER_VALIDATE_BOOLEAN ) ) : |
|
| 74 | + foreach ($donation_history_args as $index => $value) { |
|
| 75 | + if (filter_var($donation_history_args[$index], FILTER_VALIDATE_BOOLEAN)) : |
|
| 76 | 76 | echo sprintf( |
| 77 | 77 | '<th scope="col" class="give-donation-%1$s>">%2$s</th>', |
| 78 | 78 | $index, |
| 79 | - $table_headings[ $index ] |
|
| 79 | + $table_headings[$index] |
|
| 80 | 80 | ); |
| 81 | 81 | endif; |
| 82 | 82 | } |
@@ -88,13 +88,13 @@ discard block |
||
| 88 | 88 | * |
| 89 | 89 | * @since 1.7 |
| 90 | 90 | */ |
| 91 | - do_action( 'give_donation_history_header_after' ); |
|
| 91 | + do_action('give_donation_history_header_after'); |
|
| 92 | 92 | ?> |
| 93 | 93 | </tr> |
| 94 | 94 | </thead> |
| 95 | - <?php foreach ( $donations as $post ) : |
|
| 96 | - setup_postdata( $post ); |
|
| 97 | - $donation_data = give_get_payment_meta( $post->ID ); ?> |
|
| 95 | + <?php foreach ($donations as $post) : |
|
| 96 | + setup_postdata($post); |
|
| 97 | + $donation_data = give_get_payment_meta($post->ID); ?> |
|
| 98 | 98 | <tr class="give-donation-row"> |
| 99 | 99 | <?php |
| 100 | 100 | /** |
@@ -107,36 +107,36 @@ discard block |
||
| 107 | 107 | * @param int $post_id The ID of the post. |
| 108 | 108 | * @param mixed $donation_data Payment meta data. |
| 109 | 109 | */ |
| 110 | - do_action( 'give_donation_history_row_start', $post->ID, $donation_data ); |
|
| 110 | + do_action('give_donation_history_row_start', $post->ID, $donation_data); |
|
| 111 | 111 | |
| 112 | - if ( filter_var( $donation_history_args['id'], FILTER_VALIDATE_BOOLEAN ) ) : |
|
| 112 | + if (filter_var($donation_history_args['id'], FILTER_VALIDATE_BOOLEAN)) : |
|
| 113 | 113 | echo sprintf( |
| 114 | 114 | '<td class="give-donation-id">#%1$s</td>', |
| 115 | - give_get_payment_number( $post->ID ) |
|
| 115 | + give_get_payment_number($post->ID) |
|
| 116 | 116 | ); |
| 117 | 117 | endif; |
| 118 | 118 | |
| 119 | - if ( filter_var( $donation_history_args['date'], FILTER_VALIDATE_BOOLEAN ) ) : |
|
| 119 | + if (filter_var($donation_history_args['date'], FILTER_VALIDATE_BOOLEAN)) : |
|
| 120 | 120 | echo sprintf( |
| 121 | 121 | '<td class="give-donation-date">%1$s</td>', |
| 122 | - date_i18n( give_date_format(), strtotime( get_post_field( 'post_date', $post->ID ) ) ) |
|
| 122 | + date_i18n(give_date_format(), strtotime(get_post_field('post_date', $post->ID))) |
|
| 123 | 123 | ); |
| 124 | 124 | endif; |
| 125 | 125 | |
| 126 | - if ( filter_var( $donation_history_args['donor'], FILTER_VALIDATE_BOOLEAN ) ) : |
|
| 126 | + if (filter_var($donation_history_args['donor'], FILTER_VALIDATE_BOOLEAN)) : |
|
| 127 | 127 | echo sprintf( |
| 128 | 128 | '<td class="give-donation-donor">%1$s</td>', |
| 129 | - give_get_donor_name_by( $post->ID ) |
|
| 129 | + give_get_donor_name_by($post->ID) |
|
| 130 | 130 | ); |
| 131 | 131 | endif; |
| 132 | 132 | ?> |
| 133 | 133 | |
| 134 | - <?php if ( filter_var( $donation_history_args['amount'], FILTER_VALIDATE_BOOLEAN ) ) : ?> |
|
| 134 | + <?php if (filter_var($donation_history_args['amount'], FILTER_VALIDATE_BOOLEAN)) : ?> |
|
| 135 | 135 | <td class="give-donation-amount"> |
| 136 | 136 | <span class="give-donation-amount"> |
| 137 | 137 | <?php |
| 138 | - $currency_code = give_get_payment_currency_code( $post->ID ); |
|
| 139 | - $donation_amount = give_donation_amount( $post->ID, true ); |
|
| 138 | + $currency_code = give_get_payment_currency_code($post->ID); |
|
| 139 | + $donation_amount = give_donation_amount($post->ID, true); |
|
| 140 | 140 | |
| 141 | 141 | /** |
| 142 | 142 | * Filters the donation amount on Donation History Page. |
@@ -148,42 +148,42 @@ discard block |
||
| 148 | 148 | * |
| 149 | 149 | * @return int |
| 150 | 150 | */ |
| 151 | - echo apply_filters( 'give_donation_history_row_amount', $donation_amount, $post->ID ); |
|
| 151 | + echo apply_filters('give_donation_history_row_amount', $donation_amount, $post->ID); |
|
| 152 | 152 | ?> |
| 153 | 153 | </span> |
| 154 | 154 | </td> |
| 155 | 155 | <?php endif; ?> |
| 156 | 156 | |
| 157 | 157 | <?php |
| 158 | - if ( filter_var( $donation_history_args['status'], FILTER_VALIDATE_BOOLEAN ) ) : |
|
| 158 | + if (filter_var($donation_history_args['status'], FILTER_VALIDATE_BOOLEAN)) : |
|
| 159 | 159 | echo sprintf( |
| 160 | 160 | '<td class="give-donation-status">%1$s</td>', |
| 161 | - give_get_payment_status( $post, true ) |
|
| 161 | + give_get_payment_status($post, true) |
|
| 162 | 162 | ); |
| 163 | 163 | endif; |
| 164 | 164 | |
| 165 | - if ( filter_var( $donation_history_args['payment_method'], FILTER_VALIDATE_BOOLEAN ) ) : |
|
| 165 | + if (filter_var($donation_history_args['payment_method'], FILTER_VALIDATE_BOOLEAN)) : |
|
| 166 | 166 | echo sprintf( |
| 167 | 167 | '<td class="give-donation-payment-method">%1$s</td>', |
| 168 | - give_get_gateway_checkout_label( give_get_payment_gateway( $post->ID ) ) |
|
| 168 | + give_get_gateway_checkout_label(give_get_payment_gateway($post->ID)) |
|
| 169 | 169 | ); |
| 170 | 170 | endif; |
| 171 | 171 | ?> |
| 172 | 172 | <td class="give-donation-details"> |
| 173 | 173 | <?php |
| 174 | 174 | // Display View Receipt or. |
| 175 | - if ( 'publish' !== $post->post_status && 'subscription' !== $post->post_status ) : |
|
| 175 | + if ('publish' !== $post->post_status && 'subscription' !== $post->post_status) : |
|
| 176 | 176 | echo sprintf( |
| 177 | 177 | '<a href="%1$s"><span class="give-donation-status %2$s">%3$s</span></a>', |
| 178 | 178 | esc_url( |
| 179 | 179 | add_query_arg( |
| 180 | 180 | 'payment_key', |
| 181 | - give_get_payment_key( $post->ID ), |
|
| 181 | + give_get_payment_key($post->ID), |
|
| 182 | 182 | give_get_history_page_uri() |
| 183 | 183 | ) |
| 184 | 184 | ), |
| 185 | 185 | $post->post_status, |
| 186 | - __( 'View', 'give' ) . ' ' . give_get_payment_status( $post, true ) . ' »' |
|
| 186 | + __('View', 'give').' '.give_get_payment_status($post, true).' »' |
|
| 187 | 187 | ); |
| 188 | 188 | |
| 189 | 189 | else : |
@@ -192,11 +192,11 @@ discard block |
||
| 192 | 192 | esc_url( |
| 193 | 193 | add_query_arg( |
| 194 | 194 | 'payment_key', |
| 195 | - give_get_payment_key( $post->ID ), |
|
| 195 | + give_get_payment_key($post->ID), |
|
| 196 | 196 | give_get_history_page_uri() |
| 197 | 197 | ) |
| 198 | 198 | ), |
| 199 | - __( 'View Receipt »', 'give' ) |
|
| 199 | + __('View Receipt »', 'give') |
|
| 200 | 200 | ); |
| 201 | 201 | |
| 202 | 202 | endif; |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | * @param int $post_id The ID of the post. |
| 214 | 214 | * @param mixed $donation_data Payment meta data. |
| 215 | 215 | */ |
| 216 | - do_action( 'give_donation_history_row_end', $post->ID, $donation_data ); |
|
| 216 | + do_action('give_donation_history_row_end', $post->ID, $donation_data); |
|
| 217 | 217 | ?> |
| 218 | 218 | </tr> |
| 219 | 219 | <?php endforeach; ?> |
@@ -226,22 +226,22 @@ discard block |
||
| 226 | 226 | * |
| 227 | 227 | * @since 1.8.17 |
| 228 | 228 | */ |
| 229 | - do_action( 'give_donation_history_table_end' ); |
|
| 229 | + do_action('give_donation_history_table_end'); |
|
| 230 | 230 | ?> |
| 231 | 231 | </table> |
| 232 | 232 | <div id="give-donation-history-pagination" class="give_pagination navigation"> |
| 233 | 233 | <?php |
| 234 | 234 | $big = 999999; |
| 235 | - echo paginate_links( array( |
|
| 236 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
| 235 | + echo paginate_links(array( |
|
| 236 | + 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
|
| 237 | 237 | 'format' => '?paged=%#%', |
| 238 | - 'current' => max( 1, get_query_var( 'paged' ) ), |
|
| 239 | - 'total' => ceil( give_count_donations_of_donor() / 20 ) // 20 items per page |
|
| 240 | - ) ); |
|
| 238 | + 'current' => max(1, get_query_var('paged')), |
|
| 239 | + 'total' => ceil(give_count_donations_of_donor() / 20) // 20 items per page |
|
| 240 | + )); |
|
| 241 | 241 | ?> |
| 242 | 242 | </div> |
| 243 | 243 | </div> |
| 244 | 244 | <?php wp_reset_postdata(); ?> |
| 245 | 245 | <?php else : ?> |
| 246 | - <?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?> |
|
| 246 | + <?php Give()->notices->print_frontend_notice(__('It looks like you haven\'t made any donations.', 'give'), true, 'success'); ?> |
|
| 247 | 247 | <?php endif; |
| 248 | 248 | \ No newline at end of file |
@@ -6,25 +6,25 @@ discard block |
||
| 6 | 6 | global $give_receipt_args, $payment; |
| 7 | 7 | |
| 8 | 8 | // Validation: Ensure $payment var is set. |
| 9 | -if ( empty( $payment ) ) { |
|
| 10 | - $payment = ! empty( $give_receipt_args['id'] ) ? get_post( $give_receipt_args['id'] ) : 0; |
|
| 9 | +if (empty($payment)) { |
|
| 10 | + $payment = ! empty($give_receipt_args['id']) ? get_post($give_receipt_args['id']) : 0; |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | // Double-Validation: Check for $payment global. |
| 14 | -if ( empty( $payment ) ) { |
|
| 15 | - Give()->notices->print_frontend_notice( __( 'The specified receipt ID appears to be invalid.', 'give' ) ); |
|
| 14 | +if (empty($payment)) { |
|
| 15 | + Give()->notices->print_frontend_notice(__('The specified receipt ID appears to be invalid.', 'give')); |
|
| 16 | 16 | |
| 17 | 17 | return; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | $donation_id = $payment->ID; |
| 21 | -$form_id = give_get_payment_meta( $donation_id, '_give_payment_form_id', true ); |
|
| 22 | -$meta = give_get_payment_meta( $donation_id ); |
|
| 23 | -$donation = give_get_donation_form_title( $donation_id ); |
|
| 24 | -$user = give_get_payment_meta_user_info( $donation_id ); |
|
| 25 | -$email = give_get_payment_user_email( $donation_id ); |
|
| 21 | +$form_id = give_get_payment_meta($donation_id, '_give_payment_form_id', true); |
|
| 22 | +$meta = give_get_payment_meta($donation_id); |
|
| 23 | +$donation = give_get_donation_form_title($donation_id); |
|
| 24 | +$user = give_get_payment_meta_user_info($donation_id); |
|
| 25 | +$email = give_get_payment_user_email($donation_id); |
|
| 26 | 26 | $status = $payment->post_status; |
| 27 | -$status_label = give_get_payment_status( $payment, true ); |
|
| 27 | +$status_label = give_get_payment_status($payment, true); |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Generate Donation Receipt Arguments. |
@@ -35,50 +35,50 @@ discard block |
||
| 35 | 35 | * @since 1.8.8 |
| 36 | 36 | */ |
| 37 | 37 | $give_receipt_args['donation_receipt']['donor'] = array( |
| 38 | - 'name' => __( 'Donor', 'give' ), |
|
| 39 | - 'value' => $user['first_name'] . ' ' . $user['last_name'], |
|
| 38 | + 'name' => __('Donor', 'give'), |
|
| 39 | + 'value' => $user['first_name'].' '.$user['last_name'], |
|
| 40 | 40 | 'display' => $give_receipt_args['donor'], |
| 41 | 41 | ); |
| 42 | 42 | |
| 43 | 43 | $give_receipt_args['donation_receipt']['date'] = array( |
| 44 | - 'name' => __( 'Date', 'give' ), |
|
| 45 | - 'value' => date_i18n( give_date_format(), strtotime( $meta['date'] ) ), |
|
| 44 | + 'name' => __('Date', 'give'), |
|
| 45 | + 'value' => date_i18n(give_date_format(), strtotime($meta['date'])), |
|
| 46 | 46 | 'display' => $give_receipt_args['date'], |
| 47 | 47 | ); |
| 48 | 48 | |
| 49 | 49 | $give_receipt_args['donation_receipt']['total_donation'] = array( |
| 50 | - 'name' => __( 'Total Donation', 'give' ), |
|
| 51 | - 'value' => give_donation_amount( $donation_id, array( 'currency' => true, 'amount' => true, 'type' => 'receipt' ) ), |
|
| 50 | + 'name' => __('Total Donation', 'give'), |
|
| 51 | + 'value' => give_donation_amount($donation_id, array('currency' => true, 'amount' => true, 'type' => 'receipt')), |
|
| 52 | 52 | 'display' => $give_receipt_args['price'], |
| 53 | 53 | ); |
| 54 | 54 | |
| 55 | 55 | $give_receipt_args['donation_receipt']['donation'] = array( |
| 56 | - 'name' => __( 'Donation', 'give' ), |
|
| 56 | + 'name' => __('Donation', 'give'), |
|
| 57 | 57 | 'value' => $donation, |
| 58 | 58 | 'display' => true, |
| 59 | 59 | ); |
| 60 | 60 | |
| 61 | 61 | $give_receipt_args['donation_receipt']['donation_status'] = array( |
| 62 | - 'name' => __( 'Donation Status', 'give' ), |
|
| 63 | - 'value' => esc_attr( $status_label ), |
|
| 62 | + 'name' => __('Donation Status', 'give'), |
|
| 63 | + 'value' => esc_attr($status_label), |
|
| 64 | 64 | 'display' => $give_receipt_args['payment_status'], |
| 65 | 65 | ); |
| 66 | 66 | |
| 67 | 67 | $give_receipt_args['donation_receipt']['donation_id'] = array( |
| 68 | - 'name' => __( 'Donation ID', 'give' ), |
|
| 68 | + 'name' => __('Donation ID', 'give'), |
|
| 69 | 69 | 'value' => $donation_id, |
| 70 | 70 | 'display' => $give_receipt_args['payment_id'], |
| 71 | 71 | ); |
| 72 | 72 | |
| 73 | 73 | $give_receipt_args['donation_receipt']['payment_key'] = array( |
| 74 | - 'name' => __( 'Payment Key', 'give' ), |
|
| 75 | - 'value' => get_post_meta( $donation_id, '_give_payment_purchase_key', true ), |
|
| 74 | + 'name' => __('Payment Key', 'give'), |
|
| 75 | + 'value' => get_post_meta($donation_id, '_give_payment_purchase_key', true), |
|
| 76 | 76 | 'display' => $give_receipt_args['payment_key'], |
| 77 | 77 | ); |
| 78 | 78 | |
| 79 | 79 | $give_receipt_args['donation_receipt']['payment_method'] = array( |
| 80 | - 'name' => __( 'Payment Method', 'give' ), |
|
| 81 | - 'value' => give_get_gateway_checkout_label( give_get_payment_gateway( $donation_id ) ), |
|
| 80 | + 'name' => __('Payment Method', 'give'), |
|
| 81 | + 'value' => give_get_gateway_checkout_label(give_get_payment_gateway($donation_id)), |
|
| 82 | 82 | 'display' => $give_receipt_args['payment_method'], |
| 83 | 83 | ); |
| 84 | 84 | |
@@ -93,10 +93,10 @@ discard block |
||
| 93 | 93 | * |
| 94 | 94 | * @since 1.8.8 |
| 95 | 95 | */ |
| 96 | -$give_receipt_args['donation_receipt'] = apply_filters( 'give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id ); |
|
| 96 | +$give_receipt_args['donation_receipt'] = apply_filters('give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id); |
|
| 97 | 97 | |
| 98 | 98 | // When the donation were made through offline donation, We won't show receipt and payment status though. |
| 99 | -if ( 'offline' === give_get_payment_gateway( $payment->ID ) && 'pending' === $status ) { |
|
| 99 | +if ('offline' === give_get_payment_gateway($payment->ID) && 'pending' === $status) { |
|
| 100 | 100 | |
| 101 | 101 | /** |
| 102 | 102 | * Before the offline donation receipt content starts. |
@@ -106,13 +106,13 @@ discard block |
||
| 106 | 106 | * @param Give_Payment $payment Donation payment object. |
| 107 | 107 | * @param array $give_receipt_args Receipt Arguments. |
| 108 | 108 | */ |
| 109 | - do_action( 'give_receipt_before_offline_payment', $payment, $give_receipt_args ); |
|
| 109 | + do_action('give_receipt_before_offline_payment', $payment, $give_receipt_args); |
|
| 110 | 110 | ?> |
| 111 | - <h2><?php echo apply_filters( 'give_receipt_offline_payment_heading', __( 'Your Donation is Almost Complete!', 'give' ) ); ?></h2> |
|
| 112 | - <div id="give_donation_receipt" class="<?php echo esc_attr( apply_filters( 'give_receipt_offline_payment_classes', 'give_receipt_offline_payment' ) ); ?>"> |
|
| 111 | + <h2><?php echo apply_filters('give_receipt_offline_payment_heading', __('Your Donation is Almost Complete!', 'give')); ?></h2> |
|
| 112 | + <div id="give_donation_receipt" class="<?php echo esc_attr(apply_filters('give_receipt_offline_payment_classes', 'give_receipt_offline_payment')); ?>"> |
|
| 113 | 113 | <?php |
| 114 | 114 | // Instruction for offline donation. |
| 115 | - $offline_instruction = give_get_offline_payment_instruction( $form_id, true ); |
|
| 115 | + $offline_instruction = give_get_offline_payment_instruction($form_id, true); |
|
| 116 | 116 | |
| 117 | 117 | /** |
| 118 | 118 | * Instruction for the offline donation. |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | * @param Give_Payment $payment Payment object. |
| 124 | 124 | * @param integer $form_id Donation form id. |
| 125 | 125 | */ |
| 126 | - echo apply_filters( 'give_receipt_offline_payment_instruction', $offline_instruction, $payment, $form_id ); |
|
| 126 | + echo apply_filters('give_receipt_offline_payment_instruction', $offline_instruction, $payment, $form_id); |
|
| 127 | 127 | ?> |
| 128 | 128 | </div> |
| 129 | 129 | <?php |
@@ -135,52 +135,52 @@ discard block |
||
| 135 | 135 | * @param Give_Payment $payment Donation payment object. |
| 136 | 136 | * @param array $give_receipt_args Receipt Arguments. |
| 137 | 137 | */ |
| 138 | - do_action( 'give_receipt_after_offline_payment', $payment, $give_receipt_args ); |
|
| 138 | + do_action('give_receipt_after_offline_payment', $payment, $give_receipt_args); |
|
| 139 | 139 | |
| 140 | 140 | return; |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | // Show payment status notice based on shortcode attribute. |
| 144 | -if ( filter_var( $give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN ) ) { |
|
| 144 | +if (filter_var($give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN)) { |
|
| 145 | 145 | $notice_message = ''; |
| 146 | 146 | $notice_type = 'warning'; |
| 147 | 147 | |
| 148 | - switch ( $status ) { |
|
| 148 | + switch ($status) { |
|
| 149 | 149 | case 'publish': |
| 150 | - $notice_message = __( 'Payment Complete: Thank you for your donation.', 'give' ); |
|
| 150 | + $notice_message = __('Payment Complete: Thank you for your donation.', 'give'); |
|
| 151 | 151 | $notice_type = 'success'; |
| 152 | 152 | break; |
| 153 | 153 | case 'pending': |
| 154 | - $notice_message = __( 'Payment Pending: Your donation is currently processing.', 'give' ); |
|
| 154 | + $notice_message = __('Payment Pending: Your donation is currently processing.', 'give'); |
|
| 155 | 155 | $notice_type = 'warning'; |
| 156 | 156 | break; |
| 157 | 157 | case 'refunded': |
| 158 | - $notice_message = __( 'Payment Refunded: Your donation has been refunded.', 'give' ); |
|
| 158 | + $notice_message = __('Payment Refunded: Your donation has been refunded.', 'give'); |
|
| 159 | 159 | $notice_type = 'warning'; |
| 160 | 160 | break; |
| 161 | 161 | case 'preapproval': |
| 162 | - $notice_message = __( 'Payment Preapproved: Thank you for your donation.', 'give' ); |
|
| 162 | + $notice_message = __('Payment Preapproved: Thank you for your donation.', 'give'); |
|
| 163 | 163 | $notice_type = 'warning'; |
| 164 | 164 | break; |
| 165 | 165 | case 'failed': |
| 166 | - $notice_message = __( 'Payment Failed: Please contact the site owner for assistance.', 'give' ); |
|
| 166 | + $notice_message = __('Payment Failed: Please contact the site owner for assistance.', 'give'); |
|
| 167 | 167 | $notice_type = 'error'; |
| 168 | 168 | break; |
| 169 | 169 | case 'cancelled': |
| 170 | - $notice_message = __( 'Payment Cancelled: Your donation has been cancelled.', 'give' ); |
|
| 170 | + $notice_message = __('Payment Cancelled: Your donation has been cancelled.', 'give'); |
|
| 171 | 171 | $notice_type = 'error'; |
| 172 | 172 | break; |
| 173 | 173 | case 'abandoned': |
| 174 | - $notice_message = __( 'Payment Abandoned: This donation has not been completed.', 'give' ); |
|
| 174 | + $notice_message = __('Payment Abandoned: This donation has not been completed.', 'give'); |
|
| 175 | 175 | $notice_type = 'error'; |
| 176 | 176 | break; |
| 177 | 177 | case 'revoked': |
| 178 | - $notice_message = __( 'Payment Revoked: Please contact the site owner for assistance.', 'give' ); |
|
| 178 | + $notice_message = __('Payment Revoked: Please contact the site owner for assistance.', 'give'); |
|
| 179 | 179 | $notice_type = 'error'; |
| 180 | 180 | break; |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - if ( ! empty( $notice_message ) ) { |
|
| 183 | + if ( ! empty($notice_message)) { |
|
| 184 | 184 | /** |
| 185 | 185 | * Filters payment status notice for receipts. |
| 186 | 186 | * |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | * @param string $status Payment status. |
| 196 | 196 | * @param array $meta Array of meta data related to the payment. |
| 197 | 197 | */ |
| 198 | - echo apply_filters( 'give_receipt_status_notice', Give()->notices->print_frontend_notice( $notice_message, false, $notice_type ), $id, $status, $meta ); |
|
| 198 | + echo apply_filters('give_receipt_status_notice', Give()->notices->print_frontend_notice($notice_message, false, $notice_type), $id, $status, $meta); |
|
| 199 | 199 | } |
| 200 | 200 | }// End if(). |
| 201 | 201 | |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | * @param object $payment The payment object. |
| 210 | 210 | * @param array $give_receipt_args Receipt_argument. |
| 211 | 211 | */ |
| 212 | -do_action( 'give_payment_receipt_before_table', $payment, $give_receipt_args ); |
|
| 212 | +do_action('give_payment_receipt_before_table', $payment, $give_receipt_args); |
|
| 213 | 213 | ?> |
| 214 | 214 | |
| 215 | 215 | <table id="give_donation_receipt" class="give-table"> |
@@ -225,11 +225,11 @@ discard block |
||
| 225 | 225 | * @param object $payment The payment object. |
| 226 | 226 | * @param array $give_receipt_args Receipt_argument. |
| 227 | 227 | */ |
| 228 | - do_action( 'give_payment_receipt_header_before', $payment, $give_receipt_args ); |
|
| 228 | + do_action('give_payment_receipt_header_before', $payment, $give_receipt_args); |
|
| 229 | 229 | ?> |
| 230 | 230 | <tr> |
| 231 | 231 | <th scope="colgroup" colspan="2"> |
| 232 | - <span class="give-receipt-thead-text"><?php esc_html_e( 'Donation Receipt', 'give' ) ?></span> |
|
| 232 | + <span class="give-receipt-thead-text"><?php esc_html_e('Donation Receipt', 'give') ?></span> |
|
| 233 | 233 | </th> |
| 234 | 234 | </tr> |
| 235 | 235 | <?php |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | * @param object $payment The payment object. |
| 244 | 244 | * @param array $give_receipt_args Receipt_argument. |
| 245 | 245 | */ |
| 246 | - do_action( 'give_payment_receipt_header_after', $payment, $give_receipt_args ); |
|
| 246 | + do_action('give_payment_receipt_header_after', $payment, $give_receipt_args); |
|
| 247 | 247 | ?> |
| 248 | 248 | </thead> |
| 249 | 249 | |
@@ -259,11 +259,11 @@ discard block |
||
| 259 | 259 | * @param object $payment The payment object. |
| 260 | 260 | * @param array $give_receipt_args Receipt_argument. |
| 261 | 261 | */ |
| 262 | - do_action( 'give_payment_receipt_before', $payment, $give_receipt_args ); |
|
| 262 | + do_action('give_payment_receipt_before', $payment, $give_receipt_args); |
|
| 263 | 263 | ?> |
| 264 | 264 | |
| 265 | - <?php foreach ( $give_receipt_args['donation_receipt'] as $receipt_item ) { ?> |
|
| 266 | - <?php if ( filter_var( $receipt_item['display'], FILTER_VALIDATE_BOOLEAN ) ) : ?> |
|
| 265 | + <?php foreach ($give_receipt_args['donation_receipt'] as $receipt_item) { ?> |
|
| 266 | + <?php if (filter_var($receipt_item['display'], FILTER_VALIDATE_BOOLEAN)) : ?> |
|
| 267 | 267 | <tr> |
| 268 | 268 | <td scope="row"><strong><?php echo $receipt_item['name']; ?></strong></td> |
| 269 | 269 | <td><?php echo $receipt_item['value']; ?></td> |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | * @param object $payment The payment object. |
| 283 | 283 | * @param array $give_receipt_args Receipt_argument. |
| 284 | 284 | */ |
| 285 | - do_action( 'give_payment_receipt_after', $payment, $give_receipt_args ); |
|
| 285 | + do_action('give_payment_receipt_after', $payment, $give_receipt_args); |
|
| 286 | 286 | ?> |
| 287 | 287 | </tbody> |
| 288 | 288 | </table> |
@@ -298,5 +298,5 @@ discard block |
||
| 298 | 298 | * @param object $payment The payment object. |
| 299 | 299 | * @param array $give_receipt_args Receipt_argument. |
| 300 | 300 | */ |
| 301 | -do_action( 'give_payment_receipt_after_table', $payment, $give_receipt_args ); |
|
| 301 | +do_action('give_payment_receipt_after_table', $payment, $give_receipt_args); |
|
| 302 | 302 | ?> |
@@ -10,61 +10,61 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly. |
| 13 | -if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
|
| 13 | +if ( ! defined('WP_UNINSTALL_PLUGIN')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | // Load Give file. |
| 18 | -include_once( 'give.php' ); |
|
| 18 | +include_once('give.php'); |
|
| 19 | 19 | |
| 20 | 20 | global $wpdb, $wp_roles; |
| 21 | 21 | |
| 22 | 22 | |
| 23 | -if ( give_is_setting_enabled( give_get_option( 'uninstall_on_delete' ) ) ) { |
|
| 23 | +if (give_is_setting_enabled(give_get_option('uninstall_on_delete'))) { |
|
| 24 | 24 | |
| 25 | 25 | // Delete All the Custom Post Types. |
| 26 | - $give_taxonomies = array( 'form_category', 'form_tag' ); |
|
| 27 | - $give_post_types = array( 'give_forms', 'give_payment' ); |
|
| 28 | - foreach ( $give_post_types as $post_type ) { |
|
| 26 | + $give_taxonomies = array('form_category', 'form_tag'); |
|
| 27 | + $give_post_types = array('give_forms', 'give_payment'); |
|
| 28 | + foreach ($give_post_types as $post_type) { |
|
| 29 | 29 | |
| 30 | - $give_taxonomies = array_merge( $give_taxonomies, get_object_taxonomies( $post_type ) ); |
|
| 31 | - $items = get_posts( array( |
|
| 30 | + $give_taxonomies = array_merge($give_taxonomies, get_object_taxonomies($post_type)); |
|
| 31 | + $items = get_posts(array( |
|
| 32 | 32 | 'post_type' => $post_type, |
| 33 | 33 | 'post_status' => 'any', |
| 34 | - 'numberposts' => - 1, |
|
| 34 | + 'numberposts' => -1, |
|
| 35 | 35 | 'fields' => 'ids', |
| 36 | - ) ); |
|
| 36 | + )); |
|
| 37 | 37 | |
| 38 | - if ( $items ) { |
|
| 39 | - foreach ( $items as $item ) { |
|
| 40 | - wp_delete_post( $item, true ); |
|
| 38 | + if ($items) { |
|
| 39 | + foreach ($items as $item) { |
|
| 40 | + wp_delete_post($item, true); |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // Delete All the Terms & Taxonomies. |
| 46 | - foreach ( array_unique( array_filter( $give_taxonomies ) ) as $taxonomy ) { |
|
| 46 | + foreach (array_unique(array_filter($give_taxonomies)) as $taxonomy) { |
|
| 47 | 47 | |
| 48 | - $terms = $wpdb->get_results( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('%s') ORDER BY t.name ASC", $taxonomy ) ); |
|
| 48 | + $terms = $wpdb->get_results($wpdb->prepare("SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('%s') ORDER BY t.name ASC", $taxonomy)); |
|
| 49 | 49 | |
| 50 | 50 | // Delete Terms. |
| 51 | - if ( $terms ) { |
|
| 52 | - foreach ( $terms as $term ) { |
|
| 53 | - $wpdb->delete( $wpdb->term_taxonomy, array( 'term_taxonomy_id' => $term->term_taxonomy_id ) ); |
|
| 54 | - $wpdb->delete( $wpdb->terms, array( 'term_id' => $term->term_id ) ); |
|
| 51 | + if ($terms) { |
|
| 52 | + foreach ($terms as $term) { |
|
| 53 | + $wpdb->delete($wpdb->term_taxonomy, array('term_taxonomy_id' => $term->term_taxonomy_id)); |
|
| 54 | + $wpdb->delete($wpdb->terms, array('term_id' => $term->term_id)); |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | // Delete Taxonomies. |
| 59 | - $wpdb->delete( $wpdb->term_taxonomy, array( 'taxonomy' => $taxonomy ), array( '%s' ) ); |
|
| 59 | + $wpdb->delete($wpdb->term_taxonomy, array('taxonomy' => $taxonomy), array('%s')); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | // Delete the Plugin Pages. |
| 63 | - $give_created_pages = array( 'success_page', 'failure_page', 'history_page' ); |
|
| 64 | - foreach ( $give_created_pages as $p ) { |
|
| 65 | - $page = give_get_option( $p, false ); |
|
| 66 | - if ( $page ) { |
|
| 67 | - wp_delete_post( $page, true ); |
|
| 63 | + $give_created_pages = array('success_page', 'failure_page', 'history_page'); |
|
| 64 | + foreach ($give_created_pages as $p) { |
|
| 65 | + $page = give_get_option($p, false); |
|
| 66 | + if ($page) { |
|
| 67 | + wp_delete_post($page, true); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
@@ -73,26 +73,26 @@ discard block |
||
| 73 | 73 | Give()->roles->remove_caps(); |
| 74 | 74 | |
| 75 | 75 | // Delete the Roles. |
| 76 | - $give_roles = array( 'give_manager', 'give_accountant', 'give_worker', 'give_donor' ); |
|
| 77 | - foreach ( $give_roles as $role ) { |
|
| 78 | - remove_role( $role ); |
|
| 76 | + $give_roles = array('give_manager', 'give_accountant', 'give_worker', 'give_donor'); |
|
| 77 | + foreach ($give_roles as $role) { |
|
| 78 | + remove_role($role); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | // Remove all database tables. |
| 82 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_donors' ); |
|
| 83 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_donormeta' ); |
|
| 84 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_customers' ); |
|
| 85 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_customermeta' ); |
|
| 86 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_paymentmeta' ); |
|
| 87 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_formmeta' ); |
|
| 88 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_logs' ); |
|
| 89 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_logmeta' ); |
|
| 82 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_donors'); |
|
| 83 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_donormeta'); |
|
| 84 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_customers'); |
|
| 85 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_customermeta'); |
|
| 86 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_paymentmeta'); |
|
| 87 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_formmeta'); |
|
| 88 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_logs'); |
|
| 89 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_logmeta'); |
|
| 90 | 90 | |
| 91 | 91 | // Cleanup Cron Events. |
| 92 | - wp_clear_scheduled_hook( 'give_daily_scheduled_events' ); |
|
| 93 | - wp_clear_scheduled_hook( 'give_weekly_scheduled_events' ); |
|
| 94 | - wp_clear_scheduled_hook( 'give_daily_cron' ); |
|
| 95 | - wp_clear_scheduled_hook( 'give_weekly_cron' ); |
|
| 92 | + wp_clear_scheduled_hook('give_daily_scheduled_events'); |
|
| 93 | + wp_clear_scheduled_hook('give_weekly_scheduled_events'); |
|
| 94 | + wp_clear_scheduled_hook('give_daily_cron'); |
|
| 95 | + wp_clear_scheduled_hook('give_weekly_cron'); |
|
| 96 | 96 | |
| 97 | 97 | // Get all options. |
| 98 | 98 | $give_option_names = $wpdb->get_col( |
@@ -102,16 +102,16 @@ discard block |
||
| 102 | 102 | ) |
| 103 | 103 | ); |
| 104 | 104 | |
| 105 | - if ( ! empty( $give_option_names ) ) { |
|
| 105 | + if ( ! empty($give_option_names)) { |
|
| 106 | 106 | // Convert option name to transient or option name. |
| 107 | 107 | $new_give_option_names = array(); |
| 108 | 108 | |
| 109 | 109 | // Delete all the Plugin Options. |
| 110 | - foreach ( $give_option_names as $option ) { |
|
| 111 | - if ( false !== strpos( $option, 'give_cache' ) ) { |
|
| 112 | - Give_Cache::delete( $option ); |
|
| 110 | + foreach ($give_option_names as $option) { |
|
| 111 | + if (false !== strpos($option, 'give_cache')) { |
|
| 112 | + Give_Cache::delete($option); |
|
| 113 | 113 | } else { |
| 114 | - delete_option( $option ); |
|
| 114 | + delete_option($option); |
|
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | } |