@@ -740,8 +740,11 @@ |
||
| 740 | 740 | } |
| 741 | 741 | ?> |
| 742 | 742 | </select> |
| 743 | - <?php else : ?> |
|
| 744 | - <input type="text" size="6" name="card_state" id="card_state" class="card_state give-input" placeholder="<?php _e( 'State / Province', 'give' ); ?>"/> |
|
| 743 | + <?php else { |
|
| 744 | + : ?> |
|
| 745 | + <input type="text" size="6" name="card_state" id="card_state" class="card_state give-input" placeholder="<?php _e( 'State / Province', 'give' ); |
|
| 746 | +} |
|
| 747 | +?>"/> |
|
| 745 | 748 | <?php endif; ?> |
| 746 | 749 | </p> |
| 747 | 750 | <?php do_action( 'give_cc_billing_bottom' ); ?> |
@@ -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,64 +23,64 @@ 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 | - $form_id = is_object( $post ) ? $post->ID : 0; |
|
| 30 | + $form_id = is_object($post) ? $post->ID : 0; |
|
| 31 | 31 | |
| 32 | - if ( isset( $args['id'] ) ) { |
|
| 32 | + if (isset($args['id'])) { |
|
| 33 | 33 | $form_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' => $form_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 | 57 | //Sanity Check: Donation form not published or user doesn't have permission to view drafts |
| 58 | - if ( 'publish' !== $form->post_status && ! current_user_can( 'edit_give_forms', $form->ID ) ) { |
|
| 58 | + if ('publish' !== $form->post_status && ! current_user_can('edit_give_forms', $form->ID)) { |
|
| 59 | 59 | return false; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - $display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) ) |
|
| 62 | + $display_option = (isset($args['display_style']) && ! empty($args['display_style'])) |
|
| 63 | 63 | ? $args['display_style'] |
| 64 | - : get_post_meta( $form->ID, '_give_payment_display', true ); |
|
| 64 | + : get_post_meta($form->ID, '_give_payment_display', true); |
|
| 65 | 65 | |
| 66 | - $float_labels_option = give_is_float_labels_enabled( $args ) |
|
| 66 | + $float_labels_option = give_is_float_labels_enabled($args) |
|
| 67 | 67 | ? ' float-labels-enabled' |
| 68 | 68 | : ''; |
| 69 | 69 | |
| 70 | 70 | //Form Wrap Classes |
| 71 | - $form_wrap_classes_array = apply_filters( 'give_form_wrap_classes', array( |
|
| 71 | + $form_wrap_classes_array = apply_filters('give_form_wrap_classes', array( |
|
| 72 | 72 | 'give-form-wrap', |
| 73 | - 'give-display-' . $display_option |
|
| 74 | - ), $form->ID, $args ); |
|
| 75 | - $form_wrap_classes = implode( ' ', $form_wrap_classes_array ); |
|
| 73 | + 'give-display-'.$display_option |
|
| 74 | + ), $form->ID, $args); |
|
| 75 | + $form_wrap_classes = implode(' ', $form_wrap_classes_array); |
|
| 76 | 76 | |
| 77 | 77 | //Form Classes |
| 78 | - $form_classes_array = apply_filters( 'give_form_classes', array( |
|
| 78 | + $form_classes_array = apply_filters('give_form_classes', array( |
|
| 79 | 79 | 'give-form', |
| 80 | - 'give-form-' . $form->ID, |
|
| 80 | + 'give-form-'.$form->ID, |
|
| 81 | 81 | $float_labels_option |
| 82 | - ), $form->ID, $args ); |
|
| 83 | - $form_classes = implode( ' ', $form_classes_array ); |
|
| 82 | + ), $form->ID, $args); |
|
| 83 | + $form_classes = implode(' ', $form_classes_array); |
|
| 84 | 84 | |
| 85 | 85 | |
| 86 | 86 | ob_start(); |
@@ -93,35 +93,35 @@ discard block |
||
| 93 | 93 | * @param int $form ->ID The current form ID |
| 94 | 94 | * @param array $args An array of form args |
| 95 | 95 | */ |
| 96 | - do_action( 'give_pre_form_output', $form->ID, $args ); ?> |
|
| 96 | + do_action('give_pre_form_output', $form->ID, $args); ?> |
|
| 97 | 97 | |
| 98 | 98 | <div id="give-form-<?php echo $form->ID; ?>-wrap" class="<?php echo $form_wrap_classes; ?>"> |
| 99 | 99 | |
| 100 | - <?php if ( $form->is_close_donation_form() ) { |
|
| 100 | + <?php if ($form->is_close_donation_form()) { |
|
| 101 | 101 | |
| 102 | 102 | //Get Goal thank you message. |
| 103 | - $display_thankyou_message = get_post_meta( $form->ID, '_give_form_goal_achieved_message', true ); |
|
| 104 | - $display_thankyou_message = ! empty( $display_thankyou_message ) ? $display_thankyou_message : __( 'Thank you to all our donors, we have met our fundraising goal.', 'give' ); |
|
| 103 | + $display_thankyou_message = get_post_meta($form->ID, '_give_form_goal_achieved_message', true); |
|
| 104 | + $display_thankyou_message = ! empty($display_thankyou_message) ? $display_thankyou_message : __('Thank you to all our donors, we have met our fundraising goal.', 'give'); |
|
| 105 | 105 | |
| 106 | 106 | //Print thank you message. |
| 107 | - apply_filters( 'give_goal_closed_output', give_output_error( $display_thankyou_message, true, 'success' ) ); |
|
| 107 | + apply_filters('give_goal_closed_output', give_output_error($display_thankyou_message, true, 'success')); |
|
| 108 | 108 | |
| 109 | 109 | } else { |
| 110 | 110 | |
| 111 | - if ( isset( $args['show_title'] ) && $args['show_title'] == true ) { |
|
| 111 | + if (isset($args['show_title']) && $args['show_title'] == true) { |
|
| 112 | 112 | |
| 113 | - echo apply_filters( 'give_form_title', '<h2 class="give-form-title">' . get_the_title( $form_id ) . '</h2>' ); |
|
| 113 | + echo apply_filters('give_form_title', '<h2 class="give-form-title">'.get_the_title($form_id).'</h2>'); |
|
| 114 | 114 | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - do_action( 'give_pre_form', $form->ID, $args ); ?> |
|
| 117 | + do_action('give_pre_form', $form->ID, $args); ?> |
|
| 118 | 118 | |
| 119 | 119 | <form id="give-form-<?php echo $form_id; ?>" class="<?php echo $form_classes; ?>" action="<?php echo $form_action; ?>" method="post"> |
| 120 | 120 | <input type="hidden" name="give-form-id" value="<?php echo $form->ID; ?>"/> |
| 121 | - <input type="hidden" name="give-form-title" value="<?php echo htmlentities( $form->post_title ); ?>"/> |
|
| 122 | - <input type="hidden" name="give-current-url" value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/> |
|
| 123 | - <input type="hidden" name="give-form-url" value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/> |
|
| 124 | - <input type="hidden" name="give-form-minimum" value="<?php echo give_format_amount( give_get_form_minimum_price( $form->ID ) ); ?>"/> |
|
| 121 | + <input type="hidden" name="give-form-title" value="<?php echo htmlentities($form->post_title); ?>"/> |
|
| 122 | + <input type="hidden" name="give-current-url" value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/> |
|
| 123 | + <input type="hidden" name="give-form-url" value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/> |
|
| 124 | + <input type="hidden" name="give-form-minimum" value="<?php echo give_format_amount(give_get_form_minimum_price($form->ID)); ?>"/> |
|
| 125 | 125 | |
| 126 | 126 | <!-- The following field is for robots only, invisible to humans: --> |
| 127 | 127 | <span class="give-hidden" style="display: none !important;"> |
@@ -132,13 +132,13 @@ discard block |
||
| 132 | 132 | <?php |
| 133 | 133 | |
| 134 | 134 | //Price ID hidden field for variable (mult-level) donation forms |
| 135 | - if ( give_has_variable_prices( $form_id ) ) { |
|
| 135 | + if (give_has_variable_prices($form_id)) { |
|
| 136 | 136 | //get default selected price ID |
| 137 | - $prices = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id ); |
|
| 137 | + $prices = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id); |
|
| 138 | 138 | $price_id = 0; |
| 139 | 139 | //loop through prices |
| 140 | - foreach ( $prices as $price ) { |
|
| 141 | - if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) { |
|
| 140 | + foreach ($prices as $price) { |
|
| 141 | + if (isset($price['_give_default']) && $price['_give_default'] === 'default') { |
|
| 142 | 142 | $price_id = $price['_give_id']['level_id']; |
| 143 | 143 | }; |
| 144 | 144 | } |
@@ -146,20 +146,20 @@ discard block |
||
| 146 | 146 | <input type="hidden" name="give-price-id" value="<?php echo $price_id; ?>"/> |
| 147 | 147 | <?php } |
| 148 | 148 | |
| 149 | - do_action( 'give_checkout_form_top', $form->ID, $args ); |
|
| 149 | + do_action('give_checkout_form_top', $form->ID, $args); |
|
| 150 | 150 | |
| 151 | - do_action( 'give_payment_mode_select', $form->ID, $args ); |
|
| 151 | + do_action('give_payment_mode_select', $form->ID, $args); |
|
| 152 | 152 | |
| 153 | - do_action( 'give_checkout_form_bottom', $form->ID, $args ); |
|
| 153 | + do_action('give_checkout_form_bottom', $form->ID, $args); |
|
| 154 | 154 | |
| 155 | 155 | ?> |
| 156 | 156 | </form> |
| 157 | 157 | |
| 158 | - <?php do_action( 'give_post_form', $form->ID, $args ); ?> |
|
| 158 | + <?php do_action('give_post_form', $form->ID, $args); ?> |
|
| 159 | 159 | |
| 160 | 160 | <?php } ?> |
| 161 | 161 | |
| 162 | - <!--end #give-form-<?php echo absint( $form->ID ); ?>--></div> |
|
| 162 | + <!--end #give-form-<?php echo absint($form->ID); ?>--></div> |
|
| 163 | 163 | <?php |
| 164 | 164 | |
| 165 | 165 | /** |
@@ -170,11 +170,11 @@ discard block |
||
| 170 | 170 | * @param int $form ->ID The current form ID |
| 171 | 171 | * @param array $args An array of form args |
| 172 | 172 | */ |
| 173 | - do_action( 'give_post_form_output', $form->ID, $args ); |
|
| 173 | + do_action('give_post_form_output', $form->ID, $args); |
|
| 174 | 174 | |
| 175 | 175 | $final_output = ob_get_clean(); |
| 176 | 176 | |
| 177 | - echo apply_filters( 'give_donate_form', $final_output, $args ); |
|
| 177 | + echo apply_filters('give_donate_form', $final_output, $args); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | |
@@ -194,43 +194,43 @@ discard block |
||
| 194 | 194 | * @global $give_options Array of all the Give options |
| 195 | 195 | * @return string |
| 196 | 196 | */ |
| 197 | -function give_show_purchase_form( $form_id ) { |
|
| 197 | +function give_show_purchase_form($form_id) { |
|
| 198 | 198 | |
| 199 | - $payment_mode = give_get_chosen_gateway( $form_id ); |
|
| 199 | + $payment_mode = give_get_chosen_gateway($form_id); |
|
| 200 | 200 | |
| 201 | - if ( ! isset( $form_id ) && isset( $_POST['give_form_id'] ) ) { |
|
| 201 | + if ( ! isset($form_id) && isset($_POST['give_form_id'])) { |
|
| 202 | 202 | $form_id = $_POST['give_form_id']; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - do_action( 'give_purchase_form_top', $form_id ); |
|
| 205 | + do_action('give_purchase_form_top', $form_id); |
|
| 206 | 206 | |
| 207 | - if ( give_can_checkout() && isset( $form_id ) ) { |
|
| 207 | + if (give_can_checkout() && isset($form_id)) { |
|
| 208 | 208 | |
| 209 | - do_action( 'give_purchase_form_before_register_login', $form_id ); |
|
| 209 | + do_action('give_purchase_form_before_register_login', $form_id); |
|
| 210 | 210 | |
| 211 | - do_action( 'give_purchase_form_register_login_fields', $form_id ); |
|
| 211 | + do_action('give_purchase_form_register_login_fields', $form_id); |
|
| 212 | 212 | |
| 213 | - do_action( 'give_purchase_form_before_cc_form', $form_id ); |
|
| 213 | + do_action('give_purchase_form_before_cc_form', $form_id); |
|
| 214 | 214 | |
| 215 | 215 | // Load the credit card form and allow gateways to load their own if they wish |
| 216 | - if ( has_action( 'give_' . $payment_mode . '_cc_form' ) ) { |
|
| 217 | - do_action( 'give_' . $payment_mode . '_cc_form', $form_id ); |
|
| 216 | + if (has_action('give_'.$payment_mode.'_cc_form')) { |
|
| 217 | + do_action('give_'.$payment_mode.'_cc_form', $form_id); |
|
| 218 | 218 | } else { |
| 219 | - do_action( 'give_cc_form', $form_id ); |
|
| 219 | + do_action('give_cc_form', $form_id); |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - do_action( 'give_purchase_form_after_cc_form', $form_id ); |
|
| 222 | + do_action('give_purchase_form_after_cc_form', $form_id); |
|
| 223 | 223 | |
| 224 | 224 | } else { |
| 225 | 225 | // Can't checkout |
| 226 | - do_action( 'give_purchase_form_no_access', $form_id ); |
|
| 226 | + do_action('give_purchase_form_no_access', $form_id); |
|
| 227 | 227 | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - do_action( 'give_purchase_form_bottom', $form_id ); |
|
| 230 | + do_action('give_purchase_form_bottom', $form_id); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | -add_action( 'give_purchase_form', 'give_show_purchase_form' ); |
|
| 233 | +add_action('give_purchase_form', 'give_show_purchase_form'); |
|
| 234 | 234 | |
| 235 | 235 | /** |
| 236 | 236 | * |
@@ -242,26 +242,26 @@ discard block |
||
| 242 | 242 | * |
| 243 | 243 | * @return void |
| 244 | 244 | */ |
| 245 | -function give_show_register_login_fields( $form_id ) { |
|
| 245 | +function give_show_register_login_fields($form_id) { |
|
| 246 | 246 | |
| 247 | - $show_register_form = give_show_login_register_option( $form_id ); |
|
| 247 | + $show_register_form = give_show_login_register_option($form_id); |
|
| 248 | 248 | |
| 249 | - if ( ( $show_register_form === 'registration' || ( $show_register_form === 'both' && ! isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) : ?> |
|
| 249 | + if (($show_register_form === 'registration' || ($show_register_form === 'both' && ! isset($_GET['login']))) && ! is_user_logged_in()) : ?> |
|
| 250 | 250 | <div id="give-checkout-login-register-<?php echo $form_id; ?>"> |
| 251 | - <?php do_action( 'give_purchase_form_register_fields', $form_id ); ?> |
|
| 251 | + <?php do_action('give_purchase_form_register_fields', $form_id); ?> |
|
| 252 | 252 | </div> |
| 253 | - <?php elseif ( ( $show_register_form === 'login' || ( $show_register_form === 'both' && isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) : ?> |
|
| 253 | + <?php elseif (($show_register_form === 'login' || ($show_register_form === 'both' && isset($_GET['login']))) && ! is_user_logged_in()) : ?> |
|
| 254 | 254 | <div id="give-checkout-login-register-<?php echo $form_id; ?>"> |
| 255 | - <?php do_action( 'give_purchase_form_login_fields', $form_id ); ?> |
|
| 255 | + <?php do_action('give_purchase_form_login_fields', $form_id); ?> |
|
| 256 | 256 | </div> |
| 257 | 257 | <?php endif; ?> |
| 258 | 258 | |
| 259 | - <?php if ( ( ! isset( $_GET['login'] ) && is_user_logged_in() ) || ! isset( $show_register_form ) || 'none' === $show_register_form || 'login' === $show_register_form ) { |
|
| 260 | - do_action( 'give_purchase_form_after_user_info', $form_id ); |
|
| 259 | + <?php if (( ! isset($_GET['login']) && is_user_logged_in()) || ! isset($show_register_form) || 'none' === $show_register_form || 'login' === $show_register_form) { |
|
| 260 | + do_action('give_purchase_form_after_user_info', $form_id); |
|
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | -add_action( 'give_purchase_form_register_login_fields', 'give_show_register_login_fields' ); |
|
| 264 | +add_action('give_purchase_form_register_login_fields', 'give_show_register_login_fields'); |
|
| 265 | 265 | |
| 266 | 266 | /** |
| 267 | 267 | * Donation Amount Field |
@@ -275,33 +275,33 @@ discard block |
||
| 275 | 275 | * |
| 276 | 276 | * @return void |
| 277 | 277 | */ |
| 278 | -function give_output_donation_amount_top( $form_id = 0, $args = array() ) { |
|
| 278 | +function give_output_donation_amount_top($form_id = 0, $args = array()) { |
|
| 279 | 279 | |
| 280 | 280 | global $give_options; |
| 281 | 281 | |
| 282 | - $variable_pricing = give_has_variable_prices( $form_id ); |
|
| 283 | - $allow_custom_amount = get_post_meta( $form_id, '_give_custom_amount', true ); |
|
| 284 | - $currency_position = isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before'; |
|
| 285 | - $symbol = give_currency_symbol( give_get_currency() ); |
|
| 286 | - $currency_output = '<span class="give-currency-symbol give-currency-position-' . $currency_position . '">' . $symbol . '</span>'; |
|
| 287 | - $default_amount = give_format_amount( give_get_default_form_amount( $form_id ) ); |
|
| 288 | - $custom_amount_text = get_post_meta( $form_id, '_give_custom_amount_text', true ); |
|
| 282 | + $variable_pricing = give_has_variable_prices($form_id); |
|
| 283 | + $allow_custom_amount = get_post_meta($form_id, '_give_custom_amount', true); |
|
| 284 | + $currency_position = isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before'; |
|
| 285 | + $symbol = give_currency_symbol(give_get_currency()); |
|
| 286 | + $currency_output = '<span class="give-currency-symbol give-currency-position-'.$currency_position.'">'.$symbol.'</span>'; |
|
| 287 | + $default_amount = give_format_amount(give_get_default_form_amount($form_id)); |
|
| 288 | + $custom_amount_text = get_post_meta($form_id, '_give_custom_amount_text', true); |
|
| 289 | 289 | |
| 290 | - do_action( 'give_before_donation_levels', $form_id, $args ); |
|
| 290 | + do_action('give_before_donation_levels', $form_id, $args); |
|
| 291 | 291 | |
| 292 | 292 | //Set Price, No Custom Amount Allowed means hidden price field |
| 293 | - if ( $allow_custom_amount == 'no' ) { |
|
| 293 | + if ($allow_custom_amount == 'no') { |
|
| 294 | 294 | ?> |
| 295 | 295 | |
| 296 | - <label class="give-hidden" for="give-amount-hidden"><?php echo __( 'Donation Amount:', 'give' ); ?></label> |
|
| 296 | + <label class="give-hidden" for="give-amount-hidden"><?php echo __('Donation Amount:', 'give'); ?></label> |
|
| 297 | 297 | <input id="give-amount" class="give-amount-hidden" type="hidden" name="give-amount" |
| 298 | 298 | value="<?php echo $default_amount; ?>" required> |
| 299 | 299 | <div class="set-price give-donation-amount form-row-wide"> |
| 300 | - <?php if ( $currency_position == 'before' ) { |
|
| 300 | + <?php if ($currency_position == 'before') { |
|
| 301 | 301 | echo $currency_output; |
| 302 | 302 | } ?> |
| 303 | 303 | <span id="give-amount-text" class="give-text-input give-amount-top"><?php echo $default_amount; ?></span> |
| 304 | - <?php if ( $currency_position == 'after' ) { |
|
| 304 | + <?php if ($currency_position == 'after') { |
|
| 305 | 305 | echo $currency_output; |
| 306 | 306 | } ?> |
| 307 | 307 | </div> |
@@ -311,34 +311,34 @@ discard block |
||
| 311 | 311 | ?> |
| 312 | 312 | <div class="give-total-wrap"> |
| 313 | 313 | <div class="give-donation-amount form-row-wide"> |
| 314 | - <?php if ( $currency_position == 'before' ) { |
|
| 314 | + <?php if ($currency_position == 'before') { |
|
| 315 | 315 | echo $currency_output; |
| 316 | 316 | } ?> |
| 317 | - <label class="give-hidden" for="give-amount"><?php echo __( 'Donation Amount:', 'give' ); ?></label> |
|
| 317 | + <label class="give-hidden" for="give-amount"><?php echo __('Donation Amount:', 'give'); ?></label> |
|
| 318 | 318 | <input class="give-text-input give-amount-top" id="give-amount" name="give-amount" type="tel" placeholder="" value="<?php echo $default_amount; ?>" autocomplete="off"> |
| 319 | - <?php if ( $currency_position == 'after' ) { |
|
| 319 | + <?php if ($currency_position == 'after') { |
|
| 320 | 320 | echo $currency_output; |
| 321 | 321 | } ?> |
| 322 | 322 | </div> |
| 323 | 323 | </div> |
| 324 | 324 | <?php } |
| 325 | 325 | |
| 326 | - do_action( 'give_after_donation_amount', $form_id, $args ); |
|
| 326 | + do_action('give_after_donation_amount', $form_id, $args); |
|
| 327 | 327 | |
| 328 | 328 | //Custom Amount Text |
| 329 | - if ( ! $variable_pricing && $allow_custom_amount == 'yes' && ! empty( $custom_amount_text ) ) { ?> |
|
| 329 | + if ( ! $variable_pricing && $allow_custom_amount == 'yes' && ! empty($custom_amount_text)) { ?> |
|
| 330 | 330 | <p class="give-custom-amount-text"><?php echo $custom_amount_text; ?></p> |
| 331 | 331 | <?php } |
| 332 | 332 | |
| 333 | 333 | //Output Variable Pricing Levels |
| 334 | - if ( $variable_pricing ) { |
|
| 335 | - give_output_levels( $form_id ); |
|
| 334 | + if ($variable_pricing) { |
|
| 335 | + give_output_levels($form_id); |
|
| 336 | 336 | } |
| 337 | 337 | |
| 338 | - do_action( 'give_after_donation_levels', $form_id, $args ); |
|
| 338 | + do_action('give_after_donation_levels', $form_id, $args); |
|
| 339 | 339 | } |
| 340 | 340 | |
| 341 | -add_action( 'give_checkout_form_top', 'give_output_donation_amount_top', 10, 2 ); |
|
| 341 | +add_action('give_checkout_form_top', 'give_output_donation_amount_top', 10, 2); |
|
| 342 | 342 | |
| 343 | 343 | |
| 344 | 344 | /** |
@@ -350,32 +350,32 @@ discard block |
||
| 350 | 350 | * |
| 351 | 351 | * @return string |
| 352 | 352 | */ |
| 353 | -function give_output_levels( $form_id ) { |
|
| 353 | +function give_output_levels($form_id) { |
|
| 354 | 354 | |
| 355 | 355 | //Get variable pricing |
| 356 | - $prices = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id ); |
|
| 357 | - $display_style = get_post_meta( $form_id, '_give_display_style', true ); |
|
| 358 | - $custom_amount = get_post_meta( $form_id, '_give_custom_amount', true ); |
|
| 359 | - $custom_amount_text = get_post_meta( $form_id, '_give_custom_amount_text', true ); |
|
| 360 | - if ( empty( $custom_amount_text ) ) { |
|
| 361 | - $custom_amount_text = __( 'Give a Custom Amount', 'give' ); |
|
| 356 | + $prices = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id); |
|
| 357 | + $display_style = get_post_meta($form_id, '_give_display_style', true); |
|
| 358 | + $custom_amount = get_post_meta($form_id, '_give_custom_amount', true); |
|
| 359 | + $custom_amount_text = get_post_meta($form_id, '_give_custom_amount_text', true); |
|
| 360 | + if (empty($custom_amount_text)) { |
|
| 361 | + $custom_amount_text = __('Give a Custom Amount', 'give'); |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | $output = ''; |
| 365 | 365 | $counter = 0; |
| 366 | 366 | |
| 367 | - switch ( $display_style ) { |
|
| 367 | + switch ($display_style) { |
|
| 368 | 368 | case 'buttons': |
| 369 | 369 | |
| 370 | 370 | $output .= '<ul id="give-donation-level-button-wrap" class="give-donation-levels-wrap give-list-inline">'; |
| 371 | 371 | |
| 372 | - foreach ( $prices as $price ) { |
|
| 373 | - $counter ++; |
|
| 374 | - $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 ); |
|
| 375 | - $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 ); |
|
| 372 | + foreach ($prices as $price) { |
|
| 373 | + $counter++; |
|
| 374 | + $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); |
|
| 375 | + $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); |
|
| 376 | 376 | |
| 377 | 377 | $output .= '<li>'; |
| 378 | - $output .= '<button type="button" data-price-id="' . $price['_give_id']['level_id'] . '" class=" ' . $level_classes . '" value="' . give_format_amount( $price['_give_amount'] ) . '">'; |
|
| 378 | + $output .= '<button type="button" data-price-id="'.$price['_give_id']['level_id'].'" class=" '.$level_classes.'" value="'.give_format_amount($price['_give_amount']).'">'; |
|
| 379 | 379 | $output .= $level_text; |
| 380 | 380 | $output .= '</button>'; |
| 381 | 381 | $output .= '</li>'; |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | //Custom Amount |
| 386 | - if ( $custom_amount === 'yes' && ! empty( $custom_amount_text ) ) { |
|
| 386 | + if ($custom_amount === 'yes' && ! empty($custom_amount_text)) { |
|
| 387 | 387 | $output .= '<li>'; |
| 388 | 388 | $output .= '<button type="button" data-price-id="custom" class="give-donation-level-btn give-btn give-btn-level-custom" value="custom">'; |
| 389 | 389 | $output .= $custom_amount_text; |
@@ -399,23 +399,23 @@ discard block |
||
| 399 | 399 | |
| 400 | 400 | $output .= '<ul id="give-donation-level-radio-list" class="give-donation-levels-wrap">'; |
| 401 | 401 | |
| 402 | - foreach ( $prices as $price ) { |
|
| 403 | - $counter ++; |
|
| 404 | - $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 ); |
|
| 405 | - $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 ); |
|
| 402 | + foreach ($prices as $price) { |
|
| 403 | + $counter++; |
|
| 404 | + $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); |
|
| 405 | + $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); |
|
| 406 | 406 | |
| 407 | 407 | $output .= '<li>'; |
| 408 | - $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'] ) . '">'; |
|
| 409 | - $output .= '<label for="give-radio-level-' . $counter . '">' . $level_text . '</label>'; |
|
| 408 | + $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']).'">'; |
|
| 409 | + $output .= '<label for="give-radio-level-'.$counter.'">'.$level_text.'</label>'; |
|
| 410 | 410 | $output .= '</li>'; |
| 411 | 411 | |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | //Custom Amount |
| 415 | - if ( $custom_amount === 'yes' && ! empty( $custom_amount_text ) ) { |
|
| 415 | + if ($custom_amount === 'yes' && ! empty($custom_amount_text)) { |
|
| 416 | 416 | $output .= '<li>'; |
| 417 | 417 | $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">'; |
| 418 | - $output .= '<label for="give-radio-level-custom">' . $custom_amount_text . '</label>'; |
|
| 418 | + $output .= '<label for="give-radio-level-custom">'.$custom_amount_text.'</label>'; |
|
| 419 | 419 | $output .= '</li>'; |
| 420 | 420 | } |
| 421 | 421 | |
@@ -425,23 +425,23 @@ discard block |
||
| 425 | 425 | |
| 426 | 426 | case 'dropdown': |
| 427 | 427 | |
| 428 | - $output .= '<label for="give-donation-level" class="give-hidden">' . __( 'Choose Your Donation Amount', 'give' ) . ':</label>'; |
|
| 429 | - $output .= '<select id="give-donation-level-' . $form_id . '" class="give-select give-select-level">'; |
|
| 428 | + $output .= '<label for="give-donation-level" class="give-hidden">'.__('Choose Your Donation Amount', 'give').':</label>'; |
|
| 429 | + $output .= '<select id="give-donation-level-'.$form_id.'" class="give-select give-select-level">'; |
|
| 430 | 430 | |
| 431 | 431 | //first loop through prices |
| 432 | - foreach ( $prices as $price ) { |
|
| 433 | - $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 ); |
|
| 434 | - $level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-' . $form_id . ( ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) ? ' give-default-level' : '' ), $form_id, $price ); |
|
| 432 | + foreach ($prices as $price) { |
|
| 433 | + $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); |
|
| 434 | + $level_classes = apply_filters('give_form_level_classes', 'give-donation-level-'.$form_id.((isset($price['_give_default']) && $price['_give_default'] === 'default') ? ' give-default-level' : ''), $form_id, $price); |
|
| 435 | 435 | |
| 436 | - $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'] ) . '">'; |
|
| 436 | + $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']).'">'; |
|
| 437 | 437 | $output .= $level_text; |
| 438 | 438 | $output .= '</option>'; |
| 439 | 439 | |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | //Custom Amount |
| 443 | - if ( $custom_amount === 'yes' && ! empty( $custom_amount_text ) ) { |
|
| 444 | - $output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">' . $custom_amount_text . '</option>'; |
|
| 443 | + if ($custom_amount === 'yes' && ! empty($custom_amount_text)) { |
|
| 444 | + $output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">'.$custom_amount_text.'</option>'; |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | $output .= '</select>'; |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | break; |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | - echo apply_filters( 'give_form_level_output', $output, $form_id ); |
|
| 452 | + echo apply_filters('give_form_level_output', $output, $form_id); |
|
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | /** |
@@ -461,26 +461,26 @@ discard block |
||
| 461 | 461 | * @param array $args |
| 462 | 462 | * |
| 463 | 463 | */ |
| 464 | -function give_display_checkout_button( $form_id, $args ) { |
|
| 464 | +function give_display_checkout_button($form_id, $args) { |
|
| 465 | 465 | |
| 466 | - $display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) ) |
|
| 466 | + $display_option = (isset($args['display_style']) && ! empty($args['display_style'])) |
|
| 467 | 467 | ? $args['display_style'] |
| 468 | - : get_post_meta( $form_id, '_give_payment_display', true ); |
|
| 468 | + : get_post_meta($form_id, '_give_payment_display', true); |
|
| 469 | 469 | |
| 470 | 470 | //no btn for onpage |
| 471 | - if ( $display_option === 'onpage' ) { |
|
| 471 | + if ($display_option === 'onpage') { |
|
| 472 | 472 | return; |
| 473 | 473 | } |
| 474 | 474 | |
| 475 | - $display_label_field = get_post_meta( $form_id, '_give_reveal_label', true ); |
|
| 476 | - $display_label = ( ! empty( $display_label_field ) ? $display_label_field : __( 'Donate Now', 'give' ) ); |
|
| 475 | + $display_label_field = get_post_meta($form_id, '_give_reveal_label', true); |
|
| 476 | + $display_label = ( ! empty($display_label_field) ? $display_label_field : __('Donate Now', 'give')); |
|
| 477 | 477 | |
| 478 | - $output = '<button type="button" class="give-btn give-btn-' . $display_option . '">' . $display_label . '</button>'; |
|
| 478 | + $output = '<button type="button" class="give-btn give-btn-'.$display_option.'">'.$display_label.'</button>'; |
|
| 479 | 479 | |
| 480 | - echo apply_filters( 'give_display_checkout_button', $output ); |
|
| 480 | + echo apply_filters('give_display_checkout_button', $output); |
|
| 481 | 481 | } |
| 482 | 482 | |
| 483 | -add_action( 'give_after_donation_levels', 'give_display_checkout_button', 10, 2 ); |
|
| 483 | +add_action('give_after_donation_levels', 'give_display_checkout_button', 10, 2); |
|
| 484 | 484 | |
| 485 | 485 | /** |
| 486 | 486 | * Shows the User Info fields in the Personal Info box, more fields can be added via the hooks provided. |
@@ -491,71 +491,71 @@ discard block |
||
| 491 | 491 | * |
| 492 | 492 | * @return void |
| 493 | 493 | */ |
| 494 | -function give_user_info_fields( $form_id ) { |
|
| 494 | +function give_user_info_fields($form_id) { |
|
| 495 | 495 | |
| 496 | - if ( is_user_logged_in() ) : |
|
| 497 | - $user_data = get_userdata( get_current_user_id() ); |
|
| 496 | + if (is_user_logged_in()) : |
|
| 497 | + $user_data = get_userdata(get_current_user_id()); |
|
| 498 | 498 | endif; |
| 499 | 499 | |
| 500 | - do_action( 'give_purchase_form_before_personal_info', $form_id ); |
|
| 500 | + do_action('give_purchase_form_before_personal_info', $form_id); |
|
| 501 | 501 | ?> |
| 502 | 502 | <fieldset id="give_checkout_user_info"> |
| 503 | - <legend><?php echo apply_filters( 'give_checkout_personal_info_text', __( 'Personal Info', 'give' ) ); ?></legend> |
|
| 503 | + <legend><?php echo apply_filters('give_checkout_personal_info_text', __('Personal Info', 'give')); ?></legend> |
|
| 504 | 504 | <p id="give-first-name-wrap" class="form-row form-row-first"> |
| 505 | 505 | <label class="give-label" for="give-first"> |
| 506 | - <?php _e( 'First Name', 'give' ); ?> |
|
| 507 | - <?php if ( give_field_is_required( 'give_first', $form_id ) ) { ?> |
|
| 506 | + <?php _e('First Name', 'give'); ?> |
|
| 507 | + <?php if (give_field_is_required('give_first', $form_id)) { ?> |
|
| 508 | 508 | <span class="give-required-indicator">*</span> |
| 509 | 509 | <?php } ?> |
| 510 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'We will use this to personalize your account experience.', 'give' ); ?>"></span> |
|
| 510 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('We will use this to personalize your account experience.', 'give'); ?>"></span> |
|
| 511 | 511 | </label> |
| 512 | - <input class="give-input required" type="text" name="give_first" placeholder="<?php _e( 'First name', 'give' ); ?>" id="give-first" value="<?php echo is_user_logged_in() ? $user_data->first_name : ''; ?>"<?php if ( give_field_is_required( 'give_first', $form_id ) ) { |
|
| 512 | + <input class="give-input required" type="text" name="give_first" placeholder="<?php _e('First name', 'give'); ?>" id="give-first" value="<?php echo is_user_logged_in() ? $user_data->first_name : ''; ?>"<?php if (give_field_is_required('give_first', $form_id)) { |
|
| 513 | 513 | echo ' required '; |
| 514 | 514 | } ?>/> |
| 515 | 515 | </p> |
| 516 | 516 | |
| 517 | 517 | <p id="give-last-name-wrap" class="form-row form-row-last"> |
| 518 | 518 | <label class="give-label" for="give-last"> |
| 519 | - <?php _e( 'Last Name', 'give' ); ?> |
|
| 520 | - <?php if ( give_field_is_required( 'give_last', $form_id ) ) { ?> |
|
| 519 | + <?php _e('Last Name', 'give'); ?> |
|
| 520 | + <?php if (give_field_is_required('give_last', $form_id)) { ?> |
|
| 521 | 521 | <span class="give-required-indicator">*</span> |
| 522 | 522 | <?php } ?> |
| 523 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'We will use this as well to personalize your account experience.', 'give' ); ?>"></span> |
|
| 523 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('We will use this as well to personalize your account experience.', 'give'); ?>"></span> |
|
| 524 | 524 | </label> |
| 525 | 525 | |
| 526 | - <input class="give-input<?php if ( give_field_is_required( 'give_last', $form_id ) ) { |
|
| 526 | + <input class="give-input<?php if (give_field_is_required('give_last', $form_id)) { |
|
| 527 | 527 | echo ' required'; |
| 528 | - } ?>" type="text" name="give_last" id="give-last" placeholder="<?php _e( 'Last name', 'give' ); ?>" value="<?php echo is_user_logged_in() ? $user_data->last_name : ''; ?>"<?php if ( give_field_is_required( 'give_last', $form_id ) ) { |
|
| 528 | + } ?>" type="text" name="give_last" id="give-last" placeholder="<?php _e('Last name', 'give'); ?>" value="<?php echo is_user_logged_in() ? $user_data->last_name : ''; ?>"<?php if (give_field_is_required('give_last', $form_id)) { |
|
| 529 | 529 | echo ' required '; |
| 530 | 530 | } ?> /> |
| 531 | 531 | </p> |
| 532 | 532 | |
| 533 | - <?php do_action( 'give_purchase_form_before_email', $form_id ); ?> |
|
| 533 | + <?php do_action('give_purchase_form_before_email', $form_id); ?> |
|
| 534 | 534 | <p id="give-email-wrap" class="form-row form-row-wide"> |
| 535 | 535 | <label class="give-label" for="give-email"> |
| 536 | - <?php _e( 'Email Address', 'give' ); ?> |
|
| 537 | - <?php if ( give_field_is_required( 'give_email', $form_id ) ) { ?> |
|
| 536 | + <?php _e('Email Address', 'give'); ?> |
|
| 537 | + <?php if (give_field_is_required('give_email', $form_id)) { ?> |
|
| 538 | 538 | <span class="give-required-indicator">*</span> |
| 539 | 539 | <?php } ?> |
| 540 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'We will send the purchase receipt to this address.', 'give' ); ?>"></span> |
|
| 540 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('We will send the purchase receipt to this address.', 'give'); ?>"></span> |
|
| 541 | 541 | </label> |
| 542 | 542 | |
| 543 | - <input class="give-input required" type="email" name="give_email" placeholder="<?php _e( 'Email address', 'give' ); ?>" id="give-email" value="<?php echo is_user_logged_in() ? $user_data->user_email : ''; ?>"<?php if ( give_field_is_required( 'give_email', $form_id ) ) { |
|
| 543 | + <input class="give-input required" type="email" name="give_email" placeholder="<?php _e('Email address', 'give'); ?>" id="give-email" value="<?php echo is_user_logged_in() ? $user_data->user_email : ''; ?>"<?php if (give_field_is_required('give_email', $form_id)) { |
|
| 544 | 544 | echo ' required '; |
| 545 | 545 | } ?>/> |
| 546 | 546 | |
| 547 | 547 | </p> |
| 548 | - <?php do_action( 'give_purchase_form_after_email', $form_id ); ?> |
|
| 548 | + <?php do_action('give_purchase_form_after_email', $form_id); ?> |
|
| 549 | 549 | |
| 550 | - <?php do_action( 'give_purchase_form_user_info', $form_id ); ?> |
|
| 550 | + <?php do_action('give_purchase_form_user_info', $form_id); ?> |
|
| 551 | 551 | </fieldset> |
| 552 | 552 | <?php |
| 553 | - do_action( 'give_purchase_form_after_personal_info', $form_id ); |
|
| 553 | + do_action('give_purchase_form_after_personal_info', $form_id); |
|
| 554 | 554 | |
| 555 | 555 | } |
| 556 | 556 | |
| 557 | -add_action( 'give_purchase_form_after_user_info', 'give_user_info_fields' ); |
|
| 558 | -add_action( 'give_register_fields_before', 'give_user_info_fields' ); |
|
| 557 | +add_action('give_purchase_form_after_user_info', 'give_user_info_fields'); |
|
| 558 | +add_action('give_register_fields_before', 'give_user_info_fields'); |
|
| 559 | 559 | |
| 560 | 560 | /** |
| 561 | 561 | * Renders the credit card info form. |
@@ -566,73 +566,73 @@ discard block |
||
| 566 | 566 | * |
| 567 | 567 | * @return void |
| 568 | 568 | */ |
| 569 | -function give_get_cc_form( $form_id ) { |
|
| 569 | +function give_get_cc_form($form_id) { |
|
| 570 | 570 | |
| 571 | 571 | ob_start(); |
| 572 | 572 | |
| 573 | - do_action( 'give_before_cc_fields', $form_id ); ?> |
|
| 573 | + do_action('give_before_cc_fields', $form_id); ?> |
|
| 574 | 574 | |
| 575 | 575 | <fieldset id="give_cc_fields-<?php echo $form_id ?>" class="give-do-validate"> |
| 576 | - <legend><?php echo apply_filters( 'give_credit_card_fieldset_heading', __( 'Credit Card Info', 'give' ) ); ?></legend> |
|
| 577 | - <?php if ( is_ssl() ) : ?> |
|
| 576 | + <legend><?php echo apply_filters('give_credit_card_fieldset_heading', __('Credit Card Info', 'give')); ?></legend> |
|
| 577 | + <?php if (is_ssl()) : ?> |
|
| 578 | 578 | <div id="give_secure_site_wrapper-<?php echo $form_id ?>"> |
| 579 | 579 | <span class="give-icon padlock"></span> |
| 580 | - <span><?php _e( 'This is a secure SSL encrypted payment.', 'give' ); ?></span> |
|
| 580 | + <span><?php _e('This is a secure SSL encrypted payment.', 'give'); ?></span> |
|
| 581 | 581 | </div> |
| 582 | 582 | <?php endif; ?> |
| 583 | 583 | <p id="give-card-number-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds"> |
| 584 | 584 | <label for="card_number-<?php echo $form_id ?>" class="give-label"> |
| 585 | - <?php _e( 'Card Number', 'give' ); ?> |
|
| 585 | + <?php _e('Card Number', 'give'); ?> |
|
| 586 | 586 | <span class="give-required-indicator">*</span> |
| 587 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The (typically) 16 digits on the front of your credit card.', 'give' ); ?>"></span> |
|
| 587 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The (typically) 16 digits on the front of your credit card.', 'give'); ?>"></span> |
|
| 588 | 588 | <span class="card-type"></span> |
| 589 | 589 | </label> |
| 590 | 590 | |
| 591 | - <input type="tel" autocomplete="off" name="card_number" id="card_number-<?php echo $form_id ?>" class="card-number give-input required" placeholder="<?php _e( 'Card number', 'give' ); ?>" required/> |
|
| 591 | + <input type="tel" autocomplete="off" name="card_number" id="card_number-<?php echo $form_id ?>" class="card-number give-input required" placeholder="<?php _e('Card number', 'give'); ?>" required/> |
|
| 592 | 592 | </p> |
| 593 | 593 | |
| 594 | 594 | <p id="give-card-cvc-wrap-<?php echo $form_id ?>" class="form-row form-row-one-third"> |
| 595 | 595 | <label for="card_cvc-<?php echo $form_id ?>" class="give-label"> |
| 596 | - <?php _e( 'CVC', 'give' ); ?> |
|
| 596 | + <?php _e('CVC', 'give'); ?> |
|
| 597 | 597 | <span class="give-required-indicator">*</span> |
| 598 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The 3 digit (back) or 4 digit (front) value on your card.', 'give' ); ?>"></span> |
|
| 598 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The 3 digit (back) or 4 digit (front) value on your card.', 'give'); ?>"></span> |
|
| 599 | 599 | </label> |
| 600 | 600 | |
| 601 | - <input type="tel" size="4" autocomplete="off" name="card_cvc" id="card_cvc-<?php echo $form_id ?>" class="card-cvc give-input required" placeholder="<?php _e( 'Security code', 'give' ); ?>" required/> |
|
| 601 | + <input type="tel" size="4" autocomplete="off" name="card_cvc" id="card_cvc-<?php echo $form_id ?>" class="card-cvc give-input required" placeholder="<?php _e('Security code', 'give'); ?>" required/> |
|
| 602 | 602 | </p> |
| 603 | 603 | |
| 604 | 604 | <p id="give-card-name-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds"> |
| 605 | 605 | <label for="card_name-<?php echo $form_id ?>" class="give-label"> |
| 606 | - <?php _e( 'Name on the Card', 'give' ); ?> |
|
| 606 | + <?php _e('Name on the Card', 'give'); ?> |
|
| 607 | 607 | <span class="give-required-indicator">*</span> |
| 608 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The name printed on the front of your credit card.', 'give' ); ?>"></span> |
|
| 608 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The name printed on the front of your credit card.', 'give'); ?>"></span> |
|
| 609 | 609 | </label> |
| 610 | 610 | |
| 611 | - <input type="text" autocomplete="off" name="card_name" id="card_name-<?php echo $form_id ?>" class="card-name give-input required" placeholder="<?php _e( 'Card name', 'give' ); ?>" required/> |
|
| 611 | + <input type="text" autocomplete="off" name="card_name" id="card_name-<?php echo $form_id ?>" class="card-name give-input required" placeholder="<?php _e('Card name', 'give'); ?>" required/> |
|
| 612 | 612 | </p> |
| 613 | - <?php do_action( 'give_before_cc_expiration' ); ?> |
|
| 613 | + <?php do_action('give_before_cc_expiration'); ?> |
|
| 614 | 614 | <p class="card-expiration form-row form-row-one-third"> |
| 615 | 615 | <label for="card_expiry-<?php echo $form_id ?>" class="give-label"> |
| 616 | - <?php _e( 'Expiration', 'give' ); ?> |
|
| 616 | + <?php _e('Expiration', 'give'); ?> |
|
| 617 | 617 | <span class="give-required-indicator">*</span> |
| 618 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The date your credit card expires, typically on the front of the card.', 'give' ); ?>"></span> |
|
| 618 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The date your credit card expires, typically on the front of the card.', 'give'); ?>"></span> |
|
| 619 | 619 | </label> |
| 620 | 620 | |
| 621 | 621 | <input type="hidden" id="card_exp_month-<?php echo $form_id ?>" name="card_exp_month" class="card-expiry-month"/> |
| 622 | 622 | <input type="hidden" id="card_exp_year-<?php echo $form_id ?>" name="card_exp_year" class="card-expiry-year"/> |
| 623 | 623 | |
| 624 | - <input type="tel" autocomplete="off" name="card_expiry" id="card_expiry-<?php echo $form_id ?>" class="card-expiry give-input required" placeholder="<?php _e( 'MM / YY', 'give' ); ?>" required/> |
|
| 624 | + <input type="tel" autocomplete="off" name="card_expiry" id="card_expiry-<?php echo $form_id ?>" class="card-expiry give-input required" placeholder="<?php _e('MM / YY', 'give'); ?>" required/> |
|
| 625 | 625 | </p> |
| 626 | - <?php do_action( 'give_after_cc_expiration', $form_id ); ?> |
|
| 626 | + <?php do_action('give_after_cc_expiration', $form_id); ?> |
|
| 627 | 627 | |
| 628 | 628 | </fieldset> |
| 629 | 629 | <?php |
| 630 | - do_action( 'give_after_cc_fields', $form_id ); |
|
| 630 | + do_action('give_after_cc_fields', $form_id); |
|
| 631 | 631 | |
| 632 | 632 | echo ob_get_clean(); |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | -add_action( 'give_cc_form', 'give_get_cc_form' ); |
|
| 635 | +add_action('give_cc_form', 'give_get_cc_form'); |
|
| 636 | 636 | |
| 637 | 637 | /** |
| 638 | 638 | * Outputs the default credit card address fields |
@@ -643,110 +643,110 @@ discard block |
||
| 643 | 643 | * |
| 644 | 644 | * @return void |
| 645 | 645 | */ |
| 646 | -function give_default_cc_address_fields( $form_id ) { |
|
| 646 | +function give_default_cc_address_fields($form_id) { |
|
| 647 | 647 | |
| 648 | 648 | $logged_in = is_user_logged_in(); |
| 649 | 649 | |
| 650 | - if ( $logged_in ) { |
|
| 651 | - $user_address = get_user_meta( get_current_user_id(), '_give_user_address', true ); |
|
| 650 | + if ($logged_in) { |
|
| 651 | + $user_address = get_user_meta(get_current_user_id(), '_give_user_address', true); |
|
| 652 | 652 | } |
| 653 | - $line1 = $logged_in && ! empty( $user_address['line1'] ) ? $user_address['line1'] : ''; |
|
| 654 | - $line2 = $logged_in && ! empty( $user_address['line2'] ) ? $user_address['line2'] : ''; |
|
| 655 | - $city = $logged_in && ! empty( $user_address['city'] ) ? $user_address['city'] : ''; |
|
| 656 | - $zip = $logged_in && ! empty( $user_address['zip'] ) ? $user_address['zip'] : ''; |
|
| 653 | + $line1 = $logged_in && ! empty($user_address['line1']) ? $user_address['line1'] : ''; |
|
| 654 | + $line2 = $logged_in && ! empty($user_address['line2']) ? $user_address['line2'] : ''; |
|
| 655 | + $city = $logged_in && ! empty($user_address['city']) ? $user_address['city'] : ''; |
|
| 656 | + $zip = $logged_in && ! empty($user_address['zip']) ? $user_address['zip'] : ''; |
|
| 657 | 657 | ob_start(); ?> |
| 658 | 658 | <fieldset id="give_cc_address" class="cc-address"> |
| 659 | - <legend><?php echo apply_filters( 'give_billing_details_fieldset_heading', __( 'Billing Details', 'give' ) ); ?></legend> |
|
| 660 | - <?php do_action( 'give_cc_billing_top' ); ?> |
|
| 659 | + <legend><?php echo apply_filters('give_billing_details_fieldset_heading', __('Billing Details', 'give')); ?></legend> |
|
| 660 | + <?php do_action('give_cc_billing_top'); ?> |
|
| 661 | 661 | <p id="give-card-address-wrap" class="form-row form-row-two-thirds"> |
| 662 | 662 | <label for="card_address" class="give-label"> |
| 663 | - <?php _e( 'Address', 'give' ); ?> |
|
| 663 | + <?php _e('Address', 'give'); ?> |
|
| 664 | 664 | <?php |
| 665 | - if ( give_field_is_required( 'card_address', $form_id ) ) { ?> |
|
| 665 | + if (give_field_is_required('card_address', $form_id)) { ?> |
|
| 666 | 666 | <span class="give-required-indicator">*</span> |
| 667 | 667 | <?php } ?> |
| 668 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The primary billing address for your credit card.', 'give' ); ?>"></span> |
|
| 668 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The primary billing address for your credit card.', 'give'); ?>"></span> |
|
| 669 | 669 | </label> |
| 670 | 670 | |
| 671 | - <input type="text" id="card_address" name="card_address" class="card-address give-input<?php if ( give_field_is_required( 'card_address', $form_id ) ) { |
|
| 671 | + <input type="text" id="card_address" name="card_address" class="card-address give-input<?php if (give_field_is_required('card_address', $form_id)) { |
|
| 672 | 672 | echo ' required'; |
| 673 | - } ?>" placeholder="<?php _e( 'Address line 1', 'give' ); ?>" value="<?php echo $line1; ?>"<?php if ( give_field_is_required( 'card_address', $form_id ) ) { |
|
| 673 | + } ?>" placeholder="<?php _e('Address line 1', 'give'); ?>" value="<?php echo $line1; ?>"<?php if (give_field_is_required('card_address', $form_id)) { |
|
| 674 | 674 | echo ' required '; |
| 675 | 675 | } ?>/> |
| 676 | 676 | </p> |
| 677 | 677 | |
| 678 | 678 | <p id="give-card-address-2-wrap" class="form-row form-row-one-third"> |
| 679 | 679 | <label for="card_address_2" class="give-label"> |
| 680 | - <?php _e( 'Address Line 2', 'give' ); ?> |
|
| 681 | - <?php if ( give_field_is_required( 'card_address_2', $form_id ) ) { ?> |
|
| 680 | + <?php _e('Address Line 2', 'give'); ?> |
|
| 681 | + <?php if (give_field_is_required('card_address_2', $form_id)) { ?> |
|
| 682 | 682 | <span class="give-required-indicator">*</span> |
| 683 | 683 | <?php } ?> |
| 684 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( '(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give' ); ?>"></span> |
|
| 684 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('(optional) The suite, apt no, PO box, etc, associated with your billing address.', 'give'); ?>"></span> |
|
| 685 | 685 | </label> |
| 686 | 686 | |
| 687 | - <input type="text" id="card_address_2" name="card_address_2" class="card-address-2 give-input<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) { |
|
| 687 | + <input type="text" id="card_address_2" name="card_address_2" class="card-address-2 give-input<?php if (give_field_is_required('card_address_2', $form_id)) { |
|
| 688 | 688 | echo ' required'; |
| 689 | - } ?>" placeholder="<?php _e( 'Address line 2', 'give' ); ?>" value="<?php echo $line2; ?>"<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) { |
|
| 689 | + } ?>" placeholder="<?php _e('Address line 2', 'give'); ?>" value="<?php echo $line2; ?>"<?php if (give_field_is_required('card_address_2', $form_id)) { |
|
| 690 | 690 | echo ' required '; |
| 691 | 691 | } ?>/> |
| 692 | 692 | </p> |
| 693 | 693 | |
| 694 | 694 | <p id="give-card-city-wrap" class="form-row form-row-two-thirds"> |
| 695 | 695 | <label for="card_city" class="give-label"> |
| 696 | - <?php _e( 'City', 'give' ); ?> |
|
| 697 | - <?php if ( give_field_is_required( 'card_city', $form_id ) ) { ?> |
|
| 696 | + <?php _e('City', 'give'); ?> |
|
| 697 | + <?php if (give_field_is_required('card_city', $form_id)) { ?> |
|
| 698 | 698 | <span class="give-required-indicator">*</span> |
| 699 | 699 | <?php } ?> |
| 700 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The city for your billing address.', 'give' ); ?>"></span> |
|
| 700 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The city for your billing address.', 'give'); ?>"></span> |
|
| 701 | 701 | </label> |
| 702 | - <input type="text" id="card_city" name="card_city" class="card-city give-input<?php if ( give_field_is_required( 'card_city', $form_id ) ) { |
|
| 702 | + <input type="text" id="card_city" name="card_city" class="card-city give-input<?php if (give_field_is_required('card_city', $form_id)) { |
|
| 703 | 703 | echo ' required'; |
| 704 | - } ?>" placeholder="<?php _e( 'City', 'give' ); ?>" value="<?php echo $city; ?>"<?php if ( give_field_is_required( 'card_city', $form_id ) ) { |
|
| 704 | + } ?>" placeholder="<?php _e('City', 'give'); ?>" value="<?php echo $city; ?>"<?php if (give_field_is_required('card_city', $form_id)) { |
|
| 705 | 705 | echo ' required '; |
| 706 | 706 | } ?>/> |
| 707 | 707 | </p> |
| 708 | 708 | |
| 709 | 709 | <p id="give-card-zip-wrap" class="form-row form-row-one-third"> |
| 710 | 710 | <label for="card_zip" class="give-label"> |
| 711 | - <?php _e( 'Zip / Postal Code', 'give' ); ?> |
|
| 712 | - <?php if ( give_field_is_required( 'card_zip', $form_id ) ) { ?> |
|
| 711 | + <?php _e('Zip / Postal Code', 'give'); ?> |
|
| 712 | + <?php if (give_field_is_required('card_zip', $form_id)) { ?> |
|
| 713 | 713 | <span class="give-required-indicator">*</span> |
| 714 | 714 | <?php } ?> |
| 715 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The zip or postal code for your billing address.', 'give' ); ?>"></span> |
|
| 715 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The zip or postal code for your billing address.', 'give'); ?>"></span> |
|
| 716 | 716 | </label> |
| 717 | 717 | |
| 718 | - <input type="text" size="4" id="card_zip" name="card_zip" class="card-zip give-input<?php if ( give_field_is_required( 'card_zip', $form_id ) ) { |
|
| 718 | + <input type="text" size="4" id="card_zip" name="card_zip" class="card-zip give-input<?php if (give_field_is_required('card_zip', $form_id)) { |
|
| 719 | 719 | echo ' required'; |
| 720 | - } ?>" placeholder="<?php _e( 'Zip / Postal code', 'give' ); ?>" value="<?php echo $zip; ?>" <?php if ( give_field_is_required( 'card_zip', $form_id ) ) { |
|
| 720 | + } ?>" placeholder="<?php _e('Zip / Postal code', 'give'); ?>" value="<?php echo $zip; ?>" <?php if (give_field_is_required('card_zip', $form_id)) { |
|
| 721 | 721 | echo ' required '; |
| 722 | 722 | } ?>/> |
| 723 | 723 | </p> |
| 724 | 724 | |
| 725 | 725 | <p id="give-card-country-wrap" class="form-row form-row-first"> |
| 726 | 726 | <label for="billing_country" class="give-label"> |
| 727 | - <?php _e( 'Country', 'give' ); ?> |
|
| 728 | - <?php if ( give_field_is_required( 'billing_country', $form_id ) ) { ?> |
|
| 727 | + <?php _e('Country', 'give'); ?> |
|
| 728 | + <?php if (give_field_is_required('billing_country', $form_id)) { ?> |
|
| 729 | 729 | <span class="give-required-indicator">*</span> |
| 730 | 730 | <?php } ?> |
| 731 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The country for your billing address.', 'give' ); ?>"></span> |
|
| 731 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The country for your billing address.', 'give'); ?>"></span> |
|
| 732 | 732 | </label> |
| 733 | 733 | |
| 734 | - <select name="billing_country" id="billing_country" class="billing-country billing_country give-select<?php if ( give_field_is_required( 'billing_country', $form_id ) ) { |
|
| 734 | + <select name="billing_country" id="billing_country" class="billing-country billing_country give-select<?php if (give_field_is_required('billing_country', $form_id)) { |
|
| 735 | 735 | echo ' required'; |
| 736 | - } ?>"<?php if ( give_field_is_required( 'billing_country', $form_id ) ) { |
|
| 736 | + } ?>"<?php if (give_field_is_required('billing_country', $form_id)) { |
|
| 737 | 737 | echo ' required '; |
| 738 | 738 | } ?>> |
| 739 | 739 | <?php |
| 740 | 740 | |
| 741 | 741 | $selected_country = give_get_country(); |
| 742 | 742 | |
| 743 | - if ( $logged_in && ! empty( $user_address['country'] ) && '*' !== $user_address['country'] ) { |
|
| 743 | + if ($logged_in && ! empty($user_address['country']) && '*' !== $user_address['country']) { |
|
| 744 | 744 | $selected_country = $user_address['country']; |
| 745 | 745 | } |
| 746 | 746 | |
| 747 | 747 | $countries = give_get_country_list(); |
| 748 | - foreach ( $countries as $country_code => $country ) { |
|
| 749 | - echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>'; |
|
| 748 | + foreach ($countries as $country_code => $country) { |
|
| 749 | + echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>'; |
|
| 750 | 750 | } |
| 751 | 751 | ?> |
| 752 | 752 | </select> |
@@ -754,44 +754,44 @@ discard block |
||
| 754 | 754 | |
| 755 | 755 | <p id="give-card-state-wrap" class="form-row form-row-last"> |
| 756 | 756 | <label for="card_state" class="give-label"> |
| 757 | - <?php _e( 'State / Province', 'give' ); ?> |
|
| 758 | - <?php if ( give_field_is_required( 'card_state', $form_id ) ) { ?> |
|
| 757 | + <?php _e('State / Province', 'give'); ?> |
|
| 758 | + <?php if (give_field_is_required('card_state', $form_id)) { ?> |
|
| 759 | 759 | <span class="give-required-indicator">*</span> |
| 760 | 760 | <?php } ?> |
| 761 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The state or province for your billing address.', 'give' ); ?>"></span> |
|
| 761 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The state or province for your billing address.', 'give'); ?>"></span> |
|
| 762 | 762 | </label> |
| 763 | 763 | |
| 764 | 764 | <?php |
| 765 | 765 | $selected_state = give_get_state(); |
| 766 | - $states = give_get_states( $selected_country ); |
|
| 766 | + $states = give_get_states($selected_country); |
|
| 767 | 767 | |
| 768 | - if ( $logged_in && ! empty( $user_address['state'] ) ) { |
|
| 768 | + if ($logged_in && ! empty($user_address['state'])) { |
|
| 769 | 769 | $selected_state = $user_address['state']; |
| 770 | 770 | } |
| 771 | 771 | |
| 772 | - if ( ! empty( $states ) ) : ?> |
|
| 773 | - <select name="card_state" id="card_state" class="card_state give-select<?php if ( give_field_is_required( 'card_state', $form_id ) ) { |
|
| 772 | + if ( ! empty($states)) : ?> |
|
| 773 | + <select name="card_state" id="card_state" class="card_state give-select<?php if (give_field_is_required('card_state', $form_id)) { |
|
| 774 | 774 | echo ' required'; |
| 775 | - } ?>"<?php if ( give_field_is_required( 'card_state', $form_id ) ) { |
|
| 775 | + } ?>"<?php if (give_field_is_required('card_state', $form_id)) { |
|
| 776 | 776 | echo ' required '; |
| 777 | 777 | } ?>> |
| 778 | 778 | <?php |
| 779 | - foreach ( $states as $state_code => $state ) { |
|
| 780 | - echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>'; |
|
| 779 | + foreach ($states as $state_code => $state) { |
|
| 780 | + echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>'; |
|
| 781 | 781 | } |
| 782 | 782 | ?> |
| 783 | 783 | </select> |
| 784 | 784 | <?php else : ?> |
| 785 | - <input type="text" size="6" name="card_state" id="card_state" class="card_state give-input" placeholder="<?php _e( 'State / Province', 'give' ); ?>"/> |
|
| 785 | + <input type="text" size="6" name="card_state" id="card_state" class="card_state give-input" 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,93 +803,93 @@ 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 $user_ID; |
| 809 | 809 | |
| 810 | - if ( is_user_logged_in() ) { |
|
| 811 | - $user_data = get_userdata( $user_ID ); |
|
| 810 | + if (is_user_logged_in()) { |
|
| 811 | + $user_data = get_userdata($user_ID); |
|
| 812 | 812 | } |
| 813 | 813 | |
| 814 | - $show_register_form = give_show_login_register_option( $form_id ); |
|
| 814 | + $show_register_form = give_show_login_register_option($form_id); |
|
| 815 | 815 | |
| 816 | 816 | ob_start(); ?> |
| 817 | 817 | <fieldset id="give-register-fields-<?php echo $form_id; ?>"> |
| 818 | 818 | |
| 819 | - <?php if ( $show_register_form == 'both' ) { ?> |
|
| 819 | + <?php if ($show_register_form == 'both') { ?> |
|
| 820 | 820 | <div class="give-login-account-wrap"> |
| 821 | - <p class="give-login-message"><?php _e( 'Already have an account?', 'give' ); ?> |
|
| 822 | - <a href="<?php echo esc_url( add_query_arg( 'login', 1 ) ); ?>" class="give-checkout-login" data-action="give_checkout_login"><?php _e( 'Login', 'give' ); ?></a> |
|
| 821 | + <p class="give-login-message"><?php _e('Already have an account?', 'give'); ?> |
|
| 822 | + <a href="<?php echo esc_url(add_query_arg('login', 1)); ?>" class="give-checkout-login" data-action="give_checkout_login"><?php _e('Login', 'give'); ?></a> |
|
| 823 | 823 | </p> |
| 824 | 824 | <p class="give-loading-text"> |
| 825 | - <span class="give-loading-animation"></span> <?php _e( 'Loading...', 'give' ); ?></p> |
|
| 825 | + <span class="give-loading-animation"></span> <?php _e('Loading...', 'give'); ?></p> |
|
| 826 | 826 | </div> |
| 827 | 827 | <?php } ?> |
| 828 | 828 | |
| 829 | - <?php do_action( 'give_register_fields_before', $form_id ); ?> |
|
| 829 | + <?php do_action('give_register_fields_before', $form_id); ?> |
|
| 830 | 830 | |
| 831 | 831 | <fieldset id="give-register-account-fields-<?php echo $form_id; ?>"> |
| 832 | - <legend><?php echo apply_filters( 'give_create_account_fieldset_heading', __( 'Create an account', 'give' ) ); |
|
| 833 | - if ( ! give_logged_in_only( $form_id ) ) { |
|
| 834 | - echo ' <span class="sub-text">' . __( '(optional)', 'give' ) . '</span>'; |
|
| 832 | + <legend><?php echo apply_filters('give_create_account_fieldset_heading', __('Create an account', 'give')); |
|
| 833 | + if ( ! give_logged_in_only($form_id)) { |
|
| 834 | + echo ' <span class="sub-text">'.__('(optional)', 'give').'</span>'; |
|
| 835 | 835 | } ?></legend> |
| 836 | - <?php do_action( 'give_register_account_fields_before', $form_id ); ?> |
|
| 836 | + <?php do_action('give_register_account_fields_before', $form_id); ?> |
|
| 837 | 837 | <div id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-one-third form-row-first"> |
| 838 | 838 | <label for="give-user-login-<?php echo $form_id; ?>"> |
| 839 | - <?php _e( 'Username', 'give' ); ?> |
|
| 840 | - <?php if ( give_logged_in_only( $form_id ) ) { ?> |
|
| 839 | + <?php _e('Username', 'give'); ?> |
|
| 840 | + <?php if (give_logged_in_only($form_id)) { ?> |
|
| 841 | 841 | <span class="give-required-indicator">*</span> |
| 842 | 842 | <?php } ?> |
| 843 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The username you will use to log into your account.', 'give' ); ?>"></span> |
|
| 843 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The username you will use to log into your account.', 'give'); ?>"></span> |
|
| 844 | 844 | </label> |
| 845 | 845 | |
| 846 | - <input name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" class="<?php if ( give_logged_in_only( $form_id ) ) { |
|
| 846 | + <input name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" class="<?php if (give_logged_in_only($form_id)) { |
|
| 847 | 847 | echo 'required '; |
| 848 | - } ?>give-input" type="text" placeholder="<?php _e( 'Username', 'give' ); ?>" title="<?php _e( 'Username', 'give' ); ?>"/> |
|
| 848 | + } ?>give-input" type="text" placeholder="<?php _e('Username', 'give'); ?>" title="<?php _e('Username', 'give'); ?>"/> |
|
| 849 | 849 | </div> |
| 850 | 850 | |
| 851 | 851 | <div id="give-user-pass-wrap-<?php echo $form_id; ?>" class="form-row form-row-one-third"> |
| 852 | 852 | <label for="give-user-pass-<?php echo $form_id; ?>"> |
| 853 | - <?php _e( 'Password', 'give' ); ?> |
|
| 854 | - <?php if ( give_logged_in_only( $form_id ) ) { ?> |
|
| 853 | + <?php _e('Password', 'give'); ?> |
|
| 854 | + <?php if (give_logged_in_only($form_id)) { ?> |
|
| 855 | 855 | <span class="give-required-indicator">*</span> |
| 856 | 856 | <?php } ?> |
| 857 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The password used to access your account.', 'give' ); ?>"></span> |
|
| 857 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The password used to access your account.', 'give'); ?>"></span> |
|
| 858 | 858 | </label> |
| 859 | 859 | |
| 860 | - <input name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" class="<?php if ( give_logged_in_only( $form_id ) ) { |
|
| 860 | + <input name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" class="<?php if (give_logged_in_only($form_id)) { |
|
| 861 | 861 | echo 'required '; |
| 862 | - } ?>give-input" placeholder="<?php _e( 'Password', 'give' ); ?>" type="password"/> |
|
| 862 | + } ?>give-input" placeholder="<?php _e('Password', 'give'); ?>" type="password"/> |
|
| 863 | 863 | </div> |
| 864 | 864 | |
| 865 | 865 | <div id="give-user-pass-confirm-wrap-<?php echo $form_id; ?>" class="give-register-password form-row form-row-one-third"> |
| 866 | 866 | <label for="give-user-pass-confirm-<?php echo $form_id; ?>"> |
| 867 | - <?php _e( 'Confirm PW', 'give' ); ?> |
|
| 868 | - <?php if ( give_logged_in_only( $form_id ) ) { ?> |
|
| 867 | + <?php _e('Confirm PW', 'give'); ?> |
|
| 868 | + <?php if (give_logged_in_only($form_id)) { ?> |
|
| 869 | 869 | <span class="give-required-indicator">*</span> |
| 870 | 870 | <?php } ?> |
| 871 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'Please retype your password to confirm.', 'give' ); ?>"></span> |
|
| 871 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('Please retype your password to confirm.', 'give'); ?>"></span> |
|
| 872 | 872 | </label> |
| 873 | 873 | |
| 874 | - <input name="give_user_pass_confirm" id="give-user-pass-confirm-<?php echo $form_id; ?>" class="<?php if ( give_logged_in_only( $form_id ) ) { |
|
| 874 | + <input name="give_user_pass_confirm" id="give-user-pass-confirm-<?php echo $form_id; ?>" class="<?php if (give_logged_in_only($form_id)) { |
|
| 875 | 875 | echo 'required '; |
| 876 | - } ?>give-input" placeholder="<?php _e( 'Confirm password', 'give' ); ?>" type="password"/> |
|
| 876 | + } ?>give-input" placeholder="<?php _e('Confirm password', 'give'); ?>" type="password"/> |
|
| 877 | 877 | </div> |
| 878 | - <?php do_action( 'give_register_account_fields_after', $form_id ); ?> |
|
| 878 | + <?php do_action('give_register_account_fields_after', $form_id); ?> |
|
| 879 | 879 | </fieldset> |
| 880 | 880 | |
| 881 | - <?php do_action( 'give_register_fields_after', $form_id ); ?> |
|
| 881 | + <?php do_action('give_register_fields_after', $form_id); ?> |
|
| 882 | 882 | |
| 883 | 883 | <input type="hidden" name="give-purchase-var" value="needs-to-register"/> |
| 884 | 884 | |
| 885 | - <?php do_action( 'give_purchase_form_user_info', $form_id ); ?> |
|
| 885 | + <?php do_action('give_purchase_form_user_info', $form_id); ?> |
|
| 886 | 886 | |
| 887 | 887 | </fieldset> |
| 888 | 888 | <?php |
| 889 | 889 | echo ob_get_clean(); |
| 890 | 890 | } |
| 891 | 891 | |
| 892 | -add_action( 'give_purchase_form_register_fields', 'give_get_register_fields' ); |
|
| 892 | +add_action('give_purchase_form_register_fields', 'give_get_register_fields'); |
|
| 893 | 893 | |
| 894 | 894 | /** |
| 895 | 895 | * Gets the login fields for the login form on the checkout. This function hooks |
@@ -902,73 +902,73 @@ discard block |
||
| 902 | 902 | * |
| 903 | 903 | * @return string |
| 904 | 904 | */ |
| 905 | -function give_get_login_fields( $form_id ) { |
|
| 905 | +function give_get_login_fields($form_id) { |
|
| 906 | 906 | |
| 907 | - $form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : $form_id; |
|
| 908 | - $show_register_form = give_show_login_register_option( $form_id ); |
|
| 907 | + $form_id = isset($_POST['form_id']) ? $_POST['form_id'] : $form_id; |
|
| 908 | + $show_register_form = give_show_login_register_option($form_id); |
|
| 909 | 909 | |
| 910 | 910 | ob_start(); |
| 911 | 911 | ?> |
| 912 | 912 | <fieldset id="give-login-fields-<?php echo $form_id; ?>"> |
| 913 | - <legend><?php echo apply_filters( 'give_account_login_fieldset_heading', __( 'Login to Your Account', 'give' ) ); |
|
| 914 | - if ( ! give_logged_in_only( $form_id ) ) { |
|
| 915 | - echo ' <span class="sub-text">' . __( '(optional)', 'give' ) . '</span>'; |
|
| 913 | + <legend><?php echo apply_filters('give_account_login_fieldset_heading', __('Login to Your Account', 'give')); |
|
| 914 | + if ( ! give_logged_in_only($form_id)) { |
|
| 915 | + echo ' <span class="sub-text">'.__('(optional)', 'give').'</span>'; |
|
| 916 | 916 | } ?> |
| 917 | 917 | </legend> |
| 918 | - <?php if ( $show_register_form == 'both' ) { ?> |
|
| 918 | + <?php if ($show_register_form == 'both') { ?> |
|
| 919 | 919 | <p class="give-new-account-link"> |
| 920 | - <?php _e( 'Need to create an account?', 'give' ); ?> |
|
| 921 | - <a href="<?php echo remove_query_arg( 'login' ); ?>" class="give-checkout-register-cancel" data-action="give_checkout_register"> |
|
| 922 | - <?php _e( 'Register', 'give' ); |
|
| 923 | - if ( ! give_logged_in_only( $form_id ) ) { |
|
| 924 | - echo ' ' . __( 'or checkout as a guest.', 'give' ); |
|
| 920 | + <?php _e('Need to create an account?', 'give'); ?> |
|
| 921 | + <a href="<?php echo remove_query_arg('login'); ?>" class="give-checkout-register-cancel" data-action="give_checkout_register"> |
|
| 922 | + <?php _e('Register', 'give'); |
|
| 923 | + if ( ! give_logged_in_only($form_id)) { |
|
| 924 | + echo ' '.__('or checkout as a guest.', 'give'); |
|
| 925 | 925 | } ?> |
| 926 | 926 | </a> |
| 927 | 927 | </p> |
| 928 | 928 | <p class="give-loading-text"> |
| 929 | - <span class="give-loading-animation"></span> <?php _e( 'Loading...', 'give' ); ?> </p> |
|
| 929 | + <span class="give-loading-animation"></span> <?php _e('Loading...', 'give'); ?> </p> |
|
| 930 | 930 | <?php } ?> |
| 931 | - <?php do_action( 'give_checkout_login_fields_before', $form_id ); ?> |
|
| 931 | + <?php do_action('give_checkout_login_fields_before', $form_id); ?> |
|
| 932 | 932 | <div id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-first"> |
| 933 | 933 | <label class="give-label" for="give-user-login-<?php echo $form_id; ?>"> |
| 934 | - <?php _e( 'Username', 'give' ); ?> |
|
| 935 | - <?php if ( give_logged_in_only( $form_id ) ) { ?> |
|
| 934 | + <?php _e('Username', 'give'); ?> |
|
| 935 | + <?php if (give_logged_in_only($form_id)) { ?> |
|
| 936 | 936 | <span class="give-required-indicator">*</span> |
| 937 | 937 | <?php } ?> |
| 938 | 938 | </label> |
| 939 | 939 | |
| 940 | - <input class="<?php if ( give_logged_in_only( $form_id ) ) { |
|
| 940 | + <input class="<?php if (give_logged_in_only($form_id)) { |
|
| 941 | 941 | echo 'required '; |
| 942 | - } ?>give-input" type="text" name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value="" placeholder="<?php _e( 'Your username', 'give' ); ?>"/> |
|
| 942 | + } ?>give-input" type="text" name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value="" placeholder="<?php _e('Your username', 'give'); ?>"/> |
|
| 943 | 943 | </div> |
| 944 | 944 | |
| 945 | 945 | <div id="give-user-pass-wrap-<?php echo $form_id; ?>" class="give_login_password form-row form-row-last"> |
| 946 | 946 | <label class="give-label" for="give-user-pass-<?php echo $form_id; ?>"> |
| 947 | - <?php _e( 'Password', 'give' ); ?> |
|
| 948 | - <?php if ( give_logged_in_only( $form_id ) ) { ?> |
|
| 947 | + <?php _e('Password', 'give'); ?> |
|
| 948 | + <?php if (give_logged_in_only($form_id)) { ?> |
|
| 949 | 949 | <span class="give-required-indicator">*</span> |
| 950 | 950 | <?php } ?> |
| 951 | 951 | </label> |
| 952 | - <input class="<?php if ( give_logged_in_only( $form_id ) ) { |
|
| 952 | + <input class="<?php if (give_logged_in_only($form_id)) { |
|
| 953 | 953 | echo 'required '; |
| 954 | - } ?>give-input" type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" placeholder="<?php _e( 'Your password', 'give' ); ?>"/> |
|
| 954 | + } ?>give-input" type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" placeholder="<?php _e('Your password', 'give'); ?>"/> |
|
| 955 | 955 | <input type="hidden" name="give-purchase-var" value="needs-to-login"/> |
| 956 | 956 | </div> |
| 957 | 957 | |
| 958 | 958 | <div id="give-user-login-submit-<?php echo $form_id; ?>" class="give-clearfix"> |
| 959 | - <input type="submit" class="give-submit give-btn button" name="give_login_submit" value="<?php _e( 'Login', 'give' ); ?>"/> |
|
| 960 | - <?php if ( $show_register_form !== 'login' ) { ?> |
|
| 961 | - <input type="button" data-action="give_cancel_login" class="give-cancel-login give-checkout-register-cancel give-btn button" name="give_login_cancel" value="<?php _e( 'Cancel', 'give' ); ?>"/> |
|
| 959 | + <input type="submit" class="give-submit give-btn button" name="give_login_submit" value="<?php _e('Login', 'give'); ?>"/> |
|
| 960 | + <?php if ($show_register_form !== 'login') { ?> |
|
| 961 | + <input type="button" data-action="give_cancel_login" class="give-cancel-login give-checkout-register-cancel give-btn button" name="give_login_cancel" value="<?php _e('Cancel', 'give'); ?>"/> |
|
| 962 | 962 | <?php } ?> |
| 963 | 963 | <span class="give-loading-animation"></span> |
| 964 | 964 | </div> |
| 965 | - <?php do_action( 'give_checkout_login_fields_after', $form_id ); ?> |
|
| 965 | + <?php do_action('give_checkout_login_fields_after', $form_id); ?> |
|
| 966 | 966 | </fieldset><!--end #give-login-fields--> |
| 967 | 967 | <?php |
| 968 | 968 | echo ob_get_clean(); |
| 969 | 969 | } |
| 970 | 970 | |
| 971 | -add_action( 'give_purchase_form_login_fields', 'give_get_login_fields', 10, 1 ); |
|
| 971 | +add_action('give_purchase_form_login_fields', 'give_get_login_fields', 10, 1); |
|
| 972 | 972 | |
| 973 | 973 | /** |
| 974 | 974 | * Payment Mode Select |
@@ -984,49 +984,49 @@ discard block |
||
| 984 | 984 | * |
| 985 | 985 | * @return void |
| 986 | 986 | */ |
| 987 | -function give_payment_mode_select( $form_id ) { |
|
| 987 | +function give_payment_mode_select($form_id) { |
|
| 988 | 988 | |
| 989 | 989 | $gateways = give_get_enabled_payment_gateways(); |
| 990 | 990 | |
| 991 | - do_action( 'give_payment_mode_top', $form_id ); ?> |
|
| 991 | + do_action('give_payment_mode_top', $form_id); ?> |
|
| 992 | 992 | |
| 993 | 993 | <fieldset id="give-payment-mode-select"> |
| 994 | - <?php do_action( 'give_payment_mode_before_gateways_wrap' ); ?> |
|
| 994 | + <?php do_action('give_payment_mode_before_gateways_wrap'); ?> |
|
| 995 | 995 | <div id="give-payment-mode-wrap"> |
| 996 | - <legend class="give-payment-mode-label"><?php echo apply_filters( 'give_checkout_payment_method_text', __( 'Select Payment Method', 'give' ) ); ?> |
|
| 997 | - <span class="give-loading-text"><span class="give-loading-animation"></span> <?php _e( 'Loading...', 'give' ); ?></span> |
|
| 996 | + <legend class="give-payment-mode-label"><?php echo apply_filters('give_checkout_payment_method_text', __('Select Payment Method', 'give')); ?> |
|
| 997 | + <span class="give-loading-text"><span class="give-loading-animation"></span> <?php _e('Loading...', 'give'); ?></span> |
|
| 998 | 998 | </legend> |
| 999 | 999 | <?php |
| 1000 | 1000 | |
| 1001 | - do_action( 'give_payment_mode_before_gateways' ) ?> |
|
| 1001 | + do_action('give_payment_mode_before_gateways') ?> |
|
| 1002 | 1002 | |
| 1003 | 1003 | <ul id="give-gateway-radio-list"> |
| 1004 | - <?php foreach ( $gateways as $gateway_id => $gateway ) : |
|
| 1005 | - $checked = checked( $gateway_id, give_get_default_gateway( $form_id ), false ); |
|
| 1004 | + <?php foreach ($gateways as $gateway_id => $gateway) : |
|
| 1005 | + $checked = checked($gateway_id, give_get_default_gateway($form_id), false); |
|
| 1006 | 1006 | $checked_class = $checked ? ' give-gateway-option-selected' : ''; |
| 1007 | - 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 ) . '">'; |
|
| 1008 | - 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'] ); |
|
| 1007 | + 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).'">'; |
|
| 1008 | + 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']); |
|
| 1009 | 1009 | echo '</label></li>'; |
| 1010 | 1010 | endforeach; ?> |
| 1011 | 1011 | </ul> |
| 1012 | - <?php do_action( 'give_payment_mode_after_gateways' ); ?> |
|
| 1012 | + <?php do_action('give_payment_mode_after_gateways'); ?> |
|
| 1013 | 1013 | </div> |
| 1014 | - <?php do_action( 'give_payment_mode_after_gateways_wrap' ); ?> |
|
| 1014 | + <?php do_action('give_payment_mode_after_gateways_wrap'); ?> |
|
| 1015 | 1015 | </fieldset> |
| 1016 | 1016 | |
| 1017 | - <?php do_action( 'give_payment_mode_bottom', $form_id ); ?> |
|
| 1017 | + <?php do_action('give_payment_mode_bottom', $form_id); ?> |
|
| 1018 | 1018 | |
| 1019 | 1019 | <div id="give_purchase_form_wrap"> |
| 1020 | 1020 | |
| 1021 | - <?php do_action( 'give_purchase_form', $form_id ); ?> |
|
| 1021 | + <?php do_action('give_purchase_form', $form_id); ?> |
|
| 1022 | 1022 | |
| 1023 | 1023 | </div><!-- the checkout fields are loaded into this--> |
| 1024 | 1024 | |
| 1025 | - <?php do_action( 'give_purchase_form_wrap_bottom', $form_id ); |
|
| 1025 | + <?php do_action('give_purchase_form_wrap_bottom', $form_id); |
|
| 1026 | 1026 | |
| 1027 | 1027 | } |
| 1028 | 1028 | |
| 1029 | -add_action( 'give_payment_mode_select', 'give_payment_mode_select' ); |
|
| 1029 | +add_action('give_payment_mode_select', 'give_payment_mode_select'); |
|
| 1030 | 1030 | |
| 1031 | 1031 | |
| 1032 | 1032 | /** |
@@ -1041,36 +1041,36 @@ discard block |
||
| 1041 | 1041 | * |
| 1042 | 1042 | * @return void |
| 1043 | 1043 | */ |
| 1044 | -function give_terms_agreement( $form_id ) { |
|
| 1044 | +function give_terms_agreement($form_id) { |
|
| 1045 | 1045 | |
| 1046 | - $form_option = get_post_meta( $form_id, '_give_terms_option', true ); |
|
| 1047 | - $label = get_post_meta( $form_id, '_give_agree_label', true ); |
|
| 1048 | - $terms = get_post_meta( $form_id, '_give_agree_text', true ); |
|
| 1046 | + $form_option = get_post_meta($form_id, '_give_terms_option', true); |
|
| 1047 | + $label = get_post_meta($form_id, '_give_agree_label', true); |
|
| 1048 | + $terms = get_post_meta($form_id, '_give_agree_text', true); |
|
| 1049 | 1049 | |
| 1050 | - if ( $form_option === 'yes' && ! empty( $terms ) ) { ?> |
|
| 1050 | + if ($form_option === 'yes' && ! empty($terms)) { ?> |
|
| 1051 | 1051 | <fieldset id="give_terms_agreement"> |
| 1052 | 1052 | <div id="give_terms" style="display:none;"> |
| 1053 | 1053 | <?php |
| 1054 | - do_action( 'give_before_terms' ); |
|
| 1055 | - echo wpautop( stripslashes( $terms ) ); |
|
| 1056 | - do_action( 'give_after_terms' ); |
|
| 1054 | + do_action('give_before_terms'); |
|
| 1055 | + echo wpautop(stripslashes($terms)); |
|
| 1056 | + do_action('give_after_terms'); |
|
| 1057 | 1057 | ?> |
| 1058 | 1058 | </div> |
| 1059 | 1059 | <div id="give_show_terms"> |
| 1060 | - <a href="#" class="give_terms_links"><?php _e( 'Show Terms', 'give' ); ?></a> |
|
| 1061 | - <a href="#" class="give_terms_links" style="display:none;"><?php _e( 'Hide Terms', 'give' ); ?></a> |
|
| 1060 | + <a href="#" class="give_terms_links"><?php _e('Show Terms', 'give'); ?></a> |
|
| 1061 | + <a href="#" class="give_terms_links" style="display:none;"><?php _e('Hide Terms', 'give'); ?></a> |
|
| 1062 | 1062 | </div> |
| 1063 | 1063 | |
| 1064 | 1064 | <input name="give_agree_to_terms" class="required" type="checkbox" id="give_agree_to_terms" value="1"/> |
| 1065 | 1065 | <label |
| 1066 | - for="give_agree_to_terms"><?php echo ! empty( $label ) ? stripslashes( $label ) : __( 'Agree to Terms?', 'give' ); ?></label> |
|
| 1066 | + for="give_agree_to_terms"><?php echo ! empty($label) ? stripslashes($label) : __('Agree to Terms?', 'give'); ?></label> |
|
| 1067 | 1067 | |
| 1068 | 1068 | </fieldset> |
| 1069 | 1069 | <?php |
| 1070 | 1070 | } |
| 1071 | 1071 | } |
| 1072 | 1072 | |
| 1073 | -add_action( 'give_purchase_form_before_submit', 'give_terms_agreement', 10, 1 ); |
|
| 1073 | +add_action('give_purchase_form_before_submit', 'give_terms_agreement', 10, 1); |
|
| 1074 | 1074 | |
| 1075 | 1075 | /** |
| 1076 | 1076 | * Checkout Final Total |
@@ -1082,27 +1082,27 @@ discard block |
||
| 1082 | 1082 | * @since 1.0 |
| 1083 | 1083 | * @return void |
| 1084 | 1084 | */ |
| 1085 | -function give_checkout_final_total( $form_id ) { |
|
| 1085 | +function give_checkout_final_total($form_id) { |
|
| 1086 | 1086 | |
| 1087 | - if ( isset( $_POST['give_total'] ) ) { |
|
| 1088 | - $total = apply_filters( 'give_donation_total', $_POST['give_total'] ); |
|
| 1087 | + if (isset($_POST['give_total'])) { |
|
| 1088 | + $total = apply_filters('give_donation_total', $_POST['give_total']); |
|
| 1089 | 1089 | } else { |
| 1090 | 1090 | //default total |
| 1091 | - $total = give_get_default_form_amount( $form_id ); |
|
| 1091 | + $total = give_get_default_form_amount($form_id); |
|
| 1092 | 1092 | } |
| 1093 | 1093 | //Only proceed if give_total available |
| 1094 | - if ( empty( $total ) ) { |
|
| 1094 | + if (empty($total)) { |
|
| 1095 | 1095 | return; |
| 1096 | 1096 | } |
| 1097 | 1097 | ?> |
| 1098 | 1098 | <p id="give-final-total-wrap" class="form-wrap "> |
| 1099 | - <span class="give-donation-total-label"><?php echo apply_filters( 'give_donation_total_label', esc_attr__( 'Donation Total:', 'give' ) ); ?></span> |
|
| 1100 | - <span class="give-final-total-amount" data-total="<?php echo give_format_amount( $total ); ?>"><?php echo give_currency_filter( give_format_amount( $total ) ); ?></span> |
|
| 1099 | + <span class="give-donation-total-label"><?php echo apply_filters('give_donation_total_label', esc_attr__('Donation Total:', 'give')); ?></span> |
|
| 1100 | + <span class="give-final-total-amount" data-total="<?php echo give_format_amount($total); ?>"><?php echo give_currency_filter(give_format_amount($total)); ?></span> |
|
| 1101 | 1101 | </p> |
| 1102 | 1102 | <?php |
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | -add_action( 'give_purchase_form_before_submit', 'give_checkout_final_total', 999 ); |
|
| 1105 | +add_action('give_purchase_form_before_submit', 'give_checkout_final_total', 999); |
|
| 1106 | 1106 | |
| 1107 | 1107 | |
| 1108 | 1108 | /** |
@@ -1114,22 +1114,22 @@ discard block |
||
| 1114 | 1114 | * |
| 1115 | 1115 | * @return void |
| 1116 | 1116 | */ |
| 1117 | -function give_checkout_submit( $form_id ) { |
|
| 1117 | +function give_checkout_submit($form_id) { |
|
| 1118 | 1118 | ?> |
| 1119 | 1119 | <fieldset id="give_purchase_submit"> |
| 1120 | - <?php do_action( 'give_purchase_form_before_submit', $form_id ); ?> |
|
| 1120 | + <?php do_action('give_purchase_form_before_submit', $form_id); ?> |
|
| 1121 | 1121 | |
| 1122 | - <?php give_checkout_hidden_fields( $form_id ); ?> |
|
| 1122 | + <?php give_checkout_hidden_fields($form_id); ?> |
|
| 1123 | 1123 | |
| 1124 | - <?php echo give_checkout_button_purchase( $form_id ); ?> |
|
| 1124 | + <?php echo give_checkout_button_purchase($form_id); ?> |
|
| 1125 | 1125 | |
| 1126 | - <?php do_action( 'give_purchase_form_after_submit', $form_id ); ?> |
|
| 1126 | + <?php do_action('give_purchase_form_after_submit', $form_id); ?> |
|
| 1127 | 1127 | |
| 1128 | 1128 | </fieldset> |
| 1129 | 1129 | <?php |
| 1130 | 1130 | } |
| 1131 | 1131 | |
| 1132 | -add_action( 'give_purchase_form_after_cc_form', 'give_checkout_submit', 9999 ); |
|
| 1132 | +add_action('give_purchase_form_after_cc_form', 'give_checkout_submit', 9999); |
|
| 1133 | 1133 | |
| 1134 | 1134 | |
| 1135 | 1135 | /** |
@@ -1142,17 +1142,17 @@ discard block |
||
| 1142 | 1142 | * |
| 1143 | 1143 | * @return string |
| 1144 | 1144 | */ |
| 1145 | -function give_checkout_button_purchase( $form_id ) { |
|
| 1145 | +function give_checkout_button_purchase($form_id) { |
|
| 1146 | 1146 | |
| 1147 | - $display_label_field = get_post_meta( $form_id, '_give_checkout_label', true ); |
|
| 1148 | - $display_label = ( ! empty( $display_label_field ) ? $display_label_field : __( 'Donate Now', 'give' ) ); |
|
| 1147 | + $display_label_field = get_post_meta($form_id, '_give_checkout_label', true); |
|
| 1148 | + $display_label = ( ! empty($display_label_field) ? $display_label_field : __('Donate Now', 'give')); |
|
| 1149 | 1149 | ob_start(); ?> |
| 1150 | 1150 | <div class="give-submit-button-wrap give-clearfix"> |
| 1151 | 1151 | <input type="submit" class="give-submit give-btn" id="give-purchase-button" name="give-purchase" value="<?php echo $display_label; ?>"/> |
| 1152 | 1152 | <span class="give-loading-animation"></span> |
| 1153 | 1153 | </div> |
| 1154 | 1154 | <?php |
| 1155 | - return apply_filters( 'give_checkout_button_purchase', ob_get_clean(), $form_id ); |
|
| 1155 | + return apply_filters('give_checkout_button_purchase', ob_get_clean(), $form_id); |
|
| 1156 | 1156 | } |
| 1157 | 1157 | |
| 1158 | 1158 | /** |
@@ -1165,11 +1165,11 @@ discard block |
||
| 1165 | 1165 | * |
| 1166 | 1166 | * @return void |
| 1167 | 1167 | */ |
| 1168 | -function give_agree_to_terms_js( $form_id ) { |
|
| 1168 | +function give_agree_to_terms_js($form_id) { |
|
| 1169 | 1169 | |
| 1170 | - $form_option = get_post_meta( $form_id, '_give_terms_option', true ); |
|
| 1170 | + $form_option = get_post_meta($form_id, '_give_terms_option', true); |
|
| 1171 | 1171 | |
| 1172 | - if ( $form_option === 'yes' ) { |
|
| 1172 | + if ($form_option === 'yes') { |
|
| 1173 | 1173 | ?> |
| 1174 | 1174 | <script type="text/javascript"> |
| 1175 | 1175 | jQuery(document).ready(function ($) { |
@@ -1185,7 +1185,7 @@ discard block |
||
| 1185 | 1185 | } |
| 1186 | 1186 | } |
| 1187 | 1187 | |
| 1188 | -add_action( 'give_checkout_form_top', 'give_agree_to_terms_js', 10, 2 ); |
|
| 1188 | +add_action('give_checkout_form_top', 'give_agree_to_terms_js', 10, 2); |
|
| 1189 | 1189 | |
| 1190 | 1190 | /** |
| 1191 | 1191 | * Show Give Goals |
@@ -1198,25 +1198,25 @@ discard block |
||
| 1198 | 1198 | * @return mixed |
| 1199 | 1199 | */ |
| 1200 | 1200 | |
| 1201 | -function give_show_goal_progress( $form_id, $args ) { |
|
| 1201 | +function give_show_goal_progress($form_id, $args) { |
|
| 1202 | 1202 | |
| 1203 | - $goal_option = get_post_meta( $form_id, '_give_goal_option', true ); |
|
| 1204 | - $form = new Give_Donate_Form( $form_id ); |
|
| 1203 | + $goal_option = get_post_meta($form_id, '_give_goal_option', true); |
|
| 1204 | + $form = new Give_Donate_Form($form_id); |
|
| 1205 | 1205 | $goal = $form->goal; |
| 1206 | - $goal_format = get_post_meta( $form_id, '_give_goal_format', true ); |
|
| 1206 | + $goal_format = get_post_meta($form_id, '_give_goal_format', true); |
|
| 1207 | 1207 | $income = $form->get_earnings(); |
| 1208 | - $color = get_post_meta( $form_id, '_give_goal_color', true ); |
|
| 1209 | - $show_text = (bool) isset( $args['show_text'] ) ? filter_var( $args['show_text'], FILTER_VALIDATE_BOOLEAN ) : true; |
|
| 1210 | - $show_bar = (bool) isset( $args['show_bar'] ) ? filter_var( $args['show_bar'], FILTER_VALIDATE_BOOLEAN ) : true; |
|
| 1208 | + $color = get_post_meta($form_id, '_give_goal_color', true); |
|
| 1209 | + $show_text = (bool) isset($args['show_text']) ? filter_var($args['show_text'], FILTER_VALIDATE_BOOLEAN) : true; |
|
| 1210 | + $show_bar = (bool) isset($args['show_bar']) ? filter_var($args['show_bar'], FILTER_VALIDATE_BOOLEAN) : true; |
|
| 1211 | 1211 | |
| 1212 | 1212 | //Sanity check - respect shortcode args |
| 1213 | - if ( isset( $args['show_goal'] ) && $args['show_goal'] === false ) { |
|
| 1213 | + if (isset($args['show_goal']) && $args['show_goal'] === false) { |
|
| 1214 | 1214 | return false; |
| 1215 | 1215 | } |
| 1216 | 1216 | |
| 1217 | 1217 | //Sanity check - ensure form has goal set to output |
| 1218 | - if ( empty( $form->ID ) |
|
| 1219 | - || ( is_singular( 'give_forms' ) && $goal_option !== 'yes' ) |
|
| 1218 | + if (empty($form->ID) |
|
| 1219 | + || (is_singular('give_forms') && $goal_option !== 'yes') |
|
| 1220 | 1220 | || $goal_option !== 'yes' |
| 1221 | 1221 | || $goal == 0 |
| 1222 | 1222 | ) { |
@@ -1224,26 +1224,26 @@ discard block |
||
| 1224 | 1224 | return false; |
| 1225 | 1225 | } |
| 1226 | 1226 | |
| 1227 | - $progress = round( ( $income / $goal ) * 100, 2 ); |
|
| 1227 | + $progress = round(($income / $goal) * 100, 2); |
|
| 1228 | 1228 | |
| 1229 | - if ( $income >= $goal ) { |
|
| 1229 | + if ($income >= $goal) { |
|
| 1230 | 1230 | $progress = 100; |
| 1231 | 1231 | } |
| 1232 | 1232 | |
| 1233 | 1233 | $output = '<div class="give-goal-progress">'; |
| 1234 | 1234 | |
| 1235 | 1235 | //Goal Progress Text |
| 1236 | - if ( ! empty( $show_text ) ) { |
|
| 1236 | + if ( ! empty($show_text)) { |
|
| 1237 | 1237 | |
| 1238 | 1238 | $output .= '<div class="raised">'; |
| 1239 | 1239 | |
| 1240 | - if ( $goal_format !== 'percentage' ) { |
|
| 1240 | + if ($goal_format !== 'percentage') { |
|
| 1241 | 1241 | |
| 1242 | - $output .= sprintf( _x( '%s of %s raised', 'This text displays the amount of income raised compared to the goal.', 'give' ), '<span class="income">' . apply_filters( 'give_goal_amount_raised_output', give_currency_filter( give_format_amount( $income ) ) ) . '</span>', '<span class="goal-text">' . apply_filters( 'give_goal_amount_target_output', give_currency_filter( give_format_amount( $goal ) ) ) ) . '</span>'; |
|
| 1242 | + $output .= sprintf(_x('%s of %s raised', 'This text displays the amount of income raised compared to the goal.', 'give'), '<span class="income">'.apply_filters('give_goal_amount_raised_output', give_currency_filter(give_format_amount($income))).'</span>', '<span class="goal-text">'.apply_filters('give_goal_amount_target_output', give_currency_filter(give_format_amount($goal)))).'</span>'; |
|
| 1243 | 1243 | |
| 1244 | - } elseif ( $goal_format == 'percentage' ) { |
|
| 1244 | + } elseif ($goal_format == 'percentage') { |
|
| 1245 | 1245 | |
| 1246 | - $output .= sprintf( _x( '%s%% funded', 'This text displays the percentage amount of income raised compared to the goal target.', 'give' ), '<span class="give-percentage">' . apply_filters( 'give_goal_amount_funded_percentage_output', round( $progress ) ) . '</span>' ) . '</span>'; |
|
| 1246 | + $output .= sprintf(_x('%s%% funded', 'This text displays the percentage amount of income raised compared to the goal target.', 'give'), '<span class="give-percentage">'.apply_filters('give_goal_amount_funded_percentage_output', round($progress)).'</span>').'</span>'; |
|
| 1247 | 1247 | |
| 1248 | 1248 | } |
| 1249 | 1249 | |
@@ -1252,11 +1252,11 @@ discard block |
||
| 1252 | 1252 | } |
| 1253 | 1253 | |
| 1254 | 1254 | //Goal Progress Bar |
| 1255 | - if ( ! empty( $show_bar ) ) { |
|
| 1255 | + if ( ! empty($show_bar)) { |
|
| 1256 | 1256 | $output .= '<div class="give-progress-bar">'; |
| 1257 | - $output .= '<span style="width: ' . esc_attr( $progress ) . '%;'; |
|
| 1258 | - if ( ! empty( $color ) ) { |
|
| 1259 | - $output .= 'background-color:' . $color; |
|
| 1257 | + $output .= '<span style="width: '.esc_attr($progress).'%;'; |
|
| 1258 | + if ( ! empty($color)) { |
|
| 1259 | + $output .= 'background-color:'.$color; |
|
| 1260 | 1260 | } |
| 1261 | 1261 | $output .= '"></span>'; |
| 1262 | 1262 | $output .= '</div><!-- /.give-progress-bar -->'; |
@@ -1264,13 +1264,13 @@ discard block |
||
| 1264 | 1264 | |
| 1265 | 1265 | $output .= '</div><!-- /.goal-progress -->'; |
| 1266 | 1266 | |
| 1267 | - echo apply_filters( 'give_goal_output', $output ); |
|
| 1267 | + echo apply_filters('give_goal_output', $output); |
|
| 1268 | 1268 | |
| 1269 | 1269 | return false; |
| 1270 | 1270 | |
| 1271 | 1271 | } |
| 1272 | 1272 | |
| 1273 | -add_action( 'give_pre_form', 'give_show_goal_progress', 10, 2 ); |
|
| 1273 | +add_action('give_pre_form', 'give_show_goal_progress', 10, 2); |
|
| 1274 | 1274 | |
| 1275 | 1275 | /** |
| 1276 | 1276 | * Adds Actions to Render Form Content |
@@ -1282,19 +1282,19 @@ discard block |
||
| 1282 | 1282 | * |
| 1283 | 1283 | * @return void |
| 1284 | 1284 | */ |
| 1285 | -function give_form_content( $form_id, $args ) { |
|
| 1285 | +function give_form_content($form_id, $args) { |
|
| 1286 | 1286 | |
| 1287 | - $show_content = ( isset( $args['show_content'] ) && ! empty( $args['show_content'] ) ) |
|
| 1287 | + $show_content = (isset($args['show_content']) && ! empty($args['show_content'])) |
|
| 1288 | 1288 | ? $args['show_content'] |
| 1289 | - : get_post_meta( $form_id, '_give_content_option', true ); |
|
| 1289 | + : get_post_meta($form_id, '_give_content_option', true); |
|
| 1290 | 1290 | |
| 1291 | - if ( $show_content !== 'none' ) { |
|
| 1291 | + if ($show_content !== 'none') { |
|
| 1292 | 1292 | //add action according to value |
| 1293 | - add_action( $show_content, 'give_form_display_content', 10, 2 ); |
|
| 1293 | + add_action($show_content, 'give_form_display_content', 10, 2); |
|
| 1294 | 1294 | } |
| 1295 | 1295 | } |
| 1296 | 1296 | |
| 1297 | -add_action( 'give_pre_form_output', 'give_form_content', 10, 2 ); |
|
| 1297 | +add_action('give_pre_form_output', 'give_form_content', 10, 2); |
|
| 1298 | 1298 | |
| 1299 | 1299 | /** |
| 1300 | 1300 | * Renders Post Form Content |
@@ -1306,24 +1306,24 @@ discard block |
||
| 1306 | 1306 | * @return void |
| 1307 | 1307 | * @since 1.0 |
| 1308 | 1308 | */ |
| 1309 | -function give_form_display_content( $form_id, $args ) { |
|
| 1309 | +function give_form_display_content($form_id, $args) { |
|
| 1310 | 1310 | |
| 1311 | - $content = wpautop( get_post_meta( $form_id, '_give_form_content', true ) ); |
|
| 1312 | - $show_content = ( isset( $args['show_content'] ) && ! empty( $args['show_content'] ) ) |
|
| 1311 | + $content = wpautop(get_post_meta($form_id, '_give_form_content', true)); |
|
| 1312 | + $show_content = (isset($args['show_content']) && ! empty($args['show_content'])) |
|
| 1313 | 1313 | ? $args['show_content'] |
| 1314 | - : get_post_meta( $form_id, '_give_content_option', true ); |
|
| 1314 | + : get_post_meta($form_id, '_give_content_option', true); |
|
| 1315 | 1315 | |
| 1316 | - if ( give_get_option( 'disable_the_content_filter' ) !== 'on' ) { |
|
| 1317 | - $content = apply_filters( 'the_content', $content ); |
|
| 1316 | + if (give_get_option('disable_the_content_filter') !== 'on') { |
|
| 1317 | + $content = apply_filters('the_content', $content); |
|
| 1318 | 1318 | } |
| 1319 | 1319 | |
| 1320 | - $output = '<div id="give-form-content-' . $form_id . '" class="give-form-content-wrap" >' . $content . '</div>'; |
|
| 1320 | + $output = '<div id="give-form-content-'.$form_id.'" class="give-form-content-wrap" >'.$content.'</div>'; |
|
| 1321 | 1321 | |
| 1322 | - echo apply_filters( 'give_form_content_output', $output ); |
|
| 1322 | + echo apply_filters('give_form_content_output', $output); |
|
| 1323 | 1323 | |
| 1324 | 1324 | //remove action to prevent content output on addition forms on page |
| 1325 | 1325 | //@see: https://github.com/WordImpress/Give/issues/634 |
| 1326 | - remove_action( $show_content, 'give_form_display_content' ); |
|
| 1326 | + remove_action($show_content, 'give_form_display_content'); |
|
| 1327 | 1327 | } |
| 1328 | 1328 | |
| 1329 | 1329 | |
@@ -1336,16 +1336,16 @@ discard block |
||
| 1336 | 1336 | * |
| 1337 | 1337 | * @return void |
| 1338 | 1338 | */ |
| 1339 | -function give_checkout_hidden_fields( $form_id ) { |
|
| 1339 | +function give_checkout_hidden_fields($form_id) { |
|
| 1340 | 1340 | |
| 1341 | - do_action( 'give_hidden_fields_before', $form_id ); |
|
| 1342 | - if ( is_user_logged_in() ) { ?> |
|
| 1341 | + do_action('give_hidden_fields_before', $form_id); |
|
| 1342 | + if (is_user_logged_in()) { ?> |
|
| 1343 | 1343 | <input type="hidden" name="give-user-id" value="<?php echo get_current_user_id(); ?>"/> |
| 1344 | 1344 | <?php } ?> |
| 1345 | 1345 | <input type="hidden" name="give_action" value="purchase"/> |
| 1346 | - <input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway( $form_id ); ?>"/> |
|
| 1346 | + <input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway($form_id); ?>"/> |
|
| 1347 | 1347 | <?php |
| 1348 | - do_action( 'give_hidden_fields_after', $form_id ); |
|
| 1348 | + do_action('give_hidden_fields_after', $form_id); |
|
| 1349 | 1349 | |
| 1350 | 1350 | } |
| 1351 | 1351 | |
@@ -1360,20 +1360,20 @@ discard block |
||
| 1360 | 1360 | * |
| 1361 | 1361 | * @return string $content Filtered content |
| 1362 | 1362 | */ |
| 1363 | -function give_filter_success_page_content( $content ) { |
|
| 1363 | +function give_filter_success_page_content($content) { |
|
| 1364 | 1364 | |
| 1365 | 1365 | global $give_options; |
| 1366 | 1366 | |
| 1367 | - if ( isset( $give_options['success_page'] ) && isset( $_GET['payment-confirmation'] ) && is_page( $give_options['success_page'] ) ) { |
|
| 1368 | - if ( has_filter( 'give_payment_confirm_' . $_GET['payment-confirmation'] ) ) { |
|
| 1369 | - $content = apply_filters( 'give_payment_confirm_' . $_GET['payment-confirmation'], $content ); |
|
| 1367 | + if (isset($give_options['success_page']) && isset($_GET['payment-confirmation']) && is_page($give_options['success_page'])) { |
|
| 1368 | + if (has_filter('give_payment_confirm_'.$_GET['payment-confirmation'])) { |
|
| 1369 | + $content = apply_filters('give_payment_confirm_'.$_GET['payment-confirmation'], $content); |
|
| 1370 | 1370 | } |
| 1371 | 1371 | } |
| 1372 | 1372 | |
| 1373 | 1373 | return $content; |
| 1374 | 1374 | } |
| 1375 | 1375 | |
| 1376 | -add_filter( 'the_content', 'give_filter_success_page_content' ); |
|
| 1376 | +add_filter('the_content', 'give_filter_success_page_content'); |
|
| 1377 | 1377 | |
| 1378 | 1378 | |
| 1379 | 1379 | /** |
@@ -1385,14 +1385,14 @@ discard block |
||
| 1385 | 1385 | |
| 1386 | 1386 | function give_test_mode_frontend_warning() { |
| 1387 | 1387 | |
| 1388 | - $test_mode = give_get_option( 'test_mode' ); |
|
| 1388 | + $test_mode = give_get_option('test_mode'); |
|
| 1389 | 1389 | |
| 1390 | - if ( $test_mode == 'on' ) { |
|
| 1391 | - 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>'; |
|
| 1390 | + if ($test_mode == 'on') { |
|
| 1391 | + 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>'; |
|
| 1392 | 1392 | } |
| 1393 | 1393 | } |
| 1394 | 1394 | |
| 1395 | -add_action( 'give_pre_form', 'give_test_mode_frontend_warning', 10 ); |
|
| 1395 | +add_action('give_pre_form', 'give_test_mode_frontend_warning', 10); |
|
| 1396 | 1396 | |
| 1397 | 1397 | |
| 1398 | 1398 | /** |
@@ -1402,21 +1402,21 @@ discard block |
||
| 1402 | 1402 | * @since 1.4.1 |
| 1403 | 1403 | */ |
| 1404 | 1404 | |
| 1405 | -function give_members_only_form( $final_output, $args ) { |
|
| 1405 | +function give_members_only_form($final_output, $args) { |
|
| 1406 | 1406 | |
| 1407 | - $form_id = isset( $args['form_id'] ) ? $args['form_id'] : 0; |
|
| 1407 | + $form_id = isset($args['form_id']) ? $args['form_id'] : 0; |
|
| 1408 | 1408 | |
| 1409 | 1409 | //Sanity Check: Must have form_id & not be logged in |
| 1410 | - if ( empty( $form_id ) || is_user_logged_in() ) { |
|
| 1410 | + if (empty($form_id) || is_user_logged_in()) { |
|
| 1411 | 1411 | return $final_output; |
| 1412 | 1412 | } |
| 1413 | 1413 | |
| 1414 | 1414 | //Logged in only and Register / Login set to none |
| 1415 | - if ( give_logged_in_only( $form_id ) && give_show_login_register_option( $form_id ) == 'none' ) { |
|
| 1415 | + if (give_logged_in_only($form_id) && give_show_login_register_option($form_id) == 'none') { |
|
| 1416 | 1416 | |
| 1417 | - $final_output = give_output_error( __( 'Please login in order to complete your donation.', 'give' ), false ); |
|
| 1417 | + $final_output = give_output_error(__('Please login in order to complete your donation.', 'give'), false); |
|
| 1418 | 1418 | |
| 1419 | - return apply_filters( 'give_members_only_output', $final_output, $form_id ); |
|
| 1419 | + return apply_filters('give_members_only_output', $final_output, $form_id); |
|
| 1420 | 1420 | |
| 1421 | 1421 | } |
| 1422 | 1422 | |
@@ -1424,4 +1424,4 @@ discard block |
||
| 1424 | 1424 | |
| 1425 | 1425 | } |
| 1426 | 1426 | |
| 1427 | -add_filter( 'give_donate_form', 'give_members_only_form', 10, 2 ); |
|
| 1428 | 1427 | \ No newline at end of file |
| 1428 | +add_filter('give_donate_form', 'give_members_only_form', 10, 2); |
|
| 1429 | 1429 | \ No newline at end of file |
@@ -10,11 +10,11 @@ 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 | |
| 17 | -add_filter( 'cmb2_meta_boxes', 'give_single_forms_cmb2_metaboxes' ); |
|
| 17 | +add_filter('cmb2_meta_boxes', 'give_single_forms_cmb2_metaboxes');
|
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * Define the metabox and field configurations. |
@@ -23,23 +23,23 @@ discard block |
||
| 23 | 23 | * |
| 24 | 24 | * @return array |
| 25 | 25 | */ |
| 26 | -function give_single_forms_cmb2_metaboxes( array $meta_boxes ) {
|
|
| 26 | +function give_single_forms_cmb2_metaboxes(array $meta_boxes) {
|
|
| 27 | 27 | |
| 28 | 28 | $post_id = give_get_admin_post_id(); |
| 29 | - $price = give_get_form_price( $post_id ); |
|
| 30 | - $custom_amount_minimum = give_get_form_minimum_price( $post_id ); |
|
| 31 | - $goal = give_get_form_goal( $post_id ); |
|
| 32 | - $variable_pricing = give_has_variable_prices( $post_id ); |
|
| 33 | - $prices = give_get_variable_prices( $post_id ); |
|
| 29 | + $price = give_get_form_price($post_id); |
|
| 30 | + $custom_amount_minimum = give_get_form_minimum_price($post_id); |
|
| 31 | + $goal = give_get_form_goal($post_id); |
|
| 32 | + $variable_pricing = give_has_variable_prices($post_id); |
|
| 33 | + $prices = give_get_variable_prices($post_id); |
|
| 34 | 34 | |
| 35 | 35 | //No empty prices - min. 1.00 for new forms |
| 36 | - if ( empty( $price ) && is_null( $post_id ) ) {
|
|
| 37 | - $price = esc_attr( give_format_amount( '1.00' ) ); |
|
| 36 | + if (empty($price) && is_null($post_id)) {
|
|
| 37 | + $price = esc_attr(give_format_amount('1.00'));
|
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | //Min. $1.00 for new forms |
| 41 | - if ( empty( $custom_amount_minimum ) ) {
|
|
| 42 | - $custom_amount_minimum = esc_attr( give_format_amount( '1.00' ) ); |
|
| 41 | + if (empty($custom_amount_minimum)) {
|
|
| 42 | + $custom_amount_minimum = esc_attr(give_format_amount('1.00'));
|
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // Start with an underscore to hide fields from custom fields list |
@@ -48,325 +48,325 @@ discard block |
||
| 48 | 48 | /** |
| 49 | 49 | * Repeatable Field Groups |
| 50 | 50 | */ |
| 51 | - $meta_boxes['form_field_options'] = apply_filters( 'give_forms_field_options', array( |
|
| 51 | + $meta_boxes['form_field_options'] = apply_filters('give_forms_field_options', array(
|
|
| 52 | 52 | 'id' => 'form_field_options', |
| 53 | - 'title' => __( 'Donation Options', 'give' ), |
|
| 54 | - 'object_types' => array( 'give_forms' ), |
|
| 53 | + 'title' => __('Donation Options', 'give'),
|
|
| 54 | + 'object_types' => array('give_forms'),
|
|
| 55 | 55 | 'context' => 'normal', |
| 56 | 56 | 'priority' => 'high', //Show above Content WYSIWYG |
| 57 | - 'fields' => apply_filters( 'give_forms_donation_form_metabox_fields', array( |
|
| 57 | + 'fields' => apply_filters('give_forms_donation_form_metabox_fields', array(
|
|
| 58 | 58 | //Donation Option |
| 59 | 59 | array( |
| 60 | - 'name' => __( 'Donation Option', 'give' ), |
|
| 61 | - 'description' => __( 'Would you like this form to have one set donation price or multiple levels (for example, $10, $20, $50)?', 'give' ), |
|
| 62 | - 'id' => $prefix . 'price_option', |
|
| 60 | + 'name' => __('Donation Option', 'give'),
|
|
| 61 | + 'description' => __('Would you like this form to have one set donation price or multiple levels (for example, $10, $20, $50)?', 'give'),
|
|
| 62 | + 'id' => $prefix.'price_option', |
|
| 63 | 63 | 'type' => 'radio_inline', |
| 64 | 64 | 'default' => 'set', |
| 65 | - 'options' => apply_filters( 'give_forms_price_options', array( |
|
| 66 | - 'set' => __( 'Set Donation', 'give' ), |
|
| 67 | - 'multi' => __( 'Multi-level Donation', 'give' ), |
|
| 68 | - ) ), |
|
| 65 | + 'options' => apply_filters('give_forms_price_options', array(
|
|
| 66 | + 'set' => __('Set Donation', 'give'),
|
|
| 67 | + 'multi' => __('Multi-level Donation', 'give'),
|
|
| 68 | + )), |
|
| 69 | 69 | ), |
| 70 | 70 | array( |
| 71 | - 'name' => __( 'Set Donation', 'give' ), |
|
| 72 | - 'description' => __( 'This is the set donation amount for this form. If you have a "Custom Amount Minimum" set, make sure it is less than this amount.', 'give' ), |
|
| 73 | - 'id' => $prefix . 'set_price', |
|
| 71 | + 'name' => __('Set Donation', 'give'),
|
|
| 72 | + 'description' => __('This is the set donation amount for this form. If you have a "Custom Amount Minimum" set, make sure it is less than this amount.', 'give'),
|
|
| 73 | + 'id' => $prefix.'set_price', |
|
| 74 | 74 | 'type' => 'text_small', |
| 75 | 75 | 'row_classes' => 'give-subfield', |
| 76 | - 'before_field' => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '', |
|
| 77 | - 'after_field' => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '', |
|
| 76 | + 'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
|
|
| 77 | + 'after_field' => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
|
|
| 78 | 78 | 'attributes' => array( |
| 79 | - 'placeholder' => give_format_amount( '1.00' ), |
|
| 80 | - 'value' => give_format_amount( $price ), |
|
| 79 | + 'placeholder' => give_format_amount('1.00'),
|
|
| 80 | + 'value' => give_format_amount($price), |
|
| 81 | 81 | 'class' => 'cmb-type-text-small give-money-field', |
| 82 | 82 | ), |
| 83 | 83 | ), |
| 84 | 84 | //Donation levels: Header |
| 85 | 85 | array( |
| 86 | - 'id' => $prefix . 'levels_header', |
|
| 86 | + 'id' => $prefix.'levels_header', |
|
| 87 | 87 | 'type' => 'levels_repeater_header', |
| 88 | 88 | ), |
| 89 | 89 | //Donation Levels: Repeatable CMB2 Group |
| 90 | 90 | array( |
| 91 | - 'id' => $prefix . 'donation_levels', |
|
| 91 | + 'id' => $prefix.'donation_levels', |
|
| 92 | 92 | 'type' => 'group', |
| 93 | 93 | 'row_classes' => 'give-subfield', |
| 94 | 94 | 'options' => array( |
| 95 | - 'add_button' => __( 'Add Level', 'give' ), |
|
| 96 | - 'remove_button' => __( '<span class="dashicons dashicons-no"></span>', 'give' ), |
|
| 95 | + 'add_button' => __('Add Level', 'give'),
|
|
| 96 | + 'remove_button' => __('<span class="dashicons dashicons-no"></span>', 'give'),
|
|
| 97 | 97 | 'sortable' => true, // beta |
| 98 | 98 | ), |
| 99 | 99 | // Fields array works the same, except id's only need to be unique for this group. Prefix is not needed. |
| 100 | - 'fields' => apply_filters( 'give_donation_levels_table_row', array( |
|
| 100 | + 'fields' => apply_filters('give_donation_levels_table_row', array(
|
|
| 101 | 101 | array( |
| 102 | - 'name' => __( 'ID', 'give' ), |
|
| 103 | - 'id' => $prefix . 'id', |
|
| 102 | + 'name' => __('ID', 'give'),
|
|
| 103 | + 'id' => $prefix.'id', |
|
| 104 | 104 | 'type' => 'levels_id', |
| 105 | 105 | ), |
| 106 | 106 | array( |
| 107 | - 'name' => __( 'Amount', 'give' ), |
|
| 108 | - 'id' => $prefix . 'amount', |
|
| 107 | + 'name' => __('Amount', 'give'),
|
|
| 108 | + 'id' => $prefix.'amount', |
|
| 109 | 109 | 'type' => 'text_small', |
| 110 | - 'before_field' => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '', |
|
| 111 | - 'after_field' => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '', |
|
| 110 | + 'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
|
|
| 111 | + 'after_field' => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
|
|
| 112 | 112 | 'attributes' => array( |
| 113 | - 'placeholder' => give_format_amount( '1.00' ), |
|
| 113 | + 'placeholder' => give_format_amount('1.00'),
|
|
| 114 | 114 | 'class' => 'cmb-type-text-small give-money-field', |
| 115 | 115 | ), |
| 116 | 116 | 'before' => 'give_format_admin_multilevel_amount', |
| 117 | 117 | ), |
| 118 | 118 | array( |
| 119 | - 'name' => __( 'Text', 'give' ), |
|
| 120 | - 'id' => $prefix . 'text', |
|
| 119 | + 'name' => __('Text', 'give'),
|
|
| 120 | + 'id' => $prefix.'text', |
|
| 121 | 121 | 'type' => 'text', |
| 122 | 122 | 'attributes' => array( |
| 123 | - 'placeholder' => __( 'Donation Level', 'give' ), |
|
| 123 | + 'placeholder' => __('Donation Level', 'give'),
|
|
| 124 | 124 | 'class' => 'give-multilevel-text-field', |
| 125 | 125 | ), |
| 126 | 126 | ), |
| 127 | 127 | array( |
| 128 | - 'name' => __( 'Default', 'give' ), |
|
| 129 | - 'id' => $prefix . 'default', |
|
| 128 | + 'name' => __('Default', 'give'),
|
|
| 129 | + 'id' => $prefix.'default', |
|
| 130 | 130 | 'type' => 'give_default_radio_inline' |
| 131 | 131 | ), |
| 132 | - ) ), |
|
| 132 | + )), |
|
| 133 | 133 | ), |
| 134 | 134 | //Display Style |
| 135 | 135 | array( |
| 136 | - 'name' => __( 'Display Style', 'give' ), |
|
| 137 | - 'description' => __( 'Set how the donations levels will display on the form.', 'give' ), |
|
| 138 | - 'id' => $prefix . 'display_style', |
|
| 136 | + 'name' => __('Display Style', 'give'),
|
|
| 137 | + 'description' => __('Set how the donations levels will display on the form.', 'give'),
|
|
| 138 | + 'id' => $prefix.'display_style', |
|
| 139 | 139 | 'type' => 'radio_inline', |
| 140 | 140 | 'default' => 'buttons', |
| 141 | 141 | 'options' => array( |
| 142 | - 'buttons' => __( 'Buttons', 'give' ), |
|
| 143 | - 'radios' => __( 'Radios', 'give' ), |
|
| 144 | - 'dropdown' => __( 'Dropdown', 'give' ), |
|
| 142 | + 'buttons' => __('Buttons', 'give'),
|
|
| 143 | + 'radios' => __('Radios', 'give'),
|
|
| 144 | + 'dropdown' => __('Dropdown', 'give'),
|
|
| 145 | 145 | ), |
| 146 | 146 | ), |
| 147 | 147 | //Custom Amount |
| 148 | 148 | array( |
| 149 | - 'name' => __( 'Custom Amount', 'give' ), |
|
| 150 | - 'description' => __( 'Do you want the user to be able to input their own donation amount?', 'give' ), |
|
| 151 | - 'id' => $prefix . 'custom_amount', |
|
| 149 | + 'name' => __('Custom Amount', 'give'),
|
|
| 150 | + 'description' => __('Do you want the user to be able to input their own donation amount?', 'give'),
|
|
| 151 | + 'id' => $prefix.'custom_amount', |
|
| 152 | 152 | 'type' => 'radio_inline', |
| 153 | 153 | 'default' => 'no', |
| 154 | 154 | 'options' => array( |
| 155 | - 'yes' => __( 'Yes', 'give' ), |
|
| 156 | - 'no' => __( 'No', 'give' ), |
|
| 155 | + 'yes' => __('Yes', 'give'),
|
|
| 156 | + 'no' => __('No', 'give'),
|
|
| 157 | 157 | ), |
| 158 | 158 | ), |
| 159 | 159 | array( |
| 160 | - 'name' => __( 'Custom Amount Minimum', 'give' ), |
|
| 161 | - 'description' => __( 'If you would like to set a minimum custom donation amount please enter it here.', 'give' ), |
|
| 162 | - 'id' => $prefix . 'custom_amount_minimum', |
|
| 160 | + 'name' => __('Custom Amount Minimum', 'give'),
|
|
| 161 | + 'description' => __('If you would like to set a minimum custom donation amount please enter it here.', 'give'),
|
|
| 162 | + 'id' => $prefix.'custom_amount_minimum', |
|
| 163 | 163 | 'type' => 'text_small', |
| 164 | 164 | 'row_classes' => 'give-subfield', |
| 165 | - 'before_field' => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '', |
|
| 166 | - 'after_field' => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '', |
|
| 165 | + 'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
|
|
| 166 | + 'after_field' => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
|
|
| 167 | 167 | 'attributes' => array( |
| 168 | - 'placeholder' => give_format_amount( '1.00' ), |
|
| 169 | - 'value' => give_format_amount( $custom_amount_minimum ), |
|
| 168 | + 'placeholder' => give_format_amount('1.00'),
|
|
| 169 | + 'value' => give_format_amount($custom_amount_minimum), |
|
| 170 | 170 | 'class' => 'cmb-type-text-small give-money-field', |
| 171 | 171 | ), |
| 172 | 172 | ), |
| 173 | 173 | array( |
| 174 | - 'name' => __( 'Custom Amount Text', 'give' ), |
|
| 175 | - 'description' => __( 'This text appears as a label below the custom amount field for set donation forms. For multi-level forms the text will appear as it\'s own level (ie button, radio, or select option).', 'give' ), |
|
| 176 | - 'id' => $prefix . 'custom_amount_text', |
|
| 174 | + 'name' => __('Custom Amount Text', 'give'),
|
|
| 175 | + 'description' => __('This text appears as a label below the custom amount field for set donation forms. For multi-level forms the text will appear as it\'s own level (ie button, radio, or select option).', 'give'),
|
|
| 176 | + 'id' => $prefix.'custom_amount_text', |
|
| 177 | 177 | 'type' => 'text', |
| 178 | 178 | 'row_classes' => 'give-subfield', |
| 179 | 179 | 'attributes' => array( |
| 180 | 180 | 'rows' => 3, |
| 181 | - 'placeholder' => __( 'Give a Custom Amount', 'give' ), |
|
| 181 | + 'placeholder' => __('Give a Custom Amount', 'give'),
|
|
| 182 | 182 | ), |
| 183 | 183 | ), |
| 184 | 184 | //Goals |
| 185 | 185 | array( |
| 186 | - 'name' => __( 'Goal', 'give' ), |
|
| 187 | - 'description' => __( 'Do you want to set a donation goal for this form?', 'give' ), |
|
| 188 | - 'id' => $prefix . 'goal_option', |
|
| 186 | + 'name' => __('Goal', 'give'),
|
|
| 187 | + 'description' => __('Do you want to set a donation goal for this form?', 'give'),
|
|
| 188 | + 'id' => $prefix.'goal_option', |
|
| 189 | 189 | 'type' => 'radio_inline', |
| 190 | 190 | 'default' => 'no', |
| 191 | 191 | 'options' => array( |
| 192 | - 'yes' => __( 'Yes', 'give' ), |
|
| 193 | - 'no' => __( 'No', 'give' ), |
|
| 192 | + 'yes' => __('Yes', 'give'),
|
|
| 193 | + 'no' => __('No', 'give'),
|
|
| 194 | 194 | ), |
| 195 | 195 | ), |
| 196 | 196 | array( |
| 197 | - 'name' => __( 'Goal Amount', 'give' ), |
|
| 198 | - 'description' => __( 'This is the monetary goal amount you want to reach for this donation form.', 'give' ), |
|
| 199 | - 'id' => $prefix . 'set_goal', |
|
| 197 | + 'name' => __('Goal Amount', 'give'),
|
|
| 198 | + 'description' => __('This is the monetary goal amount you want to reach for this donation form.', 'give'),
|
|
| 199 | + 'id' => $prefix.'set_goal', |
|
| 200 | 200 | 'type' => 'text_small', |
| 201 | 201 | 'row_classes' => 'give-subfield', |
| 202 | - 'before_field' => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '', |
|
| 203 | - 'after_field' => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '', |
|
| 202 | + 'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
|
|
| 203 | + 'after_field' => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
|
|
| 204 | 204 | 'attributes' => array( |
| 205 | - 'placeholder' => give_format_amount( '0.00' ), |
|
| 206 | - 'value' => isset( $goal ) ? esc_attr( give_format_amount( $goal ) ) : '', |
|
| 205 | + 'placeholder' => give_format_amount('0.00'),
|
|
| 206 | + 'value' => isset($goal) ? esc_attr(give_format_amount($goal)) : '', |
|
| 207 | 207 | 'class' => 'cmb-type-text-small give-money-field', |
| 208 | 208 | ), |
| 209 | 209 | ), |
| 210 | 210 | |
| 211 | 211 | array( |
| 212 | - 'name' => __( 'Goal Format', 'give' ), |
|
| 213 | - 'description' => __( 'Would you like to display the total amount raised based on your monetary goal or a percentage? For instance, "$500 of $1,000 raised" or "50% funded".', 'give' ), |
|
| 214 | - 'id' => $prefix . 'goal_format', |
|
| 212 | + 'name' => __('Goal Format', 'give'),
|
|
| 213 | + 'description' => __('Would you like to display the total amount raised based on your monetary goal or a percentage? For instance, "$500 of $1,000 raised" or "50% funded".', 'give'),
|
|
| 214 | + 'id' => $prefix.'goal_format', |
|
| 215 | 215 | 'type' => 'radio_inline', |
| 216 | 216 | 'default' => 'amount', |
| 217 | 217 | 'row_classes' => 'give-subfield', |
| 218 | 218 | 'options' => array( |
| 219 | - 'amount' => __( 'Amount ', 'give' ), |
|
| 220 | - 'percentage' => __( 'Percentage', 'give' ), |
|
| 219 | + 'amount' => __('Amount ', 'give'),
|
|
| 220 | + 'percentage' => __('Percentage', 'give'),
|
|
| 221 | 221 | ), |
| 222 | 222 | ), |
| 223 | 223 | array( |
| 224 | - 'name' => __( 'Goal Progress Bar Color', 'give' ), |
|
| 225 | - 'id' => $prefix . 'goal_color', |
|
| 224 | + 'name' => __('Goal Progress Bar Color', 'give'),
|
|
| 225 | + 'id' => $prefix.'goal_color', |
|
| 226 | 226 | 'type' => 'colorpicker', |
| 227 | 227 | 'row_classes' => 'give-subfield', |
| 228 | 228 | 'default' => '#2bc253', |
| 229 | 229 | ), |
| 230 | 230 | |
| 231 | 231 | array( |
| 232 | - 'name' => __( 'Close Form when Goal Achieved', 'give' ), |
|
| 233 | - 'desc' => __( 'Would you like to close the donation forms and stop accepting donations once this goal has been met?', 'give' ), |
|
| 234 | - 'id' => $prefix . 'close_form_when_goal_achieved', |
|
| 232 | + 'name' => __('Close Form when Goal Achieved', 'give'),
|
|
| 233 | + 'desc' => __('Would you like to close the donation forms and stop accepting donations once this goal has been met?', 'give'),
|
|
| 234 | + 'id' => $prefix.'close_form_when_goal_achieved', |
|
| 235 | 235 | 'type' => 'radio_inline', |
| 236 | 236 | 'row_classes' => 'give-subfield', |
| 237 | 237 | 'options' => array( |
| 238 | - 'yes' => __( 'Yes', 'give' ), |
|
| 239 | - 'no' => __( 'No', 'give' ), |
|
| 238 | + 'yes' => __('Yes', 'give'),
|
|
| 239 | + 'no' => __('No', 'give'),
|
|
| 240 | 240 | ), |
| 241 | 241 | 'default' => 'no', |
| 242 | 242 | ), |
| 243 | 243 | array( |
| 244 | - 'name' => __( 'Goal Achieved Message', 'give' ), |
|
| 245 | - 'desc' => __( 'Would you like to display a custom message when the goal is closed? If none is provided the default message will be displayed', 'give' ), |
|
| 246 | - 'id' => $prefix . 'form_goal_achieved_message', |
|
| 244 | + 'name' => __('Goal Achieved Message', 'give'),
|
|
| 245 | + 'desc' => __('Would you like to display a custom message when the goal is closed? If none is provided the default message will be displayed', 'give'),
|
|
| 246 | + 'id' => $prefix.'form_goal_achieved_message', |
|
| 247 | 247 | 'type' => 'textarea', |
| 248 | 248 | 'row_classes' => 'give-subfield', |
| 249 | 249 | 'attributes' => array( |
| 250 | - 'placeholder' => __( 'Thank you to all our donors, we have met our fundraising goal.', 'give' ), |
|
| 250 | + 'placeholder' => __('Thank you to all our donors, we have met our fundraising goal.', 'give'),
|
|
| 251 | 251 | ), |
| 252 | 252 | ) |
| 253 | 253 | ) |
| 254 | 254 | ) |
| 255 | - ) ); |
|
| 255 | + )); |
|
| 256 | 256 | |
| 257 | 257 | |
| 258 | 258 | /** |
| 259 | 259 | * Content Field |
| 260 | 260 | */ |
| 261 | - $meta_boxes['form_content_options'] = apply_filters( 'give_forms_content_options', array( |
|
| 261 | + $meta_boxes['form_content_options'] = apply_filters('give_forms_content_options', array(
|
|
| 262 | 262 | 'id' => 'form_content_options', |
| 263 | - 'title' => __( 'Form Content', 'give' ), |
|
| 264 | - 'object_types' => array( 'give_forms' ), |
|
| 263 | + 'title' => __('Form Content', 'give'),
|
|
| 264 | + 'object_types' => array('give_forms'),
|
|
| 265 | 265 | 'context' => 'normal', |
| 266 | 266 | 'priority' => 'high', //Show above Content WYSIWYG |
| 267 | - 'fields' => apply_filters( 'give_forms_content_options_metabox_fields', array( |
|
| 267 | + 'fields' => apply_filters('give_forms_content_options_metabox_fields', array(
|
|
| 268 | 268 | //Donation Option |
| 269 | 269 | array( |
| 270 | - 'name' => __( 'Display Content', 'give' ), |
|
| 271 | - 'description' => __( 'Do you want to display content? If you select "Yes" a WYSIWYG editor will appear which you will be able to enter content to display above or below the form.', 'give' ), |
|
| 272 | - 'id' => $prefix . 'content_option', |
|
| 270 | + 'name' => __('Display Content', 'give'),
|
|
| 271 | + 'description' => __('Do you want to display content? If you select "Yes" a WYSIWYG editor will appear which you will be able to enter content to display above or below the form.', 'give'),
|
|
| 272 | + 'id' => $prefix.'content_option', |
|
| 273 | 273 | 'type' => 'select', |
| 274 | - 'options' => apply_filters( 'give_forms_content_options_select', array( |
|
| 275 | - 'none' => __( 'No content', 'give' ), |
|
| 276 | - 'give_pre_form' => __( 'Yes, display content ABOVE the form fields', 'give' ), |
|
| 277 | - 'give_post_form' => __( 'Yes, display content BELOW the form fields', 'give' ), |
|
| 274 | + 'options' => apply_filters('give_forms_content_options_select', array(
|
|
| 275 | + 'none' => __('No content', 'give'),
|
|
| 276 | + 'give_pre_form' => __('Yes, display content ABOVE the form fields', 'give'),
|
|
| 277 | + 'give_post_form' => __('Yes, display content BELOW the form fields', 'give'),
|
|
| 278 | 278 | ) |
| 279 | 279 | ), |
| 280 | 280 | 'default' => 'none', |
| 281 | 281 | ), |
| 282 | 282 | array( |
| 283 | - 'name' => __( 'Content', 'give' ), |
|
| 284 | - 'description' => __( 'This content will display on the single give form page.', 'give' ), |
|
| 285 | - 'id' => $prefix . 'form_content', |
|
| 283 | + 'name' => __('Content', 'give'),
|
|
| 284 | + 'description' => __('This content will display on the single give form page.', 'give'),
|
|
| 285 | + 'id' => $prefix.'form_content', |
|
| 286 | 286 | 'row_classes' => 'give-subfield', |
| 287 | 287 | 'type' => 'wysiwyg' |
| 288 | 288 | ), |
| 289 | 289 | ) |
| 290 | 290 | ) |
| 291 | - ) ); |
|
| 291 | + )); |
|
| 292 | 292 | |
| 293 | 293 | |
| 294 | 294 | /** |
| 295 | 295 | * Display Options |
| 296 | 296 | */ |
| 297 | - $meta_boxes['form_display_options'] = apply_filters( 'give_form_display_options', array( |
|
| 297 | + $meta_boxes['form_display_options'] = apply_filters('give_form_display_options', array(
|
|
| 298 | 298 | 'id' => 'form_display_options', |
| 299 | - 'title' => __( 'Form Display Options', 'give' ), |
|
| 300 | - 'object_types' => array( 'give_forms' ), |
|
| 299 | + 'title' => __('Form Display Options', 'give'),
|
|
| 300 | + 'object_types' => array('give_forms'),
|
|
| 301 | 301 | 'context' => 'normal', // 'normal', 'advanced', or 'side' |
| 302 | 302 | 'priority' => 'high', //Show above Content WYSIWYG |
| 303 | 303 | 'show_names' => true, // Show field names on the left |
| 304 | - 'fields' => apply_filters( 'give_forms_display_options_metabox_fields', array( |
|
| 304 | + 'fields' => apply_filters('give_forms_display_options_metabox_fields', array(
|
|
| 305 | 305 | array( |
| 306 | - 'name' => __( 'Payment Fields', 'give' ), |
|
| 307 | - 'desc' => __( 'How would you like to display payment information for this form? The "Show on Page" option will display the entire form when the page loads. "Reveal Upon Click" places a button below the donation fields and upon click slides into view the rest of the fields. "Modal Window Upon Click" is a similar option, rather than sliding into view the fields they will open in a shadow box or "modal" window.', 'give' ), |
|
| 308 | - 'id' => $prefix . 'payment_display', |
|
| 306 | + 'name' => __('Payment Fields', 'give'),
|
|
| 307 | + 'desc' => __('How would you like to display payment information for this form? The "Show on Page" option will display the entire form when the page loads. "Reveal Upon Click" places a button below the donation fields and upon click slides into view the rest of the fields. "Modal Window Upon Click" is a similar option, rather than sliding into view the fields they will open in a shadow box or "modal" window.', 'give'),
|
|
| 308 | + 'id' => $prefix.'payment_display', |
|
| 309 | 309 | 'type' => 'select', |
| 310 | 310 | 'options' => array( |
| 311 | - 'onpage' => __( 'Show on Page', 'give' ), |
|
| 312 | - 'reveal' => __( 'Reveal Upon Click', 'give' ), |
|
| 313 | - 'modal' => __( 'Modal Window Upon Click', 'give' ), |
|
| 311 | + 'onpage' => __('Show on Page', 'give'),
|
|
| 312 | + 'reveal' => __('Reveal Upon Click', 'give'),
|
|
| 313 | + 'modal' => __('Modal Window Upon Click', 'give'),
|
|
| 314 | 314 | ), |
| 315 | 315 | 'default' => 'onpage', |
| 316 | 316 | ), |
| 317 | 317 | array( |
| 318 | - 'id' => $prefix . 'reveal_label', |
|
| 319 | - 'name' => __( 'Reveal / Modal Open Text', 'give' ), |
|
| 320 | - 'desc' => __( 'The button label for completing the donation.', 'give' ), |
|
| 318 | + 'id' => $prefix.'reveal_label', |
|
| 319 | + 'name' => __('Reveal / Modal Open Text', 'give'),
|
|
| 320 | + 'desc' => __('The button label for completing the donation.', 'give'),
|
|
| 321 | 321 | 'type' => 'text_small', |
| 322 | 322 | 'row_classes' => 'give-subfield', |
| 323 | 323 | 'attributes' => array( |
| 324 | - 'placeholder' => __( 'Donate Now', 'give' ), |
|
| 324 | + 'placeholder' => __('Donate Now', 'give'),
|
|
| 325 | 325 | ), |
| 326 | 326 | ), |
| 327 | 327 | array( |
| 328 | - 'id' => $prefix . 'checkout_label', |
|
| 329 | - 'name' => __( 'Complete Donation Text', 'give' ), |
|
| 330 | - 'desc' => __( 'The button label for completing a donation.', 'give' ), |
|
| 328 | + 'id' => $prefix.'checkout_label', |
|
| 329 | + 'name' => __('Complete Donation Text', 'give'),
|
|
| 330 | + 'desc' => __('The button label for completing a donation.', 'give'),
|
|
| 331 | 331 | 'type' => 'text_small', |
| 332 | 332 | 'attributes' => array( |
| 333 | - 'placeholder' => __( 'Donate Now', 'give' ), |
|
| 333 | + 'placeholder' => __('Donate Now', 'give'),
|
|
| 334 | 334 | ), |
| 335 | 335 | ), |
| 336 | 336 | array( |
| 337 | - 'name' => __( 'Default Gateway', 'give' ), |
|
| 338 | - 'desc' => __( 'By default, the gateway for this form will inherit the global default gateway (set under Give > Settings > Payment Gateways). This option allows you to customize the default gateway for this form only.', 'give' ), |
|
| 339 | - 'id' => $prefix . 'default_gateway', |
|
| 337 | + 'name' => __('Default Gateway', 'give'),
|
|
| 338 | + 'desc' => __('By default, the gateway for this form will inherit the global default gateway (set under Give > Settings > Payment Gateways). This option allows you to customize the default gateway for this form only.', 'give'),
|
|
| 339 | + 'id' => $prefix.'default_gateway', |
|
| 340 | 340 | 'type' => 'default_gateway' |
| 341 | 341 | ), |
| 342 | 342 | array( |
| 343 | - 'name' => __( 'Disable Guest Donations', 'give' ), |
|
| 344 | - 'desc' => __( 'Do you want to require users be logged-in to make donations?', 'give' ), |
|
| 345 | - 'id' => $prefix . 'logged_in_only', |
|
| 343 | + 'name' => __('Disable Guest Donations', 'give'),
|
|
| 344 | + 'desc' => __('Do you want to require users be logged-in to make donations?', 'give'),
|
|
| 345 | + 'id' => $prefix.'logged_in_only', |
|
| 346 | 346 | 'type' => 'checkbox' |
| 347 | 347 | ), |
| 348 | 348 | array( |
| 349 | - 'name' => __( 'Register / Login Form', 'give' ), |
|
| 350 | - 'desc' => __( 'Display the registration and login forms in the payment section for non-logged-in users.', 'give' ), |
|
| 351 | - 'id' => $prefix . 'show_register_form', |
|
| 349 | + 'name' => __('Register / Login Form', 'give'),
|
|
| 350 | + 'desc' => __('Display the registration and login forms in the payment section for non-logged-in users.', 'give'),
|
|
| 351 | + 'id' => $prefix.'show_register_form', |
|
| 352 | 352 | 'type' => 'select', |
| 353 | 353 | 'options' => array( |
| 354 | - 'both' => __( 'Registration and Login Forms', 'give' ), |
|
| 355 | - 'registration' => __( 'Registration Form Only', 'give' ), |
|
| 356 | - 'login' => __( 'Login Form Only', 'give' ), |
|
| 357 | - 'none' => __( 'None', 'give' ), |
|
| 354 | + 'both' => __('Registration and Login Forms', 'give'),
|
|
| 355 | + 'registration' => __('Registration Form Only', 'give'),
|
|
| 356 | + 'login' => __('Login Form Only', 'give'),
|
|
| 357 | + 'none' => __('None', 'give'),
|
|
| 358 | 358 | ), |
| 359 | 359 | 'default' => 'none', |
| 360 | 360 | ), |
| 361 | 361 | array( |
| 362 | - 'name' => __( 'Floating Labels', 'give' ), |
|
| 363 | - 'desc' => sprintf( __( 'Select the <a href="%s" target="_blank">floating labels</a> setting for this Give form.<br>Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give' ), esc_url( "http://bradfrost.com/blog/post/float-label-pattern/" ) ), |
|
| 364 | - 'id' => $prefix . 'form_floating_labels', |
|
| 362 | + 'name' => __('Floating Labels', 'give'),
|
|
| 363 | + 'desc' => sprintf(__('Select the <a href="%s" target="_blank">floating labels</a> setting for this Give form.<br>Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give'), esc_url("http://bradfrost.com/blog/post/float-label-pattern/")),
|
|
| 364 | + 'id' => $prefix.'form_floating_labels', |
|
| 365 | 365 | 'type' => 'select', |
| 366 | 366 | 'options' => array( |
| 367 | - '' => __( 'Use the global setting', 'give' ), |
|
| 368 | - 'enabled' => __( 'Enabled', 'give' ), |
|
| 369 | - 'disabled' => __( 'Disabled', 'give' ), |
|
| 367 | + '' => __('Use the global setting', 'give'),
|
|
| 368 | + 'enabled' => __('Enabled', 'give'),
|
|
| 369 | + 'disabled' => __('Disabled', 'give'),
|
|
| 370 | 370 | ), |
| 371 | 371 | 'default' => 'none', |
| 372 | 372 | ) |
@@ -378,47 +378,47 @@ discard block |
||
| 378 | 378 | /** |
| 379 | 379 | * Terms & Conditions |
| 380 | 380 | */ |
| 381 | - $meta_boxes['form_terms_options'] = apply_filters( 'give_forms_terms_options', array( |
|
| 381 | + $meta_boxes['form_terms_options'] = apply_filters('give_forms_terms_options', array(
|
|
| 382 | 382 | 'id' => 'form_terms_options', |
| 383 | - 'title' => __( 'Terms and Conditions', 'give' ), |
|
| 384 | - 'object_types' => array( 'give_forms' ), |
|
| 383 | + 'title' => __('Terms and Conditions', 'give'),
|
|
| 384 | + 'object_types' => array('give_forms'),
|
|
| 385 | 385 | 'context' => 'normal', |
| 386 | 386 | 'priority' => 'high', //Show above Content WYSIWYG |
| 387 | - 'fields' => apply_filters( 'give_forms_terms_options_metabox_fields', array( |
|
| 387 | + 'fields' => apply_filters('give_forms_terms_options_metabox_fields', array(
|
|
| 388 | 388 | //Donation Option |
| 389 | 389 | array( |
| 390 | - 'name' => __( 'Terms and Conditions', 'give' ), |
|
| 391 | - 'description' => __( 'Do you want to require the user to agree to terms and conditions prior to being able to complete their donation?', 'give' ), |
|
| 392 | - 'id' => $prefix . 'terms_option', |
|
| 390 | + 'name' => __('Terms and Conditions', 'give'),
|
|
| 391 | + 'description' => __('Do you want to require the user to agree to terms and conditions prior to being able to complete their donation?', 'give'),
|
|
| 392 | + 'id' => $prefix.'terms_option', |
|
| 393 | 393 | 'type' => 'select', |
| 394 | - 'options' => apply_filters( 'give_forms_content_options_select', array( |
|
| 395 | - 'none' => __( 'No', 'give' ), |
|
| 396 | - 'yes' => __( 'Yes', 'give' ), |
|
| 394 | + 'options' => apply_filters('give_forms_content_options_select', array(
|
|
| 395 | + 'none' => __('No', 'give'),
|
|
| 396 | + 'yes' => __('Yes', 'give'),
|
|
| 397 | 397 | ) |
| 398 | 398 | ), |
| 399 | 399 | 'default' => 'none', |
| 400 | 400 | ), |
| 401 | 401 | array( |
| 402 | - 'id' => $prefix . 'agree_label', |
|
| 403 | - 'name' => __( 'Agree to Terms Label', 'give' ), |
|
| 404 | - 'desc' => __( 'The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder.', 'give' ), |
|
| 402 | + 'id' => $prefix.'agree_label', |
|
| 403 | + 'name' => __('Agree to Terms Label', 'give'),
|
|
| 404 | + 'desc' => __('The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder.', 'give'),
|
|
| 405 | 405 | 'type' => 'text', |
| 406 | 406 | 'row_classes' => 'give-subfield', |
| 407 | 407 | 'size' => 'regular', |
| 408 | 408 | 'attributes' => array( |
| 409 | - 'placeholder' => __( 'Agree to Terms?', 'give' ), |
|
| 409 | + 'placeholder' => __('Agree to Terms?', 'give'),
|
|
| 410 | 410 | ), |
| 411 | 411 | ), |
| 412 | 412 | array( |
| 413 | - 'id' => $prefix . 'agree_text', |
|
| 413 | + 'id' => $prefix.'agree_text', |
|
| 414 | 414 | 'row_classes' => 'give-subfield', |
| 415 | - 'name' => __( 'Agreement Text', 'give' ), |
|
| 416 | - 'desc' => __( 'This is the actual text which the user will have to agree to in order to make a donation.', 'give' ), |
|
| 415 | + 'name' => __('Agreement Text', 'give'),
|
|
| 416 | + 'desc' => __('This is the actual text which the user will have to agree to in order to make a donation.', 'give'),
|
|
| 417 | 417 | 'type' => 'wysiwyg' |
| 418 | 418 | ), |
| 419 | 419 | ) |
| 420 | 420 | ) |
| 421 | - ) ); |
|
| 421 | + )); |
|
| 422 | 422 | |
| 423 | 423 | return $meta_boxes; |
| 424 | 424 | |
@@ -432,11 +432,11 @@ discard block |
||
| 432 | 432 | |
| 433 | 433 | <div class="table-container"> |
| 434 | 434 | <div class="table-row"> |
| 435 | - <div class="table-cell col-amount"><?php _e( 'Amount', 'give' ); ?></div> |
|
| 436 | - <div class="table-cell col-text"><?php _e( 'Text', 'give' ); ?></div> |
|
| 437 | - <div class="table-cell col-default"><?php _e( 'Default', 'give' ); ?></div> |
|
| 438 | - <?php do_action( 'give_donation_levels_table_head' ); ?> |
|
| 439 | - <div class="table-cell col-sort"><?php _e( 'Sort', 'give' ); ?></div> |
|
| 435 | + <div class="table-cell col-amount"><?php _e('Amount', 'give'); ?></div>
|
|
| 436 | + <div class="table-cell col-text"><?php _e('Text', 'give'); ?></div>
|
|
| 437 | + <div class="table-cell col-default"><?php _e('Default', 'give'); ?></div>
|
|
| 438 | + <?php do_action('give_donation_levels_table_head'); ?>
|
|
| 439 | + <div class="table-cell col-sort"><?php _e('Sort', 'give'); ?></div>
|
|
| 440 | 440 | |
| 441 | 441 | </div> |
| 442 | 442 | </div> |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | <?php |
| 445 | 445 | } |
| 446 | 446 | |
| 447 | -add_action( 'cmb2_render_levels_repeater_header', 'give_cmb_render_levels_repeater_header', 10 ); |
|
| 447 | +add_action('cmb2_render_levels_repeater_header', 'give_cmb_render_levels_repeater_header', 10);
|
|
| 448 | 448 | |
| 449 | 449 | |
| 450 | 450 | /** |
@@ -461,25 +461,25 @@ discard block |
||
| 461 | 461 | * @param $object_type |
| 462 | 462 | * @param $field_type_object |
| 463 | 463 | */ |
| 464 | -function give_cmb_render_levels_id( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
|
|
| 464 | +function give_cmb_render_levels_id($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
|
|
| 465 | 465 | |
| 466 | - $escaped_value = ( isset( $escaped_value['level_id'] ) ? $escaped_value['level_id'] : '' ); |
|
| 466 | + $escaped_value = (isset($escaped_value['level_id']) ? $escaped_value['level_id'] : ''); |
|
| 467 | 467 | |
| 468 | 468 | $field_options_array = array( |
| 469 | 469 | 'class' => 'give-hidden give-level-id-input', |
| 470 | - 'name' => $field_type_object->_name( '[level_id]' ), |
|
| 471 | - 'id' => $field_type_object->_id( '_level_id' ), |
|
| 470 | + 'name' => $field_type_object->_name('[level_id]'),
|
|
| 471 | + 'id' => $field_type_object->_id('_level_id'),
|
|
| 472 | 472 | 'value' => $escaped_value, |
| 473 | 473 | 'type' => 'number', |
| 474 | 474 | 'desc' => '', |
| 475 | 475 | ); |
| 476 | 476 | |
| 477 | - echo '<p class="give-level-id">' . $escaped_value . '</p>'; |
|
| 478 | - echo $field_type_object->input( $field_options_array ); |
|
| 477 | + echo '<p class="give-level-id">'.$escaped_value.'</p>'; |
|
| 478 | + echo $field_type_object->input($field_options_array); |
|
| 479 | 479 | |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | -add_action( 'cmb2_render_levels_id', 'give_cmb_render_levels_id', 10, 5 ); |
|
| 482 | +add_action('cmb2_render_levels_id', 'give_cmb_render_levels_id', 10, 5);
|
|
| 483 | 483 | |
| 484 | 484 | |
| 485 | 485 | /** |
@@ -491,13 +491,13 @@ discard block |
||
| 491 | 491 | * @param $object_type |
| 492 | 492 | * @param $field_type_object |
| 493 | 493 | */ |
| 494 | -function give_cmb_give_default_radio_inline( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
|
|
| 495 | - echo '<input type="radio" class="cmb2-option donation-level-radio" name="' . $field_object->args['_name'] . '" id="' . $field_object->args['id'] . '" value="default" ' . checked( 'default', $escaped_value, false ) . '>'; |
|
| 496 | - echo '<label for="' . $field_object->args['id'] . '">Default</label>'; |
|
| 494 | +function give_cmb_give_default_radio_inline($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
|
|
| 495 | + echo '<input type="radio" class="cmb2-option donation-level-radio" name="'.$field_object->args['_name'].'" id="'.$field_object->args['id'].'" value="default" '.checked('default', $escaped_value, false).'>';
|
|
| 496 | + echo '<label for="'.$field_object->args['id'].'">Default</label>'; |
|
| 497 | 497 | |
| 498 | 498 | } |
| 499 | 499 | |
| 500 | -add_action( 'cmb2_render_give_default_radio_inline', 'give_cmb_give_default_radio_inline', 10, 5 ); |
|
| 500 | +add_action('cmb2_render_give_default_radio_inline', 'give_cmb_give_default_radio_inline', 10, 5);
|
|
| 501 | 501 | |
| 502 | 502 | |
| 503 | 503 | /** |
@@ -507,20 +507,20 @@ discard block |
||
| 507 | 507 | */ |
| 508 | 508 | function give_add_shortcode_to_publish_metabox() {
|
| 509 | 509 | |
| 510 | - if ( 'give_forms' !== get_post_type() ) {
|
|
| 510 | + if ('give_forms' !== get_post_type()) {
|
|
| 511 | 511 | return false; |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | global $post; |
| 515 | 515 | |
| 516 | 516 | //Only enqueue scripts for CPT on post type screen |
| 517 | - if ( 'give_forms' === $post->post_type ) {
|
|
| 517 | + if ('give_forms' === $post->post_type) {
|
|
| 518 | 518 | //Shortcode column with select all input |
| 519 | - $shortcode = htmlentities( '[give_form id="' . $post->ID . '"]' ); |
|
| 520 | - echo '<div class="shortcode-wrap box-sizing"><label>' . __( 'Give Form Shortcode:', 'give' ) . '</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly value="' . $shortcode . '"></div>'; |
|
| 519 | + $shortcode = htmlentities('[give_form id="'.$post->ID.'"]');
|
|
| 520 | + echo '<div class="shortcode-wrap box-sizing"><label>'.__('Give Form Shortcode:', 'give').'</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly value="'.$shortcode.'"></div>';
|
|
| 521 | 521 | |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | -add_action( 'post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox' ); |
|
| 526 | +add_action('post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox');
|
|