@@ -654,8 +654,8 @@ discard block |
||
| 654 | 654 | |
| 655 | 655 | <input type="text" id="card_address" name="card_address" |
| 656 | 656 | class="card-address give-input<?php if ( give_field_is_required( 'card_address', $form_id ) ) { |
| 657 | - echo ' required'; |
|
| 658 | - } ?>" placeholder="<?php _e( 'Address line 1', 'give' ); ?>" |
|
| 657 | + echo ' required'; |
|
| 658 | + } ?>" placeholder="<?php _e( 'Address line 1', 'give' ); ?>" |
|
| 659 | 659 | value="<?php echo $line1; ?>"<?php if ( give_field_is_required( 'card_address', $form_id ) ) { |
| 660 | 660 | echo ' required '; |
| 661 | 661 | } ?>/> |
@@ -673,8 +673,8 @@ discard block |
||
| 673 | 673 | |
| 674 | 674 | <input type="text" id="card_address_2" name="card_address_2" |
| 675 | 675 | class="card-address-2 give-input<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) { |
| 676 | - echo ' required'; |
|
| 677 | - } ?>" placeholder="<?php _e( 'Address line 2', 'give' ); ?>" |
|
| 676 | + echo ' required'; |
|
| 677 | + } ?>" placeholder="<?php _e( 'Address line 2', 'give' ); ?>" |
|
| 678 | 678 | value="<?php echo $line2; ?>"<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) { |
| 679 | 679 | echo ' required '; |
| 680 | 680 | } ?>/> |
@@ -691,8 +691,8 @@ discard block |
||
| 691 | 691 | </label> |
| 692 | 692 | <input type="text" id="card_city" name="card_city" |
| 693 | 693 | class="card-city give-input<?php if ( give_field_is_required( 'card_city', $form_id ) ) { |
| 694 | - echo ' required'; |
|
| 695 | - } ?>" placeholder="<?php _e( 'City', 'give' ); ?>" |
|
| 694 | + echo ' required'; |
|
| 695 | + } ?>" placeholder="<?php _e( 'City', 'give' ); ?>" |
|
| 696 | 696 | value="<?php echo $city; ?>"<?php if ( give_field_is_required( 'card_city', $form_id ) ) { |
| 697 | 697 | echo ' required '; |
| 698 | 698 | } ?>/> |
@@ -710,8 +710,8 @@ discard block |
||
| 710 | 710 | |
| 711 | 711 | <input type="text" size="4" id="card_zip" name="card_zip" |
| 712 | 712 | class="card-zip give-input<?php if ( give_field_is_required( 'card_zip', $form_id ) ) { |
| 713 | - echo ' required'; |
|
| 714 | - } ?>" placeholder="<?php _e( 'Zip / Postal code', 'give' ); ?>" |
|
| 713 | + echo ' required'; |
|
| 714 | + } ?>" placeholder="<?php _e( 'Zip / Postal code', 'give' ); ?>" |
|
| 715 | 715 | value="<?php echo $zip; ?>" <?php if ( give_field_is_required( 'card_zip', $form_id ) ) { |
| 716 | 716 | echo ' required '; |
| 717 | 717 | } ?>/> |
@@ -729,8 +729,8 @@ discard block |
||
| 729 | 729 | |
| 730 | 730 | <select name="billing_country" id="billing_country" |
| 731 | 731 | class="billing-country billing_country give-select<?php if ( give_field_is_required( 'billing_country', $form_id ) ) { |
| 732 | - echo ' required'; |
|
| 733 | - } ?>"<?php if ( give_field_is_required( 'billing_country', $form_id ) ) { |
|
| 732 | + echo ' required'; |
|
| 733 | + } ?>"<?php if ( give_field_is_required( 'billing_country', $form_id ) ) { |
|
| 734 | 734 | echo ' required '; |
| 735 | 735 | } ?>> |
| 736 | 736 | <?php |
@@ -770,8 +770,8 @@ discard block |
||
| 770 | 770 | if ( ! empty( $states ) ) : ?> |
| 771 | 771 | <select name="card_state" id="card_state" |
| 772 | 772 | class="card_state give-select<?php if ( give_field_is_required( 'card_state', $form_id ) ) { |
| 773 | - echo ' required'; |
|
| 774 | - } ?>"<?php if ( give_field_is_required( 'card_state', $form_id ) ) { |
|
| 773 | + echo ' required'; |
|
| 774 | + } ?>"<?php if ( give_field_is_required( 'card_state', $form_id ) ) { |
|
| 775 | 775 | echo ' required '; |
| 776 | 776 | } ?>> |
| 777 | 777 | <?php |
@@ -848,8 +848,8 @@ discard block |
||
| 848 | 848 | |
| 849 | 849 | <input name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" |
| 850 | 850 | class="<?php if ( give_no_guest_checkout( $form_id ) ) { |
| 851 | - echo 'required '; |
|
| 852 | - } ?>give-input" type="text" placeholder="<?php _e( 'Username', 'give' ); ?>" |
|
| 851 | + echo 'required '; |
|
| 852 | + } ?>give-input" type="text" placeholder="<?php _e( 'Username', 'give' ); ?>" |
|
| 853 | 853 | title="<?php _e( 'Username', 'give' ); ?>"/> |
| 854 | 854 | </p> |
| 855 | 855 | |
@@ -865,8 +865,8 @@ discard block |
||
| 865 | 865 | |
| 866 | 866 | <input name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" |
| 867 | 867 | class="<?php if ( give_no_guest_checkout( $form_id ) ) { |
| 868 | - echo 'required '; |
|
| 869 | - } ?>give-input" placeholder="<?php _e( 'Password', 'give' ); ?>" type="password"/> |
|
| 868 | + echo 'required '; |
|
| 869 | + } ?>give-input" placeholder="<?php _e( 'Password', 'give' ); ?>" type="password"/> |
|
| 870 | 870 | </p> |
| 871 | 871 | |
| 872 | 872 | <p id="give-user-pass-confirm-wrap-<?php echo $form_id; ?>" |
@@ -882,8 +882,8 @@ discard block |
||
| 882 | 882 | |
| 883 | 883 | <input name="give_user_pass_confirm" id="give-user-pass-confirm-<?php echo $form_id; ?>" |
| 884 | 884 | class="<?php if ( give_no_guest_checkout( $form_id ) ) { |
| 885 | - echo 'required '; |
|
| 886 | - } ?>give-input" placeholder="<?php _e( 'Confirm password', 'give' ); ?>" type="password"/> |
|
| 885 | + echo 'required '; |
|
| 886 | + } ?>give-input" placeholder="<?php _e( 'Confirm password', 'give' ); ?>" type="password"/> |
|
| 887 | 887 | </p> |
| 888 | 888 | <?php do_action( 'give_register_account_fields_after', $form_id ); ?> |
| 889 | 889 | </fieldset> |
@@ -1264,9 +1264,9 @@ discard block |
||
| 1264 | 1264 | |
| 1265 | 1265 | //Sanity check - ensure form has goal set to output |
| 1266 | 1266 | if ( empty( $form->ID ) |
| 1267 | - || ( is_singular( 'give_forms' ) && $goal_option !== 'yes' ) |
|
| 1268 | - || $goal_option !== 'yes' |
|
| 1269 | - || $goal == 0 |
|
| 1267 | + || ( is_singular( 'give_forms' ) && $goal_option !== 'yes' ) |
|
| 1268 | + || $goal_option !== 'yes' |
|
| 1269 | + || $goal == 0 |
|
| 1270 | 1270 | ) { |
| 1271 | 1271 | //not this form, bail |
| 1272 | 1272 | return false; |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -23,56 +23,56 @@ discard block |
||
| 23 | 23 | * |
| 24 | 24 | * @return string $purchase_form |
| 25 | 25 | */ |
| 26 | -function give_get_donation_form( $args = array() ) { |
|
| 26 | +function give_get_donation_form($args = array()) { |
|
| 27 | 27 | |
| 28 | 28 | global $post; |
| 29 | 29 | |
| 30 | - $post_id = is_object( $post ) ? $post->ID : 0; |
|
| 30 | + $post_id = is_object($post) ? $post->ID : 0; |
|
| 31 | 31 | |
| 32 | - if ( isset( $args['id'] ) ) { |
|
| 32 | + if (isset($args['id'])) { |
|
| 33 | 33 | $post_id = $args['id']; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - $defaults = apply_filters( 'give_form_args_defaults', array( |
|
| 36 | + $defaults = apply_filters('give_form_args_defaults', array( |
|
| 37 | 37 | 'form_id' => $post_id |
| 38 | - ) ); |
|
| 38 | + )); |
|
| 39 | 39 | |
| 40 | - $args = wp_parse_args( $args, $defaults ); |
|
| 40 | + $args = wp_parse_args($args, $defaults); |
|
| 41 | 41 | |
| 42 | - $form = new Give_Donate_Form( $args['form_id'] ); |
|
| 42 | + $form = new Give_Donate_Form($args['form_id']); |
|
| 43 | 43 | |
| 44 | 44 | //bail if no form ID |
| 45 | - if ( empty( $form->ID ) ) { |
|
| 45 | + if (empty($form->ID)) { |
|
| 46 | 46 | return false; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - $payment_mode = give_get_chosen_gateway( $form->ID ); |
|
| 49 | + $payment_mode = give_get_chosen_gateway($form->ID); |
|
| 50 | 50 | |
| 51 | - $form_action = esc_url( add_query_arg( apply_filters( 'give_form_action_args', array( |
|
| 51 | + $form_action = esc_url(add_query_arg(apply_filters('give_form_action_args', array( |
|
| 52 | 52 | 'payment-mode' => $payment_mode, |
| 53 | - ) ), |
|
| 53 | + )), |
|
| 54 | 54 | give_get_current_page_url() |
| 55 | - ) ); |
|
| 55 | + )); |
|
| 56 | 56 | |
| 57 | - if ( 'publish' !== $form->post_status && ! current_user_can( 'edit_product', $form->ID ) ) { |
|
| 57 | + if ('publish' !== $form->post_status && ! current_user_can('edit_product', $form->ID)) { |
|
| 58 | 58 | return false; // Product not published or user doesn't have permission to view drafts |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - $display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) ) |
|
| 61 | + $display_option = (isset($args['display_style']) && ! empty($args['display_style'])) |
|
| 62 | 62 | ? $args['display_style'] |
| 63 | - : get_post_meta( $form->ID, '_give_payment_display', true ); |
|
| 63 | + : get_post_meta($form->ID, '_give_payment_display', true); |
|
| 64 | 64 | |
| 65 | - $float_labels_option = give_is_float_labels_enabled( $args ) |
|
| 65 | + $float_labels_option = give_is_float_labels_enabled($args) |
|
| 66 | 66 | ? ' float-labels-enabled' |
| 67 | 67 | : ''; |
| 68 | 68 | |
| 69 | 69 | |
| 70 | - $form_classes_array = apply_filters( 'give_form_classes', array( |
|
| 70 | + $form_classes_array = apply_filters('give_form_classes', array( |
|
| 71 | 71 | 'give-form-wrap', |
| 72 | - 'give-display-' . $display_option |
|
| 73 | - ), $form->ID, $args ); |
|
| 72 | + 'give-display-'.$display_option |
|
| 73 | + ), $form->ID, $args); |
|
| 74 | 74 | |
| 75 | - $form_classes = implode( ' ', $form_classes_array ); |
|
| 75 | + $form_classes = implode(' ', $form_classes_array); |
|
| 76 | 76 | |
| 77 | 77 | ob_start(); |
| 78 | 78 | |
@@ -84,39 +84,39 @@ discard block |
||
| 84 | 84 | * @param int $form ->ID The current form ID |
| 85 | 85 | * @param array $args An array of form args |
| 86 | 86 | */ |
| 87 | - do_action( 'give_pre_form_output', $form->ID, $args ); ?> |
|
| 87 | + do_action('give_pre_form_output', $form->ID, $args); ?> |
|
| 88 | 88 | |
| 89 | 89 | <div id="give-form-<?php echo $form->ID; ?>-wrap" class="<?php echo $form_classes; ?>"> |
| 90 | 90 | |
| 91 | 91 | <?php |
| 92 | - if ( isset( $args['show_title'] ) && $args['show_title'] == true ) { |
|
| 92 | + if (isset($args['show_title']) && $args['show_title'] == true) { |
|
| 93 | 93 | |
| 94 | - echo apply_filters( 'give_form_title', '<h2 class="give-form-title">' . get_the_title( $post_id ) . '</h2>' ); |
|
| 94 | + echo apply_filters('give_form_title', '<h2 class="give-form-title">'.get_the_title($post_id).'</h2>'); |
|
| 95 | 95 | |
| 96 | 96 | } ?> |
| 97 | 97 | |
| 98 | - <?php do_action( 'give_pre_form', $form->ID, $args ); ?> |
|
| 98 | + <?php do_action('give_pre_form', $form->ID, $args); ?> |
|
| 99 | 99 | |
| 100 | 100 | <form id="give-form-<?php echo $post_id; ?>" |
| 101 | - class="give-form give-form-<?php echo absint( $form->ID ); ?><?php echo $float_labels_option; ?>" |
|
| 101 | + class="give-form give-form-<?php echo absint($form->ID); ?><?php echo $float_labels_option; ?>" |
|
| 102 | 102 | action="<?php echo $form_action; ?>" method="post"> |
| 103 | 103 | <input type="hidden" name="give-form-id" value="<?php echo $form->ID; ?>"/> |
| 104 | - <input type="hidden" name="give-form-title" value="<?php echo htmlentities( $form->post_title ); ?>"/> |
|
| 104 | + <input type="hidden" name="give-form-title" value="<?php echo htmlentities($form->post_title); ?>"/> |
|
| 105 | 105 | <input type="hidden" name="give-current-url" |
| 106 | - value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/> |
|
| 106 | + value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/> |
|
| 107 | 107 | <input type="hidden" name="give-form-url" |
| 108 | - value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/> |
|
| 108 | + value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/> |
|
| 109 | 109 | <input type="hidden" name="give-form-minimum" |
| 110 | - value="<?php echo give_get_form_minimum_price( $form->ID ); ?>"/> |
|
| 110 | + value="<?php echo give_get_form_minimum_price($form->ID); ?>"/> |
|
| 111 | 111 | <?php |
| 112 | 112 | //Price ID hidden field for variable (mult-level) donation forms |
| 113 | - if ( give_has_variable_prices( $post_id ) ) { |
|
| 113 | + if (give_has_variable_prices($post_id)) { |
|
| 114 | 114 | //get default selected price ID |
| 115 | - $prices = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $post_id ), $post_id ); |
|
| 115 | + $prices = apply_filters('give_form_variable_prices', give_get_variable_prices($post_id), $post_id); |
|
| 116 | 116 | $price_id = 0; |
| 117 | 117 | //loop through prices |
| 118 | - foreach ( $prices as $price ) { |
|
| 119 | - if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) { |
|
| 118 | + foreach ($prices as $price) { |
|
| 119 | + if (isset($price['_give_default']) && $price['_give_default'] === 'default') { |
|
| 120 | 120 | $price_id = $price['_give_id']['level_id']; |
| 121 | 121 | }; |
| 122 | 122 | } |
@@ -124,19 +124,19 @@ discard block |
||
| 124 | 124 | <input type="hidden" name="give-price-id" value="<?php echo $price_id; ?>"/> |
| 125 | 125 | <?php } |
| 126 | 126 | |
| 127 | - do_action( 'give_checkout_form_top', $form->ID, $args ); |
|
| 127 | + do_action('give_checkout_form_top', $form->ID, $args); |
|
| 128 | 128 | |
| 129 | - do_action( 'give_payment_mode_select', $form->ID, $args ); |
|
| 129 | + do_action('give_payment_mode_select', $form->ID, $args); |
|
| 130 | 130 | |
| 131 | - do_action( 'give_checkout_form_bottom', $form->ID, $args ); |
|
| 131 | + do_action('give_checkout_form_bottom', $form->ID, $args); |
|
| 132 | 132 | |
| 133 | 133 | ?> |
| 134 | 134 | |
| 135 | 135 | </form> |
| 136 | 136 | |
| 137 | - <?php do_action( 'give_post_form', $form->ID, $args ); ?> |
|
| 137 | + <?php do_action('give_post_form', $form->ID, $args); ?> |
|
| 138 | 138 | |
| 139 | - <!--end #give-form-<?php echo absint( $form->ID ); ?>--></div> |
|
| 139 | + <!--end #give-form-<?php echo absint($form->ID); ?>--></div> |
|
| 140 | 140 | <?php |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | * @param int $form ->ID The current form ID |
| 148 | 148 | * @param array $args An array of form args |
| 149 | 149 | */ |
| 150 | - do_action( 'give_post_form_output', $form->ID, $args ); |
|
| 150 | + do_action('give_post_form_output', $form->ID, $args); |
|
| 151 | 151 | |
| 152 | 152 | $final_output = ob_get_clean(); |
| 153 | 153 | |
| 154 | - echo apply_filters( 'give_donate_form', $final_output, $args ); |
|
| 154 | + echo apply_filters('give_donate_form', $final_output, $args); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | |
@@ -171,57 +171,57 @@ discard block |
||
| 171 | 171 | * @global $give_options Array of all the Give options |
| 172 | 172 | * @return string |
| 173 | 173 | */ |
| 174 | -function give_show_purchase_form( $form_id ) { |
|
| 174 | +function give_show_purchase_form($form_id) { |
|
| 175 | 175 | |
| 176 | - $payment_mode = give_get_chosen_gateway( $form_id ); |
|
| 176 | + $payment_mode = give_get_chosen_gateway($form_id); |
|
| 177 | 177 | |
| 178 | - if ( ! isset( $form_id ) && isset( $_POST['give_form_id'] ) ) { |
|
| 178 | + if ( ! isset($form_id) && isset($_POST['give_form_id'])) { |
|
| 179 | 179 | $form_id = $_POST['give_form_id']; |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | - do_action( 'give_purchase_form_top', $form_id ); |
|
| 182 | + do_action('give_purchase_form_top', $form_id); |
|
| 183 | 183 | |
| 184 | - if ( give_can_checkout() && isset( $form_id ) ) { |
|
| 184 | + if (give_can_checkout() && isset($form_id)) { |
|
| 185 | 185 | |
| 186 | - do_action( 'give_purchase_form_before_register_login', $form_id ); |
|
| 186 | + do_action('give_purchase_form_before_register_login', $form_id); |
|
| 187 | 187 | |
| 188 | - $show_register_form = apply_filters( 'give_show_register_form', get_post_meta( $form_id, '_give_show_register_form', true ) ); |
|
| 188 | + $show_register_form = apply_filters('give_show_register_form', get_post_meta($form_id, '_give_show_register_form', true)); |
|
| 189 | 189 | |
| 190 | - if ( ( $show_register_form === 'registration' || ( $show_register_form === 'both' && ! isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) : ?> |
|
| 190 | + if (($show_register_form === 'registration' || ($show_register_form === 'both' && ! isset($_GET['login']))) && ! is_user_logged_in()) : ?> |
|
| 191 | 191 | <div id="give-checkout-login-register-<?php echo $form_id; ?>"> |
| 192 | - <?php do_action( 'give_purchase_form_register_fields', $form_id ); ?> |
|
| 192 | + <?php do_action('give_purchase_form_register_fields', $form_id); ?> |
|
| 193 | 193 | </div> |
| 194 | - <?php elseif ( ( $show_register_form === 'login' || ( $show_register_form === 'both' && isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) : ?> |
|
| 194 | + <?php elseif (($show_register_form === 'login' || ($show_register_form === 'both' && isset($_GET['login']))) && ! is_user_logged_in()) : ?> |
|
| 195 | 195 | <div id="give-checkout-login-register-<?php echo $form_id; ?>"> |
| 196 | - <?php do_action( 'give_purchase_form_login_fields', $form_id ); ?> |
|
| 196 | + <?php do_action('give_purchase_form_login_fields', $form_id); ?> |
|
| 197 | 197 | </div> |
| 198 | 198 | <?php endif; ?> |
| 199 | 199 | |
| 200 | - <?php if ( ( ! isset( $_GET['login'] ) && is_user_logged_in() ) || ! isset( $show_register_form ) || 'none' === $show_register_form || 'login' === $show_register_form ) { |
|
| 201 | - do_action( 'give_purchase_form_after_user_info', $form_id ); |
|
| 200 | + <?php if (( ! isset($_GET['login']) && is_user_logged_in()) || ! isset($show_register_form) || 'none' === $show_register_form || 'login' === $show_register_form) { |
|
| 201 | + do_action('give_purchase_form_after_user_info', $form_id); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - do_action( 'give_purchase_form_before_cc_form', $form_id ); |
|
| 204 | + do_action('give_purchase_form_before_cc_form', $form_id); |
|
| 205 | 205 | |
| 206 | 206 | // Load the credit card form and allow gateways to load their own if they wish |
| 207 | - if ( has_action( 'give_' . $payment_mode . '_cc_form' ) ) { |
|
| 208 | - do_action( 'give_' . $payment_mode . '_cc_form', $form_id ); |
|
| 207 | + if (has_action('give_'.$payment_mode.'_cc_form')) { |
|
| 208 | + do_action('give_'.$payment_mode.'_cc_form', $form_id); |
|
| 209 | 209 | } else { |
| 210 | - do_action( 'give_cc_form', $form_id ); |
|
| 210 | + do_action('give_cc_form', $form_id); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | - do_action( 'give_purchase_form_after_cc_form', $form_id ); |
|
| 213 | + do_action('give_purchase_form_after_cc_form', $form_id); |
|
| 214 | 214 | |
| 215 | 215 | } else { |
| 216 | 216 | // Can't checkout |
| 217 | - do_action( 'give_purchase_form_no_access', $form_id ); |
|
| 217 | + do_action('give_purchase_form_no_access', $form_id); |
|
| 218 | 218 | |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | - do_action( 'give_purchase_form_bottom', $form_id ); |
|
| 221 | + do_action('give_purchase_form_bottom', $form_id); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | -add_action( 'give_purchase_form', 'give_show_purchase_form' ); |
|
| 224 | +add_action('give_purchase_form', 'give_show_purchase_form'); |
|
| 225 | 225 | |
| 226 | 226 | /** |
| 227 | 227 | * Donation Amount Field |
@@ -235,37 +235,37 @@ discard block |
||
| 235 | 235 | * |
| 236 | 236 | * @return void |
| 237 | 237 | */ |
| 238 | -function give_output_donation_amount_top( $form_id = 0, $args = array() ) { |
|
| 238 | +function give_output_donation_amount_top($form_id = 0, $args = array()) { |
|
| 239 | 239 | |
| 240 | 240 | global $give_options; |
| 241 | 241 | |
| 242 | - $variable_pricing = give_has_variable_prices( $form_id ); |
|
| 243 | - $allow_custom_amount = get_post_meta( $form_id, '_give_custom_amount', true ); |
|
| 244 | - $currency_position = isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before'; |
|
| 245 | - $symbol = give_currency_symbol( $give_options['currency'] ); |
|
| 246 | - $currency_output = '<span class="give-currency-symbol give-currency-position-' . $currency_position . '">' . $symbol . '</span>'; |
|
| 247 | - $default_amount = give_format_amount( give_get_default_form_amount( $form_id ) ); |
|
| 248 | - $custom_amount_text = get_post_meta( $form_id, '_give_custom_amount_text', true ); |
|
| 242 | + $variable_pricing = give_has_variable_prices($form_id); |
|
| 243 | + $allow_custom_amount = get_post_meta($form_id, '_give_custom_amount', true); |
|
| 244 | + $currency_position = isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before'; |
|
| 245 | + $symbol = give_currency_symbol($give_options['currency']); |
|
| 246 | + $currency_output = '<span class="give-currency-symbol give-currency-position-'.$currency_position.'">'.$symbol.'</span>'; |
|
| 247 | + $default_amount = give_format_amount(give_get_default_form_amount($form_id)); |
|
| 248 | + $custom_amount_text = get_post_meta($form_id, '_give_custom_amount_text', true); |
|
| 249 | 249 | |
| 250 | - do_action( 'give_before_donation_levels', $form_id ); |
|
| 250 | + do_action('give_before_donation_levels', $form_id); |
|
| 251 | 251 | |
| 252 | 252 | //Set Price, No Custom Amount Allowed means hidden price field |
| 253 | - if ( $allow_custom_amount == 'no' ) { |
|
| 253 | + if ($allow_custom_amount == 'no') { |
|
| 254 | 254 | ?> |
| 255 | 255 | |
| 256 | - <label class="give-hidden" for="give-amount-hidden"><?php echo __( 'Donation Amount:', 'give' ); ?></label> |
|
| 256 | + <label class="give-hidden" for="give-amount-hidden"><?php echo __('Donation Amount:', 'give'); ?></label> |
|
| 257 | 257 | <input id="give-amount" class="give-amount-hidden" type="hidden" name="give-amount" |
| 258 | 258 | value="<?php echo $default_amount; ?>" required> |
| 259 | 259 | <p class="set-price give-donation-amount form-row-wide"> |
| 260 | - <?php if ( $currency_position == 'before' ) { |
|
| 260 | + <?php if ($currency_position == 'before') { |
|
| 261 | 261 | echo $currency_output; |
| 262 | 262 | } ?> |
| 263 | 263 | <span id="give-amount-text" class="give-text-input give-amount-top"><?php echo $default_amount; ?></span> |
| 264 | - <?php if ( $currency_position == 'after' ) { |
|
| 264 | + <?php if ($currency_position == 'after') { |
|
| 265 | 265 | echo $currency_output; |
| 266 | 266 | } ?> |
| 267 | 267 | <span class="give-loading-text give-updating-price-loader"> |
| 268 | - <span class="give-loading-animation"></span> <?php _e( 'Updating Amount...', 'give' ); ?> |
|
| 268 | + <span class="give-loading-animation"></span> <?php _e('Updating Amount...', 'give'); ?> |
|
| 269 | 269 | </span> |
| 270 | 270 | </p> |
| 271 | 271 | <?php |
@@ -274,35 +274,35 @@ discard block |
||
| 274 | 274 | ?> |
| 275 | 275 | <div class="give-total-wrap"> |
| 276 | 276 | <div class="give-donation-amount form-row-wide"> |
| 277 | - <?php if ( $currency_position == 'before' ) { |
|
| 277 | + <?php if ($currency_position == 'before') { |
|
| 278 | 278 | echo $currency_output; |
| 279 | 279 | } ?> |
| 280 | - <label class="give-hidden" for="give-amount"><?php echo __( 'Donation Amount:', 'give' ); ?></label> |
|
| 280 | + <label class="give-hidden" for="give-amount"><?php echo __('Donation Amount:', 'give'); ?></label> |
|
| 281 | 281 | <input class="give-text-input give-amount-top" id="give-amount" name="give-amount" type="tel" |
| 282 | 282 | placeholder="" value="<?php echo $default_amount; ?>" autocomplete="off"> |
| 283 | - <?php if ( $currency_position == 'after' ) { |
|
| 283 | + <?php if ($currency_position == 'after') { |
|
| 284 | 284 | echo $currency_output; |
| 285 | 285 | } ?> |
| 286 | 286 | <span class="give-loading-text give-updating-price-loader"> |
| 287 | - <span class="give-loading-animation"></span> <?php _e( 'Updating Amount...', 'give' ); ?> |
|
| 287 | + <span class="give-loading-animation"></span> <?php _e('Updating Amount...', 'give'); ?> |
|
| 288 | 288 | </span> |
| 289 | 289 | </div> |
| 290 | 290 | </div> |
| 291 | 291 | <?php } |
| 292 | 292 | |
| 293 | 293 | //Custom Amount Text |
| 294 | - if ( ! $variable_pricing && $allow_custom_amount == 'yes' ) { ?> |
|
| 295 | - <p class="give-custom-amount-text"><?php echo ! empty( $custom_amount_text ) ? $custom_amount_text : __( 'Give a Custom Amount', 'give' ); ?></p> |
|
| 294 | + if ( ! $variable_pricing && $allow_custom_amount == 'yes') { ?> |
|
| 295 | + <p class="give-custom-amount-text"><?php echo ! empty($custom_amount_text) ? $custom_amount_text : __('Give a Custom Amount', 'give'); ?></p> |
|
| 296 | 296 | <?php } |
| 297 | 297 | |
| 298 | 298 | //Output Variable Pricing Levels |
| 299 | - if ( $variable_pricing ) { |
|
| 300 | - give_output_levels( $form_id ); |
|
| 299 | + if ($variable_pricing) { |
|
| 300 | + give_output_levels($form_id); |
|
| 301 | 301 | } |
| 302 | - do_action( 'give_after_donation_levels', $form_id, $args ); |
|
| 302 | + do_action('give_after_donation_levels', $form_id, $args); |
|
| 303 | 303 | } |
| 304 | 304 | |
| 305 | -add_action( 'give_checkout_form_top', 'give_output_donation_amount_top', 10, 2 ); |
|
| 305 | +add_action('give_checkout_form_top', 'give_output_donation_amount_top', 10, 2); |
|
| 306 | 306 | |
| 307 | 307 | |
| 308 | 308 | /** |
@@ -314,32 +314,32 @@ discard block |
||
| 314 | 314 | * |
| 315 | 315 | * @return string |
| 316 | 316 | */ |
| 317 | -function give_output_levels( $form_id ) { |
|
| 317 | +function give_output_levels($form_id) { |
|
| 318 | 318 | |
| 319 | 319 | //Get variable pricing |
| 320 | - $prices = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id ); |
|
| 321 | - $display_style = get_post_meta( $form_id, '_give_display_style', true ); |
|
| 322 | - $custom_amount = get_post_meta( $form_id, '_give_custom_amount', true ); |
|
| 323 | - $custom_amount_text = get_post_meta( $form_id, '_give_custom_amount_text', true ); |
|
| 324 | - if ( empty( $custom_amount_text ) ) { |
|
| 325 | - $custom_amount_text = __( 'Give a Custom Amount', 'give' ); |
|
| 320 | + $prices = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id); |
|
| 321 | + $display_style = get_post_meta($form_id, '_give_display_style', true); |
|
| 322 | + $custom_amount = get_post_meta($form_id, '_give_custom_amount', true); |
|
| 323 | + $custom_amount_text = get_post_meta($form_id, '_give_custom_amount_text', true); |
|
| 324 | + if (empty($custom_amount_text)) { |
|
| 325 | + $custom_amount_text = __('Give a Custom Amount', 'give'); |
|
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | $output = ''; |
| 329 | 329 | $counter = 0; |
| 330 | 330 | |
| 331 | - switch ( $display_style ) { |
|
| 331 | + switch ($display_style) { |
|
| 332 | 332 | case 'buttons': |
| 333 | 333 | |
| 334 | 334 | $output .= '<ul id="give-donation-level-button-wrap" class="give-donation-levels-wrap give-list-inline">'; |
| 335 | 335 | |
| 336 | - foreach ( $prices as $price ) { |
|
| 337 | - $counter ++; |
|
| 338 | - $level_text = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'] ) ), $form_id, $price ); |
|
| 339 | - $level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-btn give-btn give-btn-level-' . $counter . ' ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'give-default-level' : '' ), $form_id, $price ); |
|
| 336 | + foreach ($prices as $price) { |
|
| 337 | + $counter++; |
|
| 338 | + $level_text = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'])), $form_id, $price); |
|
| 339 | + $level_classes = apply_filters('give_form_level_classes', 'give-donation-level-btn give-btn give-btn-level-'.$counter.' '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'give-default-level' : ''), $form_id, $price); |
|
| 340 | 340 | |
| 341 | 341 | $output .= '<li>'; |
| 342 | - $output .= '<button type="button" data-price-id="' . $price['_give_id']['level_id'] . '" class=" ' . $level_classes . '" value="' . give_format_amount( $price['_give_amount'] ) . '">'; |
|
| 342 | + $output .= '<button type="button" data-price-id="'.$price['_give_id']['level_id'].'" class=" '.$level_classes.'" value="'.give_format_amount($price['_give_amount']).'">'; |
|
| 343 | 343 | $output .= $level_text; |
| 344 | 344 | $output .= '</button>'; |
| 345 | 345 | $output .= '</li>'; |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | //Custom Amount |
| 350 | - if ( $custom_amount === 'yes' && ! empty( $custom_amount_text ) ) { |
|
| 350 | + if ($custom_amount === 'yes' && ! empty($custom_amount_text)) { |
|
| 351 | 351 | $output .= '<li>'; |
| 352 | 352 | $output .= '<button type="button" data-price-id="custom" class="give-donation-level-btn give-btn give-btn-level-custom" value="custom">'; |
| 353 | 353 | $output .= $custom_amount_text; |
@@ -363,23 +363,23 @@ discard block |
||
| 363 | 363 | |
| 364 | 364 | $output .= '<ul id="give-donation-level-radio-list" class="give-donation-levels-wrap">'; |
| 365 | 365 | |
| 366 | - foreach ( $prices as $price ) { |
|
| 367 | - $counter ++; |
|
| 368 | - $level_text = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'] ) ), $form_id, $price ); |
|
| 369 | - $level_classes = apply_filters( 'give_form_level_classes', 'give-radio-input give-radio-input-level give-radio-level-' . $counter . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price ); |
|
| 366 | + foreach ($prices as $price) { |
|
| 367 | + $counter++; |
|
| 368 | + $level_text = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'])), $form_id, $price); |
|
| 369 | + $level_classes = apply_filters('give_form_level_classes', 'give-radio-input give-radio-input-level give-radio-level-'.$counter.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? ' give-default-level' : ''), $form_id, $price); |
|
| 370 | 370 | |
| 371 | 371 | $output .= '<li>'; |
| 372 | - $output .= '<input type="radio" data-price-id="' . $price['_give_id']['level_id'] . '" class="' . $level_classes . '" name="give-radio-donation-level" id="give-radio-level-' . $counter . '" ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'checked="checked"' : '' ) . ' value="' . give_format_amount( $price['_give_amount'] ) . '">'; |
|
| 373 | - $output .= '<label for="give-radio-level-' . $counter . '">' . $level_text . '</label>'; |
|
| 372 | + $output .= '<input type="radio" data-price-id="'.$price['_give_id']['level_id'].'" class="'.$level_classes.'" name="give-radio-donation-level" id="give-radio-level-'.$counter.'" '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'checked="checked"' : '').' value="'.give_format_amount($price['_give_amount']).'">'; |
|
| 373 | + $output .= '<label for="give-radio-level-'.$counter.'">'.$level_text.'</label>'; |
|
| 374 | 374 | $output .= '</li>'; |
| 375 | 375 | |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | //Custom Amount |
| 379 | - if ( $custom_amount === 'yes' && ! empty( $custom_amount_text ) ) { |
|
| 379 | + if ($custom_amount === 'yes' && ! empty($custom_amount_text)) { |
|
| 380 | 380 | $output .= '<li>'; |
| 381 | 381 | $output .= '<input type="radio" data-price-id="custom" class="give-radio-input give-radio-input-level give-radio-level-custom" name="give-radio-donation-level" id="give-radio-level-custom" value="custom">'; |
| 382 | - $output .= '<label for="give-radio-level-custom">' . $custom_amount_text . '</label>'; |
|
| 382 | + $output .= '<label for="give-radio-level-custom">'.$custom_amount_text.'</label>'; |
|
| 383 | 383 | $output .= '</li>'; |
| 384 | 384 | } |
| 385 | 385 | |
@@ -389,23 +389,23 @@ discard block |
||
| 389 | 389 | |
| 390 | 390 | case 'dropdown': |
| 391 | 391 | |
| 392 | - $output .= '<label for="give-donation-level" class="give-hidden">' . __( 'Choose your Donation Amount', 'give' ) . ':</label>'; |
|
| 393 | - $output .= '<select id="give-donation-level-' . $form_id . '" class="give-select give-select-level">'; |
|
| 392 | + $output .= '<label for="give-donation-level" class="give-hidden">'.__('Choose your Donation Amount', 'give').':</label>'; |
|
| 393 | + $output .= '<select id="give-donation-level-'.$form_id.'" class="give-select give-select-level">'; |
|
| 394 | 394 | |
| 395 | 395 | //first loop through prices |
| 396 | - foreach ( $prices as $price ) { |
|
| 397 | - $level_text = apply_filters( 'give_form_level_text', ! empty( $price['_give_text'] ) ? $price['_give_text'] : give_currency_filter( give_format_amount( $price['_give_amount'] ) ), $form_id, $price ); |
|
| 398 | - $level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-' . $form_id, $form_id, $price ); |
|
| 396 | + foreach ($prices as $price) { |
|
| 397 | + $level_text = apply_filters('give_form_level_text', ! empty($price['_give_text']) ? $price['_give_text'] : give_currency_filter(give_format_amount($price['_give_amount'])), $form_id, $price); |
|
| 398 | + $level_classes = apply_filters('give_form_level_classes', 'give-donation-level-'.$form_id, $form_id, $price); |
|
| 399 | 399 | |
| 400 | - $output .= '<option data-price-id="' . $price['_give_id']['level_id'] . '" class="' . $level_classes . '" ' . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? 'selected="selected"' : '' ) . ' value="' . give_format_amount( $price['_give_amount'] ) . '">'; |
|
| 400 | + $output .= '<option data-price-id="'.$price['_give_id']['level_id'].'" class="'.$level_classes.'" '.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? 'selected="selected"' : '').' value="'.give_format_amount($price['_give_amount']).'">'; |
|
| 401 | 401 | $output .= $level_text; |
| 402 | 402 | $output .= '</option>'; |
| 403 | 403 | |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | //Custom Amount |
| 407 | - if ( $custom_amount === 'yes' && ! empty( $custom_amount_text ) ) { |
|
| 408 | - $output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">' . $custom_amount_text . '</option>'; |
|
| 407 | + if ($custom_amount === 'yes' && ! empty($custom_amount_text)) { |
|
| 408 | + $output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">'.$custom_amount_text.'</option>'; |
|
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | $output .= '</select>'; |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | break; |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | - echo apply_filters( 'give_form_level_output', $output, $form_id ); |
|
| 416 | + echo apply_filters('give_form_level_output', $output, $form_id); |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | /** |
@@ -425,26 +425,26 @@ discard block |
||
| 425 | 425 | * @param array $args |
| 426 | 426 | * |
| 427 | 427 | */ |
| 428 | -function give_display_checkout_button( $form_id, $args ) { |
|
| 428 | +function give_display_checkout_button($form_id, $args) { |
|
| 429 | 429 | |
| 430 | - $display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) ) |
|
| 430 | + $display_option = (isset($args['display_style']) && ! empty($args['display_style'])) |
|
| 431 | 431 | ? $args['display_style'] |
| 432 | - : get_post_meta( $form_id, '_give_payment_display', true ); |
|
| 432 | + : get_post_meta($form_id, '_give_payment_display', true); |
|
| 433 | 433 | |
| 434 | 434 | //no btn for onpage |
| 435 | - if ( $display_option === 'onpage' ) { |
|
| 435 | + if ($display_option === 'onpage') { |
|
| 436 | 436 | return; |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | - $display_label_field = get_post_meta( $form_id, '_give_reveal_label', true ); |
|
| 440 | - $display_label = ( ! empty( $display_label_field ) ? $display_label_field : __( 'Donate Now', 'give' ) ); |
|
| 439 | + $display_label_field = get_post_meta($form_id, '_give_reveal_label', true); |
|
| 440 | + $display_label = ( ! empty($display_label_field) ? $display_label_field : __('Donate Now', 'give')); |
|
| 441 | 441 | |
| 442 | - $output = '<button type="button" class="give-btn give-btn-' . $display_option . '">' . $display_label . '</button>'; |
|
| 442 | + $output = '<button type="button" class="give-btn give-btn-'.$display_option.'">'.$display_label.'</button>'; |
|
| 443 | 443 | |
| 444 | - echo apply_filters( 'give_display_checkout_button', $output ); |
|
| 444 | + echo apply_filters('give_display_checkout_button', $output); |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | -add_action( 'give_after_donation_levels', 'give_display_checkout_button', 10, 2 ); |
|
| 447 | +add_action('give_after_donation_levels', 'give_display_checkout_button', 10, 2); |
|
| 448 | 448 | |
| 449 | 449 | /** |
| 450 | 450 | * Shows the User Info fields in the Personal Info box, more fields can be added via the hooks provided. |
@@ -455,79 +455,79 @@ discard block |
||
| 455 | 455 | * |
| 456 | 456 | * @return void |
| 457 | 457 | */ |
| 458 | -function give_user_info_fields( $form_id ) { |
|
| 458 | +function give_user_info_fields($form_id) { |
|
| 459 | 459 | |
| 460 | - if ( is_user_logged_in() ) : |
|
| 461 | - $user_data = get_userdata( get_current_user_id() ); |
|
| 460 | + if (is_user_logged_in()) : |
|
| 461 | + $user_data = get_userdata(get_current_user_id()); |
|
| 462 | 462 | endif; |
| 463 | 463 | |
| 464 | - do_action( 'give_purchase_form_before_personal_info', $form_id ); |
|
| 464 | + do_action('give_purchase_form_before_personal_info', $form_id); |
|
| 465 | 465 | ?> |
| 466 | 466 | <fieldset id="give_checkout_user_info"> |
| 467 | - <legend><?php echo apply_filters( 'give_checkout_personal_info_text', __( 'Personal Info', 'give' ) ); ?></legend> |
|
| 467 | + <legend><?php echo apply_filters('give_checkout_personal_info_text', __('Personal Info', 'give')); ?></legend> |
|
| 468 | 468 | <p id="give-first-name-wrap" class="form-row form-row-first"> |
| 469 | 469 | <label class="give-label" for="give-first"> |
| 470 | - <?php _e( 'First Name', 'give' ); ?> |
|
| 471 | - <?php if ( give_field_is_required( 'give_first', $form_id ) ) { ?> |
|
| 470 | + <?php _e('First Name', 'give'); ?> |
|
| 471 | + <?php if (give_field_is_required('give_first', $form_id)) { ?> |
|
| 472 | 472 | <span class="give-required-indicator">*</span> |
| 473 | 473 | <?php } ?> |
| 474 | 474 | <span class="give-tooltip give-icon give-icon-question" |
| 475 | - data-tooltip="<?php _e( 'We will use this to personalize your account experience.', 'give' ); ?>"></span> |
|
| 475 | + data-tooltip="<?php _e('We will use this to personalize your account experience.', 'give'); ?>"></span> |
|
| 476 | 476 | </label> |
| 477 | 477 | <input class="give-input required" type="text" name="give_first" |
| 478 | - placeholder="<?php _e( 'First name', 'give' ); ?>" id="give-first" |
|
| 479 | - value="<?php echo is_user_logged_in() ? $user_data->first_name : ''; ?>"<?php if ( give_field_is_required( 'give_first', $form_id ) ) { |
|
| 478 | + placeholder="<?php _e('First name', 'give'); ?>" id="give-first" |
|
| 479 | + value="<?php echo is_user_logged_in() ? $user_data->first_name : ''; ?>"<?php if (give_field_is_required('give_first', $form_id)) { |
|
| 480 | 480 | echo ' required '; |
| 481 | 481 | } ?>/> |
| 482 | 482 | </p> |
| 483 | 483 | |
| 484 | 484 | <p id="give-last-name-wrap" class="form-row form-row-last"> |
| 485 | 485 | <label class="give-label" for="give-last"> |
| 486 | - <?php _e( 'Last Name', 'give' ); ?> |
|
| 487 | - <?php if ( give_field_is_required( 'give_last', $form_id ) ) { ?> |
|
| 486 | + <?php _e('Last Name', 'give'); ?> |
|
| 487 | + <?php if (give_field_is_required('give_last', $form_id)) { ?> |
|
| 488 | 488 | <span class="give-required-indicator">*</span> |
| 489 | 489 | <?php } ?> |
| 490 | 490 | <span class="give-tooltip give-icon give-icon-question" |
| 491 | - data-tooltip="<?php _e( 'We will use this as well to personalize your account experience.', 'give' ); ?>"></span> |
|
| 491 | + data-tooltip="<?php _e('We will use this as well to personalize your account experience.', 'give'); ?>"></span> |
|
| 492 | 492 | </label> |
| 493 | 493 | |
| 494 | - <input class="give-input<?php if ( give_field_is_required( 'give_last', $form_id ) ) { |
|
| 494 | + <input class="give-input<?php if (give_field_is_required('give_last', $form_id)) { |
|
| 495 | 495 | echo ' required'; |
| 496 | - } ?>" type="text" name="give_last" id="give-last" placeholder="<?php _e( 'Last name', 'give' ); ?>" |
|
| 497 | - value="<?php echo is_user_logged_in() ? $user_data->last_name : ''; ?>"<?php if ( give_field_is_required( 'give_last', $form_id ) ) { |
|
| 496 | + } ?>" type="text" name="give_last" id="give-last" placeholder="<?php _e('Last name', 'give'); ?>" |
|
| 497 | + value="<?php echo is_user_logged_in() ? $user_data->last_name : ''; ?>"<?php if (give_field_is_required('give_last', $form_id)) { |
|
| 498 | 498 | echo ' required '; |
| 499 | 499 | } ?> /> |
| 500 | 500 | </p> |
| 501 | 501 | |
| 502 | - <?php do_action( 'give_purchase_form_before_email', $form_id ); ?> |
|
| 502 | + <?php do_action('give_purchase_form_before_email', $form_id); ?> |
|
| 503 | 503 | <p id="give-email-wrap" class="form-row form-row-wide"> |
| 504 | 504 | <label class="give-label" for="give-email"> |
| 505 | - <?php _e( 'Email Address', 'give' ); ?> |
|
| 506 | - <?php if ( give_field_is_required( 'give_email', $form_id ) ) { ?> |
|
| 505 | + <?php _e('Email Address', 'give'); ?> |
|
| 506 | + <?php if (give_field_is_required('give_email', $form_id)) { ?> |
|
| 507 | 507 | <span class="give-required-indicator">*</span> |
| 508 | 508 | <?php } ?> |
| 509 | 509 | <span class="give-tooltip give-icon give-icon-question" |
| 510 | - data-tooltip="<?php _e( 'We will send the purchase receipt to this address.', 'give' ); ?>"></span> |
|
| 510 | + data-tooltip="<?php _e('We will send the purchase receipt to this address.', 'give'); ?>"></span> |
|
| 511 | 511 | </label> |
| 512 | 512 | |
| 513 | 513 | <input class="give-input required" type="email" name="give_email" |
| 514 | - placeholder="<?php _e( 'Email address', 'give' ); ?>" id="give-email" |
|
| 515 | - value="<?php echo is_user_logged_in() ? $user_data->user_email : ''; ?>"<?php if ( give_field_is_required( 'give_email', $form_id ) ) { |
|
| 514 | + placeholder="<?php _e('Email address', 'give'); ?>" id="give-email" |
|
| 515 | + value="<?php echo is_user_logged_in() ? $user_data->user_email : ''; ?>"<?php if (give_field_is_required('give_email', $form_id)) { |
|
| 516 | 516 | echo ' required '; |
| 517 | 517 | } ?>/> |
| 518 | 518 | |
| 519 | 519 | </p> |
| 520 | - <?php do_action( 'give_purchase_form_after_email', $form_id ); ?> |
|
| 520 | + <?php do_action('give_purchase_form_after_email', $form_id); ?> |
|
| 521 | 521 | |
| 522 | - <?php do_action( 'give_purchase_form_user_info', $form_id ); ?> |
|
| 522 | + <?php do_action('give_purchase_form_user_info', $form_id); ?> |
|
| 523 | 523 | </fieldset> |
| 524 | 524 | <?php |
| 525 | - do_action( 'give_purchase_form_after_personal_info', $form_id ); |
|
| 525 | + do_action('give_purchase_form_after_personal_info', $form_id); |
|
| 526 | 526 | |
| 527 | 527 | } |
| 528 | 528 | |
| 529 | -add_action( 'give_purchase_form_after_user_info', 'give_user_info_fields' ); |
|
| 530 | -add_action( 'give_register_fields_before', 'give_user_info_fields' ); |
|
| 529 | +add_action('give_purchase_form_after_user_info', 'give_user_info_fields'); |
|
| 530 | +add_action('give_register_fields_before', 'give_user_info_fields'); |
|
| 531 | 531 | |
| 532 | 532 | /** |
| 533 | 533 | * Renders the credit card info form. |
@@ -538,64 +538,64 @@ discard block |
||
| 538 | 538 | * |
| 539 | 539 | * @return void |
| 540 | 540 | */ |
| 541 | -function give_get_cc_form( $form_id ) { |
|
| 541 | +function give_get_cc_form($form_id) { |
|
| 542 | 542 | |
| 543 | 543 | ob_start(); |
| 544 | 544 | |
| 545 | - do_action( 'give_before_cc_fields', $form_id ); ?> |
|
| 545 | + do_action('give_before_cc_fields', $form_id); ?> |
|
| 546 | 546 | |
| 547 | 547 | <fieldset id="give_cc_fields-<?php echo $form_id ?>" class="give-do-validate"> |
| 548 | - <legend><?php echo apply_filters( 'give_credit_card_fieldset_heading', __( 'Credit Card Info', 'give' ) ); ?></legend> |
|
| 549 | - <?php if ( is_ssl() ) : ?> |
|
| 548 | + <legend><?php echo apply_filters('give_credit_card_fieldset_heading', __('Credit Card Info', 'give')); ?></legend> |
|
| 549 | + <?php if (is_ssl()) : ?> |
|
| 550 | 550 | <div id="give_secure_site_wrapper-<?php echo $form_id ?>"> |
| 551 | 551 | <span class="give-icon padlock"></span> |
| 552 | - <span><?php _e( 'This is a secure SSL encrypted payment.', 'give' ); ?></span> |
|
| 552 | + <span><?php _e('This is a secure SSL encrypted payment.', 'give'); ?></span> |
|
| 553 | 553 | </div> |
| 554 | 554 | <?php endif; ?> |
| 555 | 555 | <p id="give-card-number-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds"> |
| 556 | 556 | <label for="card_number-<?php echo $form_id ?>" class="give-label"> |
| 557 | - <?php _e( 'Card Number', 'give' ); ?> |
|
| 557 | + <?php _e('Card Number', 'give'); ?> |
|
| 558 | 558 | <span class="give-required-indicator">*</span> |
| 559 | 559 | <span class="give-tooltip give-icon give-icon-question" |
| 560 | - data-tooltip="<?php _e( 'The (typically) 16 digits on the front of your credit card.', 'give' ); ?>"></span> |
|
| 560 | + data-tooltip="<?php _e('The (typically) 16 digits on the front of your credit card.', 'give'); ?>"></span> |
|
| 561 | 561 | <span class="card-type"></span> |
| 562 | 562 | </label> |
| 563 | 563 | |
| 564 | 564 | <input type="tel" autocomplete="off" name="card_number" id="card_number-<?php echo $form_id ?>" |
| 565 | - class="card-number give-input required" placeholder="<?php _e( 'Card number', 'give' ); ?>" |
|
| 565 | + class="card-number give-input required" placeholder="<?php _e('Card number', 'give'); ?>" |
|
| 566 | 566 | required/> |
| 567 | 567 | </p> |
| 568 | 568 | |
| 569 | 569 | <p id="give-card-cvc-wrap-<?php echo $form_id ?>" class="form-row form-row-one-third"> |
| 570 | 570 | <label for="card_cvc-<?php echo $form_id ?>" class="give-label"> |
| 571 | - <?php _e( 'CVC', 'give' ); ?> |
|
| 571 | + <?php _e('CVC', 'give'); ?> |
|
| 572 | 572 | <span class="give-required-indicator">*</span> |
| 573 | 573 | <span class="give-tooltip give-icon give-icon-question" |
| 574 | - data-tooltip="<?php _e( 'The 3 digit (back) or 4 digit (front) value on your card.', 'give' ); ?>"></span> |
|
| 574 | + data-tooltip="<?php _e('The 3 digit (back) or 4 digit (front) value on your card.', 'give'); ?>"></span> |
|
| 575 | 575 | </label> |
| 576 | 576 | |
| 577 | 577 | <input type="tel" size="4" autocomplete="off" name="card_cvc" id="card_cvc-<?php echo $form_id ?>" |
| 578 | - class="card-cvc give-input required" placeholder="<?php _e( 'Security code', 'give' ); ?>" required/> |
|
| 578 | + class="card-cvc give-input required" placeholder="<?php _e('Security code', 'give'); ?>" required/> |
|
| 579 | 579 | </p> |
| 580 | 580 | |
| 581 | 581 | <p id="give-card-name-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds"> |
| 582 | 582 | <label for="card_name-<?php echo $form_id ?>" class="give-label"> |
| 583 | - <?php _e( 'Name on the Card', 'give' ); ?> |
|
| 583 | + <?php _e('Name on the Card', 'give'); ?> |
|
| 584 | 584 | <span class="give-required-indicator">*</span> |
| 585 | 585 | <span class="give-tooltip give-icon give-icon-question" |
| 586 | - data-tooltip="<?php _e( 'The name printed on the front of your credit card.', 'give' ); ?>"></span> |
|
| 586 | + data-tooltip="<?php _e('The name printed on the front of your credit card.', 'give'); ?>"></span> |
|
| 587 | 587 | </label> |
| 588 | 588 | |
| 589 | 589 | <input type="text" autocomplete="off" name="card_name" id="card_name-<?php echo $form_id ?>" |
| 590 | - class="card-name give-input required" placeholder="<?php _e( 'Card name', 'give' ); ?>" required/> |
|
| 590 | + class="card-name give-input required" placeholder="<?php _e('Card name', 'give'); ?>" required/> |
|
| 591 | 591 | </p> |
| 592 | - <?php do_action( 'give_before_cc_expiration' ); ?> |
|
| 592 | + <?php do_action('give_before_cc_expiration'); ?> |
|
| 593 | 593 | <p class="card-expiration form-row form-row-one-third"> |
| 594 | 594 | <label for="card_expiry-<?php echo $form_id ?>" class="give-label"> |
| 595 | - <?php _e( 'Expiration', 'give' ); ?> |
|
| 595 | + <?php _e('Expiration', 'give'); ?> |
|
| 596 | 596 | <span class="give-required-indicator">*</span> |
| 597 | 597 | <span class="give-tooltip give-icon give-icon-question" |
| 598 | - data-tooltip="<?php _e( 'The date your credit card expires, typically on the front of the card.', 'give' ); ?>"></span> |
|
| 598 | + data-tooltip="<?php _e('The date your credit card expires, typically on the front of the card.', 'give'); ?>"></span> |
|
| 599 | 599 | </label> |
| 600 | 600 | |
| 601 | 601 | <input type="hidden" id="card_exp_month-<?php echo $form_id ?>" name="card_exp_month" |
@@ -604,18 +604,18 @@ discard block |
||
| 604 | 604 | class="card-expiry-year"/> |
| 605 | 605 | |
| 606 | 606 | <input type="tel" autocomplete="off" name="card_expiry" id="card_expiry-<?php echo $form_id ?>" |
| 607 | - class="card-expiry give-input required" placeholder="<?php _e( 'MM / YY', 'give' ); ?>" required/> |
|
| 607 | + class="card-expiry give-input required" placeholder="<?php _e('MM / YY', 'give'); ?>" required/> |
|
| 608 | 608 | </p> |
| 609 | - <?php do_action( 'give_after_cc_expiration', $form_id ); ?> |
|
| 609 | + <?php do_action('give_after_cc_expiration', $form_id); ?> |
|
| 610 | 610 | |
| 611 | 611 | </fieldset> |
| 612 | 612 | <?php |
| 613 | - do_action( 'give_after_cc_fields', $form_id ); |
|
| 613 | + do_action('give_after_cc_fields', $form_id); |
|
| 614 | 614 | |
| 615 | 615 | echo ob_get_clean(); |
| 616 | 616 | } |
| 617 | 617 | |
| 618 | -add_action( 'give_cc_form', 'give_get_cc_form' ); |
|
| 618 | +add_action('give_cc_form', 'give_get_cc_form'); |
|
| 619 | 619 | |
| 620 | 620 | /** |
| 621 | 621 | * Outputs the default credit card address fields |
@@ -626,124 +626,124 @@ discard block |
||
| 626 | 626 | * |
| 627 | 627 | * @return void |
| 628 | 628 | */ |
| 629 | -function give_default_cc_address_fields( $form_id ) { |
|
| 629 | +function give_default_cc_address_fields($form_id) { |
|
| 630 | 630 | |
| 631 | 631 | $logged_in = is_user_logged_in(); |
| 632 | 632 | |
| 633 | - if ( $logged_in ) { |
|
| 634 | - $user_address = get_user_meta( get_current_user_id(), '_give_user_address', true ); |
|
| 633 | + if ($logged_in) { |
|
| 634 | + $user_address = get_user_meta(get_current_user_id(), '_give_user_address', true); |
|
| 635 | 635 | } |
| 636 | - $line1 = $logged_in && ! empty( $user_address['line1'] ) ? $user_address['line1'] : ''; |
|
| 637 | - $line2 = $logged_in && ! empty( $user_address['line2'] ) ? $user_address['line2'] : ''; |
|
| 638 | - $city = $logged_in && ! empty( $user_address['city'] ) ? $user_address['city'] : ''; |
|
| 639 | - $zip = $logged_in && ! empty( $user_address['zip'] ) ? $user_address['zip'] : ''; |
|
| 636 | + $line1 = $logged_in && ! empty($user_address['line1']) ? $user_address['line1'] : ''; |
|
| 637 | + $line2 = $logged_in && ! empty($user_address['line2']) ? $user_address['line2'] : ''; |
|
| 638 | + $city = $logged_in && ! empty($user_address['city']) ? $user_address['city'] : ''; |
|
| 639 | + $zip = $logged_in && ! empty($user_address['zip']) ? $user_address['zip'] : ''; |
|
| 640 | 640 | ob_start(); ?> |
| 641 | 641 | <fieldset id="give_cc_address" class="cc-address"> |
| 642 | - <legend><?php echo apply_filters( 'give_billing_details_fieldset_heading', __( 'Billing Details', 'give' ) ); ?></legend> |
|
| 643 | - <?php do_action( 'give_cc_billing_top' ); ?> |
|
| 642 | + <legend><?php echo apply_filters('give_billing_details_fieldset_heading', __('Billing Details', 'give')); ?></legend> |
|
| 643 | + <?php do_action('give_cc_billing_top'); ?> |
|
| 644 | 644 | <p id="give-card-address-wrap" class="form-row form-row-two-thirds"> |
| 645 | 645 | <label for="card_address" class="give-label"> |
| 646 | - <?php _e( 'Address', 'give' ); ?> |
|
| 646 | + <?php _e('Address', 'give'); ?> |
|
| 647 | 647 | <?php |
| 648 | - if ( give_field_is_required( 'card_address', $form_id ) ) { ?> |
|
| 648 | + if (give_field_is_required('card_address', $form_id)) { ?> |
|
| 649 | 649 | <span class="give-required-indicator">*</span> |
| 650 | 650 | <?php } ?> |
| 651 | 651 | <span class="give-tooltip give-icon give-icon-question" |
| 652 | - data-tooltip="<?php _e( 'The primary billing address for your credit card.', 'give' ); ?>"></span> |
|
| 652 | + data-tooltip="<?php _e('The primary billing address for your credit card.', 'give'); ?>"></span> |
|
| 653 | 653 | </label> |
| 654 | 654 | |
| 655 | 655 | <input type="text" id="card_address" name="card_address" |
| 656 | - class="card-address give-input<?php if ( give_field_is_required( 'card_address', $form_id ) ) { |
|
| 656 | + class="card-address give-input<?php if (give_field_is_required('card_address', $form_id)) { |
|
| 657 | 657 | echo ' required'; |
| 658 | - } ?>" placeholder="<?php _e( 'Address line 1', 'give' ); ?>" |
|
| 659 | - value="<?php echo $line1; ?>"<?php if ( give_field_is_required( 'card_address', $form_id ) ) { |
|
| 658 | + } ?>" placeholder="<?php _e('Address line 1', 'give'); ?>" |
|
| 659 | + value="<?php echo $line1; ?>"<?php if (give_field_is_required('card_address', $form_id)) { |
|
| 660 | 660 | echo ' required '; |
| 661 | 661 | } ?>/> |
| 662 | 662 | </p> |
| 663 | 663 | |
| 664 | 664 | <p id="give-card-address-2-wrap" class="form-row form-row-one-third"> |
| 665 | 665 | <label for="card_address_2" class="give-label"> |
| 666 | - <?php _e( 'Address Line 2', 'give' ); ?> |
|
| 667 | - <?php if ( give_field_is_required( 'card_address_2', $form_id ) ) { ?> |
|
| 666 | + <?php _e('Address Line 2', 'give'); ?> |
|
| 667 | + <?php if (give_field_is_required('card_address_2', $form_id)) { ?> |
|
| 668 | 668 | <span class="give-required-indicator">*</span> |
| 669 | 669 | <?php } ?> |
| 670 | 670 | <span class="give-tooltip give-icon give-icon-question" |
| 671 | - data-tooltip="<?php _e( '(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give' ); ?>"></span> |
|
| 671 | + data-tooltip="<?php _e('(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give'); ?>"></span> |
|
| 672 | 672 | </label> |
| 673 | 673 | |
| 674 | 674 | <input type="text" id="card_address_2" name="card_address_2" |
| 675 | - class="card-address-2 give-input<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) { |
|
| 675 | + class="card-address-2 give-input<?php if (give_field_is_required('card_address_2', $form_id)) { |
|
| 676 | 676 | echo ' required'; |
| 677 | - } ?>" placeholder="<?php _e( 'Address line 2', 'give' ); ?>" |
|
| 678 | - value="<?php echo $line2; ?>"<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) { |
|
| 677 | + } ?>" placeholder="<?php _e('Address line 2', 'give'); ?>" |
|
| 678 | + value="<?php echo $line2; ?>"<?php if (give_field_is_required('card_address_2', $form_id)) { |
|
| 679 | 679 | echo ' required '; |
| 680 | 680 | } ?>/> |
| 681 | 681 | </p> |
| 682 | 682 | |
| 683 | 683 | <p id="give-card-city-wrap" class="form-row form-row-two-thirds"> |
| 684 | 684 | <label for="card_city" class="give-label"> |
| 685 | - <?php _e( 'City', 'give' ); ?> |
|
| 686 | - <?php if ( give_field_is_required( 'card_city', $form_id ) ) { ?> |
|
| 685 | + <?php _e('City', 'give'); ?> |
|
| 686 | + <?php if (give_field_is_required('card_city', $form_id)) { ?> |
|
| 687 | 687 | <span class="give-required-indicator">*</span> |
| 688 | 688 | <?php } ?> |
| 689 | 689 | <span class="give-tooltip give-icon give-icon-question" |
| 690 | - data-tooltip="<?php _e( 'The city for your billing address.', 'give' ); ?>"></span> |
|
| 690 | + data-tooltip="<?php _e('The city for your billing address.', 'give'); ?>"></span> |
|
| 691 | 691 | </label> |
| 692 | 692 | <input type="text" id="card_city" name="card_city" |
| 693 | - class="card-city give-input<?php if ( give_field_is_required( 'card_city', $form_id ) ) { |
|
| 693 | + class="card-city give-input<?php if (give_field_is_required('card_city', $form_id)) { |
|
| 694 | 694 | echo ' required'; |
| 695 | - } ?>" placeholder="<?php _e( 'City', 'give' ); ?>" |
|
| 696 | - value="<?php echo $city; ?>"<?php if ( give_field_is_required( 'card_city', $form_id ) ) { |
|
| 695 | + } ?>" placeholder="<?php _e('City', 'give'); ?>" |
|
| 696 | + value="<?php echo $city; ?>"<?php if (give_field_is_required('card_city', $form_id)) { |
|
| 697 | 697 | echo ' required '; |
| 698 | 698 | } ?>/> |
| 699 | 699 | </p> |
| 700 | 700 | |
| 701 | 701 | <p id="give-card-zip-wrap" class="form-row form-row-one-third"> |
| 702 | 702 | <label for="card_zip" class="give-label"> |
| 703 | - <?php _e( 'Zip / Postal Code', 'give' ); ?> |
|
| 704 | - <?php if ( give_field_is_required( 'card_zip', $form_id ) ) { ?> |
|
| 703 | + <?php _e('Zip / Postal Code', 'give'); ?> |
|
| 704 | + <?php if (give_field_is_required('card_zip', $form_id)) { ?> |
|
| 705 | 705 | <span class="give-required-indicator">*</span> |
| 706 | 706 | <?php } ?> |
| 707 | 707 | <span class="give-tooltip give-icon give-icon-question" |
| 708 | - data-tooltip="<?php _e( 'The zip or postal code for your billing address.', 'give' ); ?>"></span> |
|
| 708 | + data-tooltip="<?php _e('The zip or postal code for your billing address.', 'give'); ?>"></span> |
|
| 709 | 709 | </label> |
| 710 | 710 | |
| 711 | 711 | <input type="text" size="4" id="card_zip" name="card_zip" |
| 712 | - class="card-zip give-input<?php if ( give_field_is_required( 'card_zip', $form_id ) ) { |
|
| 712 | + class="card-zip give-input<?php if (give_field_is_required('card_zip', $form_id)) { |
|
| 713 | 713 | echo ' required'; |
| 714 | - } ?>" placeholder="<?php _e( 'Zip / Postal code', 'give' ); ?>" |
|
| 715 | - value="<?php echo $zip; ?>" <?php if ( give_field_is_required( 'card_zip', $form_id ) ) { |
|
| 714 | + } ?>" placeholder="<?php _e('Zip / Postal code', 'give'); ?>" |
|
| 715 | + value="<?php echo $zip; ?>" <?php if (give_field_is_required('card_zip', $form_id)) { |
|
| 716 | 716 | echo ' required '; |
| 717 | 717 | } ?>/> |
| 718 | 718 | </p> |
| 719 | 719 | |
| 720 | 720 | <p id="give-card-country-wrap" class="form-row form-row-first"> |
| 721 | 721 | <label for="billing_country" class="give-label"> |
| 722 | - <?php _e( 'Country', 'give' ); ?> |
|
| 723 | - <?php if ( give_field_is_required( 'billing_country', $form_id ) ) { ?> |
|
| 722 | + <?php _e('Country', 'give'); ?> |
|
| 723 | + <?php if (give_field_is_required('billing_country', $form_id)) { ?> |
|
| 724 | 724 | <span class="give-required-indicator">*</span> |
| 725 | 725 | <?php } ?> |
| 726 | 726 | <span class="give-tooltip give-icon give-icon-question" |
| 727 | - data-tooltip="<?php _e( 'The country for your billing address.', 'give' ); ?>"></span> |
|
| 727 | + data-tooltip="<?php _e('The country for your billing address.', 'give'); ?>"></span> |
|
| 728 | 728 | </label> |
| 729 | 729 | |
| 730 | 730 | <select name="billing_country" id="billing_country" |
| 731 | - class="billing-country billing_country give-select<?php if ( give_field_is_required( 'billing_country', $form_id ) ) { |
|
| 731 | + class="billing-country billing_country give-select<?php if (give_field_is_required('billing_country', $form_id)) { |
|
| 732 | 732 | echo ' required'; |
| 733 | - } ?>"<?php if ( give_field_is_required( 'billing_country', $form_id ) ) { |
|
| 733 | + } ?>"<?php if (give_field_is_required('billing_country', $form_id)) { |
|
| 734 | 734 | echo ' required '; |
| 735 | 735 | } ?>> |
| 736 | 736 | <?php |
| 737 | 737 | |
| 738 | 738 | $selected_country = give_get_country(); |
| 739 | 739 | |
| 740 | - if ( $logged_in && ! empty( $user_address['country'] ) && '*' !== $user_address['country'] ) { |
|
| 740 | + if ($logged_in && ! empty($user_address['country']) && '*' !== $user_address['country']) { |
|
| 741 | 741 | $selected_country = $user_address['country']; |
| 742 | 742 | } |
| 743 | 743 | |
| 744 | 744 | $countries = give_get_country_list(); |
| 745 | - foreach ( $countries as $country_code => $country ) { |
|
| 746 | - echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>'; |
|
| 745 | + foreach ($countries as $country_code => $country) { |
|
| 746 | + echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>'; |
|
| 747 | 747 | } |
| 748 | 748 | ?> |
| 749 | 749 | </select> |
@@ -751,47 +751,47 @@ discard block |
||
| 751 | 751 | |
| 752 | 752 | <p id="give-card-state-wrap" class="form-row form-row-last"> |
| 753 | 753 | <label for="card_state" class="give-label"> |
| 754 | - <?php _e( 'State / Province', 'give' ); ?> |
|
| 755 | - <?php if ( give_field_is_required( 'card_state', $form_id ) ) { ?> |
|
| 754 | + <?php _e('State / Province', 'give'); ?> |
|
| 755 | + <?php if (give_field_is_required('card_state', $form_id)) { ?> |
|
| 756 | 756 | <span class="give-required-indicator">*</span> |
| 757 | 757 | <?php } ?> |
| 758 | 758 | <span class="give-tooltip give-icon give-icon-question" |
| 759 | - data-tooltip="<?php _e( 'The state or province for your billing address.', 'give' ); ?>"></span> |
|
| 759 | + data-tooltip="<?php _e('The state or province for your billing address.', 'give'); ?>"></span> |
|
| 760 | 760 | </label> |
| 761 | 761 | |
| 762 | 762 | <?php |
| 763 | 763 | $selected_state = give_get_state(); |
| 764 | - $states = give_get_states( $selected_country ); |
|
| 764 | + $states = give_get_states($selected_country); |
|
| 765 | 765 | |
| 766 | - if ( $logged_in && ! empty( $user_address['state'] ) ) { |
|
| 766 | + if ($logged_in && ! empty($user_address['state'])) { |
|
| 767 | 767 | $selected_state = $user_address['state']; |
| 768 | 768 | } |
| 769 | 769 | |
| 770 | - if ( ! empty( $states ) ) : ?> |
|
| 770 | + if ( ! empty($states)) : ?> |
|
| 771 | 771 | <select name="card_state" id="card_state" |
| 772 | - class="card_state give-select<?php if ( give_field_is_required( 'card_state', $form_id ) ) { |
|
| 772 | + class="card_state give-select<?php if (give_field_is_required('card_state', $form_id)) { |
|
| 773 | 773 | echo ' required'; |
| 774 | - } ?>"<?php if ( give_field_is_required( 'card_state', $form_id ) ) { |
|
| 774 | + } ?>"<?php if (give_field_is_required('card_state', $form_id)) { |
|
| 775 | 775 | echo ' required '; |
| 776 | 776 | } ?>> |
| 777 | 777 | <?php |
| 778 | - foreach ( $states as $state_code => $state ) { |
|
| 779 | - echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>'; |
|
| 778 | + foreach ($states as $state_code => $state) { |
|
| 779 | + echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>'; |
|
| 780 | 780 | } |
| 781 | 781 | ?> |
| 782 | 782 | </select> |
| 783 | 783 | <?php else : ?> |
| 784 | 784 | <input type="text" size="6" name="card_state" id="card_state" class="card_state give-input" |
| 785 | - placeholder="<?php _e( 'State / Province', 'give' ); ?>"/> |
|
| 785 | + placeholder="<?php _e('State / Province', 'give'); ?>"/> |
|
| 786 | 786 | <?php endif; ?> |
| 787 | 787 | </p> |
| 788 | - <?php do_action( 'give_cc_billing_bottom' ); ?> |
|
| 788 | + <?php do_action('give_cc_billing_bottom'); ?> |
|
| 789 | 789 | </fieldset> |
| 790 | 790 | <?php |
| 791 | 791 | echo ob_get_clean(); |
| 792 | 792 | } |
| 793 | 793 | |
| 794 | -add_action( 'give_after_cc_fields', 'give_default_cc_address_fields' ); |
|
| 794 | +add_action('give_after_cc_fields', 'give_default_cc_address_fields'); |
|
| 795 | 795 | |
| 796 | 796 | |
| 797 | 797 | /** |
@@ -803,103 +803,103 @@ discard block |
||
| 803 | 803 | * |
| 804 | 804 | * @return string |
| 805 | 805 | */ |
| 806 | -function give_get_register_fields( $form_id ) { |
|
| 806 | +function give_get_register_fields($form_id) { |
|
| 807 | 807 | |
| 808 | 808 | global $give_options; |
| 809 | 809 | global $user_ID; |
| 810 | 810 | |
| 811 | - if ( is_user_logged_in() ) { |
|
| 812 | - $user_data = get_userdata( $user_ID ); |
|
| 811 | + if (is_user_logged_in()) { |
|
| 812 | + $user_data = get_userdata($user_ID); |
|
| 813 | 813 | } |
| 814 | 814 | |
| 815 | - $show_register_form = apply_filters( 'give_show_register_form', get_post_meta( $form_id, '_give_show_register_form', true ) ); |
|
| 815 | + $show_register_form = apply_filters('give_show_register_form', get_post_meta($form_id, '_give_show_register_form', true)); |
|
| 816 | 816 | |
| 817 | 817 | ob_start(); ?> |
| 818 | 818 | <fieldset id="give-register-fields-<?php echo $form_id; ?>"> |
| 819 | 819 | |
| 820 | - <?php if ( $show_register_form == 'both' ) { ?> |
|
| 820 | + <?php if ($show_register_form == 'both') { ?> |
|
| 821 | 821 | <div class="give-login-account-wrap"> |
| 822 | - <p class="give-login-message"><?php _e( 'Already have an account?', 'give' ); ?> |
|
| 823 | - <a href="<?php echo esc_url( add_query_arg( 'login', 1 ) ); ?>" class="give-checkout-register-login" |
|
| 824 | - data-action="give_checkout_login"><?php _e( 'Login', 'give' ); ?></a> |
|
| 822 | + <p class="give-login-message"><?php _e('Already have an account?', 'give'); ?> |
|
| 823 | + <a href="<?php echo esc_url(add_query_arg('login', 1)); ?>" class="give-checkout-register-login" |
|
| 824 | + data-action="give_checkout_login"><?php _e('Login', 'give'); ?></a> |
|
| 825 | 825 | </p> |
| 826 | 826 | <p class="give-loading-text"> |
| 827 | - <span class="give-loading-animation"></span> <?php _e( 'Loading...', 'give' ); ?></p> |
|
| 827 | + <span class="give-loading-animation"></span> <?php _e('Loading...', 'give'); ?></p> |
|
| 828 | 828 | </div> |
| 829 | 829 | <?php } ?> |
| 830 | 830 | |
| 831 | - <?php do_action( 'give_register_fields_before' ); ?> |
|
| 831 | + <?php do_action('give_register_fields_before'); ?> |
|
| 832 | 832 | |
| 833 | 833 | <fieldset id="give-register-account-fields-<?php echo $form_id; ?>"> |
| 834 | - <legend><?php echo apply_filters( 'give_create_account_fieldset_heading', __( 'Create an account', 'give' ) ); |
|
| 835 | - if ( ! give_no_guest_checkout( $form_id ) ) { |
|
| 836 | - echo ' <span class="sub-text">' . __( '(optional)', 'give' ) . '</span>'; |
|
| 834 | + <legend><?php echo apply_filters('give_create_account_fieldset_heading', __('Create an account', 'give')); |
|
| 835 | + if ( ! give_no_guest_checkout($form_id)) { |
|
| 836 | + echo ' <span class="sub-text">'.__('(optional)', 'give').'</span>'; |
|
| 837 | 837 | } ?></legend> |
| 838 | - <?php do_action( 'give_register_account_fields_before' ); ?> |
|
| 838 | + <?php do_action('give_register_account_fields_before'); ?> |
|
| 839 | 839 | <p id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-one-third form-row-first"> |
| 840 | 840 | <label for="give-user-login-<?php echo $form_id; ?>"> |
| 841 | - <?php _e( 'Username', 'give' ); ?> |
|
| 842 | - <?php if ( give_no_guest_checkout( $form_id ) ) { ?> |
|
| 841 | + <?php _e('Username', 'give'); ?> |
|
| 842 | + <?php if (give_no_guest_checkout($form_id)) { ?> |
|
| 843 | 843 | <span class="give-required-indicator">*</span> |
| 844 | 844 | <?php } ?> |
| 845 | 845 | <span class="give-tooltip give-icon give-icon-question" |
| 846 | - data-tooltip="<?php _e( 'The username you will use to log into your account.', 'give' ); ?>"></span> |
|
| 846 | + data-tooltip="<?php _e('The username you will use to log into your account.', 'give'); ?>"></span> |
|
| 847 | 847 | </label> |
| 848 | 848 | |
| 849 | 849 | <input name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" |
| 850 | - class="<?php if ( give_no_guest_checkout( $form_id ) ) { |
|
| 850 | + class="<?php if (give_no_guest_checkout($form_id)) { |
|
| 851 | 851 | echo 'required '; |
| 852 | - } ?>give-input" type="text" placeholder="<?php _e( 'Username', 'give' ); ?>" |
|
| 853 | - title="<?php _e( 'Username', 'give' ); ?>"/> |
|
| 852 | + } ?>give-input" type="text" placeholder="<?php _e('Username', 'give'); ?>" |
|
| 853 | + title="<?php _e('Username', 'give'); ?>"/> |
|
| 854 | 854 | </p> |
| 855 | 855 | |
| 856 | 856 | <p id="give-user-pass-wrap-<?php echo $form_id; ?>" class="form-row form-row-one-third"> |
| 857 | 857 | <label for="give-user-pass-<?php echo $form_id; ?>"> |
| 858 | - <?php _e( 'Password', 'give' ); ?> |
|
| 859 | - <?php if ( give_no_guest_checkout( $form_id ) ) { ?> |
|
| 858 | + <?php _e('Password', 'give'); ?> |
|
| 859 | + <?php if (give_no_guest_checkout($form_id)) { ?> |
|
| 860 | 860 | <span class="give-required-indicator">*</span> |
| 861 | 861 | <?php } ?> |
| 862 | 862 | <span class="give-tooltip give-icon give-icon-question" |
| 863 | - data-tooltip="<?php _e( 'The password used to access your account.', 'give' ); ?>"></span> |
|
| 863 | + data-tooltip="<?php _e('The password used to access your account.', 'give'); ?>"></span> |
|
| 864 | 864 | </label> |
| 865 | 865 | |
| 866 | 866 | <input name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" |
| 867 | - class="<?php if ( give_no_guest_checkout( $form_id ) ) { |
|
| 867 | + class="<?php if (give_no_guest_checkout($form_id)) { |
|
| 868 | 868 | echo 'required '; |
| 869 | - } ?>give-input" placeholder="<?php _e( 'Password', 'give' ); ?>" type="password"/> |
|
| 869 | + } ?>give-input" placeholder="<?php _e('Password', 'give'); ?>" type="password"/> |
|
| 870 | 870 | </p> |
| 871 | 871 | |
| 872 | 872 | <p id="give-user-pass-confirm-wrap-<?php echo $form_id; ?>" |
| 873 | 873 | class="give-register-password form-row form-row-one-third"> |
| 874 | 874 | <label for="give-user-pass-confirm-<?php echo $form_id; ?>"> |
| 875 | - <?php _e( 'Confirm Password', 'give' ); ?> |
|
| 876 | - <?php if ( give_no_guest_checkout( $form_id ) ) { ?> |
|
| 875 | + <?php _e('Confirm Password', 'give'); ?> |
|
| 876 | + <?php if (give_no_guest_checkout($form_id)) { ?> |
|
| 877 | 877 | <span class="give-required-indicator">*</span> |
| 878 | 878 | <?php } ?> |
| 879 | 879 | <span class="give-tooltip give-icon give-icon-question" |
| 880 | - data-tooltip="<?php _e( 'Please retype your password to confirm.', 'give' ); ?>"></span> |
|
| 880 | + data-tooltip="<?php _e('Please retype your password to confirm.', 'give'); ?>"></span> |
|
| 881 | 881 | </label> |
| 882 | 882 | |
| 883 | 883 | <input name="give_user_pass_confirm" id="give-user-pass-confirm-<?php echo $form_id; ?>" |
| 884 | - class="<?php if ( give_no_guest_checkout( $form_id ) ) { |
|
| 884 | + class="<?php if (give_no_guest_checkout($form_id)) { |
|
| 885 | 885 | echo 'required '; |
| 886 | - } ?>give-input" placeholder="<?php _e( 'Confirm password', 'give' ); ?>" type="password"/> |
|
| 886 | + } ?>give-input" placeholder="<?php _e('Confirm password', 'give'); ?>" type="password"/> |
|
| 887 | 887 | </p> |
| 888 | - <?php do_action( 'give_register_account_fields_after', $form_id ); ?> |
|
| 888 | + <?php do_action('give_register_account_fields_after', $form_id); ?> |
|
| 889 | 889 | </fieldset> |
| 890 | 890 | |
| 891 | - <?php do_action( 'give_register_fields_after', $form_id ); ?> |
|
| 891 | + <?php do_action('give_register_fields_after', $form_id); ?> |
|
| 892 | 892 | |
| 893 | 893 | <input type="hidden" name="give-purchase-var" value="needs-to-register"/> |
| 894 | 894 | |
| 895 | - <?php do_action( 'give_purchase_form_user_info', $form_id ); ?> |
|
| 895 | + <?php do_action('give_purchase_form_user_info', $form_id); ?> |
|
| 896 | 896 | |
| 897 | 897 | </fieldset> |
| 898 | 898 | <?php |
| 899 | 899 | echo ob_get_clean(); |
| 900 | 900 | } |
| 901 | 901 | |
| 902 | -add_action( 'give_purchase_form_register_fields', 'give_get_register_fields' ); |
|
| 902 | +add_action('give_purchase_form_register_fields', 'give_get_register_fields'); |
|
| 903 | 903 | |
| 904 | 904 | /** |
| 905 | 905 | * Gets the login fields for the login form on the checkout. This function hooks |
@@ -912,80 +912,80 @@ discard block |
||
| 912 | 912 | * |
| 913 | 913 | * @return string |
| 914 | 914 | */ |
| 915 | -function give_get_login_fields( $form_id ) { |
|
| 915 | +function give_get_login_fields($form_id) { |
|
| 916 | 916 | |
| 917 | 917 | global $give_options; |
| 918 | 918 | |
| 919 | - $form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : $form_id; |
|
| 920 | - $show_register_form = apply_filters( 'give_show_register_form', get_post_meta( $form_id, '_give_show_register_form', true ) ); |
|
| 919 | + $form_id = isset($_POST['form_id']) ? $_POST['form_id'] : $form_id; |
|
| 920 | + $show_register_form = apply_filters('give_show_register_form', get_post_meta($form_id, '_give_show_register_form', true)); |
|
| 921 | 921 | |
| 922 | 922 | ob_start(); |
| 923 | 923 | ?> |
| 924 | 924 | <fieldset id="give-login-fields-<?php echo $form_id; ?>"> |
| 925 | - <legend><?php echo apply_filters( 'give_account_login_fieldset_heading', __( 'Login to Your Account', 'give' ) ); |
|
| 926 | - if ( ! give_no_guest_checkout( $form_id ) ) { |
|
| 927 | - echo ' <span class="sub-text">' . __( '(optional)', 'give' ) . '</span>'; |
|
| 925 | + <legend><?php echo apply_filters('give_account_login_fieldset_heading', __('Login to Your Account', 'give')); |
|
| 926 | + if ( ! give_no_guest_checkout($form_id)) { |
|
| 927 | + echo ' <span class="sub-text">'.__('(optional)', 'give').'</span>'; |
|
| 928 | 928 | } ?> |
| 929 | 929 | </legend> |
| 930 | - <?php if ( $show_register_form == 'both' ) { ?> |
|
| 930 | + <?php if ($show_register_form == 'both') { ?> |
|
| 931 | 931 | <p class="give-new-account-link"> |
| 932 | - <?php _e( 'Need to create an account?', 'give' ); ?> |
|
| 933 | - <a href="<?php echo remove_query_arg( 'login' ); ?>" class="give-checkout-register-login" |
|
| 932 | + <?php _e('Need to create an account?', 'give'); ?> |
|
| 933 | + <a href="<?php echo remove_query_arg('login'); ?>" class="give-checkout-register-login" |
|
| 934 | 934 | data-action="give_checkout_register"> |
| 935 | - <?php _e( 'Register', 'give' ); |
|
| 936 | - if ( ! give_no_guest_checkout( $form_id ) ) { |
|
| 937 | - echo ' ' . __( 'or checkout as a guest.', 'give' ); |
|
| 935 | + <?php _e('Register', 'give'); |
|
| 936 | + if ( ! give_no_guest_checkout($form_id)) { |
|
| 937 | + echo ' '.__('or checkout as a guest.', 'give'); |
|
| 938 | 938 | } ?> |
| 939 | 939 | </a> |
| 940 | 940 | </p> |
| 941 | 941 | <p class="give-loading-text"> |
| 942 | - <span class="give-loading-animation"></span> <?php _e( 'Loading...', 'give' ); ?></p> |
|
| 942 | + <span class="give-loading-animation"></span> <?php _e('Loading...', 'give'); ?></p> |
|
| 943 | 943 | <?php } ?> |
| 944 | - <?php do_action( 'give_checkout_login_fields_before', $form_id ); ?> |
|
| 944 | + <?php do_action('give_checkout_login_fields_before', $form_id); ?> |
|
| 945 | 945 | <p id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-first"> |
| 946 | 946 | <label class="give-label" for="give-user-login-<?php echo $form_id; ?>"> |
| 947 | - <?php _e( 'Username', 'give' ); ?> |
|
| 948 | - <?php if ( give_no_guest_checkout( $form_id ) ) { ?> |
|
| 947 | + <?php _e('Username', 'give'); ?> |
|
| 948 | + <?php if (give_no_guest_checkout($form_id)) { ?> |
|
| 949 | 949 | <span class="give-required-indicator">*</span> |
| 950 | 950 | <?php } ?> |
| 951 | 951 | </label> |
| 952 | 952 | |
| 953 | - <input class="<?php if ( give_no_guest_checkout( $form_id ) ) { |
|
| 953 | + <input class="<?php if (give_no_guest_checkout($form_id)) { |
|
| 954 | 954 | echo 'required '; |
| 955 | 955 | } ?>give-input" type="text" name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value="" |
| 956 | - placeholder="<?php _e( 'Your username', 'give' ); ?>"/> |
|
| 956 | + placeholder="<?php _e('Your username', 'give'); ?>"/> |
|
| 957 | 957 | </p> |
| 958 | 958 | |
| 959 | 959 | <p id="give-user-pass-wrap-<?php echo $form_id; ?>" class="give_login_password form-row form-row-last"> |
| 960 | 960 | <label class="give-label" for="give-user-pass-<?php echo $form_id; ?>"> |
| 961 | - <?php _e( 'Password', 'give' ); ?> |
|
| 962 | - <?php if ( give_no_guest_checkout( $form_id ) ) { ?> |
|
| 961 | + <?php _e('Password', 'give'); ?> |
|
| 962 | + <?php if (give_no_guest_checkout($form_id)) { ?> |
|
| 963 | 963 | <span class="give-required-indicator">*</span> |
| 964 | 964 | <?php } ?> |
| 965 | 965 | </label> |
| 966 | - <input class="<?php if ( give_no_guest_checkout( $form_id ) ) { |
|
| 966 | + <input class="<?php if (give_no_guest_checkout($form_id)) { |
|
| 967 | 967 | echo 'required '; |
| 968 | 968 | } ?>give-input" type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" |
| 969 | - placeholder="<?php _e( 'Your password', 'give' ); ?>"/> |
|
| 969 | + placeholder="<?php _e('Your password', 'give'); ?>"/> |
|
| 970 | 970 | <input type="hidden" name="give-purchase-var" value="needs-to-login"/> |
| 971 | 971 | </p> |
| 972 | 972 | |
| 973 | 973 | <p id="give-user-login-submit-<?php echo $form_id; ?>" class="give-clearfix"> |
| 974 | 974 | <input type="submit" class="give-submit give-btn button" name="give_login_submit" |
| 975 | - value="<?php _e( 'Login', 'give' ); ?>"/> |
|
| 976 | - <?php if ( $show_register_form !== 'login' ) { ?> |
|
| 975 | + value="<?php _e('Login', 'give'); ?>"/> |
|
| 976 | + <?php if ($show_register_form !== 'login') { ?> |
|
| 977 | 977 | <input type="button" data-action="give_cancel_login" class="give-cancel-login give-btn button" |
| 978 | - name="give_login_cancel" value="<?php _e( 'Cancel', 'give' ); ?>"/> |
|
| 978 | + name="give_login_cancel" value="<?php _e('Cancel', 'give'); ?>"/> |
|
| 979 | 979 | <?php } ?> |
| 980 | 980 | <span class="give-loading-animation"></span> |
| 981 | 981 | </p> |
| 982 | - <?php do_action( 'give_checkout_login_fields_after' ); ?> |
|
| 982 | + <?php do_action('give_checkout_login_fields_after'); ?> |
|
| 983 | 983 | </fieldset><!--end #give-login-fields--> |
| 984 | 984 | <?php |
| 985 | 985 | echo ob_get_clean(); |
| 986 | 986 | } |
| 987 | 987 | |
| 988 | -add_action( 'give_purchase_form_login_fields', 'give_get_login_fields', 10, 1 ); |
|
| 988 | +add_action('give_purchase_form_login_fields', 'give_get_login_fields', 10, 1); |
|
| 989 | 989 | |
| 990 | 990 | /** |
| 991 | 991 | * Payment Mode Select |
@@ -1001,50 +1001,50 @@ discard block |
||
| 1001 | 1001 | * |
| 1002 | 1002 | * @return void |
| 1003 | 1003 | */ |
| 1004 | -function give_payment_mode_select( $form_id ) { |
|
| 1004 | +function give_payment_mode_select($form_id) { |
|
| 1005 | 1005 | |
| 1006 | 1006 | $gateways = give_get_enabled_payment_gateways(); |
| 1007 | 1007 | |
| 1008 | - do_action( 'give_payment_mode_top', $form_id ); ?> |
|
| 1008 | + do_action('give_payment_mode_top', $form_id); ?> |
|
| 1009 | 1009 | |
| 1010 | 1010 | <fieldset id="give-payment-mode-select"> |
| 1011 | - <?php do_action( 'give_payment_mode_before_gateways_wrap' ); ?> |
|
| 1011 | + <?php do_action('give_payment_mode_before_gateways_wrap'); ?> |
|
| 1012 | 1012 | <div id="give-payment-mode-wrap"> |
| 1013 | 1013 | <legend |
| 1014 | - class="give-payment-mode-label"><?php echo apply_filters( 'give_checkout_payment_method_text', __( 'Select Payment Method', 'give' ) ); ?> |
|
| 1014 | + class="give-payment-mode-label"><?php echo apply_filters('give_checkout_payment_method_text', __('Select Payment Method', 'give')); ?> |
|
| 1015 | 1015 | <span class="give-loading-text"><span |
| 1016 | - class="give-loading-animation"></span> <?php _e( 'Loading...', 'give' ); ?></span></legend> |
|
| 1016 | + class="give-loading-animation"></span> <?php _e('Loading...', 'give'); ?></span></legend> |
|
| 1017 | 1017 | <?php |
| 1018 | 1018 | |
| 1019 | - do_action( 'give_payment_mode_before_gateways' ) ?> |
|
| 1019 | + do_action('give_payment_mode_before_gateways') ?> |
|
| 1020 | 1020 | |
| 1021 | 1021 | <ul id="give-gateway-radio-list"> |
| 1022 | - <?php foreach ( $gateways as $gateway_id => $gateway ) : |
|
| 1023 | - $checked = checked( $gateway_id, give_get_default_gateway( $form_id ), false ); |
|
| 1022 | + <?php foreach ($gateways as $gateway_id => $gateway) : |
|
| 1023 | + $checked = checked($gateway_id, give_get_default_gateway($form_id), false); |
|
| 1024 | 1024 | $checked_class = $checked ? ' give-gateway-option-selected' : ''; |
| 1025 | - echo '<li><label for="give-gateway-' . esc_attr( $gateway_id ) . '-' . $form_id . '" class="give-gateway-option' . $checked_class . '" id="give-gateway-option-' . esc_attr( $gateway_id ) . '">'; |
|
| 1026 | - echo '<input type="radio" name="payment-mode" class="give-gateway" id="give-gateway-' . esc_attr( $gateway_id ) . '-' . $form_id . '" value="' . esc_attr( $gateway_id ) . '"' . $checked . '>' . esc_html( $gateway['checkout_label'] ); |
|
| 1025 | + echo '<li><label for="give-gateway-'.esc_attr($gateway_id).'-'.$form_id.'" class="give-gateway-option'.$checked_class.'" id="give-gateway-option-'.esc_attr($gateway_id).'">'; |
|
| 1026 | + echo '<input type="radio" name="payment-mode" class="give-gateway" id="give-gateway-'.esc_attr($gateway_id).'-'.$form_id.'" value="'.esc_attr($gateway_id).'"'.$checked.'>'.esc_html($gateway['checkout_label']); |
|
| 1027 | 1027 | echo '</label></li>'; |
| 1028 | 1028 | endforeach; ?> |
| 1029 | 1029 | </ul> |
| 1030 | - <?php do_action( 'give_payment_mode_after_gateways' ); ?> |
|
| 1030 | + <?php do_action('give_payment_mode_after_gateways'); ?> |
|
| 1031 | 1031 | </div> |
| 1032 | - <?php do_action( 'give_payment_mode_after_gateways_wrap' ); ?> |
|
| 1032 | + <?php do_action('give_payment_mode_after_gateways_wrap'); ?> |
|
| 1033 | 1033 | </fieldset> |
| 1034 | 1034 | |
| 1035 | - <?php do_action( 'give_payment_mode_bottom', $form_id ); ?> |
|
| 1035 | + <?php do_action('give_payment_mode_bottom', $form_id); ?> |
|
| 1036 | 1036 | |
| 1037 | 1037 | <div id="give_purchase_form_wrap"> |
| 1038 | 1038 | |
| 1039 | - <?php do_action( 'give_purchase_form', $form_id ); ?> |
|
| 1039 | + <?php do_action('give_purchase_form', $form_id); ?> |
|
| 1040 | 1040 | |
| 1041 | 1041 | </div><!-- the checkout fields are loaded into this--> |
| 1042 | 1042 | |
| 1043 | - <?php do_action( 'give_purchase_form_wrap_bottom', $form_id ); |
|
| 1043 | + <?php do_action('give_purchase_form_wrap_bottom', $form_id); |
|
| 1044 | 1044 | |
| 1045 | 1045 | } |
| 1046 | 1046 | |
| 1047 | -add_action( 'give_payment_mode_select', 'give_payment_mode_select' ); |
|
| 1047 | +add_action('give_payment_mode_select', 'give_payment_mode_select'); |
|
| 1048 | 1048 | |
| 1049 | 1049 | |
| 1050 | 1050 | /** |
@@ -1059,35 +1059,35 @@ discard block |
||
| 1059 | 1059 | * |
| 1060 | 1060 | * @return void |
| 1061 | 1061 | */ |
| 1062 | -function give_terms_agreement( $form_id ) { |
|
| 1062 | +function give_terms_agreement($form_id) { |
|
| 1063 | 1063 | |
| 1064 | - $form_option = get_post_meta( $form_id, '_give_terms_option', true ); |
|
| 1065 | - $label = get_post_meta( $form_id, '_give_agree_label', true ); |
|
| 1066 | - $terms = get_post_meta( $form_id, '_give_agree_text', true ); |
|
| 1064 | + $form_option = get_post_meta($form_id, '_give_terms_option', true); |
|
| 1065 | + $label = get_post_meta($form_id, '_give_agree_label', true); |
|
| 1066 | + $terms = get_post_meta($form_id, '_give_agree_text', true); |
|
| 1067 | 1067 | |
| 1068 | - if ( $form_option === 'yes' && ! empty( $terms ) ) { ?> |
|
| 1068 | + if ($form_option === 'yes' && ! empty($terms)) { ?> |
|
| 1069 | 1069 | <fieldset id="give_terms_agreement"> |
| 1070 | 1070 | <div id="give_terms" style="display:none;"> |
| 1071 | 1071 | <?php |
| 1072 | - do_action( 'give_before_terms' ); |
|
| 1073 | - echo wpautop( stripslashes( $terms ) ); |
|
| 1074 | - do_action( 'give_after_terms' ); |
|
| 1072 | + do_action('give_before_terms'); |
|
| 1073 | + echo wpautop(stripslashes($terms)); |
|
| 1074 | + do_action('give_after_terms'); |
|
| 1075 | 1075 | ?> |
| 1076 | 1076 | </div> |
| 1077 | 1077 | <div id="give_show_terms"> |
| 1078 | - <a href="#" class="give_terms_links"><?php _e( 'Show Terms', 'give' ); ?></a> |
|
| 1079 | - <a href="#" class="give_terms_links" style="display:none;"><?php _e( 'Hide Terms', 'give' ); ?></a> |
|
| 1078 | + <a href="#" class="give_terms_links"><?php _e('Show Terms', 'give'); ?></a> |
|
| 1079 | + <a href="#" class="give_terms_links" style="display:none;"><?php _e('Hide Terms', 'give'); ?></a> |
|
| 1080 | 1080 | </div> |
| 1081 | 1081 | |
| 1082 | 1082 | <label |
| 1083 | - for="give_agree_to_terms"><?php echo ! empty( $label ) ? stripslashes( $label ) : __( 'Agree to Terms?', 'give' ); ?></label> |
|
| 1083 | + for="give_agree_to_terms"><?php echo ! empty($label) ? stripslashes($label) : __('Agree to Terms?', 'give'); ?></label> |
|
| 1084 | 1084 | <input name="give_agree_to_terms" class="required" type="checkbox" id="give_agree_to_terms" value="1"/> |
| 1085 | 1085 | </fieldset> |
| 1086 | 1086 | <?php |
| 1087 | 1087 | } |
| 1088 | 1088 | } |
| 1089 | 1089 | |
| 1090 | -add_action( 'give_purchase_form_before_submit', 'give_terms_agreement', 10, 1 ); |
|
| 1090 | +add_action('give_purchase_form_before_submit', 'give_terms_agreement', 10, 1); |
|
| 1091 | 1091 | |
| 1092 | 1092 | /** |
| 1093 | 1093 | * Checkout Final Total |
@@ -1099,29 +1099,29 @@ discard block |
||
| 1099 | 1099 | * @since 1.0 |
| 1100 | 1100 | * @return void |
| 1101 | 1101 | */ |
| 1102 | -function give_checkout_final_total( $form_id ) { |
|
| 1102 | +function give_checkout_final_total($form_id) { |
|
| 1103 | 1103 | |
| 1104 | - if ( isset( $_POST['give_total'] ) ) { |
|
| 1105 | - $total = apply_filters( 'give_donation_total', $_POST['give_total'] ); |
|
| 1104 | + if (isset($_POST['give_total'])) { |
|
| 1105 | + $total = apply_filters('give_donation_total', $_POST['give_total']); |
|
| 1106 | 1106 | } else { |
| 1107 | 1107 | //default total |
| 1108 | - $total = give_get_default_form_amount( $form_id ); |
|
| 1108 | + $total = give_get_default_form_amount($form_id); |
|
| 1109 | 1109 | } |
| 1110 | 1110 | //Only proceed if give_total available |
| 1111 | - if ( empty( $total ) ) { |
|
| 1111 | + if (empty($total)) { |
|
| 1112 | 1112 | return; |
| 1113 | 1113 | } |
| 1114 | 1114 | ?> |
| 1115 | 1115 | <p id="give-final-total-wrap" class="form-wrap "> |
| 1116 | 1116 | <span |
| 1117 | - class="give-donation-total-label"><?php echo apply_filters( 'give_donation_total_label', esc_attr__( 'Donation Total:', 'give' ) ); ?></span> |
|
| 1117 | + class="give-donation-total-label"><?php echo apply_filters('give_donation_total_label', esc_attr__('Donation Total:', 'give')); ?></span> |
|
| 1118 | 1118 | <span class="give-final-total-amount" |
| 1119 | - data-total="<?php echo give_format_amount( $total ); ?>"><?php echo give_currency_filter( give_format_amount( $total ) ); ?></span> |
|
| 1119 | + data-total="<?php echo give_format_amount($total); ?>"><?php echo give_currency_filter(give_format_amount($total)); ?></span> |
|
| 1120 | 1120 | </p> |
| 1121 | 1121 | <?php |
| 1122 | 1122 | } |
| 1123 | 1123 | |
| 1124 | -add_action( 'give_purchase_form_before_submit', 'give_checkout_final_total', 999 ); |
|
| 1124 | +add_action('give_purchase_form_before_submit', 'give_checkout_final_total', 999); |
|
| 1125 | 1125 | |
| 1126 | 1126 | |
| 1127 | 1127 | /** |
@@ -1133,22 +1133,22 @@ discard block |
||
| 1133 | 1133 | * |
| 1134 | 1134 | * @return void |
| 1135 | 1135 | */ |
| 1136 | -function give_checkout_submit( $form_id ) { |
|
| 1136 | +function give_checkout_submit($form_id) { |
|
| 1137 | 1137 | ?> |
| 1138 | 1138 | <fieldset id="give_purchase_submit"> |
| 1139 | - <?php do_action( 'give_purchase_form_before_submit', $form_id ); ?> |
|
| 1139 | + <?php do_action('give_purchase_form_before_submit', $form_id); ?> |
|
| 1140 | 1140 | |
| 1141 | - <?php give_checkout_hidden_fields( $form_id ); ?> |
|
| 1141 | + <?php give_checkout_hidden_fields($form_id); ?> |
|
| 1142 | 1142 | |
| 1143 | - <?php echo give_checkout_button_purchase( $form_id ); ?> |
|
| 1143 | + <?php echo give_checkout_button_purchase($form_id); ?> |
|
| 1144 | 1144 | |
| 1145 | - <?php do_action( 'give_purchase_form_after_submit', $form_id ); ?> |
|
| 1145 | + <?php do_action('give_purchase_form_after_submit', $form_id); ?> |
|
| 1146 | 1146 | |
| 1147 | 1147 | </fieldset> |
| 1148 | 1148 | <?php |
| 1149 | 1149 | } |
| 1150 | 1150 | |
| 1151 | -add_action( 'give_purchase_form_after_cc_form', 'give_checkout_submit', 9999 ); |
|
| 1151 | +add_action('give_purchase_form_after_cc_form', 'give_checkout_submit', 9999); |
|
| 1152 | 1152 | |
| 1153 | 1153 | |
| 1154 | 1154 | /** |
@@ -1161,10 +1161,10 @@ discard block |
||
| 1161 | 1161 | * |
| 1162 | 1162 | * @return string |
| 1163 | 1163 | */ |
| 1164 | -function give_checkout_button_purchase( $form_id ) { |
|
| 1164 | +function give_checkout_button_purchase($form_id) { |
|
| 1165 | 1165 | |
| 1166 | - $display_label_field = get_post_meta( $form_id, '_give_checkout_label', true ); |
|
| 1167 | - $display_label = ( ! empty( $display_label_field ) ? $display_label_field : __( 'Donate Now', 'give' ) ); |
|
| 1166 | + $display_label_field = get_post_meta($form_id, '_give_checkout_label', true); |
|
| 1167 | + $display_label = ( ! empty($display_label_field) ? $display_label_field : __('Donate Now', 'give')); |
|
| 1168 | 1168 | |
| 1169 | 1169 | ob_start(); |
| 1170 | 1170 | |
@@ -1176,7 +1176,7 @@ discard block |
||
| 1176 | 1176 | <span class="give-loading-animation"></span> |
| 1177 | 1177 | </div> |
| 1178 | 1178 | <?php |
| 1179 | - return apply_filters( 'give_checkout_button_purchase', ob_get_clean(), $form_id ); |
|
| 1179 | + return apply_filters('give_checkout_button_purchase', ob_get_clean(), $form_id); |
|
| 1180 | 1180 | } |
| 1181 | 1181 | |
| 1182 | 1182 | /** |
@@ -1190,11 +1190,11 @@ discard block |
||
| 1190 | 1190 | * |
| 1191 | 1191 | * @return void |
| 1192 | 1192 | */ |
| 1193 | -function give_agree_to_terms_js( $form_id ) { |
|
| 1193 | +function give_agree_to_terms_js($form_id) { |
|
| 1194 | 1194 | |
| 1195 | - $form_option = get_post_meta( $form_id, '_give_terms_option', true ); |
|
| 1195 | + $form_option = get_post_meta($form_id, '_give_terms_option', true); |
|
| 1196 | 1196 | |
| 1197 | - if ( $form_option === 'yes' ) { |
|
| 1197 | + if ($form_option === 'yes') { |
|
| 1198 | 1198 | ?> |
| 1199 | 1199 | <script type="text/javascript"> |
| 1200 | 1200 | jQuery(document).ready(function ($) { |
@@ -1210,7 +1210,7 @@ discard block |
||
| 1210 | 1210 | } |
| 1211 | 1211 | } |
| 1212 | 1212 | |
| 1213 | -add_action( 'give_checkout_form_top', 'give_agree_to_terms_js', 10, 2 ); |
|
| 1213 | +add_action('give_checkout_form_top', 'give_agree_to_terms_js', 10, 2); |
|
| 1214 | 1214 | |
| 1215 | 1215 | |
| 1216 | 1216 | /** |
@@ -1223,19 +1223,19 @@ discard block |
||
| 1223 | 1223 | * |
| 1224 | 1224 | * @return void |
| 1225 | 1225 | */ |
| 1226 | -function give_form_content( $form_id, $args ) { |
|
| 1226 | +function give_form_content($form_id, $args) { |
|
| 1227 | 1227 | |
| 1228 | - $show_content = ( isset( $args['show_content'] ) && ! empty( $args['show_content'] ) ) |
|
| 1228 | + $show_content = (isset($args['show_content']) && ! empty($args['show_content'])) |
|
| 1229 | 1229 | ? $args['show_content'] |
| 1230 | - : get_post_meta( $form_id, '_give_content_option', true ); |
|
| 1230 | + : get_post_meta($form_id, '_give_content_option', true); |
|
| 1231 | 1231 | |
| 1232 | - if ( $show_content !== 'none' ) { |
|
| 1232 | + if ($show_content !== 'none') { |
|
| 1233 | 1233 | //add action according to value |
| 1234 | - add_action( $show_content, 'give_form_display_content' ); |
|
| 1234 | + add_action($show_content, 'give_form_display_content'); |
|
| 1235 | 1235 | } |
| 1236 | 1236 | } |
| 1237 | 1237 | |
| 1238 | -add_action( 'give_pre_form_output', 'give_form_content', 10, 2 ); |
|
| 1238 | +add_action('give_pre_form_output', 'give_form_content', 10, 2); |
|
| 1239 | 1239 | |
| 1240 | 1240 | /** |
| 1241 | 1241 | * Show Give Goals |
@@ -1247,24 +1247,24 @@ discard block |
||
| 1247 | 1247 | * @return mixed |
| 1248 | 1248 | */ |
| 1249 | 1249 | |
| 1250 | -function give_show_goal_progress( $form_id, $args ) { |
|
| 1250 | +function give_show_goal_progress($form_id, $args) { |
|
| 1251 | 1251 | |
| 1252 | - $goal_option = get_post_meta( $form_id, '_give_goal_option', true ); |
|
| 1253 | - $form = new Give_Donate_Form( $form_id ); |
|
| 1252 | + $goal_option = get_post_meta($form_id, '_give_goal_option', true); |
|
| 1253 | + $form = new Give_Donate_Form($form_id); |
|
| 1254 | 1254 | $goal = $form->goal; |
| 1255 | 1255 | $income = $form->get_earnings(); |
| 1256 | - $color = get_post_meta( $form_id, '_give_goal_color', true ); |
|
| 1257 | - $show_text = (bool) isset( $args['show_text'] ) ? filter_var( $args['show_text'], FILTER_VALIDATE_BOOLEAN ) : true; |
|
| 1258 | - $show_bar = (bool) isset( $args['show_bar'] ) ? filter_var( $args['show_bar'], FILTER_VALIDATE_BOOLEAN ) : true; |
|
| 1256 | + $color = get_post_meta($form_id, '_give_goal_color', true); |
|
| 1257 | + $show_text = (bool) isset($args['show_text']) ? filter_var($args['show_text'], FILTER_VALIDATE_BOOLEAN) : true; |
|
| 1258 | + $show_bar = (bool) isset($args['show_bar']) ? filter_var($args['show_bar'], FILTER_VALIDATE_BOOLEAN) : true; |
|
| 1259 | 1259 | |
| 1260 | 1260 | //Sanity check - respect shortcode args |
| 1261 | - if ( isset( $args['show_goal'] ) && $args['show_goal'] === false ) { |
|
| 1261 | + if (isset($args['show_goal']) && $args['show_goal'] === false) { |
|
| 1262 | 1262 | return false; |
| 1263 | 1263 | } |
| 1264 | 1264 | |
| 1265 | 1265 | //Sanity check - ensure form has goal set to output |
| 1266 | - if ( empty( $form->ID ) |
|
| 1267 | - || ( is_singular( 'give_forms' ) && $goal_option !== 'yes' ) |
|
| 1266 | + if (empty($form->ID) |
|
| 1267 | + || (is_singular('give_forms') && $goal_option !== 'yes') |
|
| 1268 | 1268 | || $goal_option !== 'yes' |
| 1269 | 1269 | || $goal == 0 |
| 1270 | 1270 | ) { |
@@ -1272,26 +1272,26 @@ discard block |
||
| 1272 | 1272 | return false; |
| 1273 | 1273 | } |
| 1274 | 1274 | |
| 1275 | - $progress = round( ( $income / $goal ) * 100, 2 ); |
|
| 1275 | + $progress = round(($income / $goal) * 100, 2); |
|
| 1276 | 1276 | |
| 1277 | - if ( $income > $goal ) { |
|
| 1277 | + if ($income > $goal) { |
|
| 1278 | 1278 | $progress = 100; |
| 1279 | 1279 | } |
| 1280 | 1280 | |
| 1281 | 1281 | $output = '<div class="give-goal-progress">'; |
| 1282 | 1282 | |
| 1283 | 1283 | //Goal Progress Text |
| 1284 | - if ( ! empty( $show_text ) ) { |
|
| 1284 | + if ( ! empty($show_text)) { |
|
| 1285 | 1285 | $output .= '<div class="raised">'; |
| 1286 | - $output .= sprintf( _x( '%s of %s raised', 'This text displays the amount of income raised compared to the goal.', 'give' ), '<span class="income">' . give_currency_filter( give_format_amount( $income ) ) . '</span>', '<span class="goal-text">' . give_currency_filter( give_format_amount( $goal ) ) ) . '</span>'; |
|
| 1286 | + $output .= sprintf(_x('%s of %s raised', 'This text displays the amount of income raised compared to the goal.', 'give'), '<span class="income">'.give_currency_filter(give_format_amount($income)).'</span>', '<span class="goal-text">'.give_currency_filter(give_format_amount($goal))).'</span>'; |
|
| 1287 | 1287 | $output .= '</div>'; |
| 1288 | 1288 | } |
| 1289 | 1289 | //Goal Progress Bar |
| 1290 | - if ( ! empty( $show_bar ) ) { |
|
| 1290 | + if ( ! empty($show_bar)) { |
|
| 1291 | 1291 | $output .= '<div class="give-progress-bar">'; |
| 1292 | - $output .= '<span style="width: ' . esc_attr( $progress ) . '%;'; |
|
| 1293 | - if ( ! empty( $color ) ) { |
|
| 1294 | - $output .= 'background-color:' . $color; |
|
| 1292 | + $output .= '<span style="width: '.esc_attr($progress).'%;'; |
|
| 1293 | + if ( ! empty($color)) { |
|
| 1294 | + $output .= 'background-color:'.$color; |
|
| 1295 | 1295 | } |
| 1296 | 1296 | $output .= '"></span>'; |
| 1297 | 1297 | $output .= '</div><!-- /.give-progress-bar -->'; |
@@ -1299,13 +1299,13 @@ discard block |
||
| 1299 | 1299 | |
| 1300 | 1300 | $output .= '</div><!-- /.goal-progress -->'; |
| 1301 | 1301 | |
| 1302 | - echo apply_filters( 'give_goal_output', $output ); |
|
| 1302 | + echo apply_filters('give_goal_output', $output); |
|
| 1303 | 1303 | |
| 1304 | 1304 | return false; |
| 1305 | 1305 | |
| 1306 | 1306 | } |
| 1307 | 1307 | |
| 1308 | -add_action( 'give_pre_form', 'give_show_goal_progress', 10, 2 ); |
|
| 1308 | +add_action('give_pre_form', 'give_show_goal_progress', 10, 2); |
|
| 1309 | 1309 | |
| 1310 | 1310 | /** |
| 1311 | 1311 | * Renders Post Form Content |
@@ -1317,17 +1317,17 @@ discard block |
||
| 1317 | 1317 | * @return void |
| 1318 | 1318 | * @since 1.0 |
| 1319 | 1319 | */ |
| 1320 | -function give_form_display_content( $form_id ) { |
|
| 1320 | +function give_form_display_content($form_id) { |
|
| 1321 | 1321 | |
| 1322 | - $content = wpautop( get_post_meta( $form_id, '_give_form_content', true ) ); |
|
| 1322 | + $content = wpautop(get_post_meta($form_id, '_give_form_content', true)); |
|
| 1323 | 1323 | |
| 1324 | - if ( give_get_option( 'disable_the_content_filter' ) !== 'on' ) { |
|
| 1325 | - $content = apply_filters( 'the_content', $content ); |
|
| 1324 | + if (give_get_option('disable_the_content_filter') !== 'on') { |
|
| 1325 | + $content = apply_filters('the_content', $content); |
|
| 1326 | 1326 | } |
| 1327 | 1327 | |
| 1328 | - $output = '<div id="give-form-content-' . $form_id . '" class="give-form-content-wrap" >' . $content . '</div>'; |
|
| 1328 | + $output = '<div id="give-form-content-'.$form_id.'" class="give-form-content-wrap" >'.$content.'</div>'; |
|
| 1329 | 1329 | |
| 1330 | - echo apply_filters( 'give_form_content_output', $output ); |
|
| 1330 | + echo apply_filters('give_form_content_output', $output); |
|
| 1331 | 1331 | } |
| 1332 | 1332 | |
| 1333 | 1333 | |
@@ -1340,16 +1340,16 @@ discard block |
||
| 1340 | 1340 | * |
| 1341 | 1341 | * @return void |
| 1342 | 1342 | */ |
| 1343 | -function give_checkout_hidden_fields( $form_id ) { |
|
| 1343 | +function give_checkout_hidden_fields($form_id) { |
|
| 1344 | 1344 | |
| 1345 | - do_action( 'give_hidden_fields_before', $form_id ); |
|
| 1346 | - if ( is_user_logged_in() ) { ?> |
|
| 1345 | + do_action('give_hidden_fields_before', $form_id); |
|
| 1346 | + if (is_user_logged_in()) { ?> |
|
| 1347 | 1347 | <input type="hidden" name="give-user-id" value="<?php echo get_current_user_id(); ?>"/> |
| 1348 | 1348 | <?php } ?> |
| 1349 | 1349 | <input type="hidden" name="give_action" value="purchase"/> |
| 1350 | - <input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway( $form_id ); ?>"/> |
|
| 1350 | + <input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway($form_id); ?>"/> |
|
| 1351 | 1351 | <?php |
| 1352 | - do_action( 'give_hidden_fields_after', $form_id ); |
|
| 1352 | + do_action('give_hidden_fields_after', $form_id); |
|
| 1353 | 1353 | |
| 1354 | 1354 | } |
| 1355 | 1355 | |
@@ -1364,20 +1364,20 @@ discard block |
||
| 1364 | 1364 | * |
| 1365 | 1365 | * @return string $content Filtered content |
| 1366 | 1366 | */ |
| 1367 | -function give_filter_success_page_content( $content ) { |
|
| 1367 | +function give_filter_success_page_content($content) { |
|
| 1368 | 1368 | |
| 1369 | 1369 | global $give_options; |
| 1370 | 1370 | |
| 1371 | - if ( isset( $give_options['success_page'] ) && isset( $_GET['payment-confirmation'] ) && is_page( $give_options['success_page'] ) ) { |
|
| 1372 | - if ( has_filter( 'give_payment_confirm_' . $_GET['payment-confirmation'] ) ) { |
|
| 1373 | - $content = apply_filters( 'give_payment_confirm_' . $_GET['payment-confirmation'], $content ); |
|
| 1371 | + if (isset($give_options['success_page']) && isset($_GET['payment-confirmation']) && is_page($give_options['success_page'])) { |
|
| 1372 | + if (has_filter('give_payment_confirm_'.$_GET['payment-confirmation'])) { |
|
| 1373 | + $content = apply_filters('give_payment_confirm_'.$_GET['payment-confirmation'], $content); |
|
| 1374 | 1374 | } |
| 1375 | 1375 | } |
| 1376 | 1376 | |
| 1377 | 1377 | return $content; |
| 1378 | 1378 | } |
| 1379 | 1379 | |
| 1380 | -add_filter( 'the_content', 'give_filter_success_page_content' ); |
|
| 1380 | +add_filter('the_content', 'give_filter_success_page_content'); |
|
| 1381 | 1381 | |
| 1382 | 1382 | |
| 1383 | 1383 | /** |
@@ -1389,11 +1389,11 @@ discard block |
||
| 1389 | 1389 | |
| 1390 | 1390 | function give_test_mode_frontend_warning() { |
| 1391 | 1391 | |
| 1392 | - $test_mode = give_get_option( 'test_mode' ); |
|
| 1392 | + $test_mode = give_get_option('test_mode'); |
|
| 1393 | 1393 | |
| 1394 | - if ( $test_mode == 'on' ) { |
|
| 1395 | - echo '<div class="give_error give_warning" id="give_error_test_mode"><p><strong>' . __( 'Notice', 'give' ) . '</strong>: ' . esc_attr__( 'Test mode is enabled. While in test mode no live transactions are processed.', 'give' ) . '</p></div>'; |
|
| 1394 | + if ($test_mode == 'on') { |
|
| 1395 | + echo '<div class="give_error give_warning" id="give_error_test_mode"><p><strong>'.__('Notice', 'give').'</strong>: '.esc_attr__('Test mode is enabled. While in test mode no live transactions are processed.', 'give').'</p></div>'; |
|
| 1396 | 1396 | } |
| 1397 | 1397 | } |
| 1398 | 1398 | |
| 1399 | -add_action( 'give_pre_form', 'give_test_mode_frontend_warning', 10 ); |
|
| 1399 | +add_action('give_pre_form', 'give_test_mode_frontend_warning', 10); |
|
@@ -780,9 +780,12 @@ |
||
| 780 | 780 | } |
| 781 | 781 | ?> |
| 782 | 782 | </select> |
| 783 | - <?php else : ?> |
|
| 783 | + <?php else { |
|
| 784 | + : ?> |
|
| 784 | 785 | <input type="text" size="6" name="card_state" id="card_state" class="card_state give-input" |
| 785 | - placeholder="<?php _e( 'State / Province', 'give' ); ?>"/> |
|
| 786 | + placeholder="<?php _e( 'State / Province', 'give' ); |
|
| 787 | +} |
|
| 788 | +?>"/> |
|
| 786 | 789 | <?php endif; ?> |
| 787 | 790 | </p> |
| 788 | 791 | <?php do_action( 'give_cc_billing_bottom' ); ?> |