@@ -43,24 +43,24 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct() { |
45 | 45 | |
46 | - add_action( 'admin_init', array( $this, 'init' ) ); |
|
46 | + add_action('admin_init', array($this, 'init')); |
|
47 | 47 | |
48 | 48 | //Customize CMB2 URL |
49 | - add_filter( 'cmb2_meta_box_url', array( $this, 'give_update_cmb_meta_box_url' ) ); |
|
49 | + add_filter('cmb2_meta_box_url', array($this, 'give_update_cmb_meta_box_url')); |
|
50 | 50 | |
51 | 51 | //Custom CMB2 Settings Fields |
52 | - add_action( 'cmb2_render_give_title', 'give_title_callback', 10, 5 ); |
|
53 | - add_action( 'cmb2_render_give_description', 'give_description_callback', 10, 5 ); |
|
54 | - add_action( 'cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 ); |
|
55 | - add_action( 'cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5 ); |
|
56 | - add_action( 'cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 ); |
|
57 | - add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 ); |
|
58 | - add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 ); |
|
59 | - add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 ); |
|
60 | - add_action( 'admin_notices', array( $this, 'settings_notices' ) ); |
|
52 | + add_action('cmb2_render_give_title', 'give_title_callback', 10, 5); |
|
53 | + add_action('cmb2_render_give_description', 'give_description_callback', 10, 5); |
|
54 | + add_action('cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5); |
|
55 | + add_action('cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5); |
|
56 | + add_action('cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5); |
|
57 | + add_action('cmb2_render_system_info', 'give_system_info_callback', 10, 5); |
|
58 | + add_action('cmb2_render_api', 'give_api_callback', 10, 5); |
|
59 | + add_action('cmb2_render_license_key', 'give_license_key_callback', 10, 5); |
|
60 | + add_action('admin_notices', array($this, 'settings_notices')); |
|
61 | 61 | |
62 | 62 | // Include CMB CSS in the head to avoid FOUC |
63 | - add_action( "admin_print_styles-give_forms_page_give-settings", array( 'CMB2_hookup', 'enqueue_cmb_css' ) ); |
|
63 | + add_action("admin_print_styles-give_forms_page_give-settings", array('CMB2_hookup', 'enqueue_cmb_css')); |
|
64 | 64 | |
65 | 65 | } |
66 | 66 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @since 1.0 |
70 | 70 | */ |
71 | 71 | public function init() { |
72 | - register_setting( $this->key, $this->key ); |
|
72 | + register_setting($this->key, $this->key); |
|
73 | 73 | |
74 | 74 | } |
75 | 75 | |
@@ -83,9 +83,9 @@ discard block |
||
83 | 83 | * |
84 | 84 | * @return mixed |
85 | 85 | */ |
86 | - public function give_update_cmb_meta_box_url( $url ) { |
|
86 | + public function give_update_cmb_meta_box_url($url) { |
|
87 | 87 | //Path to Give's CMB |
88 | - return GIVE_PLUGIN_URL . '/includes/libraries/cmb2'; |
|
88 | + return GIVE_PLUGIN_URL.'/includes/libraries/cmb2'; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | |
@@ -97,27 +97,27 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function give_get_settings_tabs() { |
99 | 99 | |
100 | - $settings = $this->give_settings( null ); |
|
100 | + $settings = $this->give_settings(null); |
|
101 | 101 | |
102 | 102 | $tabs = array(); |
103 | - $tabs['general'] = __( 'General', 'give' ); |
|
104 | - $tabs['gateways'] = __( 'Payment Gateways', 'give' ); |
|
105 | - $tabs['display'] = __( 'Display Options', 'give' ); |
|
106 | - $tabs['emails'] = __( 'Emails', 'give' ); |
|
103 | + $tabs['general'] = __('General', 'give'); |
|
104 | + $tabs['gateways'] = __('Payment Gateways', 'give'); |
|
105 | + $tabs['display'] = __('Display Options', 'give'); |
|
106 | + $tabs['emails'] = __('Emails', 'give'); |
|
107 | 107 | |
108 | - if ( ! empty( $settings['addons']['fields'] ) ) { |
|
109 | - $tabs['addons'] = __( 'Add-ons', 'give' ); |
|
108 | + if ( ! empty($settings['addons']['fields'])) { |
|
109 | + $tabs['addons'] = __('Add-ons', 'give'); |
|
110 | 110 | } |
111 | 111 | |
112 | - if ( ! empty( $settings['licenses']['fields'] ) ) { |
|
113 | - $tabs['licenses'] = __( 'Licenses', 'give' ); |
|
112 | + if ( ! empty($settings['licenses']['fields'])) { |
|
113 | + $tabs['licenses'] = __('Licenses', 'give'); |
|
114 | 114 | } |
115 | 115 | |
116 | - $tabs['advanced'] = __( 'Advanced', 'give' ); |
|
117 | - $tabs['api'] = __( 'API', 'give' ); |
|
118 | - $tabs['system_info'] = __( 'System Info', 'give' ); |
|
116 | + $tabs['advanced'] = __('Advanced', 'give'); |
|
117 | + $tabs['api'] = __('API', 'give'); |
|
118 | + $tabs['system_info'] = __('System Info', 'give'); |
|
119 | 119 | |
120 | - return apply_filters( 'give_settings_tabs', $tabs ); |
|
120 | + return apply_filters('give_settings_tabs', $tabs); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | |
@@ -127,31 +127,31 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function admin_page_display() { |
129 | 129 | |
130 | - $active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general'; |
|
130 | + $active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general'; |
|
131 | 131 | |
132 | 132 | ?> |
133 | 133 | |
134 | 134 | <div class="wrap give_settings_page cmb2_options_page <?php echo $this->key; ?>"> |
135 | 135 | <h1 class="nav-tab-wrapper"> |
136 | 136 | <?php |
137 | - foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) { |
|
137 | + foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) { |
|
138 | 138 | |
139 | - $tab_url = esc_url( add_query_arg( array( |
|
139 | + $tab_url = esc_url(add_query_arg(array( |
|
140 | 140 | 'settings-updated' => false, |
141 | 141 | 'tab' => $tab_id |
142 | - ) ) ); |
|
142 | + ))); |
|
143 | 143 | |
144 | 144 | $active = $active_tab == $tab_id ? ' nav-tab-active' : ''; |
145 | 145 | |
146 | - echo '<a href="' . esc_url( $tab_url ) . '" title="' . esc_attr( $tab_name ) . '" class="nav-tab' . $active . '">'; |
|
147 | - echo esc_html( $tab_name ); |
|
146 | + echo '<a href="'.esc_url($tab_url).'" title="'.esc_attr($tab_name).'" class="nav-tab'.$active.'">'; |
|
147 | + echo esc_html($tab_name); |
|
148 | 148 | |
149 | 149 | echo '</a>'; |
150 | 150 | } |
151 | 151 | ?> |
152 | 152 | </h1> |
153 | 153 | |
154 | - <?php cmb2_metabox_form( $this->give_settings( $active_tab ), $this->key ); ?> |
|
154 | + <?php cmb2_metabox_form($this->give_settings($active_tab), $this->key); ?> |
|
155 | 155 | |
156 | 156 | </div><!-- .wrap --> |
157 | 157 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * |
168 | 168 | * @return array |
169 | 169 | */ |
170 | - public function give_settings( $active_tab ) { |
|
170 | + public function give_settings($active_tab) { |
|
171 | 171 | |
172 | 172 | $give_settings = array( |
173 | 173 | /** |
@@ -175,60 +175,60 @@ discard block |
||
175 | 175 | */ |
176 | 176 | 'general' => array( |
177 | 177 | 'id' => 'options_page', |
178 | - 'give_title' => __( 'General Settings', 'give' ), |
|
179 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key, ), ), |
|
180 | - 'fields' => apply_filters( 'give_settings_general', array( |
|
178 | + 'give_title' => __('General Settings', 'give'), |
|
179 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key,),), |
|
180 | + 'fields' => apply_filters('give_settings_general', array( |
|
181 | 181 | array( |
182 | - 'name' => __( 'General Settings', 'give' ), |
|
182 | + 'name' => __('General Settings', 'give'), |
|
183 | 183 | 'desc' => '', |
184 | 184 | 'type' => 'give_title', |
185 | 185 | 'id' => 'give_title_general_settings_1' |
186 | 186 | ), |
187 | 187 | array( |
188 | - 'name' => __( 'Success Page', 'give' ), |
|
189 | - 'desc' => sprintf( __( 'This is the page donors are sent to after completing their donations. The %1$s[give_receipt]%2$s shortcode should be on this page.', 'give' ), '<code>', '</code>' ), |
|
188 | + 'name' => __('Success Page', 'give'), |
|
189 | + 'desc' => sprintf(__('This is the page donors are sent to after completing their donations. The %1$s[give_receipt]%2$s shortcode should be on this page.', 'give'), '<code>', '</code>'), |
|
190 | 190 | 'id' => 'success_page', |
191 | 191 | 'type' => 'select', |
192 | - 'options' => give_cmb2_get_post_options( array( |
|
192 | + 'options' => give_cmb2_get_post_options(array( |
|
193 | 193 | 'post_type' => 'page', |
194 | - 'numberposts' => - 1 |
|
195 | - ) ), |
|
194 | + 'numberposts' => -1 |
|
195 | + )), |
|
196 | 196 | ), |
197 | 197 | array( |
198 | - 'name' => __( 'Failed Transaction Page', 'give' ), |
|
199 | - 'desc' => __( 'This is the page donors are sent to if their transaction is cancelled or fails.', 'give' ), |
|
198 | + 'name' => __('Failed Transaction Page', 'give'), |
|
199 | + 'desc' => __('This is the page donors are sent to if their transaction is cancelled or fails.', 'give'), |
|
200 | 200 | 'id' => 'failure_page', |
201 | 201 | 'type' => 'select', |
202 | - 'options' => give_cmb2_get_post_options( array( |
|
202 | + 'options' => give_cmb2_get_post_options(array( |
|
203 | 203 | 'post_type' => 'page', |
204 | - 'numberposts' => - 1 |
|
205 | - ) ), |
|
204 | + 'numberposts' => -1 |
|
205 | + )), |
|
206 | 206 | ), |
207 | 207 | array( |
208 | - 'name' => __( 'Donation History Page', 'give' ), |
|
209 | - 'desc' => sprintf( __( 'This page shows a complete donation history for the current user. The %1$s[donation_history]%2$s shortcode should be on this page.', 'give' ), '<code>', '</code>' ), |
|
208 | + 'name' => __('Donation History Page', 'give'), |
|
209 | + 'desc' => sprintf(__('This page shows a complete donation history for the current user. The %1$s[donation_history]%2$s shortcode should be on this page.', 'give'), '<code>', '</code>'), |
|
210 | 210 | 'id' => 'history_page', |
211 | 211 | 'type' => 'select', |
212 | - 'options' => give_cmb2_get_post_options( array( |
|
212 | + 'options' => give_cmb2_get_post_options(array( |
|
213 | 213 | 'post_type' => 'page', |
214 | - 'numberposts' => - 1 |
|
215 | - ) ), |
|
214 | + 'numberposts' => -1 |
|
215 | + )), |
|
216 | 216 | ), |
217 | 217 | array( |
218 | - 'name' => __( 'Base Country', 'give' ), |
|
219 | - 'desc' => __( 'Where does your site operate from?', 'give' ), |
|
218 | + 'name' => __('Base Country', 'give'), |
|
219 | + 'desc' => __('Where does your site operate from?', 'give'), |
|
220 | 220 | 'id' => 'base_country', |
221 | 221 | 'type' => 'select', |
222 | 222 | 'options' => give_get_country_list(), |
223 | 223 | ), |
224 | 224 | array( |
225 | - 'name' => __( 'Currency Settings', 'give' ), |
|
225 | + 'name' => __('Currency Settings', 'give'), |
|
226 | 226 | 'desc' => '', |
227 | 227 | 'type' => 'give_title', |
228 | 228 | 'id' => 'give_title_general_settings_2' |
229 | 229 | ), |
230 | 230 | array( |
231 | - 'name' => __( 'Currency', 'give' ), |
|
231 | + 'name' => __('Currency', 'give'), |
|
232 | 232 | 'desc' => 'Choose your currency. Note that some payment gateways have currency restrictions.', |
233 | 233 | 'id' => 'currency', |
234 | 234 | 'type' => 'select', |
@@ -236,26 +236,26 @@ discard block |
||
236 | 236 | 'default' => 'USD', |
237 | 237 | ), |
238 | 238 | array( |
239 | - 'name' => __( 'Currency Position', 'give' ), |
|
239 | + 'name' => __('Currency Position', 'give'), |
|
240 | 240 | 'desc' => 'Choose the position of the currency sign.', |
241 | 241 | 'id' => 'currency_position', |
242 | 242 | 'type' => 'select', |
243 | 243 | 'options' => array( |
244 | - 'before' => sprintf( __( 'Before - %1$s10', 'give' ), give_currency_symbol( give_get_currency() ) ), |
|
245 | - 'after' => sprintf( __( 'After - 10%1$s', 'give' ), give_currency_symbol( give_get_currency() ) ) |
|
244 | + 'before' => sprintf(__('Before - %1$s10', 'give'), give_currency_symbol(give_get_currency())), |
|
245 | + 'after' => sprintf(__('After - 10%1$s', 'give'), give_currency_symbol(give_get_currency())) |
|
246 | 246 | ), |
247 | 247 | 'default' => 'before', |
248 | 248 | ), |
249 | 249 | array( |
250 | - 'name' => __( 'Thousands Separator', 'give' ), |
|
251 | - 'desc' => __( 'The symbol (typically , or .) to separate thousands', 'give' ), |
|
250 | + 'name' => __('Thousands Separator', 'give'), |
|
251 | + 'desc' => __('The symbol (typically , or .) to separate thousands', 'give'), |
|
252 | 252 | 'id' => 'thousands_separator', |
253 | 253 | 'type' => 'text_small', |
254 | 254 | 'default' => ',', |
255 | 255 | ), |
256 | 256 | array( |
257 | - 'name' => __( 'Decimal Separator', 'give' ), |
|
258 | - 'desc' => __( 'The symbol (usually , or .) to separate decimal points', 'give' ), |
|
257 | + 'name' => __('Decimal Separator', 'give'), |
|
258 | + 'desc' => __('The symbol (usually , or .) to separate decimal points', 'give'), |
|
259 | 259 | 'id' => 'decimal_separator', |
260 | 260 | 'type' => 'text_small', |
261 | 261 | 'default' => '.', |
@@ -268,83 +268,83 @@ discard block |
||
268 | 268 | */ |
269 | 269 | 'gateways' => array( |
270 | 270 | 'id' => 'options_page', |
271 | - 'give_title' => __( 'Payment Gateways', 'give' ), |
|
272 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key, ), ), |
|
273 | - 'fields' => apply_filters( 'give_settings_gateways', array( |
|
271 | + 'give_title' => __('Payment Gateways', 'give'), |
|
272 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key,),), |
|
273 | + 'fields' => apply_filters('give_settings_gateways', array( |
|
274 | 274 | array( |
275 | - 'name' => __( 'Gateways Settings', 'give' ), |
|
275 | + 'name' => __('Gateways Settings', 'give'), |
|
276 | 276 | 'desc' => '', |
277 | 277 | 'id' => 'give_title_gateway_settings_1', |
278 | 278 | 'type' => 'give_title' |
279 | 279 | ), |
280 | 280 | array( |
281 | - 'name' => __( 'Test Mode', 'give' ), |
|
282 | - 'desc' => __( 'While in test mode no live transactions are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ), |
|
281 | + 'name' => __('Test Mode', 'give'), |
|
282 | + 'desc' => __('While in test mode no live transactions are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'), |
|
283 | 283 | 'id' => 'test_mode', |
284 | 284 | 'type' => 'checkbox' |
285 | 285 | ), |
286 | 286 | array( |
287 | - 'name' => __( 'Enabled Gateways', 'give' ), |
|
288 | - 'desc' => __( 'Choose the payment gateways you would like enabled.', 'give' ), |
|
287 | + 'name' => __('Enabled Gateways', 'give'), |
|
288 | + 'desc' => __('Choose the payment gateways you would like enabled.', 'give'), |
|
289 | 289 | 'id' => 'gateways', |
290 | 290 | 'type' => 'enabled_gateways' |
291 | 291 | ), |
292 | 292 | array( |
293 | - 'name' => __( 'Default Gateway', 'give' ), |
|
294 | - 'desc' => __( 'This is the gateway that will be selected by default.', 'give' ), |
|
293 | + 'name' => __('Default Gateway', 'give'), |
|
294 | + 'desc' => __('This is the gateway that will be selected by default.', 'give'), |
|
295 | 295 | 'id' => 'default_gateway', |
296 | 296 | 'type' => 'default_gateway' |
297 | 297 | ), |
298 | 298 | array( |
299 | - 'name' => __( 'PayPal Standard', 'give' ), |
|
299 | + 'name' => __('PayPal Standard', 'give'), |
|
300 | 300 | 'desc' => '', |
301 | 301 | 'type' => 'give_title', |
302 | 302 | 'id' => 'give_title_gateway_settings_2', |
303 | 303 | ), |
304 | 304 | array( |
305 | - 'name' => __( 'PayPal Email', 'give' ), |
|
306 | - 'desc' => __( 'Enter your PayPal account\'s email', 'give' ), |
|
305 | + 'name' => __('PayPal Email', 'give'), |
|
306 | + 'desc' => __('Enter your PayPal account\'s email', 'give'), |
|
307 | 307 | 'id' => 'paypal_email', |
308 | 308 | 'type' => 'text_email', |
309 | 309 | ), |
310 | 310 | array( |
311 | - 'name' => __( 'PayPal Page Style', 'give' ), |
|
312 | - 'desc' => __( 'Enter the name of the page style to use, or leave blank to use the default', 'give' ), |
|
311 | + 'name' => __('PayPal Page Style', 'give'), |
|
312 | + 'desc' => __('Enter the name of the page style to use, or leave blank to use the default', 'give'), |
|
313 | 313 | 'id' => 'paypal_page_style', |
314 | 314 | 'type' => 'text', |
315 | 315 | ), |
316 | 316 | array( |
317 | - 'name' => __( 'PayPal Transaction Type', 'give' ), |
|
318 | - 'desc' => __( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ), |
|
317 | + 'name' => __('PayPal Transaction Type', 'give'), |
|
318 | + 'desc' => __('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'), |
|
319 | 319 | 'id' => 'paypal_button_type', |
320 | 320 | 'type' => 'radio_inline', |
321 | 321 | 'options' => array( |
322 | - 'donation' => __( 'Donation', 'give' ), |
|
323 | - 'standard' => __( 'Standard Transaction', 'give' ) |
|
322 | + 'donation' => __('Donation', 'give'), |
|
323 | + 'standard' => __('Standard Transaction', 'give') |
|
324 | 324 | ), |
325 | 325 | 'default' => 'donation', |
326 | 326 | ), |
327 | 327 | array( |
328 | - 'name' => __( 'Disable PayPal IPN Verification', 'give' ), |
|
329 | - 'desc' => __( 'If donations are not getting marked as complete, then check this box. This forces the site to use a slightly less secure method of verifying donations.', 'give' ), |
|
328 | + 'name' => __('Disable PayPal IPN Verification', 'give'), |
|
329 | + 'desc' => __('If donations are not getting marked as complete, then check this box. This forces the site to use a slightly less secure method of verifying donations.', 'give'), |
|
330 | 330 | 'id' => 'disable_paypal_verification', |
331 | 331 | 'type' => 'checkbox' |
332 | 332 | ), |
333 | 333 | array( |
334 | - 'name' => __( 'Offline Donations', 'give' ), |
|
334 | + 'name' => __('Offline Donations', 'give'), |
|
335 | 335 | 'desc' => '', |
336 | 336 | 'type' => 'give_title', |
337 | 337 | 'id' => 'give_title_gateway_settings_3', |
338 | 338 | ), |
339 | 339 | array( |
340 | - 'name' => __( 'Collect Billing Details', 'give' ), |
|
341 | - 'desc' => __( 'This option will enable the billing details section for offline donations. The fieldset will appear above the offline donation instructions. Note: You may customize this option per form as needed.', 'give' ), |
|
340 | + 'name' => __('Collect Billing Details', 'give'), |
|
341 | + 'desc' => __('This option will enable the billing details section for offline donations. The fieldset will appear above the offline donation instructions. Note: You may customize this option per form as needed.', 'give'), |
|
342 | 342 | 'id' => 'give_offline_donation_enable_billing_fields', |
343 | 343 | 'type' => 'checkbox' |
344 | 344 | ), |
345 | 345 | array( |
346 | - 'name' => __( 'Offline Donation Instructions', 'give' ), |
|
347 | - 'desc' => __( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ), |
|
346 | + 'name' => __('Offline Donation Instructions', 'give'), |
|
347 | + 'desc' => __('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'), |
|
348 | 348 | 'id' => 'global_offline_donation_content', |
349 | 349 | 'default' => give_get_default_offline_donation_content(), |
350 | 350 | 'type' => 'wysiwyg', |
@@ -353,15 +353,15 @@ discard block |
||
353 | 353 | ) |
354 | 354 | ), |
355 | 355 | array( |
356 | - 'name' => __( 'Offline Donation Email Instructions Subject', 'give' ), |
|
357 | - 'desc' => __( 'Enter the subject line for the donation receipt email.', 'give' ), |
|
356 | + 'name' => __('Offline Donation Email Instructions Subject', 'give'), |
|
357 | + 'desc' => __('Enter the subject line for the donation receipt email.', 'give'), |
|
358 | 358 | 'id' => 'offline_donation_subject', |
359 | - 'default' => __( '{donation} - Offline Donation Instructions', 'give' ), |
|
359 | + 'default' => __('{donation} - Offline Donation Instructions', 'give'), |
|
360 | 360 | 'type' => 'text' |
361 | 361 | ), |
362 | 362 | array( |
363 | - 'name' => __( 'Offline Donation Email Instructions', 'give' ), |
|
364 | - 'desc' => __( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ), |
|
363 | + 'name' => __('Offline Donation Email Instructions', 'give'), |
|
364 | + 'desc' => __('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give'), |
|
365 | 365 | 'id' => 'global_offline_donation_email', |
366 | 366 | 'default' => give_get_default_offline_donation_email_content(), |
367 | 367 | 'type' => 'wysiwyg', |
@@ -375,84 +375,84 @@ discard block |
||
375 | 375 | /** Display Settings */ |
376 | 376 | 'display' => array( |
377 | 377 | 'id' => 'options_page', |
378 | - 'give_title' => __( 'Display Settings', 'give' ), |
|
379 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key, ), ), |
|
380 | - 'fields' => apply_filters( 'give_settings_display', array( |
|
378 | + 'give_title' => __('Display Settings', 'give'), |
|
379 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key,),), |
|
380 | + 'fields' => apply_filters('give_settings_display', array( |
|
381 | 381 | array( |
382 | - 'name' => __( 'Display Settings', 'give' ), |
|
382 | + 'name' => __('Display Settings', 'give'), |
|
383 | 383 | 'desc' => '', |
384 | 384 | 'id' => 'give_title_display_settings_1', |
385 | 385 | 'type' => 'give_title' |
386 | 386 | ), |
387 | 387 | array( |
388 | - 'name' => __( 'Disable CSS', 'give' ), |
|
389 | - 'desc' => __( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ), |
|
388 | + 'name' => __('Disable CSS', 'give'), |
|
389 | + 'desc' => __('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'), |
|
390 | 390 | 'id' => 'disable_css', |
391 | 391 | 'type' => 'checkbox' |
392 | 392 | ), |
393 | 393 | array( |
394 | - 'name' => __( 'Enable Floating Labels', 'give' ), |
|
395 | - 'desc' => sprintf( __( 'Enable this option if you would like to enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms.<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/" ) ), |
|
394 | + 'name' => __('Enable Floating Labels', 'give'), |
|
395 | + 'desc' => sprintf(__('Enable this option if you would like to enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms.<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/")), |
|
396 | 396 | 'id' => 'enable_floatlabels', |
397 | 397 | 'type' => 'checkbox' |
398 | 398 | ), |
399 | 399 | array( |
400 | - 'name' => __( 'Disable Welcome Screen', 'give' ), |
|
401 | - 'desc' => sprintf( __( 'Enable this option if you would like to disable the Give Welcome screen every time Give is activated and/or updated. You can always access the Welcome Screen <a href="%s">here</a> if you want in the future.', 'give' ), esc_url( admin_url( 'index.php?page=give-about' ) ) ), |
|
400 | + 'name' => __('Disable Welcome Screen', 'give'), |
|
401 | + 'desc' => sprintf(__('Enable this option if you would like to disable the Give Welcome screen every time Give is activated and/or updated. You can always access the Welcome Screen <a href="%s">here</a> if you want in the future.', 'give'), esc_url(admin_url('index.php?page=give-about'))), |
|
402 | 402 | 'id' => 'disable_welcome', |
403 | 403 | 'type' => 'checkbox' |
404 | 404 | ), |
405 | 405 | array( |
406 | - 'name' => __( 'Post Types', 'give' ), |
|
406 | + 'name' => __('Post Types', 'give'), |
|
407 | 407 | 'desc' => '', |
408 | 408 | 'id' => 'give_title_display_settings_2', |
409 | 409 | 'type' => 'give_title' |
410 | 410 | ), |
411 | 411 | array( |
412 | - 'name' => __( 'Disable Form Single Views', 'give' ), |
|
413 | - 'desc' => __( 'By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ), |
|
412 | + 'name' => __('Disable Form Single Views', 'give'), |
|
413 | + 'desc' => __('By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'), |
|
414 | 414 | 'id' => 'disable_forms_singular', |
415 | 415 | 'type' => 'checkbox' |
416 | 416 | ), |
417 | 417 | array( |
418 | - 'name' => __( 'Disable Form Archives', 'give' ), |
|
419 | - 'desc' => __( 'Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give' ), |
|
418 | + 'name' => __('Disable Form Archives', 'give'), |
|
419 | + 'desc' => __('Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give'), |
|
420 | 420 | 'id' => 'disable_forms_archives', |
421 | 421 | 'type' => 'checkbox' |
422 | 422 | ), |
423 | 423 | array( |
424 | - 'name' => __( 'Disable Form Excerpts', 'give' ), |
|
425 | - 'desc' => __( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ), |
|
424 | + 'name' => __('Disable Form Excerpts', 'give'), |
|
425 | + 'desc' => __('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'), |
|
426 | 426 | 'id' => 'disable_forms_excerpt', |
427 | 427 | 'type' => 'checkbox' |
428 | 428 | ), |
429 | 429 | array( |
430 | - 'name' => __( 'Disable Form Featured Image', 'give' ), |
|
431 | - 'desc' => __( 'The Featured Image is an image that is chosen as the representative image for donation form. The display of this image is largely up to the theme. If you do not wish to use the featured image you can disable it using this option.', 'give' ), |
|
430 | + 'name' => __('Disable Form Featured Image', 'give'), |
|
431 | + 'desc' => __('The Featured Image is an image that is chosen as the representative image for donation form. The display of this image is largely up to the theme. If you do not wish to use the featured image you can disable it using this option.', 'give'), |
|
432 | 432 | 'id' => 'disable_form_featured_img', |
433 | 433 | 'type' => 'checkbox' |
434 | 434 | ), |
435 | 435 | array( |
436 | - 'name' => __( 'Disable Single Form Sidebar', 'give' ), |
|
437 | - 'desc' => __( 'The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ), |
|
436 | + 'name' => __('Disable Single Form Sidebar', 'give'), |
|
437 | + 'desc' => __('The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'), |
|
438 | 438 | 'id' => 'disable_form_sidebar', |
439 | 439 | 'type' => 'checkbox' |
440 | 440 | ), |
441 | 441 | array( |
442 | - 'name' => __( 'Taxonomies', 'give' ), |
|
442 | + 'name' => __('Taxonomies', 'give'), |
|
443 | 443 | 'desc' => '', |
444 | 444 | 'id' => 'give_title_display_settings_3', |
445 | 445 | 'type' => 'give_title' |
446 | 446 | ), |
447 | 447 | array( |
448 | - 'name' => __( 'Enable Form Categories', 'give' ), |
|
449 | - 'desc' => __( 'Check this option if you would like to categorize your donation forms. This option enables the form\'s category taxonomy.', 'give' ), |
|
448 | + 'name' => __('Enable Form Categories', 'give'), |
|
449 | + 'desc' => __('Check this option if you would like to categorize your donation forms. This option enables the form\'s category taxonomy.', 'give'), |
|
450 | 450 | 'id' => 'enable_categories', |
451 | 451 | 'type' => 'checkbox' |
452 | 452 | ), |
453 | 453 | array( |
454 | - 'name' => __( 'Enable Form Tags', 'give' ), |
|
455 | - 'desc' => __( 'Check this option if you would like to tag your donation forms. This option enables the form\'s tag taxonomy.', 'give' ), |
|
454 | + 'name' => __('Enable Form Tags', 'give'), |
|
455 | + 'desc' => __('Check this option if you would like to tag your donation forms. This option enables the form\'s tag taxonomy.', 'give'), |
|
456 | 456 | 'id' => 'enable_tags', |
457 | 457 | 'type' => 'checkbox' |
458 | 458 | ), |
@@ -465,93 +465,93 @@ discard block |
||
465 | 465 | */ |
466 | 466 | 'emails' => array( |
467 | 467 | 'id' => 'options_page', |
468 | - 'give_title' => __( 'Give Email Settings', 'give' ), |
|
469 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key, ), ), |
|
470 | - 'fields' => apply_filters( 'give_settings_emails', array( |
|
468 | + 'give_title' => __('Give Email Settings', 'give'), |
|
469 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key,),), |
|
470 | + 'fields' => apply_filters('give_settings_emails', array( |
|
471 | 471 | array( |
472 | - 'name' => __( 'Email Settings', 'give' ), |
|
472 | + 'name' => __('Email Settings', 'give'), |
|
473 | 473 | 'desc' => '', |
474 | 474 | 'id' => 'give_title_email_settings_1', |
475 | 475 | 'type' => 'give_title' |
476 | 476 | ), |
477 | 477 | array( |
478 | 478 | 'id' => 'email_template', |
479 | - 'name' => __( 'Email Template', 'give' ), |
|
480 | - 'desc' => __( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ), |
|
479 | + 'name' => __('Email Template', 'give'), |
|
480 | + 'desc' => __('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'), |
|
481 | 481 | 'type' => 'select', |
482 | 482 | 'options' => give_get_email_templates() |
483 | 483 | ), |
484 | 484 | array( |
485 | 485 | 'id' => 'email_logo', |
486 | - 'name' => __( 'Logo', 'give' ), |
|
487 | - 'desc' => __( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ), |
|
486 | + 'name' => __('Logo', 'give'), |
|
487 | + 'desc' => __('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'), |
|
488 | 488 | 'type' => 'file' |
489 | 489 | ), |
490 | 490 | array( |
491 | 491 | 'id' => 'from_name', |
492 | - 'name' => __( 'From Name', 'give' ), |
|
493 | - 'desc' => __( 'The name donation receipts are said to come from. This should probably be your site or shop name.', 'give' ), |
|
494 | - 'default' => get_bloginfo( 'name' ), |
|
492 | + 'name' => __('From Name', 'give'), |
|
493 | + 'desc' => __('The name donation receipts are said to come from. This should probably be your site or shop name.', 'give'), |
|
494 | + 'default' => get_bloginfo('name'), |
|
495 | 495 | 'type' => 'text' |
496 | 496 | ), |
497 | 497 | array( |
498 | 498 | 'id' => 'from_email', |
499 | - 'name' => __( 'From Email', 'give' ), |
|
500 | - 'desc' => __( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ), |
|
501 | - 'default' => get_bloginfo( 'admin_email' ), |
|
499 | + 'name' => __('From Email', 'give'), |
|
500 | + 'desc' => __('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'), |
|
501 | + 'default' => get_bloginfo('admin_email'), |
|
502 | 502 | 'type' => 'text' |
503 | 503 | ), |
504 | 504 | array( |
505 | - 'name' => __( 'Donation Receipt', 'give' ), |
|
505 | + 'name' => __('Donation Receipt', 'give'), |
|
506 | 506 | 'desc' => '', |
507 | 507 | 'id' => 'give_title_email_settings_2', |
508 | 508 | 'type' => 'give_title' |
509 | 509 | ), |
510 | 510 | array( |
511 | 511 | 'id' => 'donation_subject', |
512 | - 'name' => __( 'Donation Email Subject', 'give' ), |
|
513 | - 'desc' => __( 'Enter the subject line for the donation receipt email', 'give' ), |
|
514 | - 'default' => __( 'Donation Receipt', 'give' ), |
|
512 | + 'name' => __('Donation Email Subject', 'give'), |
|
513 | + 'desc' => __('Enter the subject line for the donation receipt email', 'give'), |
|
514 | + 'default' => __('Donation Receipt', 'give'), |
|
515 | 515 | 'type' => 'text' |
516 | 516 | ), |
517 | 517 | array( |
518 | 518 | 'id' => 'donation_receipt', |
519 | - 'name' => __( 'Donation Receipt', 'give' ), |
|
520 | - 'desc' => __( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags:', 'give' ) . '<br/>' . give_get_emails_tags_list(), |
|
519 | + 'name' => __('Donation Receipt', 'give'), |
|
520 | + 'desc' => __('Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags:', 'give').'<br/>'.give_get_emails_tags_list(), |
|
521 | 521 | 'type' => 'wysiwyg', |
522 | - 'default' => __( "Dear", "give" ) . " {name},\n\n" . __( "Thank you for your donation. Your generosity is appreciated! Please click on the link below to view your receipt.", "give" ) . "\n\n{receipt_link}\n\nSincerely,\n{sitename}" |
|
522 | + 'default' => __("Dear", "give")." {name},\n\n".__("Thank you for your donation. Your generosity is appreciated! Please click on the link below to view your receipt.", "give")."\n\n{receipt_link}\n\nSincerely,\n{sitename}" |
|
523 | 523 | ), |
524 | 524 | array( |
525 | - 'name' => __( 'New Donation Notification', 'give' ), |
|
525 | + 'name' => __('New Donation Notification', 'give'), |
|
526 | 526 | 'desc' => '', |
527 | 527 | 'id' => 'give_title_email_settings_3', |
528 | 528 | 'type' => 'give_title' |
529 | 529 | ), |
530 | 530 | array( |
531 | 531 | 'id' => 'donation_notification_subject', |
532 | - 'name' => __( 'Donation Notification Subject', 'give' ), |
|
533 | - 'desc' => __( 'Enter the subject line for the donation notification email', 'give' ), |
|
532 | + 'name' => __('Donation Notification Subject', 'give'), |
|
533 | + 'desc' => __('Enter the subject line for the donation notification email', 'give'), |
|
534 | 534 | 'type' => 'text', |
535 | - 'default' => __( 'New Donation - #{payment_id}', 'give' ) |
|
535 | + 'default' => __('New Donation - #{payment_id}', 'give') |
|
536 | 536 | ), |
537 | 537 | array( |
538 | 538 | 'id' => 'donation_notification', |
539 | - 'name' => __( 'Donation Notification', 'give' ), |
|
540 | - 'desc' => __( 'Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags:', 'give' ) . '<br/>' . give_get_emails_tags_list(), |
|
539 | + 'name' => __('Donation Notification', 'give'), |
|
540 | + 'desc' => __('Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags:', 'give').'<br/>'.give_get_emails_tags_list(), |
|
541 | 541 | 'type' => 'wysiwyg', |
542 | 542 | 'default' => give_get_default_donation_notification_email() |
543 | 543 | ), |
544 | 544 | array( |
545 | 545 | 'id' => 'admin_notice_emails', |
546 | - 'name' => __( 'Donation Notification Emails', 'give' ), |
|
547 | - 'desc' => sprintf( __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter %1$sone email address per line%2$s and not separated by commas.', 'give' ), '<span class="give-underline">', '</span>' ), |
|
546 | + 'name' => __('Donation Notification Emails', 'give'), |
|
547 | + 'desc' => sprintf(__('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter %1$sone email address per line%2$s and not separated by commas.', 'give'), '<span class="give-underline">', '</span>'), |
|
548 | 548 | 'type' => 'textarea', |
549 | - 'default' => get_bloginfo( 'admin_email' ) |
|
549 | + 'default' => get_bloginfo('admin_email') |
|
550 | 550 | ), |
551 | 551 | array( |
552 | 552 | 'id' => 'disable_admin_notices', |
553 | - 'name' => __( 'Disable Admin Notifications', 'give' ), |
|
554 | - 'desc' => __( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ), |
|
553 | + 'name' => __('Disable Admin Notifications', 'give'), |
|
554 | + 'desc' => __('Check this box if you do not want to receive emails when new donations are made.', 'give'), |
|
555 | 555 | 'type' => 'checkbox' |
556 | 556 | ) |
557 | 557 | ) |
@@ -560,76 +560,76 @@ discard block |
||
560 | 560 | /** Extension Settings */ |
561 | 561 | 'addons' => array( |
562 | 562 | 'id' => 'options_page', |
563 | - 'give_title' => __( 'Give Add-ons Settings', 'give' ), |
|
564 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key, ), ), |
|
565 | - 'fields' => apply_filters( 'give_settings_addons', array() |
|
563 | + 'give_title' => __('Give Add-ons Settings', 'give'), |
|
564 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key,),), |
|
565 | + 'fields' => apply_filters('give_settings_addons', array() |
|
566 | 566 | ) |
567 | 567 | ), |
568 | 568 | /** Licenses Settings */ |
569 | 569 | 'licenses' => array( |
570 | 570 | 'id' => 'options_page', |
571 | - 'give_title' => __( 'Give Licenses', 'give' ), |
|
572 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key, ), ), |
|
573 | - 'fields' => apply_filters( 'give_settings_licenses', array() |
|
571 | + 'give_title' => __('Give Licenses', 'give'), |
|
572 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key,),), |
|
573 | + 'fields' => apply_filters('give_settings_licenses', array() |
|
574 | 574 | ) |
575 | 575 | ), |
576 | 576 | /** Advanced Options */ |
577 | 577 | 'advanced' => array( |
578 | 578 | 'id' => 'options_page', |
579 | - 'give_title' => __( 'Advanced Options', 'give' ), |
|
580 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key, ), ), |
|
581 | - 'fields' => apply_filters( 'give_settings_advanced', array( |
|
579 | + 'give_title' => __('Advanced Options', 'give'), |
|
580 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key,),), |
|
581 | + 'fields' => apply_filters('give_settings_advanced', array( |
|
582 | 582 | array( |
583 | - 'name' => __( 'Session Control', 'give' ), |
|
583 | + 'name' => __('Session Control', 'give'), |
|
584 | 584 | 'desc' => '', |
585 | 585 | 'id' => 'give_title_session_control_1', |
586 | 586 | 'type' => 'give_title' |
587 | 587 | ), |
588 | 588 | array( |
589 | 589 | 'id' => 'session_lifetime', |
590 | - 'name' => __( 'Session Lifetime', 'give' ), |
|
591 | - 'desc' => __( 'Give will start a new session per user once they have donated. This option controls the lifetime a user\'s session is kept alive. An active session allows users to view donation receipts on your site without having to be logged in.', 'give' ), |
|
590 | + 'name' => __('Session Lifetime', 'give'), |
|
591 | + 'desc' => __('Give will start a new session per user once they have donated. This option controls the lifetime a user\'s session is kept alive. An active session allows users to view donation receipts on your site without having to be logged in.', 'give'), |
|
592 | 592 | 'type' => 'select', |
593 | 593 | 'options' => array( |
594 | - '86400' => __( '24 Hours', 'give' ), |
|
595 | - '172800' => __( '48 Hours', 'give' ), |
|
596 | - '259200' => __( '72 Hours', 'give' ), |
|
597 | - '604800' => __( '1 Week', 'give' ), |
|
594 | + '86400' => __('24 Hours', 'give'), |
|
595 | + '172800' => __('48 Hours', 'give'), |
|
596 | + '259200' => __('72 Hours', 'give'), |
|
597 | + '604800' => __('1 Week', 'give'), |
|
598 | 598 | ) |
599 | 599 | ), |
600 | 600 | array( |
601 | - 'name' => __( 'Data Control', 'give' ), |
|
601 | + 'name' => __('Data Control', 'give'), |
|
602 | 602 | 'desc' => '', |
603 | 603 | 'id' => 'give_title_data_control_2', |
604 | 604 | 'type' => 'give_title' |
605 | 605 | ), |
606 | 606 | array( |
607 | - 'name' => __( 'Remove All Data on Uninstall?', 'give' ), |
|
608 | - 'desc' => __( 'Check this box if you would like Give to completely remove all of its data when the plugin is deleted.', 'give' ), |
|
607 | + 'name' => __('Remove All Data on Uninstall?', 'give'), |
|
608 | + 'desc' => __('Check this box if you would like Give to completely remove all of its data when the plugin is deleted.', 'give'), |
|
609 | 609 | 'id' => 'uninstall_on_delete', |
610 | 610 | 'type' => 'checkbox' |
611 | 611 | ), |
612 | 612 | array( |
613 | - 'name' => __( 'Filter Control', 'give' ), |
|
613 | + 'name' => __('Filter Control', 'give'), |
|
614 | 614 | 'desc' => '', |
615 | 615 | 'id' => 'give_title_filter_control', |
616 | 616 | 'type' => 'give_title' |
617 | 617 | ), |
618 | 618 | array( |
619 | - 'name' => __( 'Disable <code>the_content</code> filter', 'give' ), |
|
620 | - 'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%s" target="_blank">Learn more</a> about the_content filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ) ), |
|
619 | + 'name' => __('Disable <code>the_content</code> filter', 'give'), |
|
620 | + 'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%s" target="_blank">Learn more</a> about the_content filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content')), |
|
621 | 621 | 'id' => 'disable_the_content_filter', |
622 | 622 | 'type' => 'checkbox' |
623 | 623 | ), |
624 | 624 | array( |
625 | - 'name' => __( 'Script Loading', 'give' ), |
|
625 | + 'name' => __('Script Loading', 'give'), |
|
626 | 626 | 'desc' => '', |
627 | 627 | 'id' => 'give_title_script_control', |
628 | 628 | 'type' => 'give_title' |
629 | 629 | ), |
630 | 630 | array( |
631 | - 'name' => __( 'Load Scripts in Footer?', 'give' ), |
|
632 | - 'desc' => __( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ), |
|
631 | + 'name' => __('Load Scripts in Footer?', 'give'), |
|
632 | + 'desc' => __('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'), |
|
633 | 633 | 'id' => 'scripts_footer', |
634 | 634 | 'type' => 'checkbox' |
635 | 635 | ) |
@@ -639,13 +639,13 @@ discard block |
||
639 | 639 | /** API Settings */ |
640 | 640 | 'api' => array( |
641 | 641 | 'id' => 'options_page', |
642 | - 'give_title' => __( 'API', 'give' ), |
|
643 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key, ), ), |
|
642 | + 'give_title' => __('API', 'give'), |
|
643 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key,),), |
|
644 | 644 | 'show_names' => false, // Hide field names on the left |
645 | - 'fields' => apply_filters( 'give_settings_system', array( |
|
645 | + 'fields' => apply_filters('give_settings_system', array( |
|
646 | 646 | array( |
647 | 647 | 'id' => 'api', |
648 | - 'name' => __( 'API', 'give' ), |
|
648 | + 'name' => __('API', 'give'), |
|
649 | 649 | 'type' => 'api' |
650 | 650 | ) |
651 | 651 | ) |
@@ -654,13 +654,13 @@ discard block |
||
654 | 654 | /** Licenses Settings */ |
655 | 655 | 'system_info' => array( |
656 | 656 | 'id' => 'options_page', |
657 | - 'give_title' => __( 'System Info', 'give' ), |
|
658 | - 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key, ), ), |
|
659 | - 'fields' => apply_filters( 'give_settings_system', array( |
|
657 | + 'give_title' => __('System Info', 'give'), |
|
658 | + 'show_on' => array('key' => 'options-page', 'value' => array($this->key,),), |
|
659 | + 'fields' => apply_filters('give_settings_system', array( |
|
660 | 660 | array( |
661 | 661 | 'id' => 'system_info', |
662 | - 'name' => __( 'System Info', 'give' ), |
|
663 | - 'desc' => __( 'Please copy and paste this information in your ticket when contacting support.', 'give' ), |
|
662 | + 'name' => __('System Info', 'give'), |
|
663 | + 'desc' => __('Please copy and paste this information in your ticket when contacting support.', 'give'), |
|
664 | 664 | 'type' => 'system_info' |
665 | 665 | ) |
666 | 666 | ) |
@@ -669,12 +669,12 @@ discard block |
||
669 | 669 | ); |
670 | 670 | |
671 | 671 | //Return all settings array if necessary |
672 | - if ( $active_tab === null || ! isset( $give_settings[ $active_tab ] ) ) { |
|
673 | - return apply_filters( 'give_registered_settings', $give_settings ); |
|
672 | + if ($active_tab === null || ! isset($give_settings[$active_tab])) { |
|
673 | + return apply_filters('give_registered_settings', $give_settings); |
|
674 | 674 | } |
675 | 675 | |
676 | 676 | // Add other tabs and settings fields as needed |
677 | - return apply_filters( 'give_registered_settings', $give_settings[ $active_tab ] ); |
|
677 | + return apply_filters('give_registered_settings', $give_settings[$active_tab]); |
|
678 | 678 | |
679 | 679 | } |
680 | 680 | |
@@ -683,11 +683,11 @@ discard block |
||
683 | 683 | */ |
684 | 684 | public function settings_notices() { |
685 | 685 | |
686 | - if ( ! isset( $_POST['give_settings_saved'] ) ) { |
|
686 | + if ( ! isset($_POST['give_settings_saved'])) { |
|
687 | 687 | return; |
688 | 688 | } |
689 | 689 | |
690 | - add_settings_error( 'give-notices', 'global-settings-updated', __( 'Settings updated.', 'give' ), 'updated' ); |
|
690 | + add_settings_error('give-notices', 'global-settings-updated', __('Settings updated.', 'give'), 'updated'); |
|
691 | 691 | |
692 | 692 | } |
693 | 693 | |
@@ -701,17 +701,17 @@ discard block |
||
701 | 701 | * |
702 | 702 | * @return mixed Field value or exception is thrown |
703 | 703 | */ |
704 | - public function __get( $field ) { |
|
704 | + public function __get($field) { |
|
705 | 705 | |
706 | 706 | // Allowed fields to retrieve |
707 | - if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) { |
|
707 | + if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) { |
|
708 | 708 | return $this->{$field}; |
709 | 709 | } |
710 | - if ( 'option_metabox' === $field ) { |
|
710 | + if ('option_metabox' === $field) { |
|
711 | 711 | return $this->option_metabox(); |
712 | 712 | } |
713 | 713 | |
714 | - throw new Exception( 'Invalid property: ' . $field ); |
|
714 | + throw new Exception('Invalid property: '.$field); |
|
715 | 715 | } |
716 | 716 | |
717 | 717 | |
@@ -728,12 +728,12 @@ discard block |
||
728 | 728 | * |
729 | 729 | * @return mixed Option value |
730 | 730 | */ |
731 | -function give_get_option( $key = '', $default = false ) { |
|
731 | +function give_get_option($key = '', $default = false) { |
|
732 | 732 | global $give_options; |
733 | - $value = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default; |
|
734 | - $value = apply_filters( 'give_get_option', $value, $key, $default ); |
|
733 | + $value = ! empty($give_options[$key]) ? $give_options[$key] : $default; |
|
734 | + $value = apply_filters('give_get_option', $value, $key, $default); |
|
735 | 735 | |
736 | - return apply_filters( 'give_get_option_' . $key, $value, $key, $default ); |
|
736 | + return apply_filters('give_get_option_'.$key, $value, $key, $default); |
|
737 | 737 | } |
738 | 738 | |
739 | 739 | |
@@ -751,33 +751,33 @@ discard block |
||
751 | 751 | * |
752 | 752 | * @return boolean True if updated, false if not. |
753 | 753 | */ |
754 | -function give_update_option( $key = '', $value = false ) { |
|
754 | +function give_update_option($key = '', $value = false) { |
|
755 | 755 | |
756 | 756 | // If no key, exit |
757 | - if ( empty( $key ) ) { |
|
757 | + if (empty($key)) { |
|
758 | 758 | return false; |
759 | 759 | } |
760 | 760 | |
761 | - if ( empty( $value ) ) { |
|
762 | - $remove_option = give_delete_option( $key ); |
|
761 | + if (empty($value)) { |
|
762 | + $remove_option = give_delete_option($key); |
|
763 | 763 | |
764 | 764 | return $remove_option; |
765 | 765 | } |
766 | 766 | |
767 | 767 | // First let's grab the current settings |
768 | - $options = get_option( 'give_settings' ); |
|
768 | + $options = get_option('give_settings'); |
|
769 | 769 | |
770 | 770 | // Let's let devs alter that value coming in |
771 | - $value = apply_filters( 'give_update_option', $value, $key ); |
|
771 | + $value = apply_filters('give_update_option', $value, $key); |
|
772 | 772 | |
773 | 773 | // Next let's try to update the value |
774 | - $options[ $key ] = $value; |
|
775 | - $did_update = update_option( 'give_settings', $options ); |
|
774 | + $options[$key] = $value; |
|
775 | + $did_update = update_option('give_settings', $options); |
|
776 | 776 | |
777 | 777 | // If it updated, let's update the global variable |
778 | - if ( $did_update ) { |
|
778 | + if ($did_update) { |
|
779 | 779 | global $give_options; |
780 | - $give_options[ $key ] = $value; |
|
780 | + $give_options[$key] = $value; |
|
781 | 781 | } |
782 | 782 | |
783 | 783 | return $did_update; |
@@ -794,27 +794,27 @@ discard block |
||
794 | 794 | * |
795 | 795 | * @return boolean True if updated, false if not. |
796 | 796 | */ |
797 | -function give_delete_option( $key = '' ) { |
|
797 | +function give_delete_option($key = '') { |
|
798 | 798 | |
799 | 799 | // If no key, exit |
800 | - if ( empty( $key ) ) { |
|
800 | + if (empty($key)) { |
|
801 | 801 | return false; |
802 | 802 | } |
803 | 803 | |
804 | 804 | // First let's grab the current settings |
805 | - $options = get_option( 'give_settings' ); |
|
805 | + $options = get_option('give_settings'); |
|
806 | 806 | |
807 | 807 | // Next let's try to update the value |
808 | - if ( isset( $options[ $key ] ) ) { |
|
808 | + if (isset($options[$key])) { |
|
809 | 809 | |
810 | - unset( $options[ $key ] ); |
|
810 | + unset($options[$key]); |
|
811 | 811 | |
812 | 812 | } |
813 | 813 | |
814 | - $did_update = update_option( 'give_settings', $options ); |
|
814 | + $did_update = update_option('give_settings', $options); |
|
815 | 815 | |
816 | 816 | // If it updated, let's update the global variable |
817 | - if ( $did_update ) { |
|
817 | + if ($did_update) { |
|
818 | 818 | global $give_options; |
819 | 819 | $give_options = $options; |
820 | 820 | } |
@@ -833,9 +833,9 @@ discard block |
||
833 | 833 | */ |
834 | 834 | function give_get_settings() { |
835 | 835 | |
836 | - $settings = get_option( 'give_settings' ); |
|
836 | + $settings = get_option('give_settings'); |
|
837 | 837 | |
838 | - return (array) apply_filters( 'give_get_settings', $settings ); |
|
838 | + return (array) apply_filters('give_get_settings', $settings); |
|
839 | 839 | |
840 | 840 | } |
841 | 841 | |
@@ -853,25 +853,25 @@ discard block |
||
853 | 853 | * |
854 | 854 | * @return array |
855 | 855 | */ |
856 | -function give_settings_array_insert( $array, $position, $insert ) { |
|
857 | - if ( is_int( $position ) ) { |
|
858 | - array_splice( $array, $position, 0, $insert ); |
|
856 | +function give_settings_array_insert($array, $position, $insert) { |
|
857 | + if (is_int($position)) { |
|
858 | + array_splice($array, $position, 0, $insert); |
|
859 | 859 | } else { |
860 | 860 | |
861 | - foreach ( $array as $index => $subarray ) { |
|
862 | - if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) { |
|
861 | + foreach ($array as $index => $subarray) { |
|
862 | + if (isset($subarray['id']) && $subarray['id'] == $position) { |
|
863 | 863 | $pos = $index; |
864 | 864 | } |
865 | 865 | } |
866 | 866 | |
867 | - if ( ! isset( $pos ) ) { |
|
867 | + if ( ! isset($pos)) { |
|
868 | 868 | return $array; |
869 | 869 | } |
870 | 870 | |
871 | 871 | $array = array_merge( |
872 | - array_slice( $array, 0, $pos ), |
|
872 | + array_slice($array, 0, $pos), |
|
873 | 873 | $insert, |
874 | - array_slice( $array, $pos ) |
|
874 | + array_slice($array, $pos) |
|
875 | 875 | ); |
876 | 876 | } |
877 | 877 | |
@@ -894,7 +894,7 @@ discard block |
||
894 | 894 | * |
895 | 895 | * @return void |
896 | 896 | */ |
897 | -function give_enabled_gateways_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
897 | +function give_enabled_gateways_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) { |
|
898 | 898 | |
899 | 899 | $id = $field_type_object->field->args['id']; |
900 | 900 | $field_description = $field_type_object->field->args['desc']; |
@@ -902,21 +902,21 @@ discard block |
||
902 | 902 | |
903 | 903 | echo '<ul class="cmb2-checkbox-list cmb2-list">'; |
904 | 904 | |
905 | - foreach ( $gateways as $key => $option ) : |
|
905 | + foreach ($gateways as $key => $option) : |
|
906 | 906 | |
907 | - if ( is_array( $escaped_value ) && array_key_exists( $key, $escaped_value ) ) { |
|
907 | + if (is_array($escaped_value) && array_key_exists($key, $escaped_value)) { |
|
908 | 908 | $enabled = '1'; |
909 | 909 | } else { |
910 | 910 | $enabled = null; |
911 | 911 | } |
912 | 912 | |
913 | - echo '<li><input name="' . $id . '[' . $key . ']" id="' . $id . '[' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/> '; |
|
914 | - echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>'; |
|
913 | + echo '<li><input name="'.$id.'['.$key.']" id="'.$id.'['.$key.']" type="checkbox" value="1" '.checked('1', $enabled, false).'/> '; |
|
914 | + echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>'; |
|
915 | 915 | |
916 | 916 | endforeach; |
917 | 917 | |
918 | - if ( $field_description ) { |
|
919 | - echo '<p class="cmb2-metabox-description">' . $field_description . '</p>'; |
|
918 | + if ($field_description) { |
|
919 | + echo '<p class="cmb2-metabox-description">'.$field_description.'</p>'; |
|
920 | 920 | } |
921 | 921 | |
922 | 922 | echo '</ul>'; |
@@ -935,31 +935,31 @@ discard block |
||
935 | 935 | * |
936 | 936 | * @return void |
937 | 937 | */ |
938 | -function give_default_gateway_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
938 | +function give_default_gateway_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) { |
|
939 | 939 | |
940 | 940 | $id = $field_type_object->field->args['id']; |
941 | 941 | $field_description = $field_type_object->field->args['desc']; |
942 | 942 | $gateways = give_get_enabled_payment_gateways(); |
943 | 943 | |
944 | - echo '<select class="cmb2_select" name="' . $id . '" id="' . $id . '">'; |
|
944 | + echo '<select class="cmb2_select" name="'.$id.'" id="'.$id.'">'; |
|
945 | 945 | |
946 | 946 | //Add a field to the Give Form admin single post view of this field |
947 | - if ( $field_type_object->field->object_type === 'post' ) { |
|
948 | - echo '<option value="global">' . __( 'Global Default', 'give' ) . '</option>'; |
|
947 | + if ($field_type_object->field->object_type === 'post') { |
|
948 | + echo '<option value="global">'.__('Global Default', 'give').'</option>'; |
|
949 | 949 | } |
950 | 950 | |
951 | - foreach ( $gateways as $key => $option ) : |
|
951 | + foreach ($gateways as $key => $option) : |
|
952 | 952 | |
953 | - $selected = isset( $escaped_value ) ? selected( $key, $escaped_value, false ) : ''; |
|
953 | + $selected = isset($escaped_value) ? selected($key, $escaped_value, false) : ''; |
|
954 | 954 | |
955 | 955 | |
956 | - echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>'; |
|
956 | + echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>'; |
|
957 | 957 | |
958 | 958 | endforeach; |
959 | 959 | |
960 | 960 | echo '</select>'; |
961 | 961 | |
962 | - echo '<p class="cmb2-metabox-description">' . $field_description . '</p>'; |
|
962 | + echo '<p class="cmb2-metabox-description">'.$field_description.'</p>'; |
|
963 | 963 | |
964 | 964 | } |
965 | 965 | |
@@ -974,13 +974,13 @@ discard block |
||
974 | 974 | * |
975 | 975 | * @return void |
976 | 976 | */ |
977 | -function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
977 | +function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) { |
|
978 | 978 | |
979 | 979 | $id = $field_type_object->field->args['id']; |
980 | 980 | $title = $field_type_object->field->args['name']; |
981 | 981 | $field_description = $field_type_object->field->args['desc']; |
982 | 982 | |
983 | - echo '<hr>' . $field_description; |
|
983 | + echo '<hr>'.$field_description; |
|
984 | 984 | |
985 | 985 | } |
986 | 986 | |
@@ -995,7 +995,7 @@ discard block |
||
995 | 995 | * |
996 | 996 | * @return void |
997 | 997 | */ |
998 | -function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
998 | +function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) { |
|
999 | 999 | |
1000 | 1000 | $id = $field_type_object->field->args['id']; |
1001 | 1001 | $title = $field_type_object->field->args['name']; |
@@ -1015,25 +1015,25 @@ discard block |
||
1015 | 1015 | * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types |
1016 | 1016 | * @return array An array of options that matches the CMB2 options array |
1017 | 1017 | */ |
1018 | -function give_cmb2_get_post_options( $query_args, $force = false ) { |
|
1018 | +function give_cmb2_get_post_options($query_args, $force = false) { |
|
1019 | 1019 | |
1020 | - $post_options = array( '' => '' ); // Blank option |
|
1020 | + $post_options = array('' => ''); // Blank option |
|
1021 | 1021 | |
1022 | - if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) { |
|
1022 | + if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) { |
|
1023 | 1023 | return $post_options; |
1024 | 1024 | } |
1025 | 1025 | |
1026 | - $args = wp_parse_args( $query_args, array( |
|
1026 | + $args = wp_parse_args($query_args, array( |
|
1027 | 1027 | 'post_type' => 'page', |
1028 | 1028 | 'numberposts' => 10, |
1029 | - ) ); |
|
1029 | + )); |
|
1030 | 1030 | |
1031 | - $posts = get_posts( $args ); |
|
1031 | + $posts = get_posts($args); |
|
1032 | 1032 | |
1033 | - if ( $posts ) { |
|
1034 | - foreach ( $posts as $post ) { |
|
1033 | + if ($posts) { |
|
1034 | + foreach ($posts as $post) { |
|
1035 | 1035 | |
1036 | - $post_options[ $post->ID ] = $post->post_title; |
|
1036 | + $post_options[$post->ID] = $post->post_title; |
|
1037 | 1037 | |
1038 | 1038 | } |
1039 | 1039 | } |
@@ -1050,14 +1050,14 @@ discard block |
||
1050 | 1050 | * @since 1.0 |
1051 | 1051 | */ |
1052 | 1052 | |
1053 | -add_filter( 'cmb2_get_metabox_form_format', 'give_modify_cmb2_form_output', 10, 3 ); |
|
1053 | +add_filter('cmb2_get_metabox_form_format', 'give_modify_cmb2_form_output', 10, 3); |
|
1054 | 1054 | |
1055 | -function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) { |
|
1055 | +function give_modify_cmb2_form_output($form_format, $object_id, $cmb) { |
|
1056 | 1056 | |
1057 | 1057 | //only modify the give settings form |
1058 | - if ( 'give_settings' == $object_id && 'options_page' == $cmb->cmb_id ) { |
|
1058 | + if ('give_settings' == $object_id && 'options_page' == $cmb->cmb_id) { |
|
1059 | 1059 | |
1060 | - return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . __( 'Save Settings', 'give' ) . '" class="button-primary"></div></form>'; |
|
1060 | + return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.__('Save Settings', 'give').'" class="button-primary"></div></form>'; |
|
1061 | 1061 | } |
1062 | 1062 | |
1063 | 1063 | return $form_format; |
@@ -1075,35 +1075,35 @@ discard block |
||
1075 | 1075 | * |
1076 | 1076 | * @return void |
1077 | 1077 | */ |
1078 | -if ( ! function_exists( 'give_license_key_callback' ) ) { |
|
1079 | - function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
1078 | +if ( ! function_exists('give_license_key_callback')) { |
|
1079 | + function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) { |
|
1080 | 1080 | |
1081 | 1081 | $id = $field_type_object->field->args['id']; |
1082 | 1082 | $field_description = $field_type_object->field->args['desc']; |
1083 | - $license_status = get_option( $field_type_object->field->args['options']['is_valid_license_option'] ); |
|
1083 | + $license_status = get_option($field_type_object->field->args['options']['is_valid_license_option']); |
|
1084 | 1084 | $field_classes = 'regular-text give-license-field'; |
1085 | - $type = empty( $escaped_value ) ? 'text' : 'password'; |
|
1085 | + $type = empty($escaped_value) ? 'text' : 'password'; |
|
1086 | 1086 | |
1087 | - if ( $license_status === 'valid' ) { |
|
1087 | + if ($license_status === 'valid') { |
|
1088 | 1088 | $field_classes .= ' give-license-active'; |
1089 | 1089 | } |
1090 | 1090 | |
1091 | - $html = $field_type_object->input( array( |
|
1091 | + $html = $field_type_object->input(array( |
|
1092 | 1092 | 'class' => $field_classes, |
1093 | 1093 | 'type' => $type |
1094 | - ) ); |
|
1094 | + )); |
|
1095 | 1095 | |
1096 | 1096 | //License is active so show deactivate button |
1097 | - if ( $license_status === 'valid' ) { |
|
1098 | - $html .= '<input type="submit" class="button-secondary give-license-deactivate" name="' . $id . '_deactivate" value="' . __( 'Deactivate License', 'give' ) . '"/>'; |
|
1097 | + if ($license_status === 'valid') { |
|
1098 | + $html .= '<input type="submit" class="button-secondary give-license-deactivate" name="'.$id.'_deactivate" value="'.__('Deactivate License', 'give').'"/>'; |
|
1099 | 1099 | } else { |
1100 | 1100 | //This license is not valid so delete it |
1101 | - give_delete_option( $id ); |
|
1101 | + give_delete_option($id); |
|
1102 | 1102 | } |
1103 | 1103 | |
1104 | - $html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>'; |
|
1104 | + $html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>'; |
|
1105 | 1105 | |
1106 | - wp_nonce_field( $id . '-nonce', $id . '-nonce' ); |
|
1106 | + wp_nonce_field($id.'-nonce', $id.'-nonce'); |
|
1107 | 1107 | |
1108 | 1108 | echo $html; |
1109 | 1109 | } |
@@ -1118,13 +1118,13 @@ discard block |
||
1118 | 1118 | */ |
1119 | 1119 | function give_api_callback() { |
1120 | 1120 | |
1121 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
1121 | + if ( ! current_user_can('manage_give_settings')) { |
|
1122 | 1122 | return; |
1123 | 1123 | } |
1124 | 1124 | |
1125 | - do_action( 'give_tools_api_keys_before' ); |
|
1125 | + do_action('give_tools_api_keys_before'); |
|
1126 | 1126 | |
1127 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php'; |
|
1127 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php'; |
|
1128 | 1128 | |
1129 | 1129 | $api_keys_table = new Give_API_Keys_Table(); |
1130 | 1130 | $api_keys_table->prepare_items(); |
@@ -1132,7 +1132,7 @@ discard block |
||
1132 | 1132 | ?> |
1133 | 1133 | <p> |
1134 | 1134 | <?php printf( |
1135 | - __( 'API keys allow users to use the <a href="%s">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%s">Zapier</a>.', 'give' ), |
|
1135 | + __('API keys allow users to use the <a href="%s">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%s">Zapier</a>.', 'give'), |
|
1136 | 1136 | 'https://givewp.com/documentation/give-api-reference/', |
1137 | 1137 | 'https://givewp.com/addons/zapier/' |
1138 | 1138 | ); ?> |
@@ -1145,10 +1145,10 @@ discard block |
||
1145 | 1145 | </style> |
1146 | 1146 | <?php |
1147 | 1147 | |
1148 | - do_action( 'give_tools_api_keys_after' ); |
|
1148 | + do_action('give_tools_api_keys_after'); |
|
1149 | 1149 | } |
1150 | 1150 | |
1151 | -add_action( 'give_settings_tab_api_keys', 'give_api_callback' ); |
|
1151 | +add_action('give_settings_tab_api_keys', 'give_api_callback'); |
|
1152 | 1152 | |
1153 | 1153 | /** |
1154 | 1154 | * Hook Callback |
@@ -1161,8 +1161,8 @@ discard block |
||
1161 | 1161 | * |
1162 | 1162 | * @return void |
1163 | 1163 | */ |
1164 | -function give_hook_callback( $args ) { |
|
1165 | - do_action( 'give_' . $args['id'] ); |
|
1164 | +function give_hook_callback($args) { |
|
1165 | + do_action('give_'.$args['id']); |
|
1166 | 1166 | } |
1167 | 1167 | |
1168 | 1168 | /** |
@@ -1172,10 +1172,10 @@ discard block |
||
1172 | 1172 | * |
1173 | 1173 | */ |
1174 | 1174 | |
1175 | -if ( file_exists( WP_PLUGIN_DIR . '/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) { |
|
1176 | - require_once WP_PLUGIN_DIR . '/cmb2/init.php'; |
|
1177 | -} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) { |
|
1178 | - require_once GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php'; |
|
1179 | -} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) { |
|
1180 | - require_once GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php'; |
|
1175 | +if (file_exists(WP_PLUGIN_DIR.'/cmb2/init.php') && ! defined('CMB2_LOADED')) { |
|
1176 | + require_once WP_PLUGIN_DIR.'/cmb2/init.php'; |
|
1177 | +} elseif (file_exists(GIVE_PLUGIN_DIR.'/includes/libraries/cmb2/init.php') && ! defined('CMB2_LOADED')) { |
|
1178 | + require_once GIVE_PLUGIN_DIR.'/includes/libraries/cmb2/init.php'; |
|
1179 | +} elseif (file_exists(GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php') && ! defined('CMB2_LOADED')) { |
|
1180 | + require_once GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php'; |
|
1181 | 1181 | } |
1182 | 1182 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -23,56 +23,56 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @return string $purchase_form |
25 | 25 | */ |
26 | -function give_get_donation_form( $args = array() ) { |
|
26 | +function give_get_donation_form($args = array()) { |
|
27 | 27 | |
28 | 28 | global $post; |
29 | 29 | |
30 | - $post_id = is_object( $post ) ? $post->ID : 0; |
|
30 | + $post_id = is_object($post) ? $post->ID : 0; |
|
31 | 31 | |
32 | - if ( isset( $args['id'] ) ) { |
|
32 | + if (isset($args['id'])) { |
|
33 | 33 | $post_id = $args['id']; |
34 | 34 | } |
35 | 35 | |
36 | - $defaults = apply_filters( 'give_form_args_defaults', array( |
|
36 | + $defaults = apply_filters('give_form_args_defaults', array( |
|
37 | 37 | 'form_id' => $post_id |
38 | - ) ); |
|
38 | + )); |
|
39 | 39 | |
40 | - $args = wp_parse_args( $args, $defaults ); |
|
40 | + $args = wp_parse_args($args, $defaults); |
|
41 | 41 | |
42 | - $form = new Give_Donate_Form( $args['form_id'] ); |
|
42 | + $form = new Give_Donate_Form($args['form_id']); |
|
43 | 43 | |
44 | 44 | //bail if no form ID |
45 | - if ( empty( $form->ID ) ) { |
|
45 | + if (empty($form->ID)) { |
|
46 | 46 | return false; |
47 | 47 | } |
48 | 48 | |
49 | - $payment_mode = give_get_chosen_gateway( $form->ID ); |
|
49 | + $payment_mode = give_get_chosen_gateway($form->ID); |
|
50 | 50 | |
51 | - $form_action = esc_url( add_query_arg( apply_filters( 'give_form_action_args', array( |
|
51 | + $form_action = esc_url(add_query_arg(apply_filters('give_form_action_args', array( |
|
52 | 52 | 'payment-mode' => $payment_mode, |
53 | - ) ), |
|
53 | + )), |
|
54 | 54 | give_get_current_page_url() |
55 | - ) ); |
|
55 | + )); |
|
56 | 56 | |
57 | - if ( 'publish' !== $form->post_status && ! current_user_can( 'edit_product', $form->ID ) ) { |
|
57 | + if ('publish' !== $form->post_status && ! current_user_can('edit_product', $form->ID)) { |
|
58 | 58 | return false; // Product not published or user doesn't have permission to view drafts |
59 | 59 | } |
60 | 60 | |
61 | - $display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) ) |
|
61 | + $display_option = (isset($args['display_style']) && ! empty($args['display_style'])) |
|
62 | 62 | ? $args['display_style'] |
63 | - : get_post_meta( $form->ID, '_give_payment_display', true ); |
|
63 | + : get_post_meta($form->ID, '_give_payment_display', true); |
|
64 | 64 | |
65 | - $float_labels_option = give_is_float_labels_enabled( $args ) |
|
65 | + $float_labels_option = give_is_float_labels_enabled($args) |
|
66 | 66 | ? ' float-labels-enabled' |
67 | 67 | : ''; |
68 | 68 | |
69 | 69 | |
70 | - $form_classes_array = apply_filters( 'give_form_classes', array( |
|
70 | + $form_classes_array = apply_filters('give_form_classes', array( |
|
71 | 71 | 'give-form-wrap', |
72 | - 'give-display-' . $display_option |
|
73 | - ), $form->ID, $args ); |
|
72 | + 'give-display-'.$display_option |
|
73 | + ), $form->ID, $args); |
|
74 | 74 | |
75 | - $form_classes = implode( ' ', $form_classes_array ); |
|
75 | + $form_classes = implode(' ', $form_classes_array); |
|
76 | 76 | |
77 | 77 | ob_start(); |
78 | 78 | |
@@ -84,34 +84,34 @@ discard block |
||
84 | 84 | * @param int $form ->ID The current form ID |
85 | 85 | * @param array $args An array of form args |
86 | 86 | */ |
87 | - do_action( 'give_pre_form_output', $form->ID, $args ); ?> |
|
87 | + do_action('give_pre_form_output', $form->ID, $args); ?> |
|
88 | 88 | |
89 | 89 | <div id="give-form-<?php echo $form->ID; ?>-wrap" class="<?php echo $form_classes; ?>"> |
90 | 90 | |
91 | 91 | <?php |
92 | - if ( isset( $args['show_title'] ) && $args['show_title'] == true ) { |
|
92 | + if (isset($args['show_title']) && $args['show_title'] == true) { |
|
93 | 93 | |
94 | - echo apply_filters( 'give_form_title', '<h2 class="give-form-title">' . get_the_title( $post_id ) . '</h2>' ); |
|
94 | + echo apply_filters('give_form_title', '<h2 class="give-form-title">'.get_the_title($post_id).'</h2>'); |
|
95 | 95 | |
96 | 96 | } ?> |
97 | 97 | |
98 | - <?php do_action( 'give_pre_form', $form->ID, $args ); ?> |
|
98 | + <?php do_action('give_pre_form', $form->ID, $args); ?> |
|
99 | 99 | |
100 | - <form id="give-form-<?php echo $post_id; ?>" class="give-form give-form-<?php echo absint( $form->ID ); ?><?php echo $float_labels_option; ?>" action="<?php echo $form_action; ?>" method="post"> |
|
100 | + <form id="give-form-<?php echo $post_id; ?>" class="give-form give-form-<?php echo absint($form->ID); ?><?php echo $float_labels_option; ?>" action="<?php echo $form_action; ?>" method="post"> |
|
101 | 101 | <input type="hidden" name="give-form-id" value="<?php echo $form->ID; ?>"/> |
102 | - <input type="hidden" name="give-form-title" value="<?php echo htmlentities( $form->post_title ); ?>"/> |
|
103 | - <input type="hidden" name="give-current-url" value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/> |
|
104 | - <input type="hidden" name="give-form-url" value="<?php echo htmlspecialchars( give_get_current_page_url() ); ?>"/> |
|
105 | - <input type="hidden" name="give-form-minimum" value="<?php echo give_get_form_minimum_price( $form->ID ); ?>"/> |
|
102 | + <input type="hidden" name="give-form-title" value="<?php echo htmlentities($form->post_title); ?>"/> |
|
103 | + <input type="hidden" name="give-current-url" value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/> |
|
104 | + <input type="hidden" name="give-form-url" value="<?php echo htmlspecialchars(give_get_current_page_url()); ?>"/> |
|
105 | + <input type="hidden" name="give-form-minimum" value="<?php echo give_get_form_minimum_price($form->ID); ?>"/> |
|
106 | 106 | <?php |
107 | 107 | //Price ID hidden field for variable (mult-level) donation forms |
108 | - if ( give_has_variable_prices( $post_id ) ) { |
|
108 | + if (give_has_variable_prices($post_id)) { |
|
109 | 109 | //get default selected price ID |
110 | - $prices = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $post_id ), $post_id ); |
|
110 | + $prices = apply_filters('give_form_variable_prices', give_get_variable_prices($post_id), $post_id); |
|
111 | 111 | $price_id = 0; |
112 | 112 | //loop through prices |
113 | - foreach ( $prices as $price ) { |
|
114 | - if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) { |
|
113 | + foreach ($prices as $price) { |
|
114 | + if (isset($price['_give_default']) && $price['_give_default'] === 'default') { |
|
115 | 115 | $price_id = $price['_give_id']['level_id']; |
116 | 116 | }; |
117 | 117 | } |
@@ -119,19 +119,19 @@ discard block |
||
119 | 119 | <input type="hidden" name="give-price-id" value="<?php echo $price_id; ?>"/> |
120 | 120 | <?php } |
121 | 121 | |
122 | - do_action( 'give_checkout_form_top', $form->ID, $args ); |
|
122 | + do_action('give_checkout_form_top', $form->ID, $args); |
|
123 | 123 | |
124 | - do_action( 'give_payment_mode_select', $form->ID, $args ); |
|
124 | + do_action('give_payment_mode_select', $form->ID, $args); |
|
125 | 125 | |
126 | - do_action( 'give_checkout_form_bottom', $form->ID, $args ); |
|
126 | + do_action('give_checkout_form_bottom', $form->ID, $args); |
|
127 | 127 | |
128 | 128 | ?> |
129 | 129 | |
130 | 130 | </form> |
131 | 131 | |
132 | - <?php do_action( 'give_post_form', $form->ID, $args ); ?> |
|
132 | + <?php do_action('give_post_form', $form->ID, $args); ?> |
|
133 | 133 | |
134 | - <!--end #give-form-<?php echo absint( $form->ID ); ?>--></div> |
|
134 | + <!--end #give-form-<?php echo absint($form->ID); ?>--></div> |
|
135 | 135 | <?php |
136 | 136 | |
137 | 137 | /** |
@@ -142,11 +142,11 @@ discard block |
||
142 | 142 | * @param int $form ->ID The current form ID |
143 | 143 | * @param array $args An array of form args |
144 | 144 | */ |
145 | - do_action( 'give_post_form_output', $form->ID, $args ); |
|
145 | + do_action('give_post_form_output', $form->ID, $args); |
|
146 | 146 | |
147 | 147 | $final_output = ob_get_clean(); |
148 | 148 | |
149 | - echo apply_filters( 'give_donate_form', $final_output, $args ); |
|
149 | + echo apply_filters('give_donate_form', $final_output, $args); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | |
@@ -166,57 +166,57 @@ discard block |
||
166 | 166 | * @global $give_options Array of all the Give options |
167 | 167 | * @return string |
168 | 168 | */ |
169 | -function give_show_purchase_form( $form_id ) { |
|
169 | +function give_show_purchase_form($form_id) { |
|
170 | 170 | |
171 | - $payment_mode = give_get_chosen_gateway( $form_id ); |
|
171 | + $payment_mode = give_get_chosen_gateway($form_id); |
|
172 | 172 | |
173 | - if ( ! isset( $form_id ) && isset( $_POST['give_form_id'] ) ) { |
|
173 | + if ( ! isset($form_id) && isset($_POST['give_form_id'])) { |
|
174 | 174 | $form_id = $_POST['give_form_id']; |
175 | 175 | } |
176 | 176 | |
177 | - do_action( 'give_purchase_form_top', $form_id ); |
|
177 | + do_action('give_purchase_form_top', $form_id); |
|
178 | 178 | |
179 | - if ( give_can_checkout() && isset( $form_id ) ) { |
|
179 | + if (give_can_checkout() && isset($form_id)) { |
|
180 | 180 | |
181 | - do_action( 'give_purchase_form_before_register_login', $form_id ); |
|
181 | + do_action('give_purchase_form_before_register_login', $form_id); |
|
182 | 182 | |
183 | - $show_register_form = apply_filters( 'give_show_register_form', get_post_meta( $form_id, '_give_show_register_form', true ) ); |
|
183 | + $show_register_form = apply_filters('give_show_register_form', get_post_meta($form_id, '_give_show_register_form', true)); |
|
184 | 184 | |
185 | - if ( ( $show_register_form === 'registration' || ( $show_register_form === 'both' && ! isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) : ?> |
|
185 | + if (($show_register_form === 'registration' || ($show_register_form === 'both' && ! isset($_GET['login']))) && ! is_user_logged_in()) : ?> |
|
186 | 186 | <div id="give-checkout-login-register-<?php echo $form_id; ?>"> |
187 | - <?php do_action( 'give_purchase_form_register_fields', $form_id ); ?> |
|
187 | + <?php do_action('give_purchase_form_register_fields', $form_id); ?> |
|
188 | 188 | </div> |
189 | - <?php elseif ( ( $show_register_form === 'login' || ( $show_register_form === 'both' && isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) : ?> |
|
189 | + <?php elseif (($show_register_form === 'login' || ($show_register_form === 'both' && isset($_GET['login']))) && ! is_user_logged_in()) : ?> |
|
190 | 190 | <div id="give-checkout-login-register-<?php echo $form_id; ?>"> |
191 | - <?php do_action( 'give_purchase_form_login_fields', $form_id ); ?> |
|
191 | + <?php do_action('give_purchase_form_login_fields', $form_id); ?> |
|
192 | 192 | </div> |
193 | 193 | <?php endif; ?> |
194 | 194 | |
195 | - <?php if ( ( ! isset( $_GET['login'] ) && is_user_logged_in() ) || ! isset( $show_register_form ) || 'none' === $show_register_form || 'login' === $show_register_form ) { |
|
196 | - do_action( 'give_purchase_form_after_user_info', $form_id ); |
|
195 | + <?php if (( ! isset($_GET['login']) && is_user_logged_in()) || ! isset($show_register_form) || 'none' === $show_register_form || 'login' === $show_register_form) { |
|
196 | + do_action('give_purchase_form_after_user_info', $form_id); |
|
197 | 197 | } |
198 | 198 | |
199 | - do_action( 'give_purchase_form_before_cc_form', $form_id ); |
|
199 | + do_action('give_purchase_form_before_cc_form', $form_id); |
|
200 | 200 | |
201 | 201 | // Load the credit card form and allow gateways to load their own if they wish |
202 | - if ( has_action( 'give_' . $payment_mode . '_cc_form' ) ) { |
|
203 | - do_action( 'give_' . $payment_mode . '_cc_form', $form_id ); |
|
202 | + if (has_action('give_'.$payment_mode.'_cc_form')) { |
|
203 | + do_action('give_'.$payment_mode.'_cc_form', $form_id); |
|
204 | 204 | } else { |
205 | - do_action( 'give_cc_form', $form_id ); |
|
205 | + do_action('give_cc_form', $form_id); |
|
206 | 206 | } |
207 | 207 | |
208 | - do_action( 'give_purchase_form_after_cc_form', $form_id ); |
|
208 | + do_action('give_purchase_form_after_cc_form', $form_id); |
|
209 | 209 | |
210 | 210 | } else { |
211 | 211 | // Can't checkout |
212 | - do_action( 'give_purchase_form_no_access', $form_id ); |
|
212 | + do_action('give_purchase_form_no_access', $form_id); |
|
213 | 213 | |
214 | 214 | } |
215 | 215 | |
216 | - do_action( 'give_purchase_form_bottom', $form_id ); |
|
216 | + do_action('give_purchase_form_bottom', $form_id); |
|
217 | 217 | } |
218 | 218 | |
219 | -add_action( 'give_purchase_form', 'give_show_purchase_form' ); |
|
219 | +add_action('give_purchase_form', 'give_show_purchase_form'); |
|
220 | 220 | |
221 | 221 | /** |
222 | 222 | * Donation Amount Field |
@@ -230,37 +230,37 @@ discard block |
||
230 | 230 | * |
231 | 231 | * @return void |
232 | 232 | */ |
233 | -function give_output_donation_amount_top( $form_id = 0, $args = array() ) { |
|
233 | +function give_output_donation_amount_top($form_id = 0, $args = array()) { |
|
234 | 234 | |
235 | 235 | global $give_options; |
236 | 236 | |
237 | - $variable_pricing = give_has_variable_prices( $form_id ); |
|
238 | - $allow_custom_amount = get_post_meta( $form_id, '_give_custom_amount', true ); |
|
239 | - $currency_position = isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before'; |
|
240 | - $symbol = give_currency_symbol( give_get_currency() ); |
|
241 | - $currency_output = '<span class="give-currency-symbol give-currency-position-' . $currency_position . '">' . $symbol . '</span>'; |
|
242 | - $default_amount = give_format_amount( give_get_default_form_amount( $form_id ) ); |
|
243 | - $custom_amount_text = get_post_meta( $form_id, '_give_custom_amount_text', true ); |
|
237 | + $variable_pricing = give_has_variable_prices($form_id); |
|
238 | + $allow_custom_amount = get_post_meta($form_id, '_give_custom_amount', true); |
|
239 | + $currency_position = isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before'; |
|
240 | + $symbol = give_currency_symbol(give_get_currency()); |
|
241 | + $currency_output = '<span class="give-currency-symbol give-currency-position-'.$currency_position.'">'.$symbol.'</span>'; |
|
242 | + $default_amount = give_format_amount(give_get_default_form_amount($form_id)); |
|
243 | + $custom_amount_text = get_post_meta($form_id, '_give_custom_amount_text', true); |
|
244 | 244 | |
245 | - do_action( 'give_before_donation_levels', $form_id ); |
|
245 | + do_action('give_before_donation_levels', $form_id); |
|
246 | 246 | |
247 | 247 | //Set Price, No Custom Amount Allowed means hidden price field |
248 | - if ( $allow_custom_amount == 'no' ) { |
|
248 | + if ($allow_custom_amount == 'no') { |
|
249 | 249 | ?> |
250 | 250 | |
251 | - <label class="give-hidden" for="give-amount-hidden"><?php echo __( 'Donation Amount:', 'give' ); ?></label> |
|
251 | + <label class="give-hidden" for="give-amount-hidden"><?php echo __('Donation Amount:', 'give'); ?></label> |
|
252 | 252 | <input id="give-amount" class="give-amount-hidden" type="hidden" name="give-amount" |
253 | 253 | value="<?php echo $default_amount; ?>" required> |
254 | 254 | <p class="set-price give-donation-amount form-row-wide"> |
255 | - <?php if ( $currency_position == 'before' ) { |
|
255 | + <?php if ($currency_position == 'before') { |
|
256 | 256 | echo $currency_output; |
257 | 257 | } ?> |
258 | 258 | <span id="give-amount-text" class="give-text-input give-amount-top"><?php echo $default_amount; ?></span> |
259 | - <?php if ( $currency_position == 'after' ) { |
|
259 | + <?php if ($currency_position == 'after') { |
|
260 | 260 | echo $currency_output; |
261 | 261 | } ?> |
262 | 262 | <span class="give-loading-text give-updating-price-loader"> |
263 | - <span class="give-loading-animation"></span> <?php _e( 'Updating Amount...', 'give' ); ?> |
|
263 | + <span class="give-loading-animation"></span> <?php _e('Updating Amount...', 'give'); ?> |
|
264 | 264 | </span> |
265 | 265 | </p> |
266 | 266 | <?php |
@@ -269,35 +269,35 @@ discard block |
||
269 | 269 | ?> |
270 | 270 | <div class="give-total-wrap"> |
271 | 271 | <div class="give-donation-amount form-row-wide"> |
272 | - <?php if ( $currency_position == 'before' ) { |
|
272 | + <?php if ($currency_position == 'before') { |
|
273 | 273 | echo $currency_output; |
274 | 274 | } ?> |
275 | - <label class="give-hidden" for="give-amount"><?php echo __( 'Donation Amount:', 'give' ); ?></label> |
|
275 | + <label class="give-hidden" for="give-amount"><?php echo __('Donation Amount:', 'give'); ?></label> |
|
276 | 276 | <input class="give-text-input give-amount-top" id="give-amount" name="give-amount" type="tel" |
277 | 277 | placeholder="" value="<?php echo $default_amount; ?>" autocomplete="off"> |
278 | - <?php if ( $currency_position == 'after' ) { |
|
278 | + <?php if ($currency_position == 'after') { |
|
279 | 279 | echo $currency_output; |
280 | 280 | } ?> |
281 | 281 | <span class="give-loading-text give-updating-price-loader"> |
282 | - <span class="give-loading-animation"></span> <?php _e( 'Updating Amount...', 'give' ); ?> |
|
282 | + <span class="give-loading-animation"></span> <?php _e('Updating Amount...', 'give'); ?> |
|
283 | 283 | </span> |
284 | 284 | </div> |
285 | 285 | </div> |
286 | 286 | <?php } |
287 | 287 | |
288 | 288 | //Custom Amount Text |
289 | - if ( ! $variable_pricing && $allow_custom_amount == 'yes' ) { ?> |
|
290 | - <p class="give-custom-amount-text"><?php echo ! empty( $custom_amount_text ) ? $custom_amount_text : ''; ?></p> |
|
289 | + if ( ! $variable_pricing && $allow_custom_amount == 'yes') { ?> |
|
290 | + <p class="give-custom-amount-text"><?php echo ! empty($custom_amount_text) ? $custom_amount_text : ''; ?></p> |
|
291 | 291 | <?php } |
292 | 292 | |
293 | 293 | //Output Variable Pricing Levels |
294 | - if ( $variable_pricing ) { |
|
295 | - give_output_levels( $form_id ); |
|
294 | + if ($variable_pricing) { |
|
295 | + give_output_levels($form_id); |
|
296 | 296 | } |
297 | - do_action( 'give_after_donation_levels', $form_id, $args ); |
|
297 | + do_action('give_after_donation_levels', $form_id, $args); |
|
298 | 298 | } |
299 | 299 | |
300 | -add_action( 'give_checkout_form_top', 'give_output_donation_amount_top', 10, 2 ); |
|
300 | +add_action('give_checkout_form_top', 'give_output_donation_amount_top', 10, 2); |
|
301 | 301 | |
302 | 302 | |
303 | 303 | /** |
@@ -309,32 +309,32 @@ discard block |
||
309 | 309 | * |
310 | 310 | * @return string |
311 | 311 | */ |
312 | -function give_output_levels( $form_id ) { |
|
312 | +function give_output_levels($form_id) { |
|
313 | 313 | |
314 | 314 | //Get variable pricing |
315 | - $prices = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id ); |
|
316 | - $display_style = get_post_meta( $form_id, '_give_display_style', true ); |
|
317 | - $custom_amount = get_post_meta( $form_id, '_give_custom_amount', true ); |
|
318 | - $custom_amount_text = get_post_meta( $form_id, '_give_custom_amount_text', true ); |
|
319 | - if ( empty( $custom_amount_text ) ) { |
|
320 | - $custom_amount_text = __( 'Give a Custom Amount', 'give' ); |
|
315 | + $prices = apply_filters('give_form_variable_prices', give_get_variable_prices($form_id), $form_id); |
|
316 | + $display_style = get_post_meta($form_id, '_give_display_style', true); |
|
317 | + $custom_amount = get_post_meta($form_id, '_give_custom_amount', true); |
|
318 | + $custom_amount_text = get_post_meta($form_id, '_give_custom_amount_text', true); |
|
319 | + if (empty($custom_amount_text)) { |
|
320 | + $custom_amount_text = __('Give a Custom Amount', 'give'); |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | $output = ''; |
324 | 324 | $counter = 0; |
325 | 325 | |
326 | - switch ( $display_style ) { |
|
326 | + switch ($display_style) { |
|
327 | 327 | case 'buttons': |
328 | 328 | |
329 | 329 | $output .= '<ul id="give-donation-level-button-wrap" class="give-donation-levels-wrap give-list-inline">'; |
330 | 330 | |
331 | - foreach ( $prices as $price ) { |
|
332 | - $counter ++; |
|
333 | - $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 ); |
|
334 | - $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 ); |
|
331 | + foreach ($prices as $price) { |
|
332 | + $counter++; |
|
333 | + $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); |
|
334 | + $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); |
|
335 | 335 | |
336 | 336 | $output .= '<li>'; |
337 | - $output .= '<button type="button" data-price-id="' . $price['_give_id']['level_id'] . '" class=" ' . $level_classes . '" value="' . give_format_amount( $price['_give_amount'] ) . '">'; |
|
337 | + $output .= '<button type="button" data-price-id="'.$price['_give_id']['level_id'].'" class=" '.$level_classes.'" value="'.give_format_amount($price['_give_amount']).'">'; |
|
338 | 338 | $output .= $level_text; |
339 | 339 | $output .= '</button>'; |
340 | 340 | $output .= '</li>'; |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | } |
343 | 343 | |
344 | 344 | //Custom Amount |
345 | - if ( $custom_amount === 'yes' && ! empty( $custom_amount_text ) ) { |
|
345 | + if ($custom_amount === 'yes' && ! empty($custom_amount_text)) { |
|
346 | 346 | $output .= '<li>'; |
347 | 347 | $output .= '<button type="button" data-price-id="custom" class="give-donation-level-btn give-btn give-btn-level-custom" value="custom">'; |
348 | 348 | $output .= $custom_amount_text; |
@@ -358,23 +358,23 @@ discard block |
||
358 | 358 | |
359 | 359 | $output .= '<ul id="give-donation-level-radio-list" class="give-donation-levels-wrap">'; |
360 | 360 | |
361 | - foreach ( $prices as $price ) { |
|
362 | - $counter ++; |
|
363 | - $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 ); |
|
364 | - $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 ); |
|
361 | + foreach ($prices as $price) { |
|
362 | + $counter++; |
|
363 | + $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); |
|
364 | + $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); |
|
365 | 365 | |
366 | 366 | $output .= '<li>'; |
367 | - $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'] ) . '">'; |
|
368 | - $output .= '<label for="give-radio-level-' . $counter . '">' . $level_text . '</label>'; |
|
367 | + $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']).'">'; |
|
368 | + $output .= '<label for="give-radio-level-'.$counter.'">'.$level_text.'</label>'; |
|
369 | 369 | $output .= '</li>'; |
370 | 370 | |
371 | 371 | } |
372 | 372 | |
373 | 373 | //Custom Amount |
374 | - if ( $custom_amount === 'yes' && ! empty( $custom_amount_text ) ) { |
|
374 | + if ($custom_amount === 'yes' && ! empty($custom_amount_text)) { |
|
375 | 375 | $output .= '<li>'; |
376 | 376 | $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">'; |
377 | - $output .= '<label for="give-radio-level-custom">' . $custom_amount_text . '</label>'; |
|
377 | + $output .= '<label for="give-radio-level-custom">'.$custom_amount_text.'</label>'; |
|
378 | 378 | $output .= '</li>'; |
379 | 379 | } |
380 | 380 | |
@@ -384,23 +384,23 @@ discard block |
||
384 | 384 | |
385 | 385 | case 'dropdown': |
386 | 386 | |
387 | - $output .= '<label for="give-donation-level" class="give-hidden">' . __( 'Choose Your Donation Amount', 'give' ) . ':</label>'; |
|
388 | - $output .= '<select id="give-donation-level-' . $form_id . '" class="give-select give-select-level">'; |
|
387 | + $output .= '<label for="give-donation-level" class="give-hidden">'.__('Choose Your Donation Amount', 'give').':</label>'; |
|
388 | + $output .= '<select id="give-donation-level-'.$form_id.'" class="give-select give-select-level">'; |
|
389 | 389 | |
390 | 390 | //first loop through prices |
391 | - foreach ( $prices as $price ) { |
|
392 | - $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 ); |
|
393 | - $level_classes = apply_filters( 'give_form_level_classes', 'give-donation-level-' . $form_id, $form_id, $price ); |
|
391 | + foreach ($prices as $price) { |
|
392 | + $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); |
|
393 | + $level_classes = apply_filters('give_form_level_classes', 'give-donation-level-'.$form_id, $form_id, $price); |
|
394 | 394 | |
395 | - $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'] ) . '">'; |
|
395 | + $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']).'">'; |
|
396 | 396 | $output .= $level_text; |
397 | 397 | $output .= '</option>'; |
398 | 398 | |
399 | 399 | } |
400 | 400 | |
401 | 401 | //Custom Amount |
402 | - if ( $custom_amount === 'yes' && ! empty( $custom_amount_text ) ) { |
|
403 | - $output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">' . $custom_amount_text . '</option>'; |
|
402 | + if ($custom_amount === 'yes' && ! empty($custom_amount_text)) { |
|
403 | + $output .= '<option data-price-id="custom" class="give-donation-level-custom" value="custom">'.$custom_amount_text.'</option>'; |
|
404 | 404 | } |
405 | 405 | |
406 | 406 | $output .= '</select>'; |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | break; |
409 | 409 | } |
410 | 410 | |
411 | - echo apply_filters( 'give_form_level_output', $output, $form_id ); |
|
411 | + echo apply_filters('give_form_level_output', $output, $form_id); |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | /** |
@@ -420,26 +420,26 @@ discard block |
||
420 | 420 | * @param array $args |
421 | 421 | * |
422 | 422 | */ |
423 | -function give_display_checkout_button( $form_id, $args ) { |
|
423 | +function give_display_checkout_button($form_id, $args) { |
|
424 | 424 | |
425 | - $display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) ) |
|
425 | + $display_option = (isset($args['display_style']) && ! empty($args['display_style'])) |
|
426 | 426 | ? $args['display_style'] |
427 | - : get_post_meta( $form_id, '_give_payment_display', true ); |
|
427 | + : get_post_meta($form_id, '_give_payment_display', true); |
|
428 | 428 | |
429 | 429 | //no btn for onpage |
430 | - if ( $display_option === 'onpage' ) { |
|
430 | + if ($display_option === 'onpage') { |
|
431 | 431 | return; |
432 | 432 | } |
433 | 433 | |
434 | - $display_label_field = get_post_meta( $form_id, '_give_reveal_label', true ); |
|
435 | - $display_label = ( ! empty( $display_label_field ) ? $display_label_field : __( 'Donate Now', 'give' ) ); |
|
434 | + $display_label_field = get_post_meta($form_id, '_give_reveal_label', true); |
|
435 | + $display_label = ( ! empty($display_label_field) ? $display_label_field : __('Donate Now', 'give')); |
|
436 | 436 | |
437 | - $output = '<button type="button" class="give-btn give-btn-' . $display_option . '">' . $display_label . '</button>'; |
|
437 | + $output = '<button type="button" class="give-btn give-btn-'.$display_option.'">'.$display_label.'</button>'; |
|
438 | 438 | |
439 | - echo apply_filters( 'give_display_checkout_button', $output ); |
|
439 | + echo apply_filters('give_display_checkout_button', $output); |
|
440 | 440 | } |
441 | 441 | |
442 | -add_action( 'give_after_donation_levels', 'give_display_checkout_button', 10, 2 ); |
|
442 | +add_action('give_after_donation_levels', 'give_display_checkout_button', 10, 2); |
|
443 | 443 | |
444 | 444 | /** |
445 | 445 | * Shows the User Info fields in the Personal Info box, more fields can be added via the hooks provided. |
@@ -450,71 +450,71 @@ discard block |
||
450 | 450 | * |
451 | 451 | * @return void |
452 | 452 | */ |
453 | -function give_user_info_fields( $form_id ) { |
|
453 | +function give_user_info_fields($form_id) { |
|
454 | 454 | |
455 | - if ( is_user_logged_in() ) : |
|
456 | - $user_data = get_userdata( get_current_user_id() ); |
|
455 | + if (is_user_logged_in()) : |
|
456 | + $user_data = get_userdata(get_current_user_id()); |
|
457 | 457 | endif; |
458 | 458 | |
459 | - do_action( 'give_purchase_form_before_personal_info', $form_id ); |
|
459 | + do_action('give_purchase_form_before_personal_info', $form_id); |
|
460 | 460 | ?> |
461 | 461 | <fieldset id="give_checkout_user_info"> |
462 | - <legend><?php echo apply_filters( 'give_checkout_personal_info_text', __( 'Personal Info', 'give' ) ); ?></legend> |
|
462 | + <legend><?php echo apply_filters('give_checkout_personal_info_text', __('Personal Info', 'give')); ?></legend> |
|
463 | 463 | <p id="give-first-name-wrap" class="form-row form-row-first"> |
464 | 464 | <label class="give-label" for="give-first"> |
465 | - <?php _e( 'First Name', 'give' ); ?> |
|
466 | - <?php if ( give_field_is_required( 'give_first', $form_id ) ) { ?> |
|
465 | + <?php _e('First Name', 'give'); ?> |
|
466 | + <?php if (give_field_is_required('give_first', $form_id)) { ?> |
|
467 | 467 | <span class="give-required-indicator">*</span> |
468 | 468 | <?php } ?> |
469 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'We will use this to personalize your account experience.', 'give' ); ?>"></span> |
|
469 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('We will use this to personalize your account experience.', 'give'); ?>"></span> |
|
470 | 470 | </label> |
471 | - <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 ) ) { |
|
471 | + <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)) { |
|
472 | 472 | echo ' required '; |
473 | 473 | } ?>/> |
474 | 474 | </p> |
475 | 475 | |
476 | 476 | <p id="give-last-name-wrap" class="form-row form-row-last"> |
477 | 477 | <label class="give-label" for="give-last"> |
478 | - <?php _e( 'Last Name', 'give' ); ?> |
|
479 | - <?php if ( give_field_is_required( 'give_last', $form_id ) ) { ?> |
|
478 | + <?php _e('Last Name', 'give'); ?> |
|
479 | + <?php if (give_field_is_required('give_last', $form_id)) { ?> |
|
480 | 480 | <span class="give-required-indicator">*</span> |
481 | 481 | <?php } ?> |
482 | - <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> |
|
482 | + <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> |
|
483 | 483 | </label> |
484 | 484 | |
485 | - <input class="give-input<?php if ( give_field_is_required( 'give_last', $form_id ) ) { |
|
485 | + <input class="give-input<?php if (give_field_is_required('give_last', $form_id)) { |
|
486 | 486 | echo ' required'; |
487 | - } ?>" 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 ) ) { |
|
487 | + } ?>" 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)) { |
|
488 | 488 | echo ' required '; |
489 | 489 | } ?> /> |
490 | 490 | </p> |
491 | 491 | |
492 | - <?php do_action( 'give_purchase_form_before_email', $form_id ); ?> |
|
492 | + <?php do_action('give_purchase_form_before_email', $form_id); ?> |
|
493 | 493 | <p id="give-email-wrap" class="form-row form-row-wide"> |
494 | 494 | <label class="give-label" for="give-email"> |
495 | - <?php _e( 'Email Address', 'give' ); ?> |
|
496 | - <?php if ( give_field_is_required( 'give_email', $form_id ) ) { ?> |
|
495 | + <?php _e('Email Address', 'give'); ?> |
|
496 | + <?php if (give_field_is_required('give_email', $form_id)) { ?> |
|
497 | 497 | <span class="give-required-indicator">*</span> |
498 | 498 | <?php } ?> |
499 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'We will send the purchase receipt to this address.', 'give' ); ?>"></span> |
|
499 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('We will send the purchase receipt to this address.', 'give'); ?>"></span> |
|
500 | 500 | </label> |
501 | 501 | |
502 | - <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 ) ) { |
|
502 | + <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)) { |
|
503 | 503 | echo ' required '; |
504 | 504 | } ?>/> |
505 | 505 | |
506 | 506 | </p> |
507 | - <?php do_action( 'give_purchase_form_after_email', $form_id ); ?> |
|
507 | + <?php do_action('give_purchase_form_after_email', $form_id); ?> |
|
508 | 508 | |
509 | - <?php do_action( 'give_purchase_form_user_info', $form_id ); ?> |
|
509 | + <?php do_action('give_purchase_form_user_info', $form_id); ?> |
|
510 | 510 | </fieldset> |
511 | 511 | <?php |
512 | - do_action( 'give_purchase_form_after_personal_info', $form_id ); |
|
512 | + do_action('give_purchase_form_after_personal_info', $form_id); |
|
513 | 513 | |
514 | 514 | } |
515 | 515 | |
516 | -add_action( 'give_purchase_form_after_user_info', 'give_user_info_fields' ); |
|
517 | -add_action( 'give_register_fields_before', 'give_user_info_fields' ); |
|
516 | +add_action('give_purchase_form_after_user_info', 'give_user_info_fields'); |
|
517 | +add_action('give_register_fields_before', 'give_user_info_fields'); |
|
518 | 518 | |
519 | 519 | /** |
520 | 520 | * Renders the credit card info form. |
@@ -525,73 +525,73 @@ discard block |
||
525 | 525 | * |
526 | 526 | * @return void |
527 | 527 | */ |
528 | -function give_get_cc_form( $form_id ) { |
|
528 | +function give_get_cc_form($form_id) { |
|
529 | 529 | |
530 | 530 | ob_start(); |
531 | 531 | |
532 | - do_action( 'give_before_cc_fields', $form_id ); ?> |
|
532 | + do_action('give_before_cc_fields', $form_id); ?> |
|
533 | 533 | |
534 | 534 | <fieldset id="give_cc_fields-<?php echo $form_id ?>" class="give-do-validate"> |
535 | - <legend><?php echo apply_filters( 'give_credit_card_fieldset_heading', __( 'Credit Card Info', 'give' ) ); ?></legend> |
|
536 | - <?php if ( is_ssl() ) : ?> |
|
535 | + <legend><?php echo apply_filters('give_credit_card_fieldset_heading', __('Credit Card Info', 'give')); ?></legend> |
|
536 | + <?php if (is_ssl()) : ?> |
|
537 | 537 | <div id="give_secure_site_wrapper-<?php echo $form_id ?>"> |
538 | 538 | <span class="give-icon padlock"></span> |
539 | - <span><?php _e( 'This is a secure SSL encrypted payment.', 'give' ); ?></span> |
|
539 | + <span><?php _e('This is a secure SSL encrypted payment.', 'give'); ?></span> |
|
540 | 540 | </div> |
541 | 541 | <?php endif; ?> |
542 | 542 | <p id="give-card-number-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds"> |
543 | 543 | <label for="card_number-<?php echo $form_id ?>" class="give-label"> |
544 | - <?php _e( 'Card Number', 'give' ); ?> |
|
544 | + <?php _e('Card Number', 'give'); ?> |
|
545 | 545 | <span class="give-required-indicator">*</span> |
546 | - <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> |
|
546 | + <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> |
|
547 | 547 | <span class="card-type"></span> |
548 | 548 | </label> |
549 | 549 | |
550 | - <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/> |
|
550 | + <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/> |
|
551 | 551 | </p> |
552 | 552 | |
553 | 553 | <p id="give-card-cvc-wrap-<?php echo $form_id ?>" class="form-row form-row-one-third"> |
554 | 554 | <label for="card_cvc-<?php echo $form_id ?>" class="give-label"> |
555 | - <?php _e( 'CVC', 'give' ); ?> |
|
555 | + <?php _e('CVC', 'give'); ?> |
|
556 | 556 | <span class="give-required-indicator">*</span> |
557 | - <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> |
|
557 | + <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> |
|
558 | 558 | </label> |
559 | 559 | |
560 | - <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/> |
|
560 | + <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/> |
|
561 | 561 | </p> |
562 | 562 | |
563 | 563 | <p id="give-card-name-wrap-<?php echo $form_id ?>" class="form-row form-row-two-thirds"> |
564 | 564 | <label for="card_name-<?php echo $form_id ?>" class="give-label"> |
565 | - <?php _e( 'Name on the Card', 'give' ); ?> |
|
565 | + <?php _e('Name on the Card', 'give'); ?> |
|
566 | 566 | <span class="give-required-indicator">*</span> |
567 | - <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> |
|
567 | + <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> |
|
568 | 568 | </label> |
569 | 569 | |
570 | - <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/> |
|
570 | + <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/> |
|
571 | 571 | </p> |
572 | - <?php do_action( 'give_before_cc_expiration' ); ?> |
|
572 | + <?php do_action('give_before_cc_expiration'); ?> |
|
573 | 573 | <p class="card-expiration form-row form-row-one-third"> |
574 | 574 | <label for="card_expiry-<?php echo $form_id ?>" class="give-label"> |
575 | - <?php _e( 'Expiration', 'give' ); ?> |
|
575 | + <?php _e('Expiration', 'give'); ?> |
|
576 | 576 | <span class="give-required-indicator">*</span> |
577 | - <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> |
|
577 | + <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> |
|
578 | 578 | </label> |
579 | 579 | |
580 | 580 | <input type="hidden" id="card_exp_month-<?php echo $form_id ?>" name="card_exp_month" class="card-expiry-month"/> |
581 | 581 | <input type="hidden" id="card_exp_year-<?php echo $form_id ?>" name="card_exp_year" class="card-expiry-year"/> |
582 | 582 | |
583 | - <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/> |
|
583 | + <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/> |
|
584 | 584 | </p> |
585 | - <?php do_action( 'give_after_cc_expiration', $form_id ); ?> |
|
585 | + <?php do_action('give_after_cc_expiration', $form_id); ?> |
|
586 | 586 | |
587 | 587 | </fieldset> |
588 | 588 | <?php |
589 | - do_action( 'give_after_cc_fields', $form_id ); |
|
589 | + do_action('give_after_cc_fields', $form_id); |
|
590 | 590 | |
591 | 591 | echo ob_get_clean(); |
592 | 592 | } |
593 | 593 | |
594 | -add_action( 'give_cc_form', 'give_get_cc_form' ); |
|
594 | +add_action('give_cc_form', 'give_get_cc_form'); |
|
595 | 595 | |
596 | 596 | /** |
597 | 597 | * Outputs the default credit card address fields |
@@ -602,110 +602,110 @@ discard block |
||
602 | 602 | * |
603 | 603 | * @return void |
604 | 604 | */ |
605 | -function give_default_cc_address_fields( $form_id ) { |
|
605 | +function give_default_cc_address_fields($form_id) { |
|
606 | 606 | |
607 | 607 | $logged_in = is_user_logged_in(); |
608 | 608 | |
609 | - if ( $logged_in ) { |
|
610 | - $user_address = get_user_meta( get_current_user_id(), '_give_user_address', true ); |
|
609 | + if ($logged_in) { |
|
610 | + $user_address = get_user_meta(get_current_user_id(), '_give_user_address', true); |
|
611 | 611 | } |
612 | - $line1 = $logged_in && ! empty( $user_address['line1'] ) ? $user_address['line1'] : ''; |
|
613 | - $line2 = $logged_in && ! empty( $user_address['line2'] ) ? $user_address['line2'] : ''; |
|
614 | - $city = $logged_in && ! empty( $user_address['city'] ) ? $user_address['city'] : ''; |
|
615 | - $zip = $logged_in && ! empty( $user_address['zip'] ) ? $user_address['zip'] : ''; |
|
612 | + $line1 = $logged_in && ! empty($user_address['line1']) ? $user_address['line1'] : ''; |
|
613 | + $line2 = $logged_in && ! empty($user_address['line2']) ? $user_address['line2'] : ''; |
|
614 | + $city = $logged_in && ! empty($user_address['city']) ? $user_address['city'] : ''; |
|
615 | + $zip = $logged_in && ! empty($user_address['zip']) ? $user_address['zip'] : ''; |
|
616 | 616 | ob_start(); ?> |
617 | 617 | <fieldset id="give_cc_address" class="cc-address"> |
618 | - <legend><?php echo apply_filters( 'give_billing_details_fieldset_heading', __( 'Billing Details', 'give' ) ); ?></legend> |
|
619 | - <?php do_action( 'give_cc_billing_top' ); ?> |
|
618 | + <legend><?php echo apply_filters('give_billing_details_fieldset_heading', __('Billing Details', 'give')); ?></legend> |
|
619 | + <?php do_action('give_cc_billing_top'); ?> |
|
620 | 620 | <p id="give-card-address-wrap" class="form-row form-row-two-thirds"> |
621 | 621 | <label for="card_address" class="give-label"> |
622 | - <?php _e( 'Address', 'give' ); ?> |
|
622 | + <?php _e('Address', 'give'); ?> |
|
623 | 623 | <?php |
624 | - if ( give_field_is_required( 'card_address', $form_id ) ) { ?> |
|
624 | + if (give_field_is_required('card_address', $form_id)) { ?> |
|
625 | 625 | <span class="give-required-indicator">*</span> |
626 | 626 | <?php } ?> |
627 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The primary billing address for your credit card.', 'give' ); ?>"></span> |
|
627 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The primary billing address for your credit card.', 'give'); ?>"></span> |
|
628 | 628 | </label> |
629 | 629 | |
630 | - <input type="text" id="card_address" name="card_address" class="card-address give-input<?php if ( give_field_is_required( 'card_address', $form_id ) ) { |
|
630 | + <input type="text" id="card_address" name="card_address" class="card-address give-input<?php if (give_field_is_required('card_address', $form_id)) { |
|
631 | 631 | echo ' required'; |
632 | - } ?>" placeholder="<?php _e( 'Address line 1', 'give' ); ?>" value="<?php echo $line1; ?>"<?php if ( give_field_is_required( 'card_address', $form_id ) ) { |
|
632 | + } ?>" placeholder="<?php _e('Address line 1', 'give'); ?>" value="<?php echo $line1; ?>"<?php if (give_field_is_required('card_address', $form_id)) { |
|
633 | 633 | echo ' required '; |
634 | 634 | } ?>/> |
635 | 635 | </p> |
636 | 636 | |
637 | 637 | <p id="give-card-address-2-wrap" class="form-row form-row-one-third"> |
638 | 638 | <label for="card_address_2" class="give-label"> |
639 | - <?php _e( 'Address Line 2', 'give' ); ?> |
|
640 | - <?php if ( give_field_is_required( 'card_address_2', $form_id ) ) { ?> |
|
639 | + <?php _e('Address Line 2', 'give'); ?> |
|
640 | + <?php if (give_field_is_required('card_address_2', $form_id)) { ?> |
|
641 | 641 | <span class="give-required-indicator">*</span> |
642 | 642 | <?php } ?> |
643 | - <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> |
|
643 | + <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> |
|
644 | 644 | </label> |
645 | 645 | |
646 | - <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 ) ) { |
|
646 | + <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)) { |
|
647 | 647 | echo ' required'; |
648 | - } ?>" placeholder="<?php _e( 'Address line 2', 'give' ); ?>" value="<?php echo $line2; ?>"<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) { |
|
648 | + } ?>" placeholder="<?php _e('Address line 2', 'give'); ?>" value="<?php echo $line2; ?>"<?php if (give_field_is_required('card_address_2', $form_id)) { |
|
649 | 649 | echo ' required '; |
650 | 650 | } ?>/> |
651 | 651 | </p> |
652 | 652 | |
653 | 653 | <p id="give-card-city-wrap" class="form-row form-row-two-thirds"> |
654 | 654 | <label for="card_city" class="give-label"> |
655 | - <?php _e( 'City', 'give' ); ?> |
|
656 | - <?php if ( give_field_is_required( 'card_city', $form_id ) ) { ?> |
|
655 | + <?php _e('City', 'give'); ?> |
|
656 | + <?php if (give_field_is_required('card_city', $form_id)) { ?> |
|
657 | 657 | <span class="give-required-indicator">*</span> |
658 | 658 | <?php } ?> |
659 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The city for your billing address.', 'give' ); ?>"></span> |
|
659 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The city for your billing address.', 'give'); ?>"></span> |
|
660 | 660 | </label> |
661 | - <input type="text" id="card_city" name="card_city" class="card-city give-input<?php if ( give_field_is_required( 'card_city', $form_id ) ) { |
|
661 | + <input type="text" id="card_city" name="card_city" class="card-city give-input<?php if (give_field_is_required('card_city', $form_id)) { |
|
662 | 662 | echo ' required'; |
663 | - } ?>" placeholder="<?php _e( 'City', 'give' ); ?>" value="<?php echo $city; ?>"<?php if ( give_field_is_required( 'card_city', $form_id ) ) { |
|
663 | + } ?>" placeholder="<?php _e('City', 'give'); ?>" value="<?php echo $city; ?>"<?php if (give_field_is_required('card_city', $form_id)) { |
|
664 | 664 | echo ' required '; |
665 | 665 | } ?>/> |
666 | 666 | </p> |
667 | 667 | |
668 | 668 | <p id="give-card-zip-wrap" class="form-row form-row-one-third"> |
669 | 669 | <label for="card_zip" class="give-label"> |
670 | - <?php _e( 'Zip / Postal Code', 'give' ); ?> |
|
671 | - <?php if ( give_field_is_required( 'card_zip', $form_id ) ) { ?> |
|
670 | + <?php _e('Zip / Postal Code', 'give'); ?> |
|
671 | + <?php if (give_field_is_required('card_zip', $form_id)) { ?> |
|
672 | 672 | <span class="give-required-indicator">*</span> |
673 | 673 | <?php } ?> |
674 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The zip or postal code for your billing address.', 'give' ); ?>"></span> |
|
674 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The zip or postal code for your billing address.', 'give'); ?>"></span> |
|
675 | 675 | </label> |
676 | 676 | |
677 | - <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 ) ) { |
|
677 | + <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)) { |
|
678 | 678 | echo ' required'; |
679 | - } ?>" placeholder="<?php _e( 'Zip / Postal code', 'give' ); ?>" value="<?php echo $zip; ?>" <?php if ( give_field_is_required( 'card_zip', $form_id ) ) { |
|
679 | + } ?>" placeholder="<?php _e('Zip / Postal code', 'give'); ?>" value="<?php echo $zip; ?>" <?php if (give_field_is_required('card_zip', $form_id)) { |
|
680 | 680 | echo ' required '; |
681 | 681 | } ?>/> |
682 | 682 | </p> |
683 | 683 | |
684 | 684 | <p id="give-card-country-wrap" class="form-row form-row-first"> |
685 | 685 | <label for="billing_country" class="give-label"> |
686 | - <?php _e( 'Country', 'give' ); ?> |
|
687 | - <?php if ( give_field_is_required( 'billing_country', $form_id ) ) { ?> |
|
686 | + <?php _e('Country', 'give'); ?> |
|
687 | + <?php if (give_field_is_required('billing_country', $form_id)) { ?> |
|
688 | 688 | <span class="give-required-indicator">*</span> |
689 | 689 | <?php } ?> |
690 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The country for your billing address.', 'give' ); ?>"></span> |
|
690 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The country for your billing address.', 'give'); ?>"></span> |
|
691 | 691 | </label> |
692 | 692 | |
693 | - <select name="billing_country" id="billing_country" class="billing-country billing_country give-select<?php if ( give_field_is_required( 'billing_country', $form_id ) ) { |
|
693 | + <select name="billing_country" id="billing_country" class="billing-country billing_country give-select<?php if (give_field_is_required('billing_country', $form_id)) { |
|
694 | 694 | echo ' required'; |
695 | - } ?>"<?php if ( give_field_is_required( 'billing_country', $form_id ) ) { |
|
695 | + } ?>"<?php if (give_field_is_required('billing_country', $form_id)) { |
|
696 | 696 | echo ' required '; |
697 | 697 | } ?>> |
698 | 698 | <?php |
699 | 699 | |
700 | 700 | $selected_country = give_get_country(); |
701 | 701 | |
702 | - if ( $logged_in && ! empty( $user_address['country'] ) && '*' !== $user_address['country'] ) { |
|
702 | + if ($logged_in && ! empty($user_address['country']) && '*' !== $user_address['country']) { |
|
703 | 703 | $selected_country = $user_address['country']; |
704 | 704 | } |
705 | 705 | |
706 | 706 | $countries = give_get_country_list(); |
707 | - foreach ( $countries as $country_code => $country ) { |
|
708 | - echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>'; |
|
707 | + foreach ($countries as $country_code => $country) { |
|
708 | + echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>'; |
|
709 | 709 | } |
710 | 710 | ?> |
711 | 711 | </select> |
@@ -713,44 +713,44 @@ discard block |
||
713 | 713 | |
714 | 714 | <p id="give-card-state-wrap" class="form-row form-row-last"> |
715 | 715 | <label for="card_state" class="give-label"> |
716 | - <?php _e( 'State / Province', 'give' ); ?> |
|
717 | - <?php if ( give_field_is_required( 'card_state', $form_id ) ) { ?> |
|
716 | + <?php _e('State / Province', 'give'); ?> |
|
717 | + <?php if (give_field_is_required('card_state', $form_id)) { ?> |
|
718 | 718 | <span class="give-required-indicator">*</span> |
719 | 719 | <?php } ?> |
720 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The state or province for your billing address.', 'give' ); ?>"></span> |
|
720 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The state or province for your billing address.', 'give'); ?>"></span> |
|
721 | 721 | </label> |
722 | 722 | |
723 | 723 | <?php |
724 | 724 | $selected_state = give_get_state(); |
725 | - $states = give_get_states( $selected_country ); |
|
725 | + $states = give_get_states($selected_country); |
|
726 | 726 | |
727 | - if ( $logged_in && ! empty( $user_address['state'] ) ) { |
|
727 | + if ($logged_in && ! empty($user_address['state'])) { |
|
728 | 728 | $selected_state = $user_address['state']; |
729 | 729 | } |
730 | 730 | |
731 | - if ( ! empty( $states ) ) : ?> |
|
732 | - <select name="card_state" id="card_state" class="card_state give-select<?php if ( give_field_is_required( 'card_state', $form_id ) ) { |
|
731 | + if ( ! empty($states)) : ?> |
|
732 | + <select name="card_state" id="card_state" class="card_state give-select<?php if (give_field_is_required('card_state', $form_id)) { |
|
733 | 733 | echo ' required'; |
734 | - } ?>"<?php if ( give_field_is_required( 'card_state', $form_id ) ) { |
|
734 | + } ?>"<?php if (give_field_is_required('card_state', $form_id)) { |
|
735 | 735 | echo ' required '; |
736 | 736 | } ?>> |
737 | 737 | <?php |
738 | - foreach ( $states as $state_code => $state ) { |
|
739 | - echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>'; |
|
738 | + foreach ($states as $state_code => $state) { |
|
739 | + echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>'; |
|
740 | 740 | } |
741 | 741 | ?> |
742 | 742 | </select> |
743 | 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' ); ?>"/> |
|
744 | + <input type="text" size="6" name="card_state" id="card_state" class="card_state give-input" placeholder="<?php _e('State / Province', 'give'); ?>"/> |
|
745 | 745 | <?php endif; ?> |
746 | 746 | </p> |
747 | - <?php do_action( 'give_cc_billing_bottom' ); ?> |
|
747 | + <?php do_action('give_cc_billing_bottom'); ?> |
|
748 | 748 | </fieldset> |
749 | 749 | <?php |
750 | 750 | echo ob_get_clean(); |
751 | 751 | } |
752 | 752 | |
753 | -add_action( 'give_after_cc_fields', 'give_default_cc_address_fields' ); |
|
753 | +add_action('give_after_cc_fields', 'give_default_cc_address_fields'); |
|
754 | 754 | |
755 | 755 | |
756 | 756 | /** |
@@ -762,94 +762,94 @@ discard block |
||
762 | 762 | * |
763 | 763 | * @return string |
764 | 764 | */ |
765 | -function give_get_register_fields( $form_id ) { |
|
765 | +function give_get_register_fields($form_id) { |
|
766 | 766 | |
767 | 767 | global $give_options; |
768 | 768 | global $user_ID; |
769 | 769 | |
770 | - if ( is_user_logged_in() ) { |
|
771 | - $user_data = get_userdata( $user_ID ); |
|
770 | + if (is_user_logged_in()) { |
|
771 | + $user_data = get_userdata($user_ID); |
|
772 | 772 | } |
773 | 773 | |
774 | - $show_register_form = apply_filters( 'give_show_register_form', get_post_meta( $form_id, '_give_show_register_form', true ) ); |
|
774 | + $show_register_form = apply_filters('give_show_register_form', get_post_meta($form_id, '_give_show_register_form', true)); |
|
775 | 775 | |
776 | 776 | ob_start(); ?> |
777 | 777 | <fieldset id="give-register-fields-<?php echo $form_id; ?>"> |
778 | 778 | |
779 | - <?php if ( $show_register_form == 'both' ) { ?> |
|
779 | + <?php if ($show_register_form == 'both') { ?> |
|
780 | 780 | <div class="give-login-account-wrap"> |
781 | - <p class="give-login-message"><?php _e( 'Already have an account?', 'give' ); ?> |
|
782 | - <a href="<?php echo esc_url( add_query_arg( 'login', 1 ) ); ?>" class="give-checkout-register-login" data-action="give_checkout_login"><?php _e( 'Login', 'give' ); ?></a> |
|
781 | + <p class="give-login-message"><?php _e('Already have an account?', 'give'); ?> |
|
782 | + <a href="<?php echo esc_url(add_query_arg('login', 1)); ?>" class="give-checkout-register-login" data-action="give_checkout_login"><?php _e('Login', 'give'); ?></a> |
|
783 | 783 | </p> |
784 | 784 | <p class="give-loading-text"> |
785 | - <span class="give-loading-animation"></span> <?php _e( 'Loading...', 'give' ); ?></p> |
|
785 | + <span class="give-loading-animation"></span> <?php _e('Loading...', 'give'); ?></p> |
|
786 | 786 | </div> |
787 | 787 | <?php } ?> |
788 | 788 | |
789 | - <?php do_action( 'give_register_fields_before' ); ?> |
|
789 | + <?php do_action('give_register_fields_before'); ?> |
|
790 | 790 | |
791 | 791 | <fieldset id="give-register-account-fields-<?php echo $form_id; ?>"> |
792 | - <legend><?php echo apply_filters( 'give_create_account_fieldset_heading', __( 'Create an account', 'give' ) ); |
|
793 | - if ( ! give_no_guest_checkout( $form_id ) ) { |
|
794 | - echo ' <span class="sub-text">' . __( '(optional)', 'give' ) . '</span>'; |
|
792 | + <legend><?php echo apply_filters('give_create_account_fieldset_heading', __('Create an account', 'give')); |
|
793 | + if ( ! give_no_guest_checkout($form_id)) { |
|
794 | + echo ' <span class="sub-text">'.__('(optional)', 'give').'</span>'; |
|
795 | 795 | } ?></legend> |
796 | - <?php do_action( 'give_register_account_fields_before' ); ?> |
|
796 | + <?php do_action('give_register_account_fields_before'); ?> |
|
797 | 797 | <p id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-one-third form-row-first"> |
798 | 798 | <label for="give-user-login-<?php echo $form_id; ?>"> |
799 | - <?php _e( 'Username', 'give' ); ?> |
|
800 | - <?php if ( give_no_guest_checkout( $form_id ) ) { ?> |
|
799 | + <?php _e('Username', 'give'); ?> |
|
800 | + <?php if (give_no_guest_checkout($form_id)) { ?> |
|
801 | 801 | <span class="give-required-indicator">*</span> |
802 | 802 | <?php } ?> |
803 | - <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> |
|
803 | + <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> |
|
804 | 804 | </label> |
805 | 805 | |
806 | - <input name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" class="<?php if ( give_no_guest_checkout( $form_id ) ) { |
|
806 | + <input name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" class="<?php if (give_no_guest_checkout($form_id)) { |
|
807 | 807 | echo 'required '; |
808 | - } ?>give-input" type="text" placeholder="<?php _e( 'Username', 'give' ); ?>" title="<?php _e( 'Username', 'give' ); ?>"/> |
|
808 | + } ?>give-input" type="text" placeholder="<?php _e('Username', 'give'); ?>" title="<?php _e('Username', 'give'); ?>"/> |
|
809 | 809 | </p> |
810 | 810 | |
811 | 811 | <p id="give-user-pass-wrap-<?php echo $form_id; ?>" class="form-row form-row-one-third"> |
812 | 812 | <label for="give-user-pass-<?php echo $form_id; ?>"> |
813 | - <?php _e( 'Password', 'give' ); ?> |
|
814 | - <?php if ( give_no_guest_checkout( $form_id ) ) { ?> |
|
813 | + <?php _e('Password', 'give'); ?> |
|
814 | + <?php if (give_no_guest_checkout($form_id)) { ?> |
|
815 | 815 | <span class="give-required-indicator">*</span> |
816 | 816 | <?php } ?> |
817 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'The password used to access your account.', 'give' ); ?>"></span> |
|
817 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('The password used to access your account.', 'give'); ?>"></span> |
|
818 | 818 | </label> |
819 | 819 | |
820 | - <input name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" class="<?php if ( give_no_guest_checkout( $form_id ) ) { |
|
820 | + <input name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" class="<?php if (give_no_guest_checkout($form_id)) { |
|
821 | 821 | echo 'required '; |
822 | - } ?>give-input" placeholder="<?php _e( 'Password', 'give' ); ?>" type="password"/> |
|
822 | + } ?>give-input" placeholder="<?php _e('Password', 'give'); ?>" type="password"/> |
|
823 | 823 | </p> |
824 | 824 | |
825 | 825 | <p id="give-user-pass-confirm-wrap-<?php echo $form_id; ?>" class="give-register-password form-row form-row-one-third"> |
826 | 826 | <label for="give-user-pass-confirm-<?php echo $form_id; ?>"> |
827 | - <?php _e( 'Confirm Password', 'give' ); ?> |
|
828 | - <?php if ( give_no_guest_checkout( $form_id ) ) { ?> |
|
827 | + <?php _e('Confirm Password', 'give'); ?> |
|
828 | + <?php if (give_no_guest_checkout($form_id)) { ?> |
|
829 | 829 | <span class="give-required-indicator">*</span> |
830 | 830 | <?php } ?> |
831 | - <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'Please retype your password to confirm.', 'give' ); ?>"></span> |
|
831 | + <span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('Please retype your password to confirm.', 'give'); ?>"></span> |
|
832 | 832 | </label> |
833 | 833 | |
834 | - <input name="give_user_pass_confirm" id="give-user-pass-confirm-<?php echo $form_id; ?>" class="<?php if ( give_no_guest_checkout( $form_id ) ) { |
|
834 | + <input name="give_user_pass_confirm" id="give-user-pass-confirm-<?php echo $form_id; ?>" class="<?php if (give_no_guest_checkout($form_id)) { |
|
835 | 835 | echo 'required '; |
836 | - } ?>give-input" placeholder="<?php _e( 'Confirm password', 'give' ); ?>" type="password"/> |
|
836 | + } ?>give-input" placeholder="<?php _e('Confirm password', 'give'); ?>" type="password"/> |
|
837 | 837 | </p> |
838 | - <?php do_action( 'give_register_account_fields_after', $form_id ); ?> |
|
838 | + <?php do_action('give_register_account_fields_after', $form_id); ?> |
|
839 | 839 | </fieldset> |
840 | 840 | |
841 | - <?php do_action( 'give_register_fields_after', $form_id ); ?> |
|
841 | + <?php do_action('give_register_fields_after', $form_id); ?> |
|
842 | 842 | |
843 | 843 | <input type="hidden" name="give-purchase-var" value="needs-to-register"/> |
844 | 844 | |
845 | - <?php do_action( 'give_purchase_form_user_info', $form_id ); ?> |
|
845 | + <?php do_action('give_purchase_form_user_info', $form_id); ?> |
|
846 | 846 | |
847 | 847 | </fieldset> |
848 | 848 | <?php |
849 | 849 | echo ob_get_clean(); |
850 | 850 | } |
851 | 851 | |
852 | -add_action( 'give_purchase_form_register_fields', 'give_get_register_fields' ); |
|
852 | +add_action('give_purchase_form_register_fields', 'give_get_register_fields'); |
|
853 | 853 | |
854 | 854 | /** |
855 | 855 | * Gets the login fields for the login form on the checkout. This function hooks |
@@ -862,76 +862,76 @@ discard block |
||
862 | 862 | * |
863 | 863 | * @return string |
864 | 864 | */ |
865 | -function give_get_login_fields( $form_id ) { |
|
865 | +function give_get_login_fields($form_id) { |
|
866 | 866 | |
867 | 867 | global $give_options; |
868 | 868 | |
869 | - $form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : $form_id; |
|
870 | - $show_register_form = apply_filters( 'give_show_register_form', get_post_meta( $form_id, '_give_show_register_form', true ) ); |
|
869 | + $form_id = isset($_POST['form_id']) ? $_POST['form_id'] : $form_id; |
|
870 | + $show_register_form = apply_filters('give_show_register_form', get_post_meta($form_id, '_give_show_register_form', true)); |
|
871 | 871 | |
872 | 872 | ob_start(); |
873 | 873 | ?> |
874 | 874 | <fieldset id="give-login-fields-<?php echo $form_id; ?>"> |
875 | - <legend><?php echo apply_filters( 'give_account_login_fieldset_heading', __( 'Login to Your Account', 'give' ) ); |
|
876 | - if ( ! give_no_guest_checkout( $form_id ) ) { |
|
877 | - echo ' <span class="sub-text">' . __( '(optional)', 'give' ) . '</span>'; |
|
875 | + <legend><?php echo apply_filters('give_account_login_fieldset_heading', __('Login to Your Account', 'give')); |
|
876 | + if ( ! give_no_guest_checkout($form_id)) { |
|
877 | + echo ' <span class="sub-text">'.__('(optional)', 'give').'</span>'; |
|
878 | 878 | } ?> |
879 | 879 | </legend> |
880 | - <?php if ( $show_register_form == 'both' ) { ?> |
|
880 | + <?php if ($show_register_form == 'both') { ?> |
|
881 | 881 | <p class="give-new-account-link"> |
882 | - <?php _e( 'Need to create an account?', 'give' ); ?> |
|
883 | - <a href="<?php echo remove_query_arg( 'login' ); ?>" class="give-checkout-register-login" |
|
882 | + <?php _e('Need to create an account?', 'give'); ?> |
|
883 | + <a href="<?php echo remove_query_arg('login'); ?>" class="give-checkout-register-login" |
|
884 | 884 | data-action="give_checkout_register"> |
885 | - <?php _e( 'Register', 'give' ); |
|
886 | - if ( ! give_no_guest_checkout( $form_id ) ) { |
|
887 | - echo ' ' . __( 'or checkout as a guest.', 'give' ); |
|
885 | + <?php _e('Register', 'give'); |
|
886 | + if ( ! give_no_guest_checkout($form_id)) { |
|
887 | + echo ' '.__('or checkout as a guest.', 'give'); |
|
888 | 888 | } ?> |
889 | 889 | </a> |
890 | 890 | </p> |
891 | 891 | <p class="give-loading-text"> |
892 | - <span class="give-loading-animation"></span> <?php _e( 'Loading...', 'give' ); ?> </p> |
|
892 | + <span class="give-loading-animation"></span> <?php _e('Loading...', 'give'); ?> </p> |
|
893 | 893 | <?php } ?> |
894 | - <?php do_action( 'give_checkout_login_fields_before', $form_id ); ?> |
|
894 | + <?php do_action('give_checkout_login_fields_before', $form_id); ?> |
|
895 | 895 | <p id="give-user-login-wrap-<?php echo $form_id; ?>" class="form-row form-row-first"> |
896 | 896 | <label class="give-label" for="give-user-login-<?php echo $form_id; ?>"> |
897 | - <?php _e( 'Username', 'give' ); ?> |
|
898 | - <?php if ( give_no_guest_checkout( $form_id ) ) { ?> |
|
897 | + <?php _e('Username', 'give'); ?> |
|
898 | + <?php if (give_no_guest_checkout($form_id)) { ?> |
|
899 | 899 | <span class="give-required-indicator">*</span> |
900 | 900 | <?php } ?> |
901 | 901 | </label> |
902 | 902 | |
903 | - <input class="<?php if ( give_no_guest_checkout( $form_id ) ) { |
|
903 | + <input class="<?php if (give_no_guest_checkout($form_id)) { |
|
904 | 904 | echo 'required '; |
905 | - } ?>give-input" type="text" name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value="" placeholder="<?php _e( 'Your username', 'give' ); ?>"/> |
|
905 | + } ?>give-input" type="text" name="give_user_login" id="give-user-login-<?php echo $form_id; ?>" value="" placeholder="<?php _e('Your username', 'give'); ?>"/> |
|
906 | 906 | </p> |
907 | 907 | |
908 | 908 | <p id="give-user-pass-wrap-<?php echo $form_id; ?>" class="give_login_password form-row form-row-last"> |
909 | 909 | <label class="give-label" for="give-user-pass-<?php echo $form_id; ?>"> |
910 | - <?php _e( 'Password', 'give' ); ?> |
|
911 | - <?php if ( give_no_guest_checkout( $form_id ) ) { ?> |
|
910 | + <?php _e('Password', 'give'); ?> |
|
911 | + <?php if (give_no_guest_checkout($form_id)) { ?> |
|
912 | 912 | <span class="give-required-indicator">*</span> |
913 | 913 | <?php } ?> |
914 | 914 | </label> |
915 | - <input class="<?php if ( give_no_guest_checkout( $form_id ) ) { |
|
915 | + <input class="<?php if (give_no_guest_checkout($form_id)) { |
|
916 | 916 | echo 'required '; |
917 | - } ?>give-input" type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" placeholder="<?php _e( 'Your password', 'give' ); ?>"/> |
|
917 | + } ?>give-input" type="password" name="give_user_pass" id="give-user-pass-<?php echo $form_id; ?>" placeholder="<?php _e('Your password', 'give'); ?>"/> |
|
918 | 918 | <input type="hidden" name="give-purchase-var" value="needs-to-login"/> |
919 | 919 | </p> |
920 | 920 | |
921 | 921 | <p id="give-user-login-submit-<?php echo $form_id; ?>" class="give-clearfix"> |
922 | - <input type="submit" class="give-submit give-btn button" name="give_login_submit" value="<?php _e( 'Login', 'give' ); ?>"/> |
|
923 | - <?php if ( $show_register_form !== 'login' ) { ?> |
|
924 | - <input type="button" data-action="give_cancel_login" class="give-cancel-login give-btn button" name="give_login_cancel" value="<?php _e( 'Cancel', 'give' ); ?>"/> |
|
922 | + <input type="submit" class="give-submit give-btn button" name="give_login_submit" value="<?php _e('Login', 'give'); ?>"/> |
|
923 | + <?php if ($show_register_form !== 'login') { ?> |
|
924 | + <input type="button" data-action="give_cancel_login" class="give-cancel-login give-btn button" name="give_login_cancel" value="<?php _e('Cancel', 'give'); ?>"/> |
|
925 | 925 | <?php } ?> |
926 | 926 | <span class="give-loading-animation"></span> |
927 | 927 | </p> |
928 | - <?php do_action( 'give_checkout_login_fields_after' ); ?> |
|
928 | + <?php do_action('give_checkout_login_fields_after'); ?> |
|
929 | 929 | </fieldset><!--end #give-login-fields--> |
930 | 930 | <?php |
931 | 931 | echo ob_get_clean(); |
932 | 932 | } |
933 | 933 | |
934 | -add_action( 'give_purchase_form_login_fields', 'give_get_login_fields', 10, 1 ); |
|
934 | +add_action('give_purchase_form_login_fields', 'give_get_login_fields', 10, 1); |
|
935 | 935 | |
936 | 936 | /** |
937 | 937 | * Payment Mode Select |
@@ -947,49 +947,49 @@ discard block |
||
947 | 947 | * |
948 | 948 | * @return void |
949 | 949 | */ |
950 | -function give_payment_mode_select( $form_id ) { |
|
950 | +function give_payment_mode_select($form_id) { |
|
951 | 951 | |
952 | 952 | $gateways = give_get_enabled_payment_gateways(); |
953 | 953 | |
954 | - do_action( 'give_payment_mode_top', $form_id ); ?> |
|
954 | + do_action('give_payment_mode_top', $form_id); ?> |
|
955 | 955 | |
956 | 956 | <fieldset id="give-payment-mode-select"> |
957 | - <?php do_action( 'give_payment_mode_before_gateways_wrap' ); ?> |
|
957 | + <?php do_action('give_payment_mode_before_gateways_wrap'); ?> |
|
958 | 958 | <div id="give-payment-mode-wrap"> |
959 | - <legend class="give-payment-mode-label"><?php echo apply_filters( 'give_checkout_payment_method_text', __( 'Select Payment Method', 'give' ) ); ?> |
|
960 | - <span class="give-loading-text"><span class="give-loading-animation"></span> <?php _e( 'Loading...', 'give' ); ?></span> |
|
959 | + <legend class="give-payment-mode-label"><?php echo apply_filters('give_checkout_payment_method_text', __('Select Payment Method', 'give')); ?> |
|
960 | + <span class="give-loading-text"><span class="give-loading-animation"></span> <?php _e('Loading...', 'give'); ?></span> |
|
961 | 961 | </legend> |
962 | 962 | <?php |
963 | 963 | |
964 | - do_action( 'give_payment_mode_before_gateways' ) ?> |
|
964 | + do_action('give_payment_mode_before_gateways') ?> |
|
965 | 965 | |
966 | 966 | <ul id="give-gateway-radio-list"> |
967 | - <?php foreach ( $gateways as $gateway_id => $gateway ) : |
|
968 | - $checked = checked( $gateway_id, give_get_default_gateway( $form_id ), false ); |
|
967 | + <?php foreach ($gateways as $gateway_id => $gateway) : |
|
968 | + $checked = checked($gateway_id, give_get_default_gateway($form_id), false); |
|
969 | 969 | $checked_class = $checked ? ' give-gateway-option-selected' : ''; |
970 | - 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 ) . '">'; |
|
971 | - 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'] ); |
|
970 | + 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).'">'; |
|
971 | + 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']); |
|
972 | 972 | echo '</label></li>'; |
973 | 973 | endforeach; ?> |
974 | 974 | </ul> |
975 | - <?php do_action( 'give_payment_mode_after_gateways' ); ?> |
|
975 | + <?php do_action('give_payment_mode_after_gateways'); ?> |
|
976 | 976 | </div> |
977 | - <?php do_action( 'give_payment_mode_after_gateways_wrap' ); ?> |
|
977 | + <?php do_action('give_payment_mode_after_gateways_wrap'); ?> |
|
978 | 978 | </fieldset> |
979 | 979 | |
980 | - <?php do_action( 'give_payment_mode_bottom', $form_id ); ?> |
|
980 | + <?php do_action('give_payment_mode_bottom', $form_id); ?> |
|
981 | 981 | |
982 | 982 | <div id="give_purchase_form_wrap"> |
983 | 983 | |
984 | - <?php do_action( 'give_purchase_form', $form_id ); ?> |
|
984 | + <?php do_action('give_purchase_form', $form_id); ?> |
|
985 | 985 | |
986 | 986 | </div><!-- the checkout fields are loaded into this--> |
987 | 987 | |
988 | - <?php do_action( 'give_purchase_form_wrap_bottom', $form_id ); |
|
988 | + <?php do_action('give_purchase_form_wrap_bottom', $form_id); |
|
989 | 989 | |
990 | 990 | } |
991 | 991 | |
992 | -add_action( 'give_payment_mode_select', 'give_payment_mode_select' ); |
|
992 | +add_action('give_payment_mode_select', 'give_payment_mode_select'); |
|
993 | 993 | |
994 | 994 | |
995 | 995 | /** |
@@ -1004,35 +1004,35 @@ discard block |
||
1004 | 1004 | * |
1005 | 1005 | * @return void |
1006 | 1006 | */ |
1007 | -function give_terms_agreement( $form_id ) { |
|
1007 | +function give_terms_agreement($form_id) { |
|
1008 | 1008 | |
1009 | - $form_option = get_post_meta( $form_id, '_give_terms_option', true ); |
|
1010 | - $label = get_post_meta( $form_id, '_give_agree_label', true ); |
|
1011 | - $terms = get_post_meta( $form_id, '_give_agree_text', true ); |
|
1009 | + $form_option = get_post_meta($form_id, '_give_terms_option', true); |
|
1010 | + $label = get_post_meta($form_id, '_give_agree_label', true); |
|
1011 | + $terms = get_post_meta($form_id, '_give_agree_text', true); |
|
1012 | 1012 | |
1013 | - if ( $form_option === 'yes' && ! empty( $terms ) ) { ?> |
|
1013 | + if ($form_option === 'yes' && ! empty($terms)) { ?> |
|
1014 | 1014 | <fieldset id="give_terms_agreement"> |
1015 | 1015 | <div id="give_terms" style="display:none;"> |
1016 | 1016 | <?php |
1017 | - do_action( 'give_before_terms' ); |
|
1018 | - echo wpautop( stripslashes( $terms ) ); |
|
1019 | - do_action( 'give_after_terms' ); |
|
1017 | + do_action('give_before_terms'); |
|
1018 | + echo wpautop(stripslashes($terms)); |
|
1019 | + do_action('give_after_terms'); |
|
1020 | 1020 | ?> |
1021 | 1021 | </div> |
1022 | 1022 | <div id="give_show_terms"> |
1023 | - <a href="#" class="give_terms_links"><?php _e( 'Show Terms', 'give' ); ?></a> |
|
1024 | - <a href="#" class="give_terms_links" style="display:none;"><?php _e( 'Hide Terms', 'give' ); ?></a> |
|
1023 | + <a href="#" class="give_terms_links"><?php _e('Show Terms', 'give'); ?></a> |
|
1024 | + <a href="#" class="give_terms_links" style="display:none;"><?php _e('Hide Terms', 'give'); ?></a> |
|
1025 | 1025 | </div> |
1026 | 1026 | |
1027 | 1027 | <label |
1028 | - for="give_agree_to_terms"><?php echo ! empty( $label ) ? stripslashes( $label ) : __( 'Agree to Terms?', 'give' ); ?></label> |
|
1028 | + for="give_agree_to_terms"><?php echo ! empty($label) ? stripslashes($label) : __('Agree to Terms?', 'give'); ?></label> |
|
1029 | 1029 | <input name="give_agree_to_terms" class="required" type="checkbox" id="give_agree_to_terms" value="1"/> |
1030 | 1030 | </fieldset> |
1031 | 1031 | <?php |
1032 | 1032 | } |
1033 | 1033 | } |
1034 | 1034 | |
1035 | -add_action( 'give_purchase_form_before_submit', 'give_terms_agreement', 10, 1 ); |
|
1035 | +add_action('give_purchase_form_before_submit', 'give_terms_agreement', 10, 1); |
|
1036 | 1036 | |
1037 | 1037 | /** |
1038 | 1038 | * Checkout Final Total |
@@ -1044,27 +1044,27 @@ discard block |
||
1044 | 1044 | * @since 1.0 |
1045 | 1045 | * @return void |
1046 | 1046 | */ |
1047 | -function give_checkout_final_total( $form_id ) { |
|
1047 | +function give_checkout_final_total($form_id) { |
|
1048 | 1048 | |
1049 | - if ( isset( $_POST['give_total'] ) ) { |
|
1050 | - $total = apply_filters( 'give_donation_total', $_POST['give_total'] ); |
|
1049 | + if (isset($_POST['give_total'])) { |
|
1050 | + $total = apply_filters('give_donation_total', $_POST['give_total']); |
|
1051 | 1051 | } else { |
1052 | 1052 | //default total |
1053 | - $total = give_get_default_form_amount( $form_id ); |
|
1053 | + $total = give_get_default_form_amount($form_id); |
|
1054 | 1054 | } |
1055 | 1055 | //Only proceed if give_total available |
1056 | - if ( empty( $total ) ) { |
|
1056 | + if (empty($total)) { |
|
1057 | 1057 | return; |
1058 | 1058 | } |
1059 | 1059 | ?> |
1060 | 1060 | <p id="give-final-total-wrap" class="form-wrap "> |
1061 | - <span class="give-donation-total-label"><?php echo apply_filters( 'give_donation_total_label', esc_attr__( 'Donation Total:', 'give' ) ); ?></span> |
|
1062 | - <span class="give-final-total-amount" data-total="<?php echo give_format_amount( $total ); ?>"><?php echo give_currency_filter( give_format_amount( $total ) ); ?></span> |
|
1061 | + <span class="give-donation-total-label"><?php echo apply_filters('give_donation_total_label', esc_attr__('Donation Total:', 'give')); ?></span> |
|
1062 | + <span class="give-final-total-amount" data-total="<?php echo give_format_amount($total); ?>"><?php echo give_currency_filter(give_format_amount($total)); ?></span> |
|
1063 | 1063 | </p> |
1064 | 1064 | <?php |
1065 | 1065 | } |
1066 | 1066 | |
1067 | -add_action( 'give_purchase_form_before_submit', 'give_checkout_final_total', 999 ); |
|
1067 | +add_action('give_purchase_form_before_submit', 'give_checkout_final_total', 999); |
|
1068 | 1068 | |
1069 | 1069 | |
1070 | 1070 | /** |
@@ -1076,22 +1076,22 @@ discard block |
||
1076 | 1076 | * |
1077 | 1077 | * @return void |
1078 | 1078 | */ |
1079 | -function give_checkout_submit( $form_id ) { |
|
1079 | +function give_checkout_submit($form_id) { |
|
1080 | 1080 | ?> |
1081 | 1081 | <fieldset id="give_purchase_submit"> |
1082 | - <?php do_action( 'give_purchase_form_before_submit', $form_id ); ?> |
|
1082 | + <?php do_action('give_purchase_form_before_submit', $form_id); ?> |
|
1083 | 1083 | |
1084 | - <?php give_checkout_hidden_fields( $form_id ); ?> |
|
1084 | + <?php give_checkout_hidden_fields($form_id); ?> |
|
1085 | 1085 | |
1086 | - <?php echo give_checkout_button_purchase( $form_id ); ?> |
|
1086 | + <?php echo give_checkout_button_purchase($form_id); ?> |
|
1087 | 1087 | |
1088 | - <?php do_action( 'give_purchase_form_after_submit', $form_id ); ?> |
|
1088 | + <?php do_action('give_purchase_form_after_submit', $form_id); ?> |
|
1089 | 1089 | |
1090 | 1090 | </fieldset> |
1091 | 1091 | <?php |
1092 | 1092 | } |
1093 | 1093 | |
1094 | -add_action( 'give_purchase_form_after_cc_form', 'give_checkout_submit', 9999 ); |
|
1094 | +add_action('give_purchase_form_after_cc_form', 'give_checkout_submit', 9999); |
|
1095 | 1095 | |
1096 | 1096 | |
1097 | 1097 | /** |
@@ -1104,10 +1104,10 @@ discard block |
||
1104 | 1104 | * |
1105 | 1105 | * @return string |
1106 | 1106 | */ |
1107 | -function give_checkout_button_purchase( $form_id ) { |
|
1107 | +function give_checkout_button_purchase($form_id) { |
|
1108 | 1108 | |
1109 | - $display_label_field = get_post_meta( $form_id, '_give_checkout_label', true ); |
|
1110 | - $display_label = ( ! empty( $display_label_field ) ? $display_label_field : __( 'Donate Now', 'give' ) ); |
|
1109 | + $display_label_field = get_post_meta($form_id, '_give_checkout_label', true); |
|
1110 | + $display_label = ( ! empty($display_label_field) ? $display_label_field : __('Donate Now', 'give')); |
|
1111 | 1111 | |
1112 | 1112 | ob_start(); |
1113 | 1113 | |
@@ -1118,7 +1118,7 @@ discard block |
||
1118 | 1118 | <span class="give-loading-animation"></span> |
1119 | 1119 | </div> |
1120 | 1120 | <?php |
1121 | - return apply_filters( 'give_checkout_button_purchase', ob_get_clean(), $form_id ); |
|
1121 | + return apply_filters('give_checkout_button_purchase', ob_get_clean(), $form_id); |
|
1122 | 1122 | } |
1123 | 1123 | |
1124 | 1124 | /** |
@@ -1132,11 +1132,11 @@ discard block |
||
1132 | 1132 | * |
1133 | 1133 | * @return void |
1134 | 1134 | */ |
1135 | -function give_agree_to_terms_js( $form_id ) { |
|
1135 | +function give_agree_to_terms_js($form_id) { |
|
1136 | 1136 | |
1137 | - $form_option = get_post_meta( $form_id, '_give_terms_option', true ); |
|
1137 | + $form_option = get_post_meta($form_id, '_give_terms_option', true); |
|
1138 | 1138 | |
1139 | - if ( $form_option === 'yes' ) { |
|
1139 | + if ($form_option === 'yes') { |
|
1140 | 1140 | ?> |
1141 | 1141 | <script type="text/javascript"> |
1142 | 1142 | jQuery(document).ready(function ($) { |
@@ -1152,7 +1152,7 @@ discard block |
||
1152 | 1152 | } |
1153 | 1153 | } |
1154 | 1154 | |
1155 | -add_action( 'give_checkout_form_top', 'give_agree_to_terms_js', 10, 2 ); |
|
1155 | +add_action('give_checkout_form_top', 'give_agree_to_terms_js', 10, 2); |
|
1156 | 1156 | |
1157 | 1157 | |
1158 | 1158 | /** |
@@ -1165,19 +1165,19 @@ discard block |
||
1165 | 1165 | * |
1166 | 1166 | * @return void |
1167 | 1167 | */ |
1168 | -function give_form_content( $form_id, $args ) { |
|
1168 | +function give_form_content($form_id, $args) { |
|
1169 | 1169 | |
1170 | - $show_content = ( isset( $args['show_content'] ) && ! empty( $args['show_content'] ) ) |
|
1170 | + $show_content = (isset($args['show_content']) && ! empty($args['show_content'])) |
|
1171 | 1171 | ? $args['show_content'] |
1172 | - : get_post_meta( $form_id, '_give_content_option', true ); |
|
1172 | + : get_post_meta($form_id, '_give_content_option', true); |
|
1173 | 1173 | |
1174 | - if ( $show_content !== 'none' ) { |
|
1174 | + if ($show_content !== 'none') { |
|
1175 | 1175 | //add action according to value |
1176 | - add_action( $show_content, 'give_form_display_content' ); |
|
1176 | + add_action($show_content, 'give_form_display_content'); |
|
1177 | 1177 | } |
1178 | 1178 | } |
1179 | 1179 | |
1180 | -add_action( 'give_pre_form_output', 'give_form_content', 10, 2 ); |
|
1180 | +add_action('give_pre_form_output', 'give_form_content', 10, 2); |
|
1181 | 1181 | |
1182 | 1182 | /** |
1183 | 1183 | * Show Give Goals |
@@ -1190,25 +1190,25 @@ discard block |
||
1190 | 1190 | * @return mixed |
1191 | 1191 | */ |
1192 | 1192 | |
1193 | -function give_show_goal_progress( $form_id, $args ) { |
|
1193 | +function give_show_goal_progress($form_id, $args) { |
|
1194 | 1194 | |
1195 | - $goal_option = get_post_meta( $form_id, '_give_goal_option', true ); |
|
1196 | - $form = new Give_Donate_Form( $form_id ); |
|
1195 | + $goal_option = get_post_meta($form_id, '_give_goal_option', true); |
|
1196 | + $form = new Give_Donate_Form($form_id); |
|
1197 | 1197 | $goal = $form->goal; |
1198 | - $goal_format = get_post_meta( $form_id, '_give_goal_format', true ); |
|
1198 | + $goal_format = get_post_meta($form_id, '_give_goal_format', true); |
|
1199 | 1199 | $income = $form->get_earnings(); |
1200 | - $color = get_post_meta( $form_id, '_give_goal_color', true ); |
|
1201 | - $show_text = (bool) isset( $args['show_text'] ) ? filter_var( $args['show_text'], FILTER_VALIDATE_BOOLEAN ) : true; |
|
1202 | - $show_bar = (bool) isset( $args['show_bar'] ) ? filter_var( $args['show_bar'], FILTER_VALIDATE_BOOLEAN ) : true; |
|
1200 | + $color = get_post_meta($form_id, '_give_goal_color', true); |
|
1201 | + $show_text = (bool) isset($args['show_text']) ? filter_var($args['show_text'], FILTER_VALIDATE_BOOLEAN) : true; |
|
1202 | + $show_bar = (bool) isset($args['show_bar']) ? filter_var($args['show_bar'], FILTER_VALIDATE_BOOLEAN) : true; |
|
1203 | 1203 | |
1204 | 1204 | //Sanity check - respect shortcode args |
1205 | - if ( isset( $args['show_goal'] ) && $args['show_goal'] === false ) { |
|
1205 | + if (isset($args['show_goal']) && $args['show_goal'] === false) { |
|
1206 | 1206 | return false; |
1207 | 1207 | } |
1208 | 1208 | |
1209 | 1209 | //Sanity check - ensure form has goal set to output |
1210 | - if ( empty( $form->ID ) |
|
1211 | - || ( is_singular( 'give_forms' ) && $goal_option !== 'yes' ) |
|
1210 | + if (empty($form->ID) |
|
1211 | + || (is_singular('give_forms') && $goal_option !== 'yes') |
|
1212 | 1212 | || $goal_option !== 'yes' |
1213 | 1213 | || $goal == 0 |
1214 | 1214 | ) { |
@@ -1216,26 +1216,26 @@ discard block |
||
1216 | 1216 | return false; |
1217 | 1217 | } |
1218 | 1218 | |
1219 | - $progress = round( ( $income / $goal ) * 100, 2 ); |
|
1219 | + $progress = round(($income / $goal) * 100, 2); |
|
1220 | 1220 | |
1221 | - if ( $income > $goal ) { |
|
1221 | + if ($income > $goal) { |
|
1222 | 1222 | $progress = 100; |
1223 | 1223 | } |
1224 | 1224 | |
1225 | 1225 | $output = '<div class="give-goal-progress">'; |
1226 | 1226 | |
1227 | 1227 | //Goal Progress Text |
1228 | - if ( ! empty( $show_text ) ) { |
|
1228 | + if ( ! empty($show_text)) { |
|
1229 | 1229 | |
1230 | 1230 | $output .= '<div class="raised">'; |
1231 | 1231 | |
1232 | - if ( $goal_format !== 'percentage' ) { |
|
1232 | + if ($goal_format !== 'percentage') { |
|
1233 | 1233 | |
1234 | - $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>'; |
|
1234 | + $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>'; |
|
1235 | 1235 | |
1236 | - } elseif ( $goal_format == 'percentage' ) { |
|
1236 | + } elseif ($goal_format == 'percentage') { |
|
1237 | 1237 | |
1238 | - $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>'; |
|
1238 | + $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>'; |
|
1239 | 1239 | |
1240 | 1240 | } |
1241 | 1241 | |
@@ -1244,11 +1244,11 @@ discard block |
||
1244 | 1244 | } |
1245 | 1245 | |
1246 | 1246 | //Goal Progress Bar |
1247 | - if ( ! empty( $show_bar ) ) { |
|
1247 | + if ( ! empty($show_bar)) { |
|
1248 | 1248 | $output .= '<div class="give-progress-bar">'; |
1249 | - $output .= '<span style="width: ' . esc_attr( $progress ) . '%;'; |
|
1250 | - if ( ! empty( $color ) ) { |
|
1251 | - $output .= 'background-color:' . $color; |
|
1249 | + $output .= '<span style="width: '.esc_attr($progress).'%;'; |
|
1250 | + if ( ! empty($color)) { |
|
1251 | + $output .= 'background-color:'.$color; |
|
1252 | 1252 | } |
1253 | 1253 | $output .= '"></span>'; |
1254 | 1254 | $output .= '</div><!-- /.give-progress-bar -->'; |
@@ -1256,13 +1256,13 @@ discard block |
||
1256 | 1256 | |
1257 | 1257 | $output .= '</div><!-- /.goal-progress -->'; |
1258 | 1258 | |
1259 | - echo apply_filters( 'give_goal_output', $output ); |
|
1259 | + echo apply_filters('give_goal_output', $output); |
|
1260 | 1260 | |
1261 | 1261 | return false; |
1262 | 1262 | |
1263 | 1263 | } |
1264 | 1264 | |
1265 | -add_action( 'give_pre_form', 'give_show_goal_progress', 10, 2 ); |
|
1265 | +add_action('give_pre_form', 'give_show_goal_progress', 10, 2); |
|
1266 | 1266 | |
1267 | 1267 | /** |
1268 | 1268 | * Renders Post Form Content |
@@ -1274,17 +1274,17 @@ discard block |
||
1274 | 1274 | * @return void |
1275 | 1275 | * @since 1.0 |
1276 | 1276 | */ |
1277 | -function give_form_display_content( $form_id ) { |
|
1277 | +function give_form_display_content($form_id) { |
|
1278 | 1278 | |
1279 | - $content = wpautop( get_post_meta( $form_id, '_give_form_content', true ) ); |
|
1279 | + $content = wpautop(get_post_meta($form_id, '_give_form_content', true)); |
|
1280 | 1280 | |
1281 | - if ( give_get_option( 'disable_the_content_filter' ) !== 'on' ) { |
|
1282 | - $content = apply_filters( 'the_content', $content ); |
|
1281 | + if (give_get_option('disable_the_content_filter') !== 'on') { |
|
1282 | + $content = apply_filters('the_content', $content); |
|
1283 | 1283 | } |
1284 | 1284 | |
1285 | - $output = '<div id="give-form-content-' . $form_id . '" class="give-form-content-wrap" >' . $content . '</div>'; |
|
1285 | + $output = '<div id="give-form-content-'.$form_id.'" class="give-form-content-wrap" >'.$content.'</div>'; |
|
1286 | 1286 | |
1287 | - echo apply_filters( 'give_form_content_output', $output ); |
|
1287 | + echo apply_filters('give_form_content_output', $output); |
|
1288 | 1288 | } |
1289 | 1289 | |
1290 | 1290 | |
@@ -1297,16 +1297,16 @@ discard block |
||
1297 | 1297 | * |
1298 | 1298 | * @return void |
1299 | 1299 | */ |
1300 | -function give_checkout_hidden_fields( $form_id ) { |
|
1300 | +function give_checkout_hidden_fields($form_id) { |
|
1301 | 1301 | |
1302 | - do_action( 'give_hidden_fields_before', $form_id ); |
|
1303 | - if ( is_user_logged_in() ) { ?> |
|
1302 | + do_action('give_hidden_fields_before', $form_id); |
|
1303 | + if (is_user_logged_in()) { ?> |
|
1304 | 1304 | <input type="hidden" name="give-user-id" value="<?php echo get_current_user_id(); ?>"/> |
1305 | 1305 | <?php } ?> |
1306 | 1306 | <input type="hidden" name="give_action" value="purchase"/> |
1307 | - <input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway( $form_id ); ?>"/> |
|
1307 | + <input type="hidden" name="give-gateway" value="<?php echo give_get_chosen_gateway($form_id); ?>"/> |
|
1308 | 1308 | <?php |
1309 | - do_action( 'give_hidden_fields_after', $form_id ); |
|
1309 | + do_action('give_hidden_fields_after', $form_id); |
|
1310 | 1310 | |
1311 | 1311 | } |
1312 | 1312 | |
@@ -1321,20 +1321,20 @@ discard block |
||
1321 | 1321 | * |
1322 | 1322 | * @return string $content Filtered content |
1323 | 1323 | */ |
1324 | -function give_filter_success_page_content( $content ) { |
|
1324 | +function give_filter_success_page_content($content) { |
|
1325 | 1325 | |
1326 | 1326 | global $give_options; |
1327 | 1327 | |
1328 | - if ( isset( $give_options['success_page'] ) && isset( $_GET['payment-confirmation'] ) && is_page( $give_options['success_page'] ) ) { |
|
1329 | - if ( has_filter( 'give_payment_confirm_' . $_GET['payment-confirmation'] ) ) { |
|
1330 | - $content = apply_filters( 'give_payment_confirm_' . $_GET['payment-confirmation'], $content ); |
|
1328 | + if (isset($give_options['success_page']) && isset($_GET['payment-confirmation']) && is_page($give_options['success_page'])) { |
|
1329 | + if (has_filter('give_payment_confirm_'.$_GET['payment-confirmation'])) { |
|
1330 | + $content = apply_filters('give_payment_confirm_'.$_GET['payment-confirmation'], $content); |
|
1331 | 1331 | } |
1332 | 1332 | } |
1333 | 1333 | |
1334 | 1334 | return $content; |
1335 | 1335 | } |
1336 | 1336 | |
1337 | -add_filter( 'the_content', 'give_filter_success_page_content' ); |
|
1337 | +add_filter('the_content', 'give_filter_success_page_content'); |
|
1338 | 1338 | |
1339 | 1339 | |
1340 | 1340 | /** |
@@ -1346,11 +1346,11 @@ discard block |
||
1346 | 1346 | |
1347 | 1347 | function give_test_mode_frontend_warning() { |
1348 | 1348 | |
1349 | - $test_mode = give_get_option( 'test_mode' ); |
|
1349 | + $test_mode = give_get_option('test_mode'); |
|
1350 | 1350 | |
1351 | - if ( $test_mode == 'on' ) { |
|
1352 | - 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>'; |
|
1351 | + if ($test_mode == 'on') { |
|
1352 | + 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>'; |
|
1353 | 1353 | } |
1354 | 1354 | } |
1355 | 1355 | |
1356 | -add_action( 'give_pre_form', 'give_test_mode_frontend_warning', 10 ); |
|
1356 | +add_action('give_pre_form', 'give_test_mode_frontend_warning', 10); |