@@ -9,13 +9,13 @@ discard block |
||
| 9 | 9 | * @since 1.0 |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -if ( ! defined( 'ABSPATH' ) ) {
|
|
| 12 | +if ( ! defined('ABSPATH')) {
|
|
| 13 | 13 | exit; // Exit if accessed directly. |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | -$template = get_option( 'template' ); |
|
| 16 | +$template = get_option('template');
|
|
| 17 | 17 | |
| 18 | -switch ( $template ) {
|
|
| 18 | +switch ($template) {
|
|
| 19 | 19 | case 'twentyeleven' : |
| 20 | 20 | echo '</div></div>'; |
| 21 | 21 | break; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | break; |
| 28 | 28 | case 'twentyfourteen' : |
| 29 | 29 | echo '</div></div></div>'; |
| 30 | - get_sidebar( 'content' ); |
|
| 30 | + get_sidebar('content');
|
|
| 31 | 31 | break; |
| 32 | 32 | case 'twentyfifteen' : |
| 33 | 33 | echo '</div></div>'; |
@@ -57,6 +57,6 @@ discard block |
||
| 57 | 57 | echo '</div>'; |
| 58 | 58 | break; |
| 59 | 59 | default : |
| 60 | - echo apply_filters( 'give_default_wrapper_end', '</div></div>' ); |
|
| 60 | + echo apply_filters('give_default_wrapper_end', '</div></div>');
|
|
| 61 | 61 | break; |
| 62 | 62 | } |
| 63 | 63 | \ No newline at end of file |
@@ -2,13 +2,13 @@ discard block |
||
| 2 | 2 | /** |
| 3 | 3 | * This template is used to display the login form with [give_login] |
| 4 | 4 | */ |
| 5 | -if ( ! is_user_logged_in() ) { |
|
| 5 | +if ( ! is_user_logged_in()) { |
|
| 6 | 6 | |
| 7 | 7 | // Show any error messages after form submission |
| 8 | - Give()->notices->render_frontend_notices( 0 ); ?> |
|
| 8 | + Give()->notices->render_frontend_notices(0); ?> |
|
| 9 | 9 | <form id="give-login-form" class="give-form" action="" method="post"> |
| 10 | 10 | <fieldset> |
| 11 | - <legend><?php esc_html_e( 'Log into Your Account', 'give' ); ?></legend> |
|
| 11 | + <legend><?php esc_html_e('Log into Your Account', 'give'); ?></legend> |
|
| 12 | 12 | <?php |
| 13 | 13 | /** |
| 14 | 14 | * Fires in the login shortcode, before the login fields. |
@@ -17,27 +17,27 @@ discard block |
||
| 17 | 17 | * |
| 18 | 18 | * @since 1.0 |
| 19 | 19 | */ |
| 20 | - do_action( 'give_login_fields_before' ); |
|
| 20 | + do_action('give_login_fields_before'); |
|
| 21 | 21 | ?> |
| 22 | 22 | <div class="give-login-username give-login"> |
| 23 | - <label for="give_user_login"><?php esc_html_e( 'Username', 'give' ); ?></label> |
|
| 23 | + <label for="give_user_login"><?php esc_html_e('Username', 'give'); ?></label> |
|
| 24 | 24 | <input name="give_user_login" id="give_user_login" class="give-required give-input" type="text" required aria-required="true" /> |
| 25 | 25 | </div> |
| 26 | 26 | |
| 27 | 27 | <div class="give-login-password give-login"> |
| 28 | - <label for="give_user_pass"><?php esc_html_e( 'Password', 'give' ); ?></label> |
|
| 28 | + <label for="give_user_pass"><?php esc_html_e('Password', 'give'); ?></label> |
|
| 29 | 29 | <input name="give_user_pass" id="give_user_pass" class="give-password give-required give-input" type="password" required aria-required="true" /> |
| 30 | 30 | </div> |
| 31 | 31 | |
| 32 | 32 | <div class="give-login-submit give-login"> |
| 33 | - <input type="hidden" name="give_login_redirect" value="<?php echo esc_url( $give_login_redirect ); ?>" /> |
|
| 34 | - <input type="hidden" name="give_login_nonce" value="<?php echo wp_create_nonce( 'give-login-nonce' ); ?>" /> |
|
| 33 | + <input type="hidden" name="give_login_redirect" value="<?php echo esc_url($give_login_redirect); ?>" /> |
|
| 34 | + <input type="hidden" name="give_login_nonce" value="<?php echo wp_create_nonce('give-login-nonce'); ?>" /> |
|
| 35 | 35 | <input type="hidden" name="give_action" value="user_login" /> |
| 36 | - <input id="give_login_submit" type="submit" class="give_submit" value="<?php esc_attr_e( 'Log In', 'give' ); ?>" /> |
|
| 36 | + <input id="give_login_submit" type="submit" class="give_submit" value="<?php esc_attr_e('Log In', 'give'); ?>" /> |
|
| 37 | 37 | </div> |
| 38 | 38 | |
| 39 | 39 | <div class="give-lost-password give-login"> |
| 40 | - <a href="<?php echo wp_lostpassword_url(); ?>"><?php esc_html_e( 'Reset Password', 'give' ); ?></a> |
|
| 40 | + <a href="<?php echo wp_lostpassword_url(); ?>"><?php esc_html_e('Reset Password', 'give'); ?></a> |
|
| 41 | 41 | </div> |
| 42 | 42 | <?php |
| 43 | 43 | /** |
@@ -47,12 +47,12 @@ discard block |
||
| 47 | 47 | * |
| 48 | 48 | * @since 1.0 |
| 49 | 49 | */ |
| 50 | - do_action( 'give_login_fields_after' ); |
|
| 50 | + do_action('give_login_fields_after'); |
|
| 51 | 51 | ?> |
| 52 | 52 | </fieldset> |
| 53 | 53 | </form> |
| 54 | -<?php } elseif( isset( $_GET['give-login-success'] ) && $_GET['give-login-success'] == true ) { ?> |
|
| 55 | - <?php Give()->notices->print_frontend_notice( apply_filters('give_successful_login_message', esc_html__( 'Login successful. Welcome!', 'give' )), true, 'success' ); ?> |
|
| 54 | +<?php } elseif (isset($_GET['give-login-success']) && $_GET['give-login-success'] == true) { ?> |
|
| 55 | + <?php Give()->notices->print_frontend_notice(apply_filters('give_successful_login_message', esc_html__('Login successful. Welcome!', 'give')), true, 'success'); ?> |
|
| 56 | 56 | <?php } else { ?> |
| 57 | - <?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' ); ?> |
|
| 57 | + <?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'); ?> |
|
| 58 | 58 | <?php } ?> |
| 59 | 59 | \ No newline at end of file |
@@ -3,24 +3,24 @@ discard block |
||
| 3 | 3 | * This template is used to display the goal with [give_goal] |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -$form = new Give_Donate_Form( $form_id ); |
|
| 7 | -$goal_option = give_get_meta( $form->ID, '_give_goal_option', true ); |
|
| 6 | +$form = new Give_Donate_Form($form_id); |
|
| 7 | +$goal_option = give_get_meta($form->ID, '_give_goal_option', true); |
|
| 8 | 8 | |
| 9 | 9 | //Sanity check - ensure form has pass all condition to show goal. |
| 10 | 10 | if ( |
| 11 | - ( isset( $args['show_goal'] ) && ! filter_var( $args['show_goal'], FILTER_VALIDATE_BOOLEAN ) ) |
|
| 12 | - || empty( $form->ID ) |
|
| 13 | - || ( is_singular( 'give_forms' ) && ! give_is_setting_enabled( $goal_option ) ) |
|
| 14 | - || ! give_is_setting_enabled( $goal_option ) |
|
| 11 | + (isset($args['show_goal']) && ! filter_var($args['show_goal'], FILTER_VALIDATE_BOOLEAN)) |
|
| 12 | + || empty($form->ID) |
|
| 13 | + || (is_singular('give_forms') && ! give_is_setting_enabled($goal_option)) |
|
| 14 | + || ! give_is_setting_enabled($goal_option) |
|
| 15 | 15 | || 0 === $form->goal |
| 16 | 16 | ) { |
| 17 | 17 | return false; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | -$goal_format = give_get_meta( $form_id, '_give_goal_format', true ); |
|
| 21 | -$color = give_get_meta( $form_id, '_give_goal_color', true ); |
|
| 22 | -$show_text = isset( $args['show_text'] ) ? filter_var( $args['show_text'], FILTER_VALIDATE_BOOLEAN ) : true; |
|
| 23 | -$show_bar = isset( $args['show_bar'] ) ? filter_var( $args['show_bar'], FILTER_VALIDATE_BOOLEAN ) : true; |
|
| 20 | +$goal_format = give_get_meta($form_id, '_give_goal_format', true); |
|
| 21 | +$color = give_get_meta($form_id, '_give_goal_color', true); |
|
| 22 | +$show_text = isset($args['show_text']) ? filter_var($args['show_text'], FILTER_VALIDATE_BOOLEAN) : true; |
|
| 23 | +$show_bar = isset($args['show_bar']) ? filter_var($args['show_bar'], FILTER_VALIDATE_BOOLEAN) : true; |
|
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -28,14 +28,14 @@ discard block |
||
| 28 | 28 | * |
| 29 | 29 | * @since 1.8.8 |
| 30 | 30 | */ |
| 31 | -$income = apply_filters( 'give_goal_amount_raised_output', $form->get_earnings(), $form_id, $form ); |
|
| 31 | +$income = apply_filters('give_goal_amount_raised_output', $form->get_earnings(), $form_id, $form); |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Filter the form |
| 35 | 35 | * |
| 36 | 36 | * @since 1.8.8 |
| 37 | 37 | */ |
| 38 | -$goal = apply_filters( 'give_goal_amount_target_output', $form->goal, $form_id, $form ); |
|
| 38 | +$goal = apply_filters('give_goal_amount_target_output', $form->goal, $form_id, $form); |
|
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -43,39 +43,39 @@ discard block |
||
| 43 | 43 | * |
| 44 | 44 | * @since 1.8.8 |
| 45 | 45 | */ |
| 46 | -$progress = apply_filters( 'give_goal_amount_funded_percentage_output', round( ( $income / $goal ) * 100, 2 ), $form_id, $form ); |
|
| 46 | +$progress = apply_filters('give_goal_amount_funded_percentage_output', round(($income / $goal) * 100, 2), $form_id, $form); |
|
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | // Set progress to 100 percentage if income > goal. |
| 50 | -if ( $income >= $goal ) { |
|
| 50 | +if ($income >= $goal) { |
|
| 51 | 51 | $progress = 100; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | ?> |
| 55 | 55 | <div class="give-goal-progress"> |
| 56 | - <?php if ( ! empty( $show_text ) ) : ?> |
|
| 56 | + <?php if ( ! empty($show_text)) : ?> |
|
| 57 | 57 | <div class="raised"> |
| 58 | 58 | <?php |
| 59 | - if ( $goal_format !== 'percentage' ) : |
|
| 59 | + if ($goal_format !== 'percentage') : |
|
| 60 | 60 | |
| 61 | 61 | // Get formatted amount. |
| 62 | - $income = give_human_format_large_amount( give_format_amount( $income, array( 'sanitize' => false ) ) ); |
|
| 63 | - $goal = give_human_format_large_amount( give_format_amount( $goal, array( 'sanitize' => false ) ) ); |
|
| 62 | + $income = give_human_format_large_amount(give_format_amount($income, array('sanitize' => false))); |
|
| 63 | + $goal = give_human_format_large_amount(give_format_amount($goal, array('sanitize' => false))); |
|
| 64 | 64 | |
| 65 | 65 | echo sprintf( |
| 66 | 66 | /* translators: 1: amount of income raised 2: goal target ammount */ |
| 67 | - __( '%1$s of %2$s raised', 'give' ), |
|
| 68 | - '<span class="income">' . give_currency_filter( $income ) . '</span>', |
|
| 69 | - '<span class="goal-text">' . give_currency_filter( $goal ) . '</span>' |
|
| 67 | + __('%1$s of %2$s raised', 'give'), |
|
| 68 | + '<span class="income">'.give_currency_filter($income).'</span>', |
|
| 69 | + '<span class="goal-text">'.give_currency_filter($goal).'</span>' |
|
| 70 | 70 | ); |
| 71 | 71 | |
| 72 | 72 | |
| 73 | - elseif ( $goal_format == 'percentage' ) : |
|
| 73 | + elseif ($goal_format == 'percentage') : |
|
| 74 | 74 | |
| 75 | 75 | echo sprintf( |
| 76 | 76 | /* translators: %s: percentage of the amount raised compared to the goal target */ |
| 77 | - __( '%s%% funded', 'give' ), |
|
| 78 | - '<span class="give-percentage">' . round( $progress ) . '</span>' |
|
| 77 | + __('%s%% funded', 'give'), |
|
| 78 | + '<span class="give-percentage">'.round($progress).'</span>' |
|
| 79 | 79 | ); |
| 80 | 80 | |
| 81 | 81 | endif; |
@@ -84,10 +84,10 @@ discard block |
||
| 84 | 84 | <?php endif; ?> |
| 85 | 85 | |
| 86 | 86 | |
| 87 | - <?php if ( ! empty( $show_bar ) ) : ?> |
|
| 88 | - <div class="give-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="<?php echo esc_attr( $progress ); ?>"> |
|
| 89 | - <span style="width: <?php echo esc_attr( $progress ); ?>%;<?php if ( ! empty( $color ) ) { |
|
| 90 | - echo 'background-color:' . $color; |
|
| 87 | + <?php if ( ! empty($show_bar)) : ?> |
|
| 88 | + <div class="give-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="<?php echo esc_attr($progress); ?>"> |
|
| 89 | + <span style="width: <?php echo esc_attr($progress); ?>%;<?php if ( ! empty($color)) { |
|
| 90 | + echo 'background-color:'.$color; |
|
| 91 | 91 | } ?>"></span> |
| 92 | 92 | </div><!-- /.give-progress-bar --> |
| 93 | 93 | <?php endif; ?> |
@@ -6,18 +6,18 @@ discard block |
||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | $show_form = true; |
| 9 | -$email = isset( $_POST['give_email'] ) ? $_POST['give_email'] : ''; |
|
| 9 | +$email = isset($_POST['give_email']) ? $_POST['give_email'] : ''; |
|
| 10 | 10 | |
| 11 | 11 | // reCAPTCHA |
| 12 | -$recaptcha_key = give_get_option( 'recaptcha_key' ); |
|
| 13 | -$recaptcha_secret = give_get_option( 'recaptcha_secret' ); |
|
| 14 | -$enable_recaptcha = ( ! empty( $recaptcha_key ) && ! empty( $recaptcha_secret ) ) ? true : false; |
|
| 12 | +$recaptcha_key = give_get_option('recaptcha_key'); |
|
| 13 | +$recaptcha_secret = give_get_option('recaptcha_secret'); |
|
| 14 | +$enable_recaptcha = ( ! empty($recaptcha_key) && ! empty($recaptcha_secret)) ? true : false; |
|
| 15 | 15 | |
| 16 | 16 | // Form submission |
| 17 | -if ( is_email( $email ) && wp_verify_nonce( $_POST['_wpnonce'], 'give' ) ) { |
|
| 17 | +if (is_email($email) && wp_verify_nonce($_POST['_wpnonce'], 'give')) { |
|
| 18 | 18 | |
| 19 | 19 | // Use reCAPTCHA |
| 20 | - if ( $enable_recaptcha ) { |
|
| 20 | + if ($enable_recaptcha) { |
|
| 21 | 21 | |
| 22 | 22 | $args = array( |
| 23 | 23 | 'secret' => $recaptcha_secret, |
@@ -25,70 +25,70 @@ discard block |
||
| 25 | 25 | 'remoteip' => $_POST['give_ip'], |
| 26 | 26 | ); |
| 27 | 27 | |
| 28 | - if ( ! empty( $args['response'] ) ) { |
|
| 29 | - $request = wp_remote_post( 'https://www.google.com/recaptcha/api/siteverify', array( |
|
| 28 | + if ( ! empty($args['response'])) { |
|
| 29 | + $request = wp_remote_post('https://www.google.com/recaptcha/api/siteverify', array( |
|
| 30 | 30 | 'body' => $args, |
| 31 | - ) ); |
|
| 32 | - if ( ! is_wp_error( $request ) || 200 == wp_remote_retrieve_response_code( $request ) ) { |
|
| 31 | + )); |
|
| 32 | + if ( ! is_wp_error($request) || 200 == wp_remote_retrieve_response_code($request)) { |
|
| 33 | 33 | |
| 34 | - $response = json_decode( $request['body'], true ); |
|
| 34 | + $response = json_decode($request['body'], true); |
|
| 35 | 35 | |
| 36 | 36 | // reCAPTCHA fail |
| 37 | - if ( ! $response['success'] ) { |
|
| 38 | - give_set_error( 'give_recaptcha_test_failed', apply_filters( 'give_recaptcha_test_failed_message', esc_html__( 'reCAPTCHA test failed.', 'give' ) ) ); |
|
| 37 | + if ( ! $response['success']) { |
|
| 38 | + give_set_error('give_recaptcha_test_failed', apply_filters('give_recaptcha_test_failed_message', esc_html__('reCAPTCHA test failed.', 'give'))); |
|
| 39 | 39 | } |
| 40 | 40 | } else { |
| 41 | 41 | |
| 42 | 42 | // Connection issue |
| 43 | - give_set_error( 'give_recaptcha_connection_issue', apply_filters( 'give_recaptcha_connection_issue_message', esc_html__( 'Unable to connect to reCAPTCHA server.', 'give' ) ) ); |
|
| 43 | + give_set_error('give_recaptcha_connection_issue', apply_filters('give_recaptcha_connection_issue_message', esc_html__('Unable to connect to reCAPTCHA server.', 'give'))); |
|
| 44 | 44 | |
| 45 | 45 | } |
| 46 | 46 | } // End if(). |
| 47 | 47 | else { |
| 48 | 48 | |
| 49 | - give_set_error( 'give_recaptcha_failed', apply_filters( 'give_recaptcha_failed_message', esc_html__( 'It looks like the reCAPTCHA test has failed.', 'give' ) ) ); |
|
| 49 | + give_set_error('give_recaptcha_failed', apply_filters('give_recaptcha_failed_message', esc_html__('It looks like the reCAPTCHA test has failed.', 'give'))); |
|
| 50 | 50 | |
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // If no errors or only expired token key error - then send email |
| 55 | - if ( ! give_get_errors() ) { |
|
| 55 | + if ( ! give_get_errors()) { |
|
| 56 | 56 | |
| 57 | - $donor = Give()->donors->get_donor_by( 'email', $email ); |
|
| 57 | + $donor = Give()->donors->get_donor_by('email', $email); |
|
| 58 | 58 | |
| 59 | - if ( isset( $donor->id ) ) { |
|
| 60 | - if ( Give()->email_access->can_send_email( $donor->id ) ) { |
|
| 61 | - Give()->email_access->send_email( $donor->id, $email ); |
|
| 59 | + if (isset($donor->id)) { |
|
| 60 | + if (Give()->email_access->can_send_email($donor->id)) { |
|
| 61 | + Give()->email_access->send_email($donor->id, $email); |
|
| 62 | 62 | $show_form = false; |
| 63 | 63 | } |
| 64 | 64 | } else { |
| 65 | - give_set_error( 'give_no_donor_email_exists', apply_filters( 'give_no_donor_email_exists_message', __( 'It looks like that donor email address does not exist.', 'give' ) ) ); |
|
| 65 | + give_set_error('give_no_donor_email_exists', apply_filters('give_no_donor_email_exists_message', __('It looks like that donor email address does not exist.', 'give'))); |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | }// End if(). |
| 69 | 69 | |
| 70 | 70 | // Print any messages & errors |
| 71 | -Give()->notices->render_frontend_notices( 0 ); |
|
| 71 | +Give()->notices->render_frontend_notices(0); |
|
| 72 | 72 | |
| 73 | 73 | // Show the email login form? |
| 74 | -if ( $show_form ) { |
|
| 74 | +if ($show_form) { |
|
| 75 | 75 | ?> |
| 76 | 76 | |
| 77 | 77 | <div class="give-form"> |
| 78 | 78 | |
| 79 | 79 | <?php |
| 80 | - if ( ! give_get_errors() ) { |
|
| 81 | - Give()->notices->print_frontend_notice( apply_filters( 'give_email_access_message', __( 'Please enter the email address you used for your donation. A verification email containing an access link will be sent to you.', 'give' ) ), true ); |
|
| 80 | + if ( ! give_get_errors()) { |
|
| 81 | + Give()->notices->print_frontend_notice(apply_filters('give_email_access_message', __('Please enter the email address you used for your donation. A verification email containing an access link will be sent to you.', 'give')), true); |
|
| 82 | 82 | } ?> |
| 83 | 83 | |
| 84 | 84 | <form method="post" action="" id="give-email-access-form"> |
| 85 | - <label for="give-email"><?php esc_html__( 'Donation Email:', 'give' ); ?></label> |
|
| 86 | - <input id="give-email" type="email" name="give_email" value="" placeholder="<?php esc_attr_e( 'Your donation email', 'give' ); ?>"/> |
|
| 87 | - <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'give' ); ?>"/> |
|
| 85 | + <label for="give-email"><?php esc_html__('Donation Email:', 'give'); ?></label> |
|
| 86 | + <input id="give-email" type="email" name="give_email" value="" placeholder="<?php esc_attr_e('Your donation email', 'give'); ?>"/> |
|
| 87 | + <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('give'); ?>"/> |
|
| 88 | 88 | |
| 89 | 89 | <?php |
| 90 | 90 | // Enable reCAPTCHA? |
| 91 | - if ( $enable_recaptcha ) { ?> |
|
| 91 | + if ($enable_recaptcha) { ?> |
|
| 92 | 92 | |
| 93 | 93 | <script> |
| 94 | 94 | //IP verify for reCAPTCHA |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | <input type="hidden" name="give_ip" class="give_ip" value=""/> |
| 107 | 107 | <?php } ?> |
| 108 | 108 | |
| 109 | - <input type="submit" class="give-submit" value="<?php esc_attr_e( 'Email access token', 'give' ); ?>"/> |
|
| 109 | + <input type="submit" class="give-submit" value="<?php esc_attr_e('Email access token', 'give'); ?>"/> |
|
| 110 | 110 | </form> |
| 111 | 111 | </div> |
| 112 | 112 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | Give()->notices->print_frontend_notice( |
| 117 | 117 | sprintf( |
| 118 | 118 | /* translators: %s: user email address */ |
| 119 | - esc_html__( 'An email with an access link has been sent to %s.', 'give' ), |
|
| 119 | + esc_html__('An email with an access link has been sent to %s.', 'give'), |
|
| 120 | 120 | |
| 121 | 121 | ), |
| 122 | 122 | true, |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | * @version 1.0 |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -if ( ! defined( 'ABSPATH' ) ) {
|
|
| 11 | +if ( ! defined('ABSPATH')) {
|
|
| 12 | 12 | exit; // Exit if accessed directly. |
| 13 | 13 | } |
| 14 | 14 | |
@@ -21,11 +21,11 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * @since 1.0 |
| 23 | 23 | */ |
| 24 | -do_action( 'give_before_main_content' ); |
|
| 24 | +do_action('give_before_main_content');
|
|
| 25 | 25 | |
| 26 | -while ( have_posts() ) : the_post(); |
|
| 26 | +while (have_posts()) : the_post(); |
|
| 27 | 27 | |
| 28 | - give_get_template_part( 'single-give-form/content', 'single-give-form' ); |
|
| 28 | + give_get_template_part('single-give-form/content', 'single-give-form');
|
|
| 29 | 29 | |
| 30 | 30 | endwhile; // end of the loop. |
| 31 | 31 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * |
| 37 | 37 | * @since 1.0 |
| 38 | 38 | */ |
| 39 | -do_action( 'give_after_main_content' ); |
|
| 39 | +do_action('give_after_main_content');
|
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * Fires in single form template, on the sidebar. |
@@ -45,6 +45,6 @@ discard block |
||
| 45 | 45 | * |
| 46 | 46 | * @since 1.0 |
| 47 | 47 | */ |
| 48 | -do_action( 'give_sidebar' ); |
|
| 48 | +do_action('give_sidebar');
|
|
| 49 | 49 | |
| 50 | 50 | get_footer(); |
| 51 | 51 | \ No newline at end of file |
@@ -75,8 +75,11 @@ discard block |
||
| 75 | 75 | ) : ?> |
| 76 | 76 | <a href="<?php echo esc_url( add_query_arg( 'payment_key', give_get_payment_key( $post->ID ), give_get_history_page_uri() ) ); ?>"><span |
| 77 | 77 | class="give-donation-status <?php echo $post->post_status; ?>"><?php echo esc_html__( 'View', 'give' ) . ' ' . give_get_payment_status( $post, true ) . ' »'; ?></span></a> |
| 78 | - <?php else : ?> |
|
| 79 | - <a href="<?php echo esc_url( add_query_arg( 'payment_key', give_get_payment_key( $post->ID ), give_get_history_page_uri() ) ); ?>"><?php esc_html_e( 'View Receipt »', 'give' ); ?></a> |
|
| 78 | + <?php else { |
|
| 79 | + : ?> |
|
| 80 | + <a href="<?php echo esc_url( add_query_arg( 'payment_key', give_get_payment_key( $post->ID ), give_get_history_page_uri() ) ); |
|
| 81 | +} |
|
| 82 | +?>"><?php esc_html_e( 'View Receipt »', 'give' ); ?></a> |
|
| 80 | 83 | <?php endif; ?> |
| 81 | 84 | </td> |
| 82 | 85 | <?php |
@@ -107,6 +110,9 @@ discard block |
||
| 107 | 110 | ?> |
| 108 | 111 | </div> |
| 109 | 112 | <?php wp_reset_postdata(); ?> |
| 110 | -<?php else : ?> |
|
| 111 | - <?php Give()->notices->print_frontend_notice( esc_html__( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?> |
|
| 113 | +<?php else { |
|
| 114 | + : ?> |
|
| 115 | + <?php Give()->notices->print_frontend_notice( esc_html__( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); |
|
| 116 | +} |
|
| 117 | +?> |
|
| 112 | 118 | <?php endif; |
@@ -67,27 +67,27 @@ |
||
| 67 | 67 | <td class="give-donation-amount"> |
| 68 | 68 | <span class="give-donation-amount"> |
| 69 | 69 | <?php |
| 70 | - $donation_amount = give_currency_filter( give_format_amount( give_get_payment_amount( $post->ID ), array( 'sanitize' => false ) ) ); |
|
| 70 | + $donation_amount = give_currency_filter( give_format_amount( give_get_payment_amount( $post->ID ), array( 'sanitize' => false ) ) ); |
|
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * Filters the donation amount on Donation History Page. |
|
| 74 | - * |
|
| 75 | - * @param int $donation_amount Donation Amount. |
|
| 76 | - * @param int $post->ID Donation ID. |
|
| 77 | - * |
|
| 78 | - * @since 1.8.13 |
|
| 79 | - * |
|
| 80 | - * @return int |
|
| 81 | - */ |
|
| 82 | - echo apply_filters( 'give_donation_history_row_amount', $donation_amount, $post->ID ); |
|
| 83 | - ?> |
|
| 72 | + /** |
|
| 73 | + * Filters the donation amount on Donation History Page. |
|
| 74 | + * |
|
| 75 | + * @param int $donation_amount Donation Amount. |
|
| 76 | + * @param int $post->ID Donation ID. |
|
| 77 | + * |
|
| 78 | + * @since 1.8.13 |
|
| 79 | + * |
|
| 80 | + * @return int |
|
| 81 | + */ |
|
| 82 | + echo apply_filters( 'give_donation_history_row_amount', $donation_amount, $post->ID ); |
|
| 83 | + ?> |
|
| 84 | 84 | </span> |
| 85 | 85 | </td> |
| 86 | 86 | <td class="give-donation-details"> |
| 87 | 87 | <?php |
| 88 | 88 | // Display View Receipt or |
| 89 | 89 | if ( 'publish' !== $post->post_status |
| 90 | - && 'subscription' !== $post->post_status |
|
| 90 | + && 'subscription' !== $post->post_status |
|
| 91 | 91 | ) : ?> |
| 92 | 92 | <a href="<?php echo esc_url( add_query_arg( 'payment_key', give_get_payment_key( $post->ID ), give_get_history_page_uri() ) ); ?>"><span |
| 93 | 93 | class="give-donation-status <?php echo $post->post_status; ?>"><?php echo esc_html__( 'View', 'give' ) . ' ' . give_get_payment_status( $post, true ) . ' »'; ?></span></a> |
@@ -4,18 +4,18 @@ discard block |
||
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | // User's Donations |
| 7 | -if ( is_user_logged_in() ) { |
|
| 8 | - $donations = give_get_users_donations( get_current_user_id(), 20, true, 'any' ); |
|
| 9 | -} elseif ( Give()->email_access->token_exists ) { |
|
| 7 | +if (is_user_logged_in()) { |
|
| 8 | + $donations = give_get_users_donations(get_current_user_id(), 20, true, 'any'); |
|
| 9 | +} elseif (Give()->email_access->token_exists) { |
|
| 10 | 10 | // Email Access Token? |
| 11 | - $donations = give_get_users_donations( 0, 20, true, 'any' ); |
|
| 12 | -} elseif ( Give()->session->get_session_expiration() !== false ) { |
|
| 11 | + $donations = give_get_users_donations(0, 20, true, 'any'); |
|
| 12 | +} elseif (Give()->session->get_session_expiration() !== false) { |
|
| 13 | 13 | // Session active? |
| 14 | - $email = Give()->session->get( 'give_email' ); |
|
| 15 | - $donations = give_get_users_donations( $email, 20, true, 'any' ); |
|
| 14 | + $email = Give()->session->get('give_email'); |
|
| 15 | + $donations = give_get_users_donations($email, 20, true, 'any'); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | -if ( $donations ) : ?> |
|
| 18 | +if ($donations) : ?> |
|
| 19 | 19 | <table id="give_user_history" class="give-table"> |
| 20 | 20 | <thead> |
| 21 | 21 | <tr class="give-donation-row"> |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | * |
| 28 | 28 | * @since 1.7 |
| 29 | 29 | */ |
| 30 | - do_action( 'give_donation_history_header_before' ); |
|
| 30 | + do_action('give_donation_history_header_before'); |
|
| 31 | 31 | ?> |
| 32 | - <th scope="col" class="give-donation-id"><?php esc_html_e( 'ID', 'give' ); ?></th> |
|
| 33 | - <th scope="col" class="give-donation-date"><?php esc_html_e( 'Date', 'give' ); ?></th> |
|
| 34 | - <th scope="col" class="give-donation-amount"><?php esc_html_e( 'Amount', 'give' ); ?></th> |
|
| 35 | - <th scope="col" class="give-donation-details"><?php esc_html_e( 'Details', 'give' ); ?></th> |
|
| 32 | + <th scope="col" class="give-donation-id"><?php esc_html_e('ID', 'give'); ?></th> |
|
| 33 | + <th scope="col" class="give-donation-date"><?php esc_html_e('Date', 'give'); ?></th> |
|
| 34 | + <th scope="col" class="give-donation-amount"><?php esc_html_e('Amount', 'give'); ?></th> |
|
| 35 | + <th scope="col" class="give-donation-details"><?php esc_html_e('Details', 'give'); ?></th> |
|
| 36 | 36 | <?php |
| 37 | 37 | /** |
| 38 | 38 | * Fires in current user donation history table, after the header row ends. |
@@ -41,13 +41,13 @@ discard block |
||
| 41 | 41 | * |
| 42 | 42 | * @since 1.7 |
| 43 | 43 | */ |
| 44 | - do_action( 'give_donation_history_header_after' ); |
|
| 44 | + do_action('give_donation_history_header_after'); |
|
| 45 | 45 | ?> |
| 46 | 46 | </tr> |
| 47 | 47 | </thead> |
| 48 | - <?php foreach ( $donations as $post ) : |
|
| 49 | - setup_postdata( $post ); |
|
| 50 | - $donation_data = give_get_payment_meta( $post->ID ); ?> |
|
| 48 | + <?php foreach ($donations as $post) : |
|
| 49 | + setup_postdata($post); |
|
| 50 | + $donation_data = give_get_payment_meta($post->ID); ?> |
|
| 51 | 51 | <tr class="give-donation-row"> |
| 52 | 52 | <?php |
| 53 | 53 | /** |
@@ -60,14 +60,14 @@ discard block |
||
| 60 | 60 | * @param int $post_id The ID of the post. |
| 61 | 61 | * @param mixed $donation_data Payment meta data. |
| 62 | 62 | */ |
| 63 | - do_action( 'give_donation_history_row_start', $post->ID, $donation_data ); |
|
| 63 | + do_action('give_donation_history_row_start', $post->ID, $donation_data); |
|
| 64 | 64 | ?> |
| 65 | - <td class="give-donation-id">#<?php echo give_get_payment_number( $post->ID ); ?></td> |
|
| 66 | - <td class="give-donation-date"><?php echo date_i18n( give_date_format(), strtotime( get_post_field( 'post_date', $post->ID ) ) ); ?></td> |
|
| 65 | + <td class="give-donation-id">#<?php echo give_get_payment_number($post->ID); ?></td> |
|
| 66 | + <td class="give-donation-date"><?php echo date_i18n(give_date_format(), strtotime(get_post_field('post_date', $post->ID))); ?></td> |
|
| 67 | 67 | <td class="give-donation-amount"> |
| 68 | 68 | <span class="give-donation-amount"> |
| 69 | 69 | <?php |
| 70 | - $donation_amount = give_currency_filter( give_format_amount( give_get_payment_amount( $post->ID ), array( 'sanitize' => false ) ) ); |
|
| 70 | + $donation_amount = give_currency_filter(give_format_amount(give_get_payment_amount($post->ID), array('sanitize' => false))); |
|
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * Filters the donation amount on Donation History Page. |
@@ -79,20 +79,20 @@ discard block |
||
| 79 | 79 | * |
| 80 | 80 | * @return int |
| 81 | 81 | */ |
| 82 | - echo apply_filters( 'give_donation_history_row_amount', $donation_amount, $post->ID ); |
|
| 82 | + echo apply_filters('give_donation_history_row_amount', $donation_amount, $post->ID); |
|
| 83 | 83 | ?> |
| 84 | 84 | </span> |
| 85 | 85 | </td> |
| 86 | 86 | <td class="give-donation-details"> |
| 87 | 87 | <?php |
| 88 | 88 | // Display View Receipt or |
| 89 | - if ( 'publish' !== $post->post_status |
|
| 89 | + if ('publish' !== $post->post_status |
|
| 90 | 90 | && 'subscription' !== $post->post_status |
| 91 | 91 | ) : ?> |
| 92 | - <a href="<?php echo esc_url( add_query_arg( 'payment_key', give_get_payment_key( $post->ID ), give_get_history_page_uri() ) ); ?>"><span |
|
| 93 | - class="give-donation-status <?php echo $post->post_status; ?>"><?php echo esc_html__( 'View', 'give' ) . ' ' . give_get_payment_status( $post, true ) . ' »'; ?></span></a> |
|
| 92 | + <a href="<?php echo esc_url(add_query_arg('payment_key', give_get_payment_key($post->ID), give_get_history_page_uri())); ?>"><span |
|
| 93 | + class="give-donation-status <?php echo $post->post_status; ?>"><?php echo esc_html__('View', 'give').' '.give_get_payment_status($post, true).' »'; ?></span></a> |
|
| 94 | 94 | <?php else : ?> |
| 95 | - <a href="<?php echo esc_url( add_query_arg( 'payment_key', give_get_payment_key( $post->ID ), give_get_history_page_uri() ) ); ?>"><?php esc_html_e( 'View Receipt »', 'give' ); ?></a> |
|
| 95 | + <a href="<?php echo esc_url(add_query_arg('payment_key', give_get_payment_key($post->ID), give_get_history_page_uri())); ?>"><?php esc_html_e('View Receipt »', 'give'); ?></a> |
|
| 96 | 96 | <?php endif; ?> |
| 97 | 97 | </td> |
| 98 | 98 | <?php |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * @param int $post_id The ID of the post. |
| 107 | 107 | * @param mixed $donation_data Payment meta data. |
| 108 | 108 | */ |
| 109 | - do_action( 'give_donation_history_row_end', $post->ID, $donation_data ); |
|
| 109 | + do_action('give_donation_history_row_end', $post->ID, $donation_data); |
|
| 110 | 110 | ?> |
| 111 | 111 | </tr> |
| 112 | 112 | <?php endforeach; ?> |
@@ -114,15 +114,15 @@ discard block |
||
| 114 | 114 | <div id="give-donation-history-pagination" class="give_pagination navigation"> |
| 115 | 115 | <?php |
| 116 | 116 | $big = 999999; |
| 117 | - echo paginate_links( array( |
|
| 118 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
| 117 | + echo paginate_links(array( |
|
| 118 | + 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
|
| 119 | 119 | 'format' => '?paged=%#%', |
| 120 | - 'current' => max( 1, get_query_var( 'paged' ) ), |
|
| 121 | - 'total' => ceil( give_count_donations_of_donor() / 20 ) // 20 items per page |
|
| 122 | - ) ); |
|
| 120 | + 'current' => max(1, get_query_var('paged')), |
|
| 121 | + 'total' => ceil(give_count_donations_of_donor() / 20) // 20 items per page |
|
| 122 | + )); |
|
| 123 | 123 | ?> |
| 124 | 124 | </div> |
| 125 | 125 | <?php wp_reset_postdata(); ?> |
| 126 | 126 | <?php else : ?> |
| 127 | - <?php Give()->notices->print_frontend_notice( esc_html__( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?> |
|
| 127 | + <?php Give()->notices->print_frontend_notice(esc_html__('It looks like you haven\'t made any donations.', 'give'), true, 'success'); ?> |
|
| 128 | 128 | <?php endif; |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * @since 1.0 |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -if ( ! defined( 'ABSPATH' ) ) {
|
|
| 13 | +if ( ! defined('ABSPATH')) {
|
|
| 14 | 14 | exit; // Exit if accessed directly. |
| 15 | 15 | } |
| 16 | 16 | |
@@ -23,22 +23,22 @@ discard block |
||
| 23 | 23 | * |
| 24 | 24 | * @since 1.0 |
| 25 | 25 | */ |
| 26 | -do_action( 'give_pre_featured_thumbnail' ); |
|
| 26 | +do_action('give_pre_featured_thumbnail');
|
|
| 27 | 27 | ?> |
| 28 | 28 | |
| 29 | 29 | <div class="images"> |
| 30 | 30 | <?php //Featured Thumbnail |
| 31 | - if ( has_post_thumbnail() ) {
|
|
| 31 | + if (has_post_thumbnail()) {
|
|
| 32 | 32 | |
| 33 | - $image_size = give_get_option( 'featured_image_size' ); |
|
| 34 | - $image = get_the_post_thumbnail( $post->ID, apply_filters( 'single_give_form_large_thumbnail_size', ( ! empty( $image_size ) ? $image_size : 'large' ) ) ); |
|
| 33 | + $image_size = give_get_option('featured_image_size');
|
|
| 34 | + $image = get_the_post_thumbnail($post->ID, apply_filters('single_give_form_large_thumbnail_size', ( ! empty($image_size) ? $image_size : 'large')));
|
|
| 35 | 35 | |
| 36 | - echo apply_filters( 'single_give_form_image_html', $image ); |
|
| 36 | + echo apply_filters('single_give_form_image_html', $image);
|
|
| 37 | 37 | |
| 38 | 38 | } else {
|
| 39 | 39 | |
| 40 | 40 | //Placeholder Image |
| 41 | - echo apply_filters( 'single_give_form_image_html', sprintf( '<img src="%s" alt="%s" />', give_get_placeholder_img_src(), esc_attr__( 'Placeholder', 'give' ) ), $post->ID ); |
|
| 41 | + echo apply_filters('single_give_form_image_html', sprintf('<img src="%s" alt="%s" />', give_get_placeholder_img_src(), esc_attr__('Placeholder', 'give')), $post->ID);
|
|
| 42 | 42 | |
| 43 | 43 | } ?> |
| 44 | 44 | </div> |
@@ -51,5 +51,5 @@ discard block |
||
| 51 | 51 | * |
| 52 | 52 | * @since 1.0 |
| 53 | 53 | */ |
| 54 | -do_action( 'give_post_featured_thumbnail' ); |
|
| 54 | +do_action('give_post_featured_thumbnail');
|
|
| 55 | 55 | ?> |
@@ -11,9 +11,9 @@ |
||
| 11 | 11 | * @since 1.0 |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 14 | +if ( ! defined('ABSPATH')) { |
|
| 15 | 15 | exit; // Exit if accessed directly. |
| 16 | 16 | } |
| 17 | -if ( is_active_sidebar( 'give-forms-sidebar' ) ) { |
|
| 18 | - dynamic_sidebar( 'give-forms-sidebar' ); |
|
| 17 | +if (is_active_sidebar('give-forms-sidebar')) { |
|
| 18 | + dynamic_sidebar('give-forms-sidebar'); |
|
| 19 | 19 | } |
| 20 | 20 | \ No newline at end of file |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | * @version 1.0 |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 11 | +if ( ! defined('ABSPATH')) { |
|
| 12 | 12 | exit; // Exit if accessed directly. |
| 13 | 13 | } |
| 14 | 14 | |
@@ -19,9 +19,9 @@ discard block |
||
| 19 | 19 | * |
| 20 | 20 | * @since 1.0 |
| 21 | 21 | */ |
| 22 | -do_action( 'give_before_single_form' ); |
|
| 22 | +do_action('give_before_single_form'); |
|
| 23 | 23 | |
| 24 | -if ( post_password_required() ) { |
|
| 24 | +if (post_password_required()) { |
|
| 25 | 25 | echo get_the_password_form(); |
| 26 | 26 | return; |
| 27 | 27 | } |
@@ -37,10 +37,10 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @since 1.0 |
| 39 | 39 | */ |
| 40 | - do_action( 'give_before_single_form_summary' ); |
|
| 40 | + do_action('give_before_single_form_summary'); |
|
| 41 | 41 | ?> |
| 42 | 42 | |
| 43 | - <div class="<?php echo apply_filters( 'give_forms_single_summary_classes', 'summary entry-summary' ); ?>"> |
|
| 43 | + <div class="<?php echo apply_filters('give_forms_single_summary_classes', 'summary entry-summary'); ?>"> |
|
| 44 | 44 | |
| 45 | 45 | <?php |
| 46 | 46 | /** |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * |
| 51 | 51 | * @since 1.0 |
| 52 | 52 | */ |
| 53 | - do_action( 'give_single_form_summary' ); |
|
| 53 | + do_action('give_single_form_summary'); |
|
| 54 | 54 | ?> |
| 55 | 55 | |
| 56 | 56 | </div> |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @since 1.0 |
| 66 | 66 | */ |
| 67 | - do_action( 'give_after_single_form_summary' ); |
|
| 67 | + do_action('give_after_single_form_summary'); |
|
| 68 | 68 | ?> |
| 69 | 69 | |
| 70 | 70 | </div><!-- #give-form-<?php the_ID(); ?> --> |
@@ -77,5 +77,5 @@ discard block |
||
| 77 | 77 | * |
| 78 | 78 | * @since 1.0 |
| 79 | 79 | */ |
| 80 | -do_action( 'give_after_single_form' ); |
|
| 80 | +do_action('give_after_single_form'); |
|
| 81 | 81 | ?> |