@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | */ |
41 | 41 | |
42 | 42 | // Exit if accessed directly. |
43 | -if ( ! defined( 'ABSPATH' ) ) { |
|
43 | +if ( ! defined('ABSPATH')) { |
|
44 | 44 | exit; |
45 | 45 | } |
46 | 46 | |
47 | -if ( ! class_exists( 'Give' ) ) : |
|
47 | +if ( ! class_exists('Give')) : |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Main Give Class |
@@ -195,11 +195,11 @@ discard block |
||
195 | 195 | * @return Give |
196 | 196 | */ |
197 | 197 | public static function instance() { |
198 | - if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Give ) ) { |
|
198 | + if ( ! isset(self::$instance) && ! (self::$instance instanceof Give)) { |
|
199 | 199 | self::$instance = new Give; |
200 | 200 | self::$instance->setup_constants(); |
201 | 201 | |
202 | - add_action( 'plugins_loaded', array( self::$instance, 'load_textdomain' ) ); |
|
202 | + add_action('plugins_loaded', array(self::$instance, 'load_textdomain')); |
|
203 | 203 | |
204 | 204 | self::$instance->includes(); |
205 | 205 | self::$instance->roles = new Give_Roles(); |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | */ |
233 | 233 | public function __clone() { |
234 | 234 | // Cloning instances of the class is forbidden |
235 | - _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ uh?', 'give' ), '1.0' ); |
|
235 | + _doing_it_wrong(__FUNCTION__, esc_html__('Cheatin’ uh?', 'give'), '1.0'); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | /** |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | */ |
246 | 246 | public function __wakeup() { |
247 | 247 | // Unserializing instances of the class is forbidden. |
248 | - _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ uh?', 'give' ), '1.0' ); |
|
248 | + _doing_it_wrong(__FUNCTION__, esc_html__('Cheatin’ uh?', 'give'), '1.0'); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | /** |
@@ -259,33 +259,33 @@ discard block |
||
259 | 259 | private function setup_constants() { |
260 | 260 | |
261 | 261 | // Plugin version |
262 | - if ( ! defined( 'GIVE_VERSION' ) ) { |
|
263 | - define( 'GIVE_VERSION', '1.6' ); |
|
262 | + if ( ! defined('GIVE_VERSION')) { |
|
263 | + define('GIVE_VERSION', '1.6'); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | // Plugin Folder Path |
267 | - if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) { |
|
268 | - define( 'GIVE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
|
267 | + if ( ! defined('GIVE_PLUGIN_DIR')) { |
|
268 | + define('GIVE_PLUGIN_DIR', plugin_dir_path(__FILE__)); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | // Plugin Folder URL |
272 | - if ( ! defined( 'GIVE_PLUGIN_URL' ) ) { |
|
273 | - define( 'GIVE_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
|
272 | + if ( ! defined('GIVE_PLUGIN_URL')) { |
|
273 | + define('GIVE_PLUGIN_URL', plugin_dir_url(__FILE__)); |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | // Plugin Basename aka: "give/give.php" |
277 | - if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) { |
|
278 | - define( 'GIVE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); |
|
277 | + if ( ! defined('GIVE_PLUGIN_BASENAME')) { |
|
278 | + define('GIVE_PLUGIN_BASENAME', plugin_basename(__FILE__)); |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | // Plugin Root File |
282 | - if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) { |
|
283 | - define( 'GIVE_PLUGIN_FILE', __FILE__ ); |
|
282 | + if ( ! defined('GIVE_PLUGIN_FILE')) { |
|
283 | + define('GIVE_PLUGIN_FILE', __FILE__); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | // Make sure CAL_GREGORIAN is defined |
287 | - if ( ! defined( 'CAL_GREGORIAN' ) ) { |
|
288 | - define( 'CAL_GREGORIAN', 1 ); |
|
287 | + if ( ! defined('CAL_GREGORIAN')) { |
|
288 | + define('CAL_GREGORIAN', 1); |
|
289 | 289 | } |
290 | 290 | } |
291 | 291 | |
@@ -300,114 +300,114 @@ discard block |
||
300 | 300 | private function includes() { |
301 | 301 | global $give_options; |
302 | 302 | |
303 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-settings.php'; |
|
303 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-give-settings.php'; |
|
304 | 304 | $give_options = give_get_settings(); |
305 | 305 | |
306 | - require_once GIVE_PLUGIN_DIR . 'includes/post-types.php'; |
|
307 | - require_once GIVE_PLUGIN_DIR . 'includes/scripts.php'; |
|
308 | - require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php'; |
|
309 | - require_once GIVE_PLUGIN_DIR . 'includes/actions.php'; |
|
310 | - require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php'; |
|
311 | - |
|
312 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php'; |
|
313 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-template-loader.php'; |
|
314 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php'; |
|
315 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php'; |
|
316 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-customers.php'; |
|
317 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-customer-meta.php'; |
|
318 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-customer.php'; |
|
319 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php'; |
|
320 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php'; |
|
321 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-html-elements.php'; |
|
322 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php'; |
|
323 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php'; |
|
324 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php'; |
|
325 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-email-access.php'; |
|
326 | - |
|
327 | - require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php'; |
|
328 | - require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php'; |
|
329 | - require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php'; |
|
330 | - require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php'; |
|
331 | - require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php'; |
|
332 | - require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php'; |
|
333 | - require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php'; |
|
334 | - require_once GIVE_PLUGIN_DIR . 'includes/formatting.php'; |
|
335 | - require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php'; |
|
336 | - require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php'; |
|
337 | - require_once GIVE_PLUGIN_DIR . 'includes/process-purchase.php'; |
|
338 | - require_once GIVE_PLUGIN_DIR . 'includes/login-register.php'; |
|
339 | - require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php'; |
|
340 | - require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php'; |
|
341 | - require_once GIVE_PLUGIN_DIR . 'includes/deprecated-functions.php'; |
|
342 | - |
|
343 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php'; |
|
344 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php'; |
|
345 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php'; |
|
346 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php'; |
|
347 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-payment.php'; |
|
348 | - |
|
349 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php'; |
|
350 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php'; |
|
351 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php'; |
|
352 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php'; |
|
353 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php'; |
|
354 | - |
|
355 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php'; |
|
356 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php'; |
|
357 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php'; |
|
358 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php'; |
|
359 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php'; |
|
360 | - |
|
361 | - if( defined( 'WP_CLI' ) && WP_CLI ) { |
|
362 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php'; |
|
306 | + require_once GIVE_PLUGIN_DIR.'includes/post-types.php'; |
|
307 | + require_once GIVE_PLUGIN_DIR.'includes/scripts.php'; |
|
308 | + require_once GIVE_PLUGIN_DIR.'includes/ajax-functions.php'; |
|
309 | + require_once GIVE_PLUGIN_DIR.'includes/actions.php'; |
|
310 | + require_once GIVE_PLUGIN_DIR.'includes/api/class-give-api.php'; |
|
311 | + |
|
312 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-roles.php'; |
|
313 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-template-loader.php'; |
|
314 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-donate-form.php'; |
|
315 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db.php'; |
|
316 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db-customers.php'; |
|
317 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db-customer-meta.php'; |
|
318 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-customer.php'; |
|
319 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-stats.php'; |
|
320 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-session.php'; |
|
321 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-html-elements.php'; |
|
322 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-logging.php'; |
|
323 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-license-handler.php'; |
|
324 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-cron.php'; |
|
325 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-email-access.php'; |
|
326 | + |
|
327 | + require_once GIVE_PLUGIN_DIR.'includes/country-functions.php'; |
|
328 | + require_once GIVE_PLUGIN_DIR.'includes/template-functions.php'; |
|
329 | + require_once GIVE_PLUGIN_DIR.'includes/misc-functions.php'; |
|
330 | + require_once GIVE_PLUGIN_DIR.'includes/forms/functions.php'; |
|
331 | + require_once GIVE_PLUGIN_DIR.'includes/forms/template.php'; |
|
332 | + require_once GIVE_PLUGIN_DIR.'includes/forms/widget.php'; |
|
333 | + require_once GIVE_PLUGIN_DIR.'includes/shortcodes.php'; |
|
334 | + require_once GIVE_PLUGIN_DIR.'includes/formatting.php'; |
|
335 | + require_once GIVE_PLUGIN_DIR.'includes/price-functions.php'; |
|
336 | + require_once GIVE_PLUGIN_DIR.'includes/error-tracking.php'; |
|
337 | + require_once GIVE_PLUGIN_DIR.'includes/process-purchase.php'; |
|
338 | + require_once GIVE_PLUGIN_DIR.'includes/login-register.php'; |
|
339 | + require_once GIVE_PLUGIN_DIR.'includes/user-functions.php'; |
|
340 | + require_once GIVE_PLUGIN_DIR.'includes/plugin-compatibility.php'; |
|
341 | + require_once GIVE_PLUGIN_DIR.'includes/deprecated-functions.php'; |
|
342 | + |
|
343 | + require_once GIVE_PLUGIN_DIR.'includes/payments/functions.php'; |
|
344 | + require_once GIVE_PLUGIN_DIR.'includes/payments/actions.php'; |
|
345 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-payment-stats.php'; |
|
346 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-payments-query.php'; |
|
347 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-give-payment.php'; |
|
348 | + |
|
349 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/functions.php'; |
|
350 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/actions.php'; |
|
351 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/paypal-standard.php'; |
|
352 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/offline-donations.php'; |
|
353 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/manual.php'; |
|
354 | + |
|
355 | + require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-emails.php'; |
|
356 | + require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-email-tags.php'; |
|
357 | + require_once GIVE_PLUGIN_DIR.'includes/emails/functions.php'; |
|
358 | + require_once GIVE_PLUGIN_DIR.'includes/emails/template.php'; |
|
359 | + require_once GIVE_PLUGIN_DIR.'includes/emails/actions.php'; |
|
360 | + |
|
361 | + if (defined('WP_CLI') && WP_CLI) { |
|
362 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-cli-commands.php'; |
|
363 | 363 | } |
364 | 364 | |
365 | - if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { |
|
366 | - |
|
367 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php'; |
|
368 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/welcome.php'; |
|
369 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php'; |
|
370 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-notices.php'; |
|
371 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php'; |
|
372 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php'; |
|
373 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/system-info.php'; |
|
374 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php'; |
|
375 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php'; |
|
376 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php'; |
|
377 | - |
|
378 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php'; |
|
379 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php'; |
|
380 | - |
|
381 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customers.php'; |
|
382 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customer-functions.php'; |
|
383 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customer-actions.php'; |
|
384 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php'; |
|
385 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php'; |
|
386 | - |
|
387 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/export-functions.php'; |
|
388 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/reports.php'; |
|
389 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools.php'; |
|
390 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/tools-actions.php'; |
|
391 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/pdf-reports.php'; |
|
392 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-give-graph.php'; |
|
393 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/graphing.php'; |
|
394 | - |
|
395 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php'; |
|
396 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php'; |
|
397 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php'; |
|
398 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php'; |
|
399 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php'; |
|
400 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php'; |
|
401 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php'; |
|
402 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php'; |
|
403 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php'; |
|
404 | - |
|
405 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php'; |
|
406 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrades.php'; |
|
365 | + if (is_admin() || (defined('WP_CLI') && WP_CLI)) { |
|
366 | + |
|
367 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-footer.php'; |
|
368 | + require_once GIVE_PLUGIN_DIR.'includes/admin/welcome.php'; |
|
369 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-pages.php'; |
|
370 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-admin-notices.php'; |
|
371 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php'; |
|
372 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-actions.php'; |
|
373 | + require_once GIVE_PLUGIN_DIR.'includes/admin/system-info.php'; |
|
374 | + require_once GIVE_PLUGIN_DIR.'includes/admin/add-ons.php'; |
|
375 | + require_once GIVE_PLUGIN_DIR.'includes/admin/plugins.php'; |
|
376 | + require_once GIVE_PLUGIN_DIR.'includes/admin/dashboard-widgets.php'; |
|
377 | + |
|
378 | + require_once GIVE_PLUGIN_DIR.'includes/admin/payments/actions.php'; |
|
379 | + require_once GIVE_PLUGIN_DIR.'includes/admin/payments/payments-history.php'; |
|
380 | + |
|
381 | + require_once GIVE_PLUGIN_DIR.'includes/admin/customers/customers.php'; |
|
382 | + require_once GIVE_PLUGIN_DIR.'includes/admin/customers/customer-functions.php'; |
|
383 | + require_once GIVE_PLUGIN_DIR.'includes/admin/customers/customer-actions.php'; |
|
384 | + require_once GIVE_PLUGIN_DIR.'includes/admin/forms/metabox.php'; |
|
385 | + require_once GIVE_PLUGIN_DIR.'includes/admin/forms/dashboard-columns.php'; |
|
386 | + |
|
387 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/export-functions.php'; |
|
388 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/reports.php'; |
|
389 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools.php'; |
|
390 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/tools-actions.php'; |
|
391 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/pdf-reports.php'; |
|
392 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-give-graph.php'; |
|
393 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/graphing.php'; |
|
394 | + |
|
395 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/abstract-shortcode-generator.php'; |
|
396 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/class-shortcode-button.php'; |
|
397 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-form.php'; |
|
398 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-goal.php'; |
|
399 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-login.php'; |
|
400 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-register.php'; |
|
401 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-profile-editor.php'; |
|
402 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donation-history.php'; |
|
403 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-receipt.php'; |
|
404 | + |
|
405 | + require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrade-functions.php'; |
|
406 | + require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrades.php'; |
|
407 | 407 | |
408 | 408 | } |
409 | 409 | |
410 | - require_once GIVE_PLUGIN_DIR . 'includes/install.php'; |
|
410 | + require_once GIVE_PLUGIN_DIR.'includes/install.php'; |
|
411 | 411 | |
412 | 412 | } |
413 | 413 | |
@@ -421,26 +421,26 @@ discard block |
||
421 | 421 | */ |
422 | 422 | public function load_textdomain() { |
423 | 423 | // Set filter for Give's languages directory |
424 | - $give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/'; |
|
425 | - $give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir ); |
|
424 | + $give_lang_dir = dirname(plugin_basename(GIVE_PLUGIN_FILE)).'/languages/'; |
|
425 | + $give_lang_dir = apply_filters('give_languages_directory', $give_lang_dir); |
|
426 | 426 | |
427 | 427 | // Traditional WordPress plugin locale filter |
428 | - $locale = apply_filters( 'plugin_locale', get_locale(), 'give' ); |
|
429 | - $mofile = sprintf( '%1$s-%2$s.mo', 'give', $locale ); |
|
428 | + $locale = apply_filters('plugin_locale', get_locale(), 'give'); |
|
429 | + $mofile = sprintf('%1$s-%2$s.mo', 'give', $locale); |
|
430 | 430 | |
431 | 431 | // Setup paths to current locale file |
432 | - $mofile_local = $give_lang_dir . $mofile; |
|
433 | - $mofile_global = WP_LANG_DIR . '/give/' . $mofile; |
|
432 | + $mofile_local = $give_lang_dir.$mofile; |
|
433 | + $mofile_global = WP_LANG_DIR.'/give/'.$mofile; |
|
434 | 434 | |
435 | - if ( file_exists( $mofile_global ) ) { |
|
435 | + if (file_exists($mofile_global)) { |
|
436 | 436 | // Look in global /wp-content/languages/give folder |
437 | - load_textdomain( 'give', $mofile_global ); |
|
438 | - } elseif ( file_exists( $mofile_local ) ) { |
|
437 | + load_textdomain('give', $mofile_global); |
|
438 | + } elseif (file_exists($mofile_local)) { |
|
439 | 439 | // Look in local location from filter `give_languages_directory` |
440 | - load_textdomain( 'give', $mofile_local ); |
|
440 | + load_textdomain('give', $mofile_local); |
|
441 | 441 | } else { |
442 | 442 | // Load the default language files packaged up w/ Give |
443 | - load_plugin_textdomain( 'give', false, $give_lang_dir ); |
|
443 | + load_plugin_textdomain('give', false, $give_lang_dir); |
|
444 | 444 | } |
445 | 445 | } |
446 | 446 |
@@ -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,7 +23,7 @@ discard block |
||
23 | 23 | * @return mixed |
24 | 24 | */ |
25 | 25 | function give_get_price_decimals() { |
26 | - return apply_filters( 'give_sanitize_amount_decimals', give_get_option( 'number_decimals', 0 ) ); |
|
26 | + return apply_filters('give_sanitize_amount_decimals', give_get_option('number_decimals', 0)); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * @return mixed |
35 | 35 | */ |
36 | 36 | function give_get_price_thousand_separator() { |
37 | - return give_get_option( 'thousands_separator', ',' ); |
|
37 | + return give_get_option('thousands_separator', ','); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @return mixed |
46 | 46 | */ |
47 | 47 | function give_get_price_decimal_separator() { |
48 | - return give_get_option( 'decimal_separator', '.' ); |
|
48 | + return give_get_option('decimal_separator', '.'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -62,60 +62,60 @@ discard block |
||
62 | 62 | * |
63 | 63 | * @return string $amount Newly sanitized amount |
64 | 64 | */ |
65 | -function give_sanitize_amount( $number, $dp = false, $trim_zeros = false ) { |
|
65 | +function give_sanitize_amount($number, $dp = false, $trim_zeros = false) { |
|
66 | 66 | |
67 | 67 | // Bailout. |
68 | - if( empty( $number ) ) { |
|
68 | + if (empty($number)) { |
|
69 | 69 | return $number; |
70 | 70 | } |
71 | 71 | |
72 | 72 | $thousand_separator = give_get_price_thousand_separator(); |
73 | 73 | |
74 | 74 | $locale = localeconv(); |
75 | - $decimals = array( give_get_price_decimal_separator(), $locale['decimal_point'], $locale['mon_decimal_point'] ); |
|
75 | + $decimals = array(give_get_price_decimal_separator(), $locale['decimal_point'], $locale['mon_decimal_point']); |
|
76 | 76 | |
77 | 77 | // Remove locale from string |
78 | - if ( ! is_float( $number ) ) { |
|
79 | - $number = str_replace( $decimals, '.', $number ); |
|
78 | + if ( ! is_float($number)) { |
|
79 | + $number = str_replace($decimals, '.', $number); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | // Remove thousand amount formatting if amount has. |
83 | 83 | // This condition use to add backward compatibility to version before 1.6, because before version 1.6 we were saving formatted amount to db. |
84 | 84 | // Do not replace thousand separator from price if it is same as decimal separator, because it will be already replace by above code. |
85 | - if( ! in_array( $thousand_separator, $decimals ) && ( false !== strpos( $number, $thousand_separator ) ) ) { |
|
86 | - $number = str_replace( $thousand_separator, '', $number ); |
|
85 | + if ( ! in_array($thousand_separator, $decimals) && (false !== strpos($number, $thousand_separator))) { |
|
86 | + $number = str_replace($thousand_separator, '', $number); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | // Remove non numeric entity before decimal separator. |
90 | - $number = preg_replace( '/[^0-9\.]/', '', $number ); |
|
90 | + $number = preg_replace('/[^0-9\.]/', '', $number); |
|
91 | 91 | $default_dp = give_get_price_decimals(); |
92 | 92 | |
93 | 93 | // Format number of decimals in number. |
94 | - if( false !== $dp ) { |
|
95 | - $dp = intval( empty( $dp ) ? $default_dp : $dp ); |
|
96 | - $dp = apply_filters( 'give_sanitize_amount_decimals', $dp, $number ); |
|
97 | - $number = number_format( floatval( $number ), $dp, '.', '' ); |
|
94 | + if (false !== $dp) { |
|
95 | + $dp = intval(empty($dp) ? $default_dp : $dp); |
|
96 | + $dp = apply_filters('give_sanitize_amount_decimals', $dp, $number); |
|
97 | + $number = number_format(floatval($number), $dp, '.', ''); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | // Reset negative amount to zero. |
101 | - if ( 0 > $number ) { |
|
102 | - $number = number_format( 0, $default_dp, '.' ); |
|
101 | + if (0 > $number) { |
|
102 | + $number = number_format(0, $default_dp, '.'); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | // If number does not have decimal then add number of decimals to it. |
106 | - if( |
|
107 | - false === strpos( $number, '.' ) |
|
108 | - || ( $default_dp > strlen( substr( $number, strpos( $number , '.' ) + 1 ) ) ) |
|
106 | + if ( |
|
107 | + false === strpos($number, '.') |
|
108 | + || ($default_dp > strlen(substr($number, strpos($number, '.') + 1))) |
|
109 | 109 | ) { |
110 | - $number = number_format( $number, $default_dp, '.', '' ); |
|
110 | + $number = number_format($number, $default_dp, '.', ''); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | // Trim zeros. |
114 | - if ( $trim_zeros && strstr( $number, '.' ) ) { |
|
115 | - $number = rtrim( rtrim( $number, '0' ), '.' ); |
|
114 | + if ($trim_zeros && strstr($number, '.')) { |
|
115 | + $number = rtrim(rtrim($number, '0'), '.'); |
|
116 | 116 | } |
117 | 117 | |
118 | - return apply_filters( 'give_sanitize_amount', $number ); |
|
118 | + return apply_filters('give_sanitize_amount', $number); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
@@ -128,47 +128,47 @@ discard block |
||
128 | 128 | * |
129 | 129 | * @return string $amount Newly formatted amount or Price Not Available |
130 | 130 | */ |
131 | -function give_format_amount( $amount, $decimals = true ) { |
|
131 | +function give_format_amount($amount, $decimals = true) { |
|
132 | 132 | |
133 | - $thousands_sep = give_get_option( 'thousands_separator', ',' ); |
|
134 | - $decimal_sep = give_get_option( 'decimal_separator', '.' ); |
|
133 | + $thousands_sep = give_get_option('thousands_separator', ','); |
|
134 | + $decimal_sep = give_get_option('decimal_separator', '.'); |
|
135 | 135 | |
136 | 136 | // Format the amount |
137 | - if ( $decimal_sep == ',' && false !== ( $sep_found = strpos( $amount, $decimal_sep ) ) ) { |
|
138 | - $whole = substr( $amount, 0, $sep_found ); |
|
139 | - $part = substr( $amount, $sep_found + 1, ( strlen( $amount ) - 1 ) ); |
|
140 | - $amount = $whole . '.' . $part; |
|
137 | + if ($decimal_sep == ',' && false !== ($sep_found = strpos($amount, $decimal_sep))) { |
|
138 | + $whole = substr($amount, 0, $sep_found); |
|
139 | + $part = substr($amount, $sep_found + 1, (strlen($amount) - 1)); |
|
140 | + $amount = $whole.'.'.$part; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | // Strip , from the amount (if set as the thousands separator) |
144 | - if ( $thousands_sep == ',' && false !== ( $found = strpos( $amount, $thousands_sep ) ) ) { |
|
145 | - $amount = str_replace( ',', '', $amount ); |
|
144 | + if ($thousands_sep == ',' && false !== ($found = strpos($amount, $thousands_sep))) { |
|
145 | + $amount = str_replace(',', '', $amount); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | // Strip . from the amount (if set as the thousands separator) AND , set to decimal separator |
149 | - if ( $thousands_sep == '.' && $decimal_sep == ',' && false !== ( $found = strpos( $amount, $thousands_sep ) ) ) { |
|
150 | - $amount = explode( '.', $amount ); |
|
151 | - $array_count = count( $amount ); |
|
152 | - if ( $decimals == true ) { |
|
153 | - unset( $amount[ $array_count - 1 ] ); |
|
149 | + if ($thousands_sep == '.' && $decimal_sep == ',' && false !== ($found = strpos($amount, $thousands_sep))) { |
|
150 | + $amount = explode('.', $amount); |
|
151 | + $array_count = count($amount); |
|
152 | + if ($decimals == true) { |
|
153 | + unset($amount[$array_count - 1]); |
|
154 | 154 | } |
155 | - $amount = implode( '', $amount ); |
|
155 | + $amount = implode('', $amount); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | // Strip ' ' from the amount (if set as the thousands separator) |
159 | - if ( $thousands_sep == ' ' && false !== ( $found = strpos( $amount, $thousands_sep ) ) ) { |
|
160 | - $amount = str_replace( ' ', '', $amount ); |
|
159 | + if ($thousands_sep == ' ' && false !== ($found = strpos($amount, $thousands_sep))) { |
|
160 | + $amount = str_replace(' ', '', $amount); |
|
161 | 161 | } |
162 | 162 | |
163 | - if ( empty( $amount ) ) { |
|
163 | + if (empty($amount)) { |
|
164 | 164 | $amount = 0; |
165 | 165 | } |
166 | 166 | |
167 | 167 | $decimals = give_get_price_decimals(); |
168 | 168 | |
169 | - $formatted = number_format( $amount, $decimals, $decimal_sep, $thousands_sep ); |
|
169 | + $formatted = number_format($amount, $decimals, $decimal_sep, $thousands_sep); |
|
170 | 170 | |
171 | - return apply_filters( 'give_format_amount', $formatted, $amount, $decimals, $decimal_sep, $thousands_sep ); |
|
171 | + return apply_filters('give_format_amount', $formatted, $amount, $decimals, $decimal_sep, $thousands_sep); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | |
@@ -184,44 +184,44 @@ discard block |
||
184 | 184 | * @param string $amount formatted amount number. |
185 | 185 | * @return float|string formatted amount number with large number names. |
186 | 186 | */ |
187 | -function give_human_format_large_amount( $amount ) { |
|
187 | +function give_human_format_large_amount($amount) { |
|
188 | 188 | |
189 | 189 | // Get thousand separator. |
190 | 190 | $thousands_sep = give_get_price_thousand_separator(); |
191 | 191 | |
192 | 192 | // Sanitize amount. |
193 | - $sanitize_amount = give_sanitize_amount( $amount ); |
|
193 | + $sanitize_amount = give_sanitize_amount($amount); |
|
194 | 194 | |
195 | 195 | // Explode amount to calculate name of large numbers. |
196 | - $amount_array = explode( $thousands_sep, $amount ); |
|
196 | + $amount_array = explode($thousands_sep, $amount); |
|
197 | 197 | |
198 | 198 | // Calculate amount parts count. |
199 | - $amount_count_parts = count( $amount_array ); |
|
199 | + $amount_count_parts = count($amount_array); |
|
200 | 200 | |
201 | 201 | // Calculate large number formatted amount. |
202 | - if ( 4 < $amount_count_parts ){ |
|
203 | - $sanitize_amount = sprintf( |
|
202 | + if (4 < $amount_count_parts) { |
|
203 | + $sanitize_amount = sprintf( |
|
204 | 204 | /* translators: %s: number */ |
205 | - esc_html__( '%s trillion', 'give' ), |
|
206 | - round( ( $sanitize_amount / 1000000000000 ), 2 ) |
|
205 | + esc_html__('%s trillion', 'give'), |
|
206 | + round(($sanitize_amount / 1000000000000), 2) |
|
207 | 207 | ); |
208 | - } elseif ( 3 < $amount_count_parts ){ |
|
209 | - $sanitize_amount = sprintf( |
|
208 | + } elseif (3 < $amount_count_parts) { |
|
209 | + $sanitize_amount = sprintf( |
|
210 | 210 | /* translators: %s: number */ |
211 | - esc_html__( '%s billion', 'give' ), |
|
212 | - round( ( $sanitize_amount / 1000000000 ), 2 ) |
|
211 | + esc_html__('%s billion', 'give'), |
|
212 | + round(($sanitize_amount / 1000000000), 2) |
|
213 | 213 | ); |
214 | - } elseif ( 2 < $amount_count_parts ) { |
|
215 | - $sanitize_amount = sprintf( |
|
214 | + } elseif (2 < $amount_count_parts) { |
|
215 | + $sanitize_amount = sprintf( |
|
216 | 216 | /* translators: %s: number */ |
217 | - esc_html__( '%s million', 'give' ), |
|
218 | - round( ( $sanitize_amount / 1000000 ), 2 ) |
|
217 | + esc_html__('%s million', 'give'), |
|
218 | + round(($sanitize_amount / 1000000), 2) |
|
219 | 219 | ); |
220 | - } else{ |
|
221 | - $sanitize_amount = give_format_amount( $amount ); |
|
220 | + } else { |
|
221 | + $sanitize_amount = give_format_amount($amount); |
|
222 | 222 | } |
223 | 223 | |
224 | - return apply_filters( 'give_human_format_large_amount', $sanitize_amount, $amount ); |
|
224 | + return apply_filters('give_human_format_large_amount', $sanitize_amount, $amount); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
@@ -234,15 +234,15 @@ discard block |
||
234 | 234 | * |
235 | 235 | * @return string $amount Newly formatted amount or Price Not Available |
236 | 236 | */ |
237 | -function give_format_decimal( $amount, $dp = false ){ |
|
237 | +function give_format_decimal($amount, $dp = false) { |
|
238 | 238 | $decimal_separator = give_get_price_decimal_separator(); |
239 | - $formatted_amount = give_sanitize_amount( $amount, $dp ); |
|
239 | + $formatted_amount = give_sanitize_amount($amount, $dp); |
|
240 | 240 | |
241 | - if( false !== strpos( $formatted_amount, '.' ) ) { |
|
242 | - $formatted_amount = str_replace( '.', $decimal_separator, $formatted_amount ); |
|
241 | + if (false !== strpos($formatted_amount, '.')) { |
|
242 | + $formatted_amount = str_replace('.', $decimal_separator, $formatted_amount); |
|
243 | 243 | } |
244 | 244 | |
245 | - return apply_filters( 'give_format_decimal', $formatted_amount, $amount, $decimal_separator ); |
|
245 | + return apply_filters('give_format_decimal', $formatted_amount, $amount, $decimal_separator); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | |
@@ -256,13 +256,13 @@ discard block |
||
256 | 256 | * |
257 | 257 | * @return bool |
258 | 258 | */ |
259 | -function give_format_admin_multilevel_amount( $field_args, $field ) { |
|
259 | +function give_format_admin_multilevel_amount($field_args, $field) { |
|
260 | 260 | |
261 | - if ( empty( $field->value ) ) { |
|
261 | + if (empty($field->value)) { |
|
262 | 262 | return false; |
263 | 263 | } |
264 | 264 | |
265 | - $field->value = give_format_decimal( $field->value ); |
|
265 | + $field->value = give_format_decimal($field->value); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -275,24 +275,24 @@ discard block |
||
275 | 275 | * |
276 | 276 | * @return mixed|string|void |
277 | 277 | */ |
278 | -function give_currency_filter( $price = '', $currency = '' ) { |
|
278 | +function give_currency_filter($price = '', $currency = '') { |
|
279 | 279 | |
280 | - if ( empty( $currency ) ) { |
|
280 | + if (empty($currency)) { |
|
281 | 281 | $currency = give_get_currency(); |
282 | 282 | } |
283 | 283 | |
284 | - $position = give_get_option( 'currency_position', 'before' ); |
|
284 | + $position = give_get_option('currency_position', 'before'); |
|
285 | 285 | |
286 | 286 | $negative = $price < 0; |
287 | 287 | |
288 | - if ( $negative ) { |
|
288 | + if ($negative) { |
|
289 | 289 | // Remove proceeding "-". |
290 | - $price = substr( $price, 1 ); |
|
290 | + $price = substr($price, 1); |
|
291 | 291 | } |
292 | 292 | |
293 | - $symbol = give_currency_symbol( $currency ); |
|
293 | + $symbol = give_currency_symbol($currency); |
|
294 | 294 | |
295 | - switch ( $currency ): |
|
295 | + switch ($currency): |
|
296 | 296 | case 'GBP' : |
297 | 297 | case 'BRL' : |
298 | 298 | case 'EUR' : |
@@ -321,13 +321,13 @@ discard block |
||
321 | 321 | case 'MAD' : |
322 | 322 | case 'KRW' : |
323 | 323 | case 'ZAR' : |
324 | - $formatted = ( 'before' === $position ? $symbol . $price : $price . $symbol ); |
|
324 | + $formatted = ('before' === $position ? $symbol.$price : $price.$symbol); |
|
325 | 325 | break; |
326 | 326 | case 'NOK' : |
327 | - $formatted = ( 'before' === $position ? $symbol . ' ' . $price : $price . ' ' . $symbol ); |
|
327 | + $formatted = ('before' === $position ? $symbol.' '.$price : $price.' '.$symbol); |
|
328 | 328 | break; |
329 | 329 | default : |
330 | - $formatted = ( 'before' === $position ? $currency . ' ' . $price : $price . ' ' . $currency ); |
|
330 | + $formatted = ('before' === $position ? $currency.' '.$price : $price.' '.$currency); |
|
331 | 331 | break; |
332 | 332 | endswitch; |
333 | 333 | |
@@ -343,11 +343,11 @@ discard block |
||
343 | 343 | * filter name will be give_usd_currency_filter_after |
344 | 344 | * |
345 | 345 | */ |
346 | - $formatted = apply_filters( 'give_' . strtolower( $currency ) . "_currency_filter_{$position}", $formatted, $currency, $price ); |
|
346 | + $formatted = apply_filters('give_'.strtolower($currency)."_currency_filter_{$position}", $formatted, $currency, $price); |
|
347 | 347 | |
348 | - if ( $negative ) { |
|
348 | + if ($negative) { |
|
349 | 349 | // Prepend the minus sign before the currency sign. |
350 | - $formatted = '-' . $formatted; |
|
350 | + $formatted = '-'.$formatted; |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | return $formatted; |
@@ -363,22 +363,22 @@ discard block |
||
363 | 363 | */ |
364 | 364 | function give_currency_decimal_filter() { |
365 | 365 | |
366 | - remove_filter( 'give_sanitize_amount_decimals', 'give_currency_decimal_filter' ); |
|
366 | + remove_filter('give_sanitize_amount_decimals', 'give_currency_decimal_filter'); |
|
367 | 367 | |
368 | 368 | // Set default number of decimals. |
369 | 369 | $decimals = give_get_price_decimals(); |
370 | 370 | |
371 | - add_filter( 'give_sanitize_amount_decimals', 'give_currency_decimal_filter' ); |
|
371 | + add_filter('give_sanitize_amount_decimals', 'give_currency_decimal_filter'); |
|
372 | 372 | |
373 | 373 | |
374 | 374 | // Get number of decimals with backward compatibility ( version < 1.6 ) |
375 | - if( 1 <= func_num_args() ){ |
|
376 | - $decimals = ( false === func_get_arg( 0 ) ? $decimals : absint( func_get_arg( 0 ) ) ); |
|
375 | + if (1 <= func_num_args()) { |
|
376 | + $decimals = (false === func_get_arg(0) ? $decimals : absint(func_get_arg(0))); |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | $currency = give_get_currency(); |
380 | 380 | |
381 | - switch ( $currency ) { |
|
381 | + switch ($currency) { |
|
382 | 382 | case 'RIAL' : |
383 | 383 | case 'JPY' : |
384 | 384 | case 'TWD' : |
@@ -388,11 +388,11 @@ discard block |
||
388 | 388 | break; |
389 | 389 | } |
390 | 390 | |
391 | - return apply_filters( 'give_currency_decimal_count', $decimals, $currency ); |
|
391 | + return apply_filters('give_currency_decimal_count', $decimals, $currency); |
|
392 | 392 | } |
393 | 393 | |
394 | -add_filter( 'give_sanitize_amount_decimals', 'give_currency_decimal_filter' ); |
|
395 | -add_filter( 'give_format_amount_decimals', 'give_currency_decimal_filter' ); |
|
394 | +add_filter('give_sanitize_amount_decimals', 'give_currency_decimal_filter'); |
|
395 | +add_filter('give_format_amount_decimals', 'give_currency_decimal_filter'); |
|
396 | 396 | |
397 | 397 | /** |
398 | 398 | * Sanitize thousand separator |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | * |
406 | 406 | * @return mixed |
407 | 407 | */ |
408 | -function give_sanitize_thousand_separator( $value, $field_args, $field ){ |
|
408 | +function give_sanitize_thousand_separator($value, $field_args, $field) { |
|
409 | 409 | return $value; |
410 | 410 | } |
411 | 411 | |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | * |
422 | 422 | * @return mixed |
423 | 423 | */ |
424 | -function give_sanitize_number_decimals( $value, $field_args, $field ){ |
|
424 | +function give_sanitize_number_decimals($value, $field_args, $field) { |
|
425 | 425 | return absint($value); |
426 | 426 | } |
427 | 427 | |
@@ -436,6 +436,6 @@ discard block |
||
436 | 436 | * |
437 | 437 | * @return mixed |
438 | 438 | */ |
439 | -function give_sanitize_price_field_value( $value, $field_args, $field ){ |
|
440 | - return give_sanitize_amount( $value ); |
|
439 | +function give_sanitize_price_field_value($value, $field_args, $field) { |
|
440 | + return give_sanitize_amount($value); |
|
441 | 441 | } |
442 | 442 | \ 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 | |
@@ -20,27 +20,27 @@ discard block |
||
20 | 20 | * @since 1.0 |
21 | 21 | * @return void |
22 | 22 | */ |
23 | -if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
|
24 | - wp_die( esc_html__( 'Donation ID not supplied. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) ); |
|
23 | +if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) { |
|
24 | + wp_die(esc_html__('Donation ID not supplied. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400)); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | // Setup the variables |
28 | -$payment_id = absint( $_GET['id'] ); |
|
29 | -$payment = new Give_Payment( $payment_id ); |
|
28 | +$payment_id = absint($_GET['id']); |
|
29 | +$payment = new Give_Payment($payment_id); |
|
30 | 30 | |
31 | 31 | // Sanity check... fail if purchase ID is invalid |
32 | 32 | $payment_exists = $payment->ID; |
33 | -if ( empty( $payment_exists ) ) { |
|
34 | - wp_die( esc_html__( 'The specified ID does not belong to a payment. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) ); |
|
33 | +if (empty($payment_exists)) { |
|
34 | + wp_die(esc_html__('The specified ID does not belong to a payment. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400)); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | $number = $payment->number; |
38 | 38 | $payment_meta = $payment->get_meta(); |
39 | -$transaction_id = esc_attr( $payment->transaction_id ); |
|
39 | +$transaction_id = esc_attr($payment->transaction_id); |
|
40 | 40 | $user_id = $payment->user_id; |
41 | 41 | $customer_id = $payment->customer_id; |
42 | -$payment_date = strtotime( $payment->date ); |
|
43 | -$user_info = give_get_payment_meta_user_info( $payment_id ); |
|
42 | +$payment_date = strtotime($payment->date); |
|
43 | +$user_info = give_get_payment_meta_user_info($payment_id); |
|
44 | 44 | $address = $payment->address; |
45 | 45 | $gateway = $payment->gateway; |
46 | 46 | $currency_code = $payment->currency; |
@@ -53,76 +53,76 @@ discard block |
||
53 | 53 | <h1 id="transaction-details-heading"><?php |
54 | 54 | printf( |
55 | 55 | /* translators: %s: payment number */ |
56 | - esc_html__( 'Payment %s', 'give' ), |
|
56 | + esc_html__('Payment %s', 'give'), |
|
57 | 57 | $number |
58 | 58 | ); |
59 | - if ( $payment_mode == 'test' ) { |
|
60 | - echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="' . esc_attr__( 'This payment was made in test mode.', 'give' ) . '" data-tooltip-my-position="center left" data-tooltip-target-position="center right">' . esc_html__( 'Test Payment', 'give' ) . '</span>'; |
|
59 | + if ($payment_mode == 'test') { |
|
60 | + echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="'.esc_attr__('This payment was made in test mode.', 'give').'" data-tooltip-my-position="center left" data-tooltip-target-position="center right">'.esc_html__('Test Payment', 'give').'</span>'; |
|
61 | 61 | } |
62 | 62 | ?></h1> |
63 | 63 | |
64 | - <?php do_action( 'give_view_order_details_before', $payment_id ); ?> |
|
64 | + <?php do_action('give_view_order_details_before', $payment_id); ?> |
|
65 | 65 | <form id="give-edit-order-form" method="post"> |
66 | - <?php do_action( 'give_view_order_details_form_top', $payment_id ); ?> |
|
66 | + <?php do_action('give_view_order_details_form_top', $payment_id); ?> |
|
67 | 67 | <div id="poststuff"> |
68 | 68 | <div id="give-dashboard-widgets-wrap"> |
69 | 69 | <div id="post-body" class="metabox-holder columns-2"> |
70 | 70 | <div id="postbox-container-1" class="postbox-container"> |
71 | 71 | <div id="side-sortables" class="meta-box-sortables ui-sortable"> |
72 | 72 | |
73 | - <?php do_action( 'give_view_order_details_sidebar_before', $payment_id ); ?> |
|
73 | + <?php do_action('give_view_order_details_sidebar_before', $payment_id); ?> |
|
74 | 74 | |
75 | 75 | <div id="give-order-update" class="postbox give-order-data"> |
76 | 76 | |
77 | 77 | <h3 class="hndle"> |
78 | - <span><?php esc_html_e( 'Update Payment', 'give' ); ?></span> |
|
78 | + <span><?php esc_html_e('Update Payment', 'give'); ?></span> |
|
79 | 79 | </h3> |
80 | 80 | |
81 | 81 | <div class="inside"> |
82 | 82 | <div class="give-admin-box"> |
83 | 83 | |
84 | - <?php do_action( 'give_view_order_details_totals_before', $payment_id ); ?> |
|
84 | + <?php do_action('give_view_order_details_totals_before', $payment_id); ?> |
|
85 | 85 | |
86 | 86 | <div class="give-admin-box-inside"> |
87 | 87 | <p> |
88 | - <label for="give-payment-status" class="strong"><?php esc_html_e( 'Status:', 'give' ); ?></label> |
|
88 | + <label for="give-payment-status" class="strong"><?php esc_html_e('Status:', 'give'); ?></label> |
|
89 | 89 | <select id="give-payment-status" name="give-payment-status" class="medium-text"> |
90 | - <?php foreach ( give_get_payment_statuses() as $key => $status ) : ?> |
|
91 | - <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $payment->status, $key, true ); ?>><?php echo esc_html( $status ); ?></option> |
|
90 | + <?php foreach (give_get_payment_statuses() as $key => $status) : ?> |
|
91 | + <option value="<?php echo esc_attr($key); ?>"<?php selected($payment->status, $key, true); ?>><?php echo esc_html($status); ?></option> |
|
92 | 92 | <?php endforeach; ?> |
93 | 93 | </select> |
94 | - <span class="give-donation-status status-<?php echo sanitize_title( $payment->status ); ?>"><span class="give-donation-status-icon"></span></span> |
|
94 | + <span class="give-donation-status status-<?php echo sanitize_title($payment->status); ?>"><span class="give-donation-status-icon"></span></span> |
|
95 | 95 | </p> |
96 | 96 | </div> |
97 | 97 | |
98 | 98 | <div class="give-admin-box-inside"> |
99 | 99 | <p> |
100 | - <label for="give-payment-date" class="strong"><?php esc_html_e( 'Date:', 'give' ); ?></label> |
|
101 | - <input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr( date( 'm/d/Y', $payment_date ) ); ?>" class="medium-text give_datepicker"/> |
|
100 | + <label for="give-payment-date" class="strong"><?php esc_html_e('Date:', 'give'); ?></label> |
|
101 | + <input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr(date('m/d/Y', $payment_date)); ?>" class="medium-text give_datepicker"/> |
|
102 | 102 | </p> |
103 | 103 | </div> |
104 | 104 | |
105 | 105 | <div class="give-admin-box-inside"> |
106 | 106 | <p> |
107 | - <label for="give-payment-time-hour" class="strong"><?php esc_html_e( 'Time:', 'give' ); ?></label> |
|
108 | - <input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr( date_i18n( 'H', $payment_date ) ); ?>" class="small-text give-payment-time-hour"/> : |
|
109 | - <input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr( date( 'i', $payment_date ) ); ?>" class="small-text give-payment-time-min"/> |
|
107 | + <label for="give-payment-time-hour" class="strong"><?php esc_html_e('Time:', 'give'); ?></label> |
|
108 | + <input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr(date_i18n('H', $payment_date)); ?>" class="small-text give-payment-time-hour"/> : |
|
109 | + <input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr(date('i', $payment_date)); ?>" class="small-text give-payment-time-min"/> |
|
110 | 110 | </p> |
111 | 111 | </div> |
112 | 112 | |
113 | - <?php do_action( 'give_view_order_details_update_inner', $payment_id ); ?> |
|
113 | + <?php do_action('give_view_order_details_update_inner', $payment_id); ?> |
|
114 | 114 | |
115 | 115 | <?php |
116 | 116 | //@TODO: Fees |
117 | - $fees = give_get_payment_fees( $payment_id ); |
|
118 | - if ( ! empty( $fees ) ) : ?> |
|
117 | + $fees = give_get_payment_fees($payment_id); |
|
118 | + if ( ! empty($fees)) : ?> |
|
119 | 119 | <div class="give-order-fees give-admin-box-inside"> |
120 | - <p class="strong"><?php esc_html_e( 'Fees:', 'give' ); ?></p> |
|
120 | + <p class="strong"><?php esc_html_e('Fees:', 'give'); ?></p> |
|
121 | 121 | <ul class="give-payment-fees"> |
122 | - <?php foreach ( $fees as $fee ) : ?> |
|
122 | + <?php foreach ($fees as $fee) : ?> |
|
123 | 123 | <li> |
124 | 124 | <span class="fee-label"><?php echo $fee['label']; ?>:</span> |
125 | - <span class="fee-amount" data-fee="<?php echo esc_attr( $fee['amount'] ); ?>"><?php echo give_currency_filter( $fee['amount'], $currency_code ); ?></span> |
|
125 | + <span class="fee-amount" data-fee="<?php echo esc_attr($fee['amount']); ?>"><?php echo give_currency_filter($fee['amount'], $currency_code); ?></span> |
|
126 | 126 | </li> |
127 | 127 | <?php endforeach; ?> |
128 | 128 | </ul> |
@@ -131,12 +131,12 @@ discard block |
||
131 | 131 | |
132 | 132 | <div class="give-order-payment give-admin-box-inside"> |
133 | 133 | <p> |
134 | - <label for="give-payment-total" class="strong"><?php esc_html_e( 'Total Donation:', 'give' ); ?></label> |
|
135 | - <?php echo give_currency_symbol( $payment->currency ); ?> <input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr( give_format_decimal( give_get_payment_amount( $payment_id ) ) ); ?>"/> |
|
134 | + <label for="give-payment-total" class="strong"><?php esc_html_e('Total Donation:', 'give'); ?></label> |
|
135 | + <?php echo give_currency_symbol($payment->currency); ?> <input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr(give_format_decimal(give_get_payment_amount($payment_id))); ?>"/> |
|
136 | 136 | </p> |
137 | 137 | </div> |
138 | 138 | |
139 | - <?php do_action( 'give_view_order_details_totals_after', $payment_id ); ?> |
|
139 | + <?php do_action('give_view_order_details_totals_after', $payment_id); ?> |
|
140 | 140 | |
141 | 141 | </div> |
142 | 142 | <!-- /.give-admin-box --> |
@@ -145,20 +145,20 @@ discard block |
||
145 | 145 | <!-- /.inside --> |
146 | 146 | |
147 | 147 | <div class="give-order-update-box give-admin-box"> |
148 | - <?php do_action( 'give_view_order_details_update_before', $payment_id ); ?> |
|
148 | + <?php do_action('give_view_order_details_update_before', $payment_id); ?> |
|
149 | 149 | <div id="major-publishing-actions"> |
150 | 150 | <div id="publishing-action"> |
151 | - <input type="submit" class="button button-primary right" value="<?php esc_attr_e( 'Save Payment', 'give' ); ?>"/> |
|
152 | - <?php if ( give_is_payment_complete( $payment_id ) ) : ?> |
|
153 | - <a href="<?php echo esc_url( add_query_arg( array( |
|
151 | + <input type="submit" class="button button-primary right" value="<?php esc_attr_e('Save Payment', 'give'); ?>"/> |
|
152 | + <?php if (give_is_payment_complete($payment_id)) : ?> |
|
153 | + <a href="<?php echo esc_url(add_query_arg(array( |
|
154 | 154 | 'give-action' => 'email_links', |
155 | 155 | 'purchase_id' => $payment_id |
156 | - ) ) ); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e( 'Resend Receipt', 'give' ); ?></a> |
|
156 | + ))); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e('Resend Receipt', 'give'); ?></a> |
|
157 | 157 | <?php endif; ?> |
158 | 158 | </div> |
159 | 159 | <div class="clear"></div> |
160 | 160 | </div> |
161 | - <?php do_action( 'give_view_order_details_update_after', $payment_id ); ?> |
|
161 | + <?php do_action('give_view_order_details_update_after', $payment_id); ?> |
|
162 | 162 | </div> |
163 | 163 | <!-- /.give-order-update-box --> |
164 | 164 | |
@@ -168,55 +168,55 @@ discard block |
||
168 | 168 | <div id="give-order-details" class="postbox give-order-data"> |
169 | 169 | |
170 | 170 | <h3 class="hndle"> |
171 | - <span><?php esc_html_e( 'Payment Meta', 'give' ); ?></span> |
|
171 | + <span><?php esc_html_e('Payment Meta', 'give'); ?></span> |
|
172 | 172 | </h3> |
173 | 173 | |
174 | 174 | <div class="inside"> |
175 | 175 | <div class="give-admin-box"> |
176 | 176 | |
177 | - <?php do_action( 'give_view_order_details_payment_meta_before', $payment_id ); ?> |
|
177 | + <?php do_action('give_view_order_details_payment_meta_before', $payment_id); ?> |
|
178 | 178 | |
179 | 179 | <?php |
180 | - $gateway = give_get_payment_gateway( $payment_id ); |
|
181 | - if ( $gateway ) : ?> |
|
180 | + $gateway = give_get_payment_gateway($payment_id); |
|
181 | + if ($gateway) : ?> |
|
182 | 182 | <div class="give-order-gateway give-admin-box-inside"> |
183 | 183 | <p> |
184 | - <strong><?php esc_html_e( 'Gateway:', 'give' ); ?></strong> |
|
185 | - <?php echo give_get_gateway_admin_label( $gateway ); ?> |
|
184 | + <strong><?php esc_html_e('Gateway:', 'give'); ?></strong> |
|
185 | + <?php echo give_get_gateway_admin_label($gateway); ?> |
|
186 | 186 | </p> |
187 | 187 | </div> |
188 | 188 | <?php endif; ?> |
189 | 189 | |
190 | 190 | <div class="give-order-payment-key give-admin-box-inside"> |
191 | 191 | <p> |
192 | - <strong><?php esc_html_e( 'Key:', 'give' ); ?></strong> |
|
193 | - <?php echo give_get_payment_key( $payment_id ); ?> |
|
192 | + <strong><?php esc_html_e('Key:', 'give'); ?></strong> |
|
193 | + <?php echo give_get_payment_key($payment_id); ?> |
|
194 | 194 | </p> |
195 | 195 | </div> |
196 | 196 | |
197 | 197 | <div class="give-order-ip give-admin-box-inside"> |
198 | 198 | <p> |
199 | - <strong><?php esc_html_e( 'IP:', 'give' ); ?></strong> |
|
200 | - <?php echo esc_html( give_get_payment_user_ip( $payment_id ) ); ?> |
|
199 | + <strong><?php esc_html_e('IP:', 'give'); ?></strong> |
|
200 | + <?php echo esc_html(give_get_payment_user_ip($payment_id)); ?> |
|
201 | 201 | </p> |
202 | 202 | </div> |
203 | 203 | |
204 | - <?php if ( $transaction_id ) : ?> |
|
204 | + <?php if ($transaction_id) : ?> |
|
205 | 205 | <div class="give-order-tx-id give-admin-box-inside"> |
206 | 206 | <p> |
207 | - <strong><?php esc_html_e( 'Transaction ID:', 'give' ); ?></strong> |
|
208 | - <?php echo apply_filters( 'give_payment_details_transaction_id-' . $gateway, $transaction_id, $payment_id ); ?> |
|
207 | + <strong><?php esc_html_e('Transaction ID:', 'give'); ?></strong> |
|
208 | + <?php echo apply_filters('give_payment_details_transaction_id-'.$gateway, $transaction_id, $payment_id); ?> |
|
209 | 209 | </p> |
210 | 210 | </div> |
211 | 211 | <?php endif; ?> |
212 | 212 | |
213 | 213 | <div class="give-admin-box-inside"> |
214 | - <p><?php $purchase_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( esc_attr( give_get_payment_user_email( $payment_id ) ) ) ); ?> |
|
215 | - <a href="<?php echo $purchase_url; ?>"><?php esc_html_e( 'View all donations for this donor »', 'give' ); ?></a> |
|
214 | + <p><?php $purchase_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode(esc_attr(give_get_payment_user_email($payment_id)))); ?> |
|
215 | + <a href="<?php echo $purchase_url; ?>"><?php esc_html_e('View all donations for this donor »', 'give'); ?></a> |
|
216 | 216 | </p> |
217 | 217 | </div> |
218 | 218 | |
219 | - <?php do_action( 'give_view_order_details_payment_meta_after', $payment_id ); ?> |
|
219 | + <?php do_action('give_view_order_details_payment_meta_after', $payment_id); ?> |
|
220 | 220 | |
221 | 221 | </div> |
222 | 222 | <!-- /.column-container --> |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | </div> |
228 | 228 | <!-- /#give-order-data --> |
229 | 229 | |
230 | - <?php do_action( 'give_view_order_details_sidebar_after', $payment_id ); ?> |
|
230 | + <?php do_action('give_view_order_details_sidebar_after', $payment_id); ?> |
|
231 | 231 | |
232 | 232 | </div> |
233 | 233 | <!-- /#side-sortables --> |
@@ -238,12 +238,12 @@ discard block |
||
238 | 238 | |
239 | 239 | <div id="normal-sortables" class="meta-box-sortables ui-sortable"> |
240 | 240 | |
241 | - <?php do_action( 'give_view_order_details_main_before', $payment_id ); ?> |
|
241 | + <?php do_action('give_view_order_details_main_before', $payment_id); ?> |
|
242 | 242 | |
243 | 243 | <?php $column_count = 'columns-3'; ?> |
244 | 244 | <div id="give-donation-overview" class="postbox <?php echo $column_count; ?>"> |
245 | 245 | <h3 class="hndle"> |
246 | - <span><?php esc_html_e( 'Donation Information', 'give' ); ?></span> |
|
246 | + <span><?php esc_html_e('Donation Information', 'give'); ?></span> |
|
247 | 247 | </h3> |
248 | 248 | |
249 | 249 | <div class="inside"> |
@@ -251,32 +251,32 @@ discard block |
||
251 | 251 | <table style="width:100%;"> |
252 | 252 | <thead> |
253 | 253 | <tr> |
254 | - <?php do_action( 'give_donation_details_thead_before', $payment_id ); ?> |
|
255 | - <th><?php esc_html_e( 'Donation Form ID', 'give' ) ?></th> |
|
256 | - <th><?php esc_html_e( 'Donation Form Title', 'give' ) ?></th> |
|
257 | - <th><?php esc_html_e( 'Donation Level', 'give' ) ?></th> |
|
258 | - <th><?php esc_html_e( 'Donation Date', 'give' ) ?></th> |
|
259 | - <th><?php esc_html_e( 'Total Donation', 'give' ) ?></th> |
|
260 | - <?php do_action( 'give_donation_details_thead_after', $payment_id ); ?> |
|
254 | + <?php do_action('give_donation_details_thead_before', $payment_id); ?> |
|
255 | + <th><?php esc_html_e('Donation Form ID', 'give') ?></th> |
|
256 | + <th><?php esc_html_e('Donation Form Title', 'give') ?></th> |
|
257 | + <th><?php esc_html_e('Donation Level', 'give') ?></th> |
|
258 | + <th><?php esc_html_e('Donation Date', 'give') ?></th> |
|
259 | + <th><?php esc_html_e('Total Donation', 'give') ?></th> |
|
260 | + <?php do_action('give_donation_details_thead_after', $payment_id); ?> |
|
261 | 261 | </tr> |
262 | 262 | </thead> |
263 | 263 | <tr> |
264 | - <?php do_action( 'give_donation_details_tbody_before', $payment_id ); ?> |
|
264 | + <?php do_action('give_donation_details_tbody_before', $payment_id); ?> |
|
265 | 265 | <td> |
266 | 266 | <?php echo $payment_meta['form_id']; ?> |
267 | 267 | </td> |
268 | 268 | <td> |
269 | - <?php give_get_form_dropdown( array( |
|
269 | + <?php give_get_form_dropdown(array( |
|
270 | 270 | 'id' => $payment_meta['form_id'], |
271 | 271 | 'selected' => $payment_meta['form_id'], |
272 | 272 | 'chosen' => true |
273 | - ), true ); ?> |
|
273 | + ), true); ?> |
|
274 | 274 | </td> |
275 | 275 | <td> |
276 | 276 | <?php |
277 | - $var_prices = give_has_variable_prices( $payment_meta['form_id'] ); |
|
278 | - if ( empty( $var_prices ) ) { |
|
279 | - echo esc_html__( 'n/a', 'give' ); |
|
277 | + $var_prices = give_has_variable_prices($payment_meta['form_id']); |
|
278 | + if (empty($var_prices)) { |
|
279 | + echo esc_html__('n/a', 'give'); |
|
280 | 280 | } else { |
281 | 281 | // Variable price dropdown options. |
282 | 282 | $variable_price_dropdown_option = array( |
@@ -288,20 +288,20 @@ discard block |
||
288 | 288 | ); |
289 | 289 | |
290 | 290 | // Render variable prices select tag html. |
291 | - give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true ); |
|
291 | + give_get_form_variable_price_dropdown($variable_price_dropdown_option, true); |
|
292 | 292 | } |
293 | 293 | ?> |
294 | 294 | </td> |
295 | 295 | <td> |
296 | 296 | <?php |
297 | 297 | //Transaction Date |
298 | - $date_format = get_option( 'date_format' ); |
|
299 | - echo date_i18n( $date_format, strtotime( $payment_date ) ); |
|
298 | + $date_format = get_option('date_format'); |
|
299 | + echo date_i18n($date_format, strtotime($payment_date)); |
|
300 | 300 | ?> |
301 | 301 | </td> |
302 | 302 | <td> |
303 | - <?php echo esc_html( give_currency_filter( give_format_amount( give_get_payment_amount( $payment_id ) ) ) ); ?></td> |
|
304 | - <?php do_action( 'give_donation_details_tbody_after', $payment_id ); ?> |
|
303 | + <?php echo esc_html(give_currency_filter(give_format_amount(give_get_payment_amount($payment_id)))); ?></td> |
|
304 | + <?php do_action('give_donation_details_tbody_after', $payment_id); ?> |
|
305 | 305 | |
306 | 306 | </tr> |
307 | 307 | </table> |
@@ -313,64 +313,64 @@ discard block |
||
313 | 313 | </div> |
314 | 314 | <!-- /#give-donation-overview --> |
315 | 315 | |
316 | - <?php do_action( 'give_view_order_details_files_after', $payment_id ); ?> |
|
316 | + <?php do_action('give_view_order_details_files_after', $payment_id); ?> |
|
317 | 317 | |
318 | - <?php do_action( 'give_view_order_details_billing_before', $payment_id ); ?> |
|
318 | + <?php do_action('give_view_order_details_billing_before', $payment_id); ?> |
|
319 | 319 | |
320 | 320 | |
321 | 321 | <div id="give-customer-details" class="postbox"> |
322 | 322 | <h3 class="hndle"> |
323 | - <span><?php esc_html_e( 'Donor Details', 'give' ); ?></span> |
|
323 | + <span><?php esc_html_e('Donor Details', 'give'); ?></span> |
|
324 | 324 | </h3> |
325 | 325 | |
326 | 326 | <div class="inside give-clearfix"> |
327 | 327 | |
328 | - <?php $customer = new Give_Customer( $customer_id ); ?> |
|
328 | + <?php $customer = new Give_Customer($customer_id); ?> |
|
329 | 329 | |
330 | 330 | <div class="column-container customer-info"> |
331 | 331 | <div class="column"> |
332 | - <?php echo Give()->html->donor_dropdown( array( |
|
332 | + <?php echo Give()->html->donor_dropdown(array( |
|
333 | 333 | 'selected' => $customer->id, |
334 | 334 | 'name' => 'customer-id' |
335 | - ) ); ?> |
|
335 | + )); ?> |
|
336 | 336 | </div> |
337 | 337 | <div class="column"> |
338 | 338 | <input type="hidden" name="give-current-customer" value="<?php echo $customer->id; ?>"/> |
339 | 339 | </div> |
340 | 340 | <div class="column"> |
341 | - <?php if ( ! empty( $customer->id ) ) : ?> |
|
342 | - <?php $customer_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ); ?> |
|
343 | - <a href="<?php echo $customer_url; ?>"><?php esc_html_e( 'View Donor Details', 'give' ); ?></a> |
|
341 | + <?php if ( ! empty($customer->id)) : ?> |
|
342 | + <?php $customer_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id); ?> |
|
343 | + <a href="<?php echo $customer_url; ?>"><?php esc_html_e('View Donor Details', 'give'); ?></a> |
|
344 | 344 | | |
345 | 345 | <?php endif; ?> |
346 | - <a href="#new" class="give-payment-new-customer"><?php esc_html_e( 'New Donor', 'give' ); ?></a> |
|
346 | + <a href="#new" class="give-payment-new-customer"><?php esc_html_e('New Donor', 'give'); ?></a> |
|
347 | 347 | </div> |
348 | 348 | </div> |
349 | 349 | |
350 | 350 | <div class="column-container new-customer" style="display: none"> |
351 | 351 | <div class="column"> |
352 | - <label for="give-new-customer-name"><?php esc_html_e( 'Name:', 'give' ); ?></label> |
|
352 | + <label for="give-new-customer-name"><?php esc_html_e('Name:', 'give'); ?></label> |
|
353 | 353 | <input id="give-new-customer-name" type="text" name="give-new-customer-name" value="" class="medium-text"/> |
354 | 354 | </div> |
355 | 355 | <div class="column"> |
356 | - <label for="give-new-customer-email"><?php esc_html_e( 'Email:', 'give' ); ?></label> |
|
356 | + <label for="give-new-customer-email"><?php esc_html_e('Email:', 'give'); ?></label> |
|
357 | 357 | <input id="give-new-customer-email" type="email" name="give-new-customer-email" value="" class="medium-text"/> |
358 | 358 | </div> |
359 | 359 | <div class="column"> |
360 | 360 | <input type="hidden" id="give-new-customer" name="give-new-customer" value="0"/> |
361 | - <a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
361 | + <a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
362 | 362 | </div> |
363 | 363 | <div class="column"> |
364 | 364 | <small> |
365 | - <em><?php esc_html_e( '* Click "Save Payment" to create new donor.', 'give' ); ?></em> |
|
365 | + <em><?php esc_html_e('* Click "Save Payment" to create new donor.', 'give'); ?></em> |
|
366 | 366 | </small> |
367 | 367 | </div> |
368 | 368 | </div> |
369 | 369 | |
370 | 370 | <?php |
371 | 371 | // The give_payment_personal_details_list hook is left here for backwards compatibility |
372 | - do_action( 'give_payment_personal_details_list', $payment_meta, $user_info ); |
|
373 | - do_action( 'give_payment_view_details', $payment_id ); |
|
372 | + do_action('give_payment_personal_details_list', $payment_meta, $user_info); |
|
373 | + do_action('give_payment_view_details', $payment_id); |
|
374 | 374 | ?> |
375 | 375 | |
376 | 376 | </div> |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | |
382 | 382 | <div id="give-billing-details" class="postbox"> |
383 | 383 | <h3 class="hndle"> |
384 | - <span><?php esc_html_e( 'Billing Address', 'give' ); ?></span> |
|
384 | + <span><?php esc_html_e('Billing Address', 'give'); ?></span> |
|
385 | 385 | </h3> |
386 | 386 | |
387 | 387 | <div class="inside give-clearfix"> |
@@ -392,62 +392,62 @@ discard block |
||
392 | 392 | <div class="data column-container"> |
393 | 393 | <div class="column"> |
394 | 394 | <div class="give-wrap-address-line1"> |
395 | - <label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e( 'Address 1:', 'give' ); ?></label> |
|
396 | - <input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr( $address['line1'] ); ?>" class="medium-text"/> |
|
395 | + <label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e('Address 1:', 'give'); ?></label> |
|
396 | + <input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr($address['line1']); ?>" class="medium-text"/> |
|
397 | 397 | </div> |
398 | 398 | |
399 | 399 | <div class="give-wrap-address-line2"> |
400 | - <label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e( 'Address 2:', 'give' ); ?></label> |
|
401 | - <input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr( $address['line2'] ); ?>" class="medium-text"/> |
|
400 | + <label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e('Address 2:', 'give'); ?></label> |
|
401 | + <input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr($address['line2']); ?>" class="medium-text"/> |
|
402 | 402 | </div> |
403 | 403 | |
404 | 404 | </div> |
405 | 405 | <div class="column"> |
406 | 406 | <div class="give-wrap-address-city"> |
407 | - <label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e( 'City:', 'give' ); ?></label> |
|
408 | - <input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr( $address['city'] ); ?>" class="medium-text"/> |
|
407 | + <label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e('City:', 'give'); ?></label> |
|
408 | + <input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr($address['city']); ?>" class="medium-text"/> |
|
409 | 409 | |
410 | 410 | </div> |
411 | 411 | |
412 | 412 | <div class="give-wrap-address-zip"> |
413 | - <label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e( 'Zip / Postal Code:', 'give' ); ?></label> |
|
414 | - <input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr( $address['zip'] ); ?>" class="medium-text"/> |
|
413 | + <label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e('Zip / Postal Code:', 'give'); ?></label> |
|
414 | + <input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr($address['zip']); ?>" class="medium-text"/> |
|
415 | 415 | |
416 | 416 | </div> |
417 | 417 | </div> |
418 | 418 | <div class="column"> |
419 | 419 | <div id="give-order-address-country-wrap"> |
420 | - <label class="order-data-address-line"><?php esc_html_e( 'Country:', 'give' ); ?></label> |
|
420 | + <label class="order-data-address-line"><?php esc_html_e('Country:', 'give'); ?></label> |
|
421 | 421 | <?php |
422 | - echo Give()->html->select( array( |
|
422 | + echo Give()->html->select(array( |
|
423 | 423 | 'options' => give_get_country_list(), |
424 | 424 | 'name' => 'give-payment-address[0][country]', |
425 | 425 | 'selected' => $address['country'], |
426 | 426 | 'show_option_all' => false, |
427 | 427 | 'show_option_none' => false, |
428 | 428 | 'chosen' => true, |
429 | - 'placeholder' => esc_attr__( 'Select a country', 'give' ) |
|
430 | - ) ); |
|
429 | + 'placeholder' => esc_attr__('Select a country', 'give') |
|
430 | + )); |
|
431 | 431 | ?> |
432 | 432 | </div> |
433 | 433 | |
434 | 434 | <div id="give-order-address-state-wrap"> |
435 | - <label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e( 'State / Province:', 'give' ); ?></label> |
|
435 | + <label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e('State / Province:', 'give'); ?></label> |
|
436 | 436 | <?php |
437 | - $states = give_get_states( $address['country'] ); |
|
438 | - if ( ! empty( $states ) ) { |
|
439 | - echo Give()->html->select( array( |
|
437 | + $states = give_get_states($address['country']); |
|
438 | + if ( ! empty($states)) { |
|
439 | + echo Give()->html->select(array( |
|
440 | 440 | 'options' => $states, |
441 | 441 | 'name' => 'give-payment-address[0][state]', |
442 | 442 | 'selected' => $address['state'], |
443 | 443 | 'show_option_all' => false, |
444 | 444 | 'show_option_none' => false, |
445 | 445 | 'chosen' => true, |
446 | - 'placeholder' => esc_attr__( 'Select a state', 'give' ) |
|
447 | - ) ); |
|
446 | + 'placeholder' => esc_attr__('Select a state', 'give') |
|
447 | + )); |
|
448 | 448 | } else { |
449 | 449 | ?> |
450 | - <input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr( $address['state'] ); ?>" class="medium-text"/> |
|
450 | + <input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr($address['state']); ?>" class="medium-text"/> |
|
451 | 451 | <?php |
452 | 452 | } ?> |
453 | 453 | </div> |
@@ -457,38 +457,38 @@ discard block |
||
457 | 457 | </div> |
458 | 458 | <!-- /#give-order-address --> |
459 | 459 | |
460 | - <?php do_action( 'give_payment_billing_details', $payment_id ); ?> |
|
460 | + <?php do_action('give_payment_billing_details', $payment_id); ?> |
|
461 | 461 | |
462 | 462 | </div> |
463 | 463 | <!-- /.inside --> |
464 | 464 | </div> |
465 | 465 | <!-- /#give-billing-details --> |
466 | 466 | |
467 | - <?php do_action( 'give_view_order_details_billing_after', $payment_id ); ?> |
|
467 | + <?php do_action('give_view_order_details_billing_after', $payment_id); ?> |
|
468 | 468 | |
469 | 469 | <div id="give-payment-notes" class="postbox"> |
470 | - <h3 class="hndle"><span><?php esc_html_e( 'Payment Notes', 'give' ); ?></span></h3> |
|
470 | + <h3 class="hndle"><span><?php esc_html_e('Payment Notes', 'give'); ?></span></h3> |
|
471 | 471 | |
472 | 472 | <div class="inside"> |
473 | 473 | <div id="give-payment-notes-inner"> |
474 | 474 | <?php |
475 | - $notes = give_get_payment_notes( $payment_id ); |
|
476 | - if ( ! empty( $notes ) ) : |
|
475 | + $notes = give_get_payment_notes($payment_id); |
|
476 | + if ( ! empty($notes)) : |
|
477 | 477 | $no_notes_display = ' style="display:none;"'; |
478 | - foreach ( $notes as $note ) : |
|
478 | + foreach ($notes as $note) : |
|
479 | 479 | |
480 | - echo give_get_payment_note_html( $note, $payment_id ); |
|
480 | + echo give_get_payment_note_html($note, $payment_id); |
|
481 | 481 | |
482 | 482 | endforeach; |
483 | 483 | else : |
484 | 484 | $no_notes_display = ''; |
485 | 485 | endif; |
486 | - echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . esc_html__( 'No payment notes', 'give' ) . '</p>'; ?> |
|
486 | + echo '<p class="give-no-payment-notes"'.$no_notes_display.'>'.esc_html__('No payment notes', 'give').'</p>'; ?> |
|
487 | 487 | </div> |
488 | 488 | <textarea name="give-payment-note" id="give-payment-note" class="large-text"></textarea> |
489 | 489 | |
490 | 490 | <div class="give-clearfix"> |
491 | - <button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint( $payment_id ); ?>"><?php esc_html_e( 'Add Note', 'give' ); ?></button> |
|
491 | + <button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint($payment_id); ?>"><?php esc_html_e('Add Note', 'give'); ?></button> |
|
492 | 492 | </div> |
493 | 493 | |
494 | 494 | </div> |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | </div> |
497 | 497 | <!-- /#give-payment-notes --> |
498 | 498 | |
499 | - <?php do_action( 'give_view_order_details_main_after', $payment_id ); ?> |
|
499 | + <?php do_action('give_view_order_details_main_after', $payment_id); ?> |
|
500 | 500 | </div> |
501 | 501 | <!-- /#normal-sortables --> |
502 | 502 | </div> |
@@ -507,10 +507,10 @@ discard block |
||
507 | 507 | <!-- #give-dashboard-widgets-wrap --> |
508 | 508 | </div> |
509 | 509 | <!-- /#post-stuff --> |
510 | - <?php do_action( 'give_view_order_details_form_bottom', $payment_id ); ?> |
|
511 | - <?php wp_nonce_field( 'give_update_payment_details_nonce' ); ?> |
|
512 | - <input type="hidden" name="give_payment_id" value="<?php echo esc_attr( $payment_id ); ?>"/> |
|
510 | + <?php do_action('give_view_order_details_form_bottom', $payment_id); ?> |
|
511 | + <?php wp_nonce_field('give_update_payment_details_nonce'); ?> |
|
512 | + <input type="hidden" name="give_payment_id" value="<?php echo esc_attr($payment_id); ?>"/> |
|
513 | 513 | <input type="hidden" name="give_action" value="update_payment_details"/> |
514 | 514 | </form> |
515 | - <?php do_action( 'give_view_order_details_after', $payment_id ); ?> |
|
515 | + <?php do_action('give_view_order_details_after', $payment_id); ?> |
|
516 | 516 | </div><!-- /.wrap --> |
@@ -10,13 +10,13 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
17 | 17 | // Load WP_List_Table if not loaded |
18 | -if ( ! class_exists( 'WP_List_Table' ) ) { |
|
19 | - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; |
|
18 | +if ( ! class_exists('WP_List_Table')) { |
|
19 | + require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php'; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -118,37 +118,37 @@ discard block |
||
118 | 118 | public function __construct() { |
119 | 119 | |
120 | 120 | // Set parent defaults |
121 | - parent::__construct( array( |
|
122 | - 'singular' => give_get_forms_label_singular(), // Singular name of the listed records |
|
123 | - 'plural' => give_get_forms_label_plural(), // Plural name of the listed records |
|
121 | + parent::__construct(array( |
|
122 | + 'singular' => give_get_forms_label_singular(), // Singular name of the listed records |
|
123 | + 'plural' => give_get_forms_label_plural(), // Plural name of the listed records |
|
124 | 124 | 'ajax' => false // Does this table support ajax? |
125 | - ) ); |
|
125 | + )); |
|
126 | 126 | |
127 | 127 | $this->get_payment_counts(); |
128 | 128 | $this->process_bulk_action(); |
129 | - $this->base_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); |
|
129 | + $this->base_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history'); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | public function advanced_filters() { |
133 | - $start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null; |
|
134 | - $end_date = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : null; |
|
135 | - $status = isset( $_GET['status'] ) ? $_GET['status'] : ''; |
|
133 | + $start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null; |
|
134 | + $end_date = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : null; |
|
135 | + $status = isset($_GET['status']) ? $_GET['status'] : ''; |
|
136 | 136 | ?> |
137 | 137 | <div id="give-payment-filters"> |
138 | 138 | <span id="give-payment-date-filters"> |
139 | - <label for="start-date" class="give-start-date-label"><?php esc_html_e( 'Start Date:', 'give' ); ?></label> |
|
139 | + <label for="start-date" class="give-start-date-label"><?php esc_html_e('Start Date:', 'give'); ?></label> |
|
140 | 140 | <input type="text" id="start-date" name="start-date" class="give_datepicker" value="<?php echo $start_date; ?>" placeholder="mm/dd/yyyy"/> |
141 | - <label for="end-date" class="give-end-date-label"><?php esc_html_e( 'End Date:', 'give' ); ?></label> |
|
141 | + <label for="end-date" class="give-end-date-label"><?php esc_html_e('End Date:', 'give'); ?></label> |
|
142 | 142 | <input type="text" id="end-date" name="end-date" class="give_datepicker" value="<?php echo $end_date; ?>" placeholder="mm/dd/yyyy"/> |
143 | - <input type="submit" class="button-secondary" value="<?php esc_attr_e( 'Apply', 'give' ); ?>"/> |
|
143 | + <input type="submit" class="button-secondary" value="<?php esc_attr_e('Apply', 'give'); ?>"/> |
|
144 | 144 | </span> |
145 | - <?php if ( ! empty( $status ) ) : ?> |
|
146 | - <input type="hidden" name="status" value="<?php echo esc_attr( $status ); ?>"/> |
|
145 | + <?php if ( ! empty($status)) : ?> |
|
146 | + <input type="hidden" name="status" value="<?php echo esc_attr($status); ?>"/> |
|
147 | 147 | <?php endif; ?> |
148 | - <?php if ( ! empty( $start_date ) || ! empty( $end_date ) ) : ?> |
|
149 | - <a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>" class="button-secondary"><?php esc_html_e( 'Clear Filter', 'give' ); ?></a> |
|
148 | + <?php if ( ! empty($start_date) || ! empty($end_date)) : ?> |
|
149 | + <a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>" class="button-secondary"><?php esc_html_e('Clear Filter', 'give'); ?></a> |
|
150 | 150 | <?php endif; ?> |
151 | - <?php $this->search_box( esc_html__( 'Search', 'give' ), 'give-payments' ); ?> |
|
151 | + <?php $this->search_box(esc_html__('Search', 'give'), 'give-payments'); ?> |
|
152 | 152 | </div> |
153 | 153 | |
154 | 154 | <?php |
@@ -165,18 +165,18 @@ discard block |
||
165 | 165 | * |
166 | 166 | * @return void |
167 | 167 | */ |
168 | - public function search_box( $text, $input_id ) { |
|
169 | - if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) { |
|
168 | + public function search_box($text, $input_id) { |
|
169 | + if (empty($_REQUEST['s']) && ! $this->has_items()) { |
|
170 | 170 | return; |
171 | 171 | } |
172 | 172 | |
173 | - $input_id = $input_id . '-search-input'; |
|
173 | + $input_id = $input_id.'-search-input'; |
|
174 | 174 | |
175 | - if ( ! empty( $_REQUEST['orderby'] ) ) { |
|
176 | - echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />'; |
|
175 | + if ( ! empty($_REQUEST['orderby'])) { |
|
176 | + echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />'; |
|
177 | 177 | } |
178 | - if ( ! empty( $_REQUEST['order'] ) ) { |
|
179 | - echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />'; |
|
178 | + if ( ! empty($_REQUEST['order'])) { |
|
179 | + echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />'; |
|
180 | 180 | } |
181 | 181 | ?> |
182 | 182 | <p class="search-box"> |
@@ -188,11 +188,11 @@ discard block |
||
188 | 188 | * |
189 | 189 | * @since 1.0 |
190 | 190 | */ |
191 | - do_action( 'give_payment_history_search' ); |
|
191 | + do_action('give_payment_history_search'); |
|
192 | 192 | ?> |
193 | 193 | <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label> |
194 | 194 | <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/> |
195 | - <?php submit_button( $text, 'button', false, false, array( 'ID' => 'search-submit' ) ); ?><br/> |
|
195 | + <?php submit_button($text, 'button', false, false, array('ID' => 'search-submit')); ?><br/> |
|
196 | 196 | </p> |
197 | 197 | <?php |
198 | 198 | } |
@@ -206,52 +206,52 @@ discard block |
||
206 | 206 | */ |
207 | 207 | public function get_views() { |
208 | 208 | |
209 | - $current = isset( $_GET['status'] ) ? $_GET['status'] : ''; |
|
210 | - $total_count = ' <span class="count">(' . $this->total_count . ')</span>'; |
|
211 | - $complete_count = ' <span class="count">(' . $this->complete_count . ')</span>'; |
|
212 | - $cancelled_count = ' <span class="count">(' . $this->cancelled_count . ')</span>'; |
|
213 | - $pending_count = ' <span class="count">(' . $this->pending_count . ')</span>'; |
|
214 | - $refunded_count = ' <span class="count">(' . $this->refunded_count . ')</span>'; |
|
215 | - $failed_count = ' <span class="count">(' . $this->failed_count . ')</span>'; |
|
216 | - $abandoned_count = ' <span class="count">(' . $this->abandoned_count . ')</span>'; |
|
217 | - $revoked_count = ' <span class="count">(' . $this->revoked_count . ')</span>'; |
|
209 | + $current = isset($_GET['status']) ? $_GET['status'] : ''; |
|
210 | + $total_count = ' <span class="count">('.$this->total_count.')</span>'; |
|
211 | + $complete_count = ' <span class="count">('.$this->complete_count.')</span>'; |
|
212 | + $cancelled_count = ' <span class="count">('.$this->cancelled_count.')</span>'; |
|
213 | + $pending_count = ' <span class="count">('.$this->pending_count.')</span>'; |
|
214 | + $refunded_count = ' <span class="count">('.$this->refunded_count.')</span>'; |
|
215 | + $failed_count = ' <span class="count">('.$this->failed_count.')</span>'; |
|
216 | + $abandoned_count = ' <span class="count">('.$this->abandoned_count.')</span>'; |
|
217 | + $revoked_count = ' <span class="count">('.$this->revoked_count.')</span>'; |
|
218 | 218 | |
219 | 219 | $views = array( |
220 | - 'all' => sprintf( '<a href="%s"%s>%s</a>', remove_query_arg( array( |
|
220 | + 'all' => sprintf('<a href="%s"%s>%s</a>', remove_query_arg(array( |
|
221 | 221 | 'status', |
222 | 222 | 'paged' |
223 | - ) ), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__( 'All', 'give' ) . $total_count ), |
|
224 | - 'publish' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array( |
|
223 | + )), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__('All', 'give').$total_count), |
|
224 | + 'publish' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( |
|
225 | 225 | 'status' => 'publish', |
226 | 226 | 'paged' => false |
227 | - ) ) ), $current === 'publish' ? ' class="current"' : '', esc_html__( 'Completed', 'give' ) . $complete_count ), |
|
228 | - 'pending' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array( |
|
227 | + ))), $current === 'publish' ? ' class="current"' : '', esc_html__('Completed', 'give').$complete_count), |
|
228 | + 'pending' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( |
|
229 | 229 | 'status' => 'pending', |
230 | 230 | 'paged' => false |
231 | - ) ) ), $current === 'pending' ? ' class="current"' : '', esc_html__( 'Pending', 'give' ) . $pending_count ), |
|
232 | - 'refunded' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array( |
|
231 | + ))), $current === 'pending' ? ' class="current"' : '', esc_html__('Pending', 'give').$pending_count), |
|
232 | + 'refunded' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( |
|
233 | 233 | 'status' => 'refunded', |
234 | 234 | 'paged' => false |
235 | - ) ) ), $current === 'refunded' ? ' class="current"' : '', esc_html__( 'Refunded', 'give' ) . $refunded_count ), |
|
236 | - 'revoked' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array( |
|
235 | + ))), $current === 'refunded' ? ' class="current"' : '', esc_html__('Refunded', 'give').$refunded_count), |
|
236 | + 'revoked' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( |
|
237 | 237 | 'status' => 'revoked', |
238 | 238 | 'paged' => false |
239 | - ) ) ), $current === 'revoked' ? ' class="current"' : '', esc_html__( 'Revoked', 'give' ) . $revoked_count ), |
|
240 | - 'failed' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array( |
|
239 | + ))), $current === 'revoked' ? ' class="current"' : '', esc_html__('Revoked', 'give').$revoked_count), |
|
240 | + 'failed' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( |
|
241 | 241 | 'status' => 'failed', |
242 | 242 | 'paged' => false |
243 | - ) ) ), $current === 'failed' ? ' class="current"' : '', esc_html__( 'Failed', 'give' ) . $failed_count ), |
|
244 | - 'cancelled' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array( |
|
243 | + ))), $current === 'failed' ? ' class="current"' : '', esc_html__('Failed', 'give').$failed_count), |
|
244 | + 'cancelled' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( |
|
245 | 245 | 'status' => 'cancelled', |
246 | 246 | 'paged' => false |
247 | - ) ) ), $current === 'cancelled' ? ' class="current"' : '', esc_html__( 'Cancelled', 'give' ) . $cancelled_count ), |
|
248 | - 'abandoned' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array( |
|
247 | + ))), $current === 'cancelled' ? ' class="current"' : '', esc_html__('Cancelled', 'give').$cancelled_count), |
|
248 | + 'abandoned' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( |
|
249 | 249 | 'status' => 'abandoned', |
250 | 250 | 'paged' => false |
251 | - ) ) ), $current === 'abandoned' ? ' class="current"' : '', esc_html__( 'Abandoned', 'give' ) . $abandoned_count ) |
|
251 | + ))), $current === 'abandoned' ? ' class="current"' : '', esc_html__('Abandoned', 'give').$abandoned_count) |
|
252 | 252 | ); |
253 | 253 | |
254 | - return apply_filters( 'give_payments_table_views', $views ); |
|
254 | + return apply_filters('give_payments_table_views', $views); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | /** |
@@ -264,15 +264,15 @@ discard block |
||
264 | 264 | public function get_columns() { |
265 | 265 | $columns = array( |
266 | 266 | 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text |
267 | - 'donation' => esc_html__( 'Donation', 'give' ), |
|
268 | - 'donation_form' => esc_html__( 'Donation Form', 'give' ), |
|
269 | - 'status' => esc_html__( 'Status', 'give' ), |
|
270 | - 'date' => esc_html__( 'Date', 'give' ), |
|
271 | - 'amount' => esc_html__( 'Amount', 'give' ), |
|
272 | - 'details' => esc_html__( 'Details', 'give' ), |
|
267 | + 'donation' => esc_html__('Donation', 'give'), |
|
268 | + 'donation_form' => esc_html__('Donation Form', 'give'), |
|
269 | + 'status' => esc_html__('Status', 'give'), |
|
270 | + 'date' => esc_html__('Date', 'give'), |
|
271 | + 'amount' => esc_html__('Amount', 'give'), |
|
272 | + 'details' => esc_html__('Details', 'give'), |
|
273 | 273 | ); |
274 | 274 | |
275 | - return apply_filters( 'give_payments_table_columns', $columns ); |
|
275 | + return apply_filters('give_payments_table_columns', $columns); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | /** |
@@ -284,12 +284,12 @@ discard block |
||
284 | 284 | */ |
285 | 285 | public function get_sortable_columns() { |
286 | 286 | $columns = array( |
287 | - 'donation' => array( 'ID', true ), |
|
288 | - 'amount' => array( 'amount', false ), |
|
289 | - 'date' => array( 'date', false ) |
|
287 | + 'donation' => array('ID', true), |
|
288 | + 'amount' => array('amount', false), |
|
289 | + 'date' => array('date', false) |
|
290 | 290 | ); |
291 | 291 | |
292 | - return apply_filters( 'give_payments_table_sortable_columns', $columns ); |
|
292 | + return apply_filters('give_payments_table_sortable_columns', $columns); |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | /** |
@@ -315,65 +315,65 @@ discard block |
||
315 | 315 | * |
316 | 316 | * @return string Column Name |
317 | 317 | */ |
318 | - public function column_default( $payment, $column_name ) { |
|
318 | + public function column_default($payment, $column_name) { |
|
319 | 319 | |
320 | - $single_transaction_url = esc_url( add_query_arg( 'id', $payment->ID, admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details' ) ) ); |
|
321 | - $row_actions = $this->get_row_actions( $payment ); |
|
320 | + $single_transaction_url = esc_url(add_query_arg('id', $payment->ID, admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details'))); |
|
321 | + $row_actions = $this->get_row_actions($payment); |
|
322 | 322 | |
323 | - switch ( $column_name ) { |
|
323 | + switch ($column_name) { |
|
324 | 324 | case 'donation' : |
325 | 325 | $value = sprintf( |
326 | 326 | /* translators: 1: Payment link 2: Donor link */ |
327 | - esc_html__( '%1$s by %2$s', 'give' ), |
|
327 | + esc_html__('%1$s by %2$s', 'give'), |
|
328 | 328 | sprintf( |
329 | 329 | '<a href="%1$s">#%2$s</a>', |
330 | - get_permalink( $payment->ID ), |
|
330 | + get_permalink($payment->ID), |
|
331 | 331 | $payment->ID |
332 | 332 | ), |
333 | 333 | sprintf( |
334 | 334 | '%1$s<br>%2$s', |
335 | - $this->get_donor( $payment ), |
|
336 | - $this->get_donor_email( $payment ) |
|
335 | + $this->get_donor($payment), |
|
336 | + $this->get_donor_email($payment) |
|
337 | 337 | ) |
338 | 338 | ); |
339 | 339 | break; |
340 | 340 | |
341 | 341 | case 'amount' : |
342 | - $amount = ! empty( $payment->total ) ? $payment->total : 0; |
|
343 | - $value = give_currency_filter( give_format_amount( $amount ), give_get_payment_currency_code( $payment->ID ) ); |
|
342 | + $amount = ! empty($payment->total) ? $payment->total : 0; |
|
343 | + $value = give_currency_filter(give_format_amount($amount), give_get_payment_currency_code($payment->ID)); |
|
344 | 344 | break; |
345 | 345 | |
346 | 346 | case 'donation_form' : |
347 | 347 | |
348 | - $value = '<a href="' . admin_url( 'post.php?post=' . $payment->form_id . '&action=edit' ) . '">' . $payment->form_title . '</a>'; |
|
349 | - $level = give_get_payment_form_title( $payment->meta, true ); |
|
348 | + $value = '<a href="'.admin_url('post.php?post='.$payment->form_id.'&action=edit').'">'.$payment->form_title.'</a>'; |
|
349 | + $level = give_get_payment_form_title($payment->meta, true); |
|
350 | 350 | |
351 | - if ( ! empty( $level ) ) { |
|
351 | + if ( ! empty($level)) { |
|
352 | 352 | $value .= $level; |
353 | 353 | } |
354 | 354 | |
355 | 355 | break; |
356 | 356 | |
357 | 357 | case 'date' : |
358 | - $date = strtotime( $payment->date ); |
|
359 | - $value = date_i18n( get_option( 'date_format' ), $date ); |
|
358 | + $date = strtotime($payment->date); |
|
359 | + $value = date_i18n(get_option('date_format'), $date); |
|
360 | 360 | break; |
361 | 361 | |
362 | 362 | case 'status' : |
363 | - $value = $this->get_payment_status( $payment ); |
|
363 | + $value = $this->get_payment_status($payment); |
|
364 | 364 | break; |
365 | 365 | |
366 | 366 | case 'details' : |
367 | - $value = '<div class="give-payment-details-link-wrap"><a href="' . $single_transaction_url . '" data-tooltip="' . __( 'View details', 'give' ) . '" class="give-payment-details-link button button-small" title="' . __( 'View Details', 'give' ) . '"><span class="dashicons dashicons-visibility"></span></a></div>'; |
|
367 | + $value = '<div class="give-payment-details-link-wrap"><a href="'.$single_transaction_url.'" data-tooltip="'.__('View details', 'give').'" class="give-payment-details-link button button-small" title="'.__('View Details', 'give').'"><span class="dashicons dashicons-visibility"></span></a></div>'; |
|
368 | 368 | break; |
369 | 369 | |
370 | 370 | default: |
371 | - $value = isset( $payment->$column_name ) ? $payment->$column_name : ''; |
|
371 | + $value = isset($payment->$column_name) ? $payment->$column_name : ''; |
|
372 | 372 | break; |
373 | 373 | |
374 | 374 | } |
375 | 375 | |
376 | - return apply_filters( 'give_payments_table_column', $value, $payment->ID, $column_name ); |
|
376 | + return apply_filters('give_payments_table_column', $value, $payment->ID, $column_name); |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | /** |
@@ -386,17 +386,17 @@ discard block |
||
386 | 386 | * |
387 | 387 | * @return string Data shown in the Email column |
388 | 388 | */ |
389 | - public function get_donor_email( $payment ) { |
|
389 | + public function get_donor_email($payment) { |
|
390 | 390 | |
391 | - $email = give_get_payment_user_email( $payment->ID ); |
|
391 | + $email = give_get_payment_user_email($payment->ID); |
|
392 | 392 | |
393 | - if ( empty( $email ) ) { |
|
394 | - $email = esc_html__( '(unknown)', 'give' ); |
|
393 | + if (empty($email)) { |
|
394 | + $email = esc_html__('(unknown)', 'give'); |
|
395 | 395 | } |
396 | 396 | |
397 | - $value = '<a href="mailto:' . $email . '" data-tooltip="' . __( 'Email donor', 'give' ) . '">' . $email . '</a>'; |
|
397 | + $value = '<a href="mailto:'.$email.'" data-tooltip="'.__('Email donor', 'give').'">'.$email.'</a>'; |
|
398 | 398 | |
399 | - return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'email' ); |
|
399 | + return apply_filters('give_payments_table_column', $value, $payment->ID, 'email'); |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | /** |
@@ -406,31 +406,31 @@ discard block |
||
406 | 406 | * |
407 | 407 | * @return mixed|void |
408 | 408 | */ |
409 | - function get_row_actions( $payment ) { |
|
409 | + function get_row_actions($payment) { |
|
410 | 410 | |
411 | 411 | $row_actions = array(); |
412 | - $email = give_get_payment_user_email( $payment->ID ); |
|
412 | + $email = give_get_payment_user_email($payment->ID); |
|
413 | 413 | |
414 | 414 | // Add search term string back to base URL |
415 | - $search_terms = ( isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '' ); |
|
416 | - if ( ! empty( $search_terms ) ) { |
|
417 | - $this->base_url = add_query_arg( 's', $search_terms, $this->base_url ); |
|
415 | + $search_terms = (isset($_GET['s']) ? trim($_GET['s']) : ''); |
|
416 | + if ( ! empty($search_terms)) { |
|
417 | + $this->base_url = add_query_arg('s', $search_terms, $this->base_url); |
|
418 | 418 | } |
419 | 419 | |
420 | - if ( give_is_payment_complete( $payment->ID ) && ! empty( $email ) ) { |
|
421 | - $row_actions['email_links'] = '<a href="' . add_query_arg( array( |
|
420 | + if (give_is_payment_complete($payment->ID) && ! empty($email)) { |
|
421 | + $row_actions['email_links'] = '<a href="'.add_query_arg(array( |
|
422 | 422 | 'give-action' => 'email_links', |
423 | 423 | 'purchase_id' => $payment->ID |
424 | - ), $this->base_url ) . '">' . esc_html__( 'Resend Donation Receipt', 'give' ) . '</a>'; |
|
424 | + ), $this->base_url).'">'.esc_html__('Resend Donation Receipt', 'give').'</a>'; |
|
425 | 425 | |
426 | 426 | } |
427 | 427 | |
428 | - $row_actions['delete'] = '<a href="' . wp_nonce_url( add_query_arg( array( |
|
428 | + $row_actions['delete'] = '<a href="'.wp_nonce_url(add_query_arg(array( |
|
429 | 429 | 'give-action' => 'delete_payment', |
430 | 430 | 'purchase_id' => $payment->ID |
431 | - ), $this->base_url ), 'give_payment_nonce' ) . '">' . esc_html__( 'Delete', 'give' ) . '</a>'; |
|
431 | + ), $this->base_url), 'give_payment_nonce').'">'.esc_html__('Delete', 'give').'</a>'; |
|
432 | 432 | |
433 | - return apply_filters( 'give_payment_row_actions', $row_actions, $payment ); |
|
433 | + return apply_filters('give_payment_row_actions', $row_actions, $payment); |
|
434 | 434 | } |
435 | 435 | |
436 | 436 | |
@@ -444,10 +444,10 @@ discard block |
||
444 | 444 | * |
445 | 445 | * @return string Data shown in the Email column |
446 | 446 | */ |
447 | - function get_payment_status( $payment ) { |
|
448 | - $value = '<div class="give-donation-status status-' . sanitize_title( give_get_payment_status( $payment, true ) ) . '"><span class="give-donation-status-icon"></span> ' . give_get_payment_status( $payment, true ) . '</div>'; |
|
449 | - if ( $payment->mode == 'test' ) { |
|
450 | - $value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="' . esc_attr__( 'This payment was made in test mode.', 'give' ) . '">' . esc_html__( 'Test', 'give' ) . '</span>'; |
|
447 | + function get_payment_status($payment) { |
|
448 | + $value = '<div class="give-donation-status status-'.sanitize_title(give_get_payment_status($payment, true)).'"><span class="give-donation-status-icon"></span> '.give_get_payment_status($payment, true).'</div>'; |
|
449 | + if ($payment->mode == 'test') { |
|
450 | + $value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="'.esc_attr__('This payment was made in test mode.', 'give').'">'.esc_html__('Test', 'give').'</span>'; |
|
451 | 451 | } |
452 | 452 | |
453 | 453 | return $value; |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | * |
464 | 464 | * @return string Displays a checkbox |
465 | 465 | */ |
466 | - public function column_cb( $payment ) { |
|
466 | + public function column_cb($payment) { |
|
467 | 467 | return sprintf( |
468 | 468 | '<input type="checkbox" name="%1$s[]" value="%2$s" />', |
469 | 469 | 'payment', |
@@ -481,8 +481,8 @@ discard block |
||
481 | 481 | * |
482 | 482 | * @return string Displays a checkbox |
483 | 483 | */ |
484 | - public function get_payment_id( $payment ) { |
|
485 | - return '<span class="give-payment-id">' . give_get_payment_number( $payment->ID ) . '</span>'; |
|
484 | + public function get_payment_id($payment) { |
|
485 | + return '<span class="give-payment-id">'.give_get_payment_number($payment->ID).'</span>'; |
|
486 | 486 | } |
487 | 487 | |
488 | 488 | /** |
@@ -495,19 +495,19 @@ discard block |
||
495 | 495 | * |
496 | 496 | * @return string Data shown in the User column |
497 | 497 | */ |
498 | - public function get_donor( $payment ) { |
|
498 | + public function get_donor($payment) { |
|
499 | 499 | |
500 | - $customer_id = give_get_payment_customer_id( $payment->ID ); |
|
500 | + $customer_id = give_get_payment_customer_id($payment->ID); |
|
501 | 501 | |
502 | - if ( ! empty( $customer_id ) ) { |
|
503 | - $customer = new Give_Customer( $customer_id ); |
|
504 | - $value = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id" ) ) . '">' . $customer->name . '</a>'; |
|
502 | + if ( ! empty($customer_id)) { |
|
503 | + $customer = new Give_Customer($customer_id); |
|
504 | + $value = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id")).'">'.$customer->name.'</a>'; |
|
505 | 505 | } else { |
506 | - $email = give_get_payment_user_email( $payment->ID ); |
|
507 | - $value = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-payment-history&s=$email" ) ) . '">' . esc_html__( '(donor missing)', 'give' ) . '</a>'; |
|
506 | + $email = give_get_payment_user_email($payment->ID); |
|
507 | + $value = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-payment-history&s=$email")).'">'.esc_html__('(donor missing)', 'give').'</a>'; |
|
508 | 508 | } |
509 | 509 | |
510 | - return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'donor' ); |
|
510 | + return apply_filters('give_payments_table_column', $value, $payment->ID, 'donor'); |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | /** |
@@ -519,18 +519,18 @@ discard block |
||
519 | 519 | */ |
520 | 520 | public function get_bulk_actions() { |
521 | 521 | $actions = array( |
522 | - 'delete' => esc_html__( 'Delete', 'give' ), |
|
523 | - 'set-status-publish' => esc_html__( 'Set To Completed', 'give' ), |
|
524 | - 'set-status-pending' => esc_html__( 'Set To Pending', 'give' ), |
|
525 | - 'set-status-refunded' => esc_html__( 'Set To Refunded', 'give' ), |
|
526 | - 'set-status-revoked' => esc_html__( 'Set To Revoked', 'give' ), |
|
527 | - 'set-status-failed' => esc_html__( 'Set To Failed', 'give' ), |
|
528 | - 'set-status-cancelled' => esc_html__( 'Set To Cancelled', 'give' ), |
|
529 | - 'set-status-abandoned' => esc_html__( 'Set To Abandoned', 'give' ), |
|
530 | - 'resend-receipt' => esc_html__( 'Resend Email Receipts', 'give' ) |
|
522 | + 'delete' => esc_html__('Delete', 'give'), |
|
523 | + 'set-status-publish' => esc_html__('Set To Completed', 'give'), |
|
524 | + 'set-status-pending' => esc_html__('Set To Pending', 'give'), |
|
525 | + 'set-status-refunded' => esc_html__('Set To Refunded', 'give'), |
|
526 | + 'set-status-revoked' => esc_html__('Set To Revoked', 'give'), |
|
527 | + 'set-status-failed' => esc_html__('Set To Failed', 'give'), |
|
528 | + 'set-status-cancelled' => esc_html__('Set To Cancelled', 'give'), |
|
529 | + 'set-status-abandoned' => esc_html__('Set To Abandoned', 'give'), |
|
530 | + 'resend-receipt' => esc_html__('Resend Email Receipts', 'give') |
|
531 | 531 | ); |
532 | 532 | |
533 | - return apply_filters( 'give_payments_table_bulk_actions', $actions ); |
|
533 | + return apply_filters('give_payments_table_bulk_actions', $actions); |
|
534 | 534 | } |
535 | 535 | |
536 | 536 | /** |
@@ -541,59 +541,59 @@ discard block |
||
541 | 541 | * @return void |
542 | 542 | */ |
543 | 543 | public function process_bulk_action() { |
544 | - $ids = isset( $_GET['payment'] ) ? $_GET['payment'] : false; |
|
544 | + $ids = isset($_GET['payment']) ? $_GET['payment'] : false; |
|
545 | 545 | $action = $this->current_action(); |
546 | 546 | |
547 | - if ( ! is_array( $ids ) ) { |
|
548 | - $ids = array( $ids ); |
|
547 | + if ( ! is_array($ids)) { |
|
548 | + $ids = array($ids); |
|
549 | 549 | } |
550 | 550 | |
551 | - if ( empty( $action ) ) { |
|
551 | + if (empty($action)) { |
|
552 | 552 | return; |
553 | 553 | } |
554 | 554 | |
555 | - foreach ( $ids as $id ) { |
|
555 | + foreach ($ids as $id) { |
|
556 | 556 | |
557 | 557 | // Detect when a bulk action is being triggered... |
558 | - switch ( $this->current_action() ) { |
|
558 | + switch ($this->current_action()) { |
|
559 | 559 | |
560 | 560 | case'delete': |
561 | - give_delete_purchase( $id ); |
|
561 | + give_delete_purchase($id); |
|
562 | 562 | break; |
563 | 563 | |
564 | 564 | case 'set-status-publish': |
565 | - give_update_payment_status( $id, 'publish' ); |
|
565 | + give_update_payment_status($id, 'publish'); |
|
566 | 566 | break; |
567 | 567 | |
568 | 568 | case 'set-status-pending': |
569 | - give_update_payment_status( $id, 'pending' ); |
|
569 | + give_update_payment_status($id, 'pending'); |
|
570 | 570 | break; |
571 | 571 | |
572 | 572 | case 'set-status-refunded': |
573 | - give_update_payment_status( $id, 'refunded' ); |
|
573 | + give_update_payment_status($id, 'refunded'); |
|
574 | 574 | break; |
575 | 575 | case 'set-status-revoked': |
576 | - give_update_payment_status( $id, 'revoked' ); |
|
576 | + give_update_payment_status($id, 'revoked'); |
|
577 | 577 | break; |
578 | 578 | |
579 | 579 | case 'set-status-failed': |
580 | - give_update_payment_status( $id, 'failed' ); |
|
580 | + give_update_payment_status($id, 'failed'); |
|
581 | 581 | break; |
582 | 582 | |
583 | 583 | case 'set-status-cancelled': |
584 | - give_update_payment_status( $id, 'cancelled' ); |
|
584 | + give_update_payment_status($id, 'cancelled'); |
|
585 | 585 | break; |
586 | 586 | |
587 | 587 | case 'set-status-abandoned': |
588 | - give_update_payment_status( $id, 'abandoned' ); |
|
588 | + give_update_payment_status($id, 'abandoned'); |
|
589 | 589 | break; |
590 | 590 | |
591 | 591 | case 'set-status-preapproval': |
592 | - give_update_payment_status( $id, 'preapproval' ); |
|
592 | + give_update_payment_status($id, 'preapproval'); |
|
593 | 593 | break; |
594 | 594 | |
595 | 595 | case 'resend-receipt': |
596 | - give_email_donation_receipt( $id, false ); |
|
596 | + give_email_donation_receipt($id, false); |
|
597 | 597 | break; |
598 | 598 | } |
599 | 599 | |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | * @param int $id The ID of the payment. |
606 | 606 | * @param string $current_action The action that is being triggered. |
607 | 607 | */ |
608 | - do_action( 'give_payments_table_do_bulk_action', $id, $this->current_action() ); |
|
608 | + do_action('give_payments_table_do_bulk_action', $id, $this->current_action()); |
|
609 | 609 | } |
610 | 610 | |
611 | 611 | } |
@@ -621,27 +621,27 @@ discard block |
||
621 | 621 | |
622 | 622 | $args = array(); |
623 | 623 | |
624 | - if ( isset( $_GET['user'] ) ) { |
|
625 | - $args['user'] = urldecode( $_GET['user'] ); |
|
626 | - } elseif ( isset( $_GET['s'] ) ) { |
|
627 | - $is_user = strpos( $_GET['s'], strtolower( 'user:' ) ) !== false; |
|
628 | - if ( $is_user ) { |
|
629 | - $args['user'] = absint( trim( str_replace( 'user:', '', strtolower( $_GET['s'] ) ) ) ); |
|
630 | - unset( $args['s'] ); |
|
624 | + if (isset($_GET['user'])) { |
|
625 | + $args['user'] = urldecode($_GET['user']); |
|
626 | + } elseif (isset($_GET['s'])) { |
|
627 | + $is_user = strpos($_GET['s'], strtolower('user:')) !== false; |
|
628 | + if ($is_user) { |
|
629 | + $args['user'] = absint(trim(str_replace('user:', '', strtolower($_GET['s'])))); |
|
630 | + unset($args['s']); |
|
631 | 631 | } else { |
632 | - $args['s'] = sanitize_text_field( $_GET['s'] ); |
|
632 | + $args['s'] = sanitize_text_field($_GET['s']); |
|
633 | 633 | } |
634 | 634 | } |
635 | 635 | |
636 | - if ( ! empty( $_GET['start-date'] ) ) { |
|
637 | - $args['start-date'] = urldecode( $_GET['start-date'] ); |
|
636 | + if ( ! empty($_GET['start-date'])) { |
|
637 | + $args['start-date'] = urldecode($_GET['start-date']); |
|
638 | 638 | } |
639 | 639 | |
640 | - if ( ! empty( $_GET['end-date'] ) ) { |
|
641 | - $args['end-date'] = urldecode( $_GET['end-date'] ); |
|
640 | + if ( ! empty($_GET['end-date'])) { |
|
641 | + $args['end-date'] = urldecode($_GET['end-date']); |
|
642 | 642 | } |
643 | 643 | |
644 | - $payment_count = give_count_payments( $args ); |
|
644 | + $payment_count = give_count_payments($args); |
|
645 | 645 | $this->complete_count = $payment_count->publish; |
646 | 646 | $this->pending_count = $payment_count->pending; |
647 | 647 | $this->refunded_count = $payment_count->refunded; |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | $this->cancelled_count = $payment_count->cancelled; |
651 | 651 | $this->abandoned_count = $payment_count->abandoned; |
652 | 652 | |
653 | - foreach ( $payment_count as $count ) { |
|
653 | + foreach ($payment_count as $count) { |
|
654 | 654 | $this->total_count += $count; |
655 | 655 | } |
656 | 656 | } |
@@ -665,26 +665,26 @@ discard block |
||
665 | 665 | public function payments_data() { |
666 | 666 | |
667 | 667 | $per_page = $this->per_page; |
668 | - $orderby = isset( $_GET['orderby'] ) ? urldecode( $_GET['orderby'] ) : 'ID'; |
|
669 | - $order = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC'; |
|
670 | - $user = isset( $_GET['user'] ) ? $_GET['user'] : null; |
|
671 | - $status = isset( $_GET['status'] ) ? $_GET['status'] : give_get_payment_status_keys(); |
|
672 | - $meta_key = isset( $_GET['meta_key'] ) ? $_GET['meta_key'] : null; |
|
673 | - $year = isset( $_GET['year'] ) ? $_GET['year'] : null; |
|
674 | - $month = isset( $_GET['m'] ) ? $_GET['m'] : null; |
|
675 | - $day = isset( $_GET['day'] ) ? $_GET['day'] : null; |
|
676 | - $search = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : null; |
|
677 | - $start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null; |
|
678 | - $end_date = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : $start_date; |
|
679 | - |
|
680 | - if ( ! empty( $search ) ) { |
|
668 | + $orderby = isset($_GET['orderby']) ? urldecode($_GET['orderby']) : 'ID'; |
|
669 | + $order = isset($_GET['order']) ? $_GET['order'] : 'DESC'; |
|
670 | + $user = isset($_GET['user']) ? $_GET['user'] : null; |
|
671 | + $status = isset($_GET['status']) ? $_GET['status'] : give_get_payment_status_keys(); |
|
672 | + $meta_key = isset($_GET['meta_key']) ? $_GET['meta_key'] : null; |
|
673 | + $year = isset($_GET['year']) ? $_GET['year'] : null; |
|
674 | + $month = isset($_GET['m']) ? $_GET['m'] : null; |
|
675 | + $day = isset($_GET['day']) ? $_GET['day'] : null; |
|
676 | + $search = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : null; |
|
677 | + $start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null; |
|
678 | + $end_date = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : $start_date; |
|
679 | + |
|
680 | + if ( ! empty($search)) { |
|
681 | 681 | $status = 'any'; // Force all payment statuses when searching |
682 | 682 | } |
683 | 683 | |
684 | 684 | $args = array( |
685 | 685 | 'output' => 'payments', |
686 | 686 | 'number' => $per_page, |
687 | - 'page' => isset( $_GET['paged'] ) ? $_GET['paged'] : null, |
|
687 | + 'page' => isset($_GET['paged']) ? $_GET['paged'] : null, |
|
688 | 688 | 'orderby' => $orderby, |
689 | 689 | 'order' => $order, |
690 | 690 | 'user' => $user, |
@@ -698,14 +698,14 @@ discard block |
||
698 | 698 | 'end_date' => $end_date, |
699 | 699 | ); |
700 | 700 | |
701 | - if ( is_string( $search ) && false !== strpos( $search, 'txn:' ) ) { |
|
701 | + if (is_string($search) && false !== strpos($search, 'txn:')) { |
|
702 | 702 | |
703 | 703 | $args['search_in_notes'] = true; |
704 | - $args['s'] = trim( str_replace( 'txn:', '', $args['s'] ) ); |
|
704 | + $args['s'] = trim(str_replace('txn:', '', $args['s'])); |
|
705 | 705 | |
706 | 706 | } |
707 | 707 | |
708 | - $p_query = new Give_Payments_Query( $args ); |
|
708 | + $p_query = new Give_Payments_Query($args); |
|
709 | 709 | |
710 | 710 | return $p_query->get_payments(); |
711 | 711 | |
@@ -725,17 +725,17 @@ discard block |
||
725 | 725 | */ |
726 | 726 | public function prepare_items() { |
727 | 727 | |
728 | - wp_reset_vars( array( 'action', 'payment', 'orderby', 'order', 's' ) ); |
|
728 | + wp_reset_vars(array('action', 'payment', 'orderby', 'order', 's')); |
|
729 | 729 | |
730 | 730 | $columns = $this->get_columns(); |
731 | 731 | $hidden = array(); // No hidden columns |
732 | 732 | $sortable = $this->get_sortable_columns(); |
733 | 733 | $data = $this->payments_data(); |
734 | - $status = isset( $_GET['status'] ) ? $_GET['status'] : 'any'; |
|
734 | + $status = isset($_GET['status']) ? $_GET['status'] : 'any'; |
|
735 | 735 | |
736 | - $this->_column_headers = array( $columns, $hidden, $sortable ); |
|
736 | + $this->_column_headers = array($columns, $hidden, $sortable); |
|
737 | 737 | |
738 | - switch ( $status ) { |
|
738 | + switch ($status) { |
|
739 | 739 | case 'publish': |
740 | 740 | $total_items = $this->complete_count; |
741 | 741 | break; |
@@ -762,19 +762,19 @@ discard block |
||
762 | 762 | break; |
763 | 763 | default: |
764 | 764 | // Retrieve the count of the non-default-Give status |
765 | - $count = wp_count_posts( 'give_payment' ); |
|
765 | + $count = wp_count_posts('give_payment'); |
|
766 | 766 | $total_items = $count->{$status}; |
767 | 767 | break; |
768 | 768 | } |
769 | 769 | |
770 | 770 | $this->items = $data; |
771 | 771 | |
772 | - $this->set_pagination_args( array( |
|
772 | + $this->set_pagination_args(array( |
|
773 | 773 | 'total_items' => $total_items, |
774 | 774 | // WE have to calculate the total number of items |
775 | 775 | 'per_page' => $this->per_page, |
776 | 776 | // WE have to determine how many items to show on a page |
777 | - 'total_pages' => ceil( $total_items / $this->per_page ) |
|
777 | + 'total_pages' => ceil($total_items / $this->per_page) |
|
778 | 778 | // WE have to calculate the total number of pages |
779 | 779 | ) |
780 | 780 | ); |
@@ -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 | |
@@ -26,52 +26,52 @@ discard block |
||
26 | 26 | * @return void |
27 | 27 | * |
28 | 28 | */ |
29 | -function give_update_payment_details( $data ) { |
|
29 | +function give_update_payment_details($data) { |
|
30 | 30 | |
31 | - if ( ! current_user_can( 'edit_give_payments', $data['give_payment_id'] ) ) { |
|
32 | - wp_die( esc_html__( 'You do not have permission to edit payments.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
31 | + if ( ! current_user_can('edit_give_payments', $data['give_payment_id'])) { |
|
32 | + wp_die(esc_html__('You do not have permission to edit payments.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
33 | 33 | } |
34 | 34 | |
35 | - check_admin_referer( 'give_update_payment_details_nonce' ); |
|
35 | + check_admin_referer('give_update_payment_details_nonce'); |
|
36 | 36 | |
37 | 37 | // Retrieve the payment ID |
38 | - $payment_id = absint( $data['give_payment_id'] ); |
|
38 | + $payment_id = absint($data['give_payment_id']); |
|
39 | 39 | |
40 | 40 | /* @var Give_Payment $payment */ |
41 | - $payment = new Give_Payment( $payment_id ); |
|
41 | + $payment = new Give_Payment($payment_id); |
|
42 | 42 | |
43 | 43 | // Retrieve existing payment meta |
44 | 44 | $meta = $payment->get_meta(); |
45 | 45 | $user_info = $payment->user_info; |
46 | 46 | |
47 | 47 | $status = $data['give-payment-status']; |
48 | - $date = sanitize_text_field( $data['give-payment-date'] ); |
|
49 | - $hour = sanitize_text_field( $data['give-payment-time-hour'] ); |
|
48 | + $date = sanitize_text_field($data['give-payment-date']); |
|
49 | + $hour = sanitize_text_field($data['give-payment-time-hour']); |
|
50 | 50 | |
51 | 51 | // Restrict to our high and low |
52 | - if ( $hour > 23 ) { |
|
52 | + if ($hour > 23) { |
|
53 | 53 | $hour = 23; |
54 | - } elseif ( $hour < 0 ) { |
|
54 | + } elseif ($hour < 0) { |
|
55 | 55 | $hour = 00; |
56 | 56 | } |
57 | 57 | |
58 | - $minute = sanitize_text_field( $data['give-payment-time-min'] ); |
|
58 | + $minute = sanitize_text_field($data['give-payment-time-min']); |
|
59 | 59 | |
60 | 60 | // Restrict to our high and low |
61 | - if ( $minute > 59 ) { |
|
61 | + if ($minute > 59) { |
|
62 | 62 | $minute = 59; |
63 | - } elseif ( $minute < 0 ) { |
|
63 | + } elseif ($minute < 0) { |
|
64 | 64 | $minute = 00; |
65 | 65 | } |
66 | 66 | |
67 | - $address = array_map( 'trim', $data['give-payment-address'][0] ); |
|
67 | + $address = array_map('trim', $data['give-payment-address'][0]); |
|
68 | 68 | |
69 | - $curr_total = give_sanitize_amount( $payment->total ); |
|
70 | - $new_total = give_sanitize_amount( $data['give-payment-total'] ); |
|
71 | - $date = date( 'Y-m-d', strtotime( $date ) ) . ' ' . $hour . ':' . $minute . ':00'; |
|
69 | + $curr_total = give_sanitize_amount($payment->total); |
|
70 | + $new_total = give_sanitize_amount($data['give-payment-total']); |
|
71 | + $date = date('Y-m-d', strtotime($date)).' '.$hour.':'.$minute.':00'; |
|
72 | 72 | |
73 | - $curr_customer_id = sanitize_text_field( $data['give-current-customer'] ); |
|
74 | - $new_customer_id = sanitize_text_field( $data['customer-id'] ); |
|
73 | + $curr_customer_id = sanitize_text_field($data['give-current-customer']); |
|
74 | + $new_customer_id = sanitize_text_field($data['customer-id']); |
|
75 | 75 | |
76 | 76 | /** |
77 | 77 | * Fires before updating edited purchase. |
@@ -80,62 +80,62 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @param int $payment_id The ID of the payment. |
82 | 82 | */ |
83 | - do_action( 'give_update_edited_purchase', $payment_id ); |
|
83 | + do_action('give_update_edited_purchase', $payment_id); |
|
84 | 84 | |
85 | 85 | $payment->date = $date; |
86 | 86 | $updated = $payment->save(); |
87 | 87 | |
88 | - if ( 0 === $updated ) { |
|
89 | - wp_die( esc_html__( 'Error Updating Payment.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) ); |
|
88 | + if (0 === $updated) { |
|
89 | + wp_die(esc_html__('Error Updating Payment.', 'give'), esc_html__('Error', 'give'), array('response' => 400)); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | |
93 | 93 | $customer_changed = false; |
94 | 94 | |
95 | - if ( isset( $data['give-new-customer'] ) && $data['give-new-customer'] == '1' ) { |
|
95 | + if (isset($data['give-new-customer']) && $data['give-new-customer'] == '1') { |
|
96 | 96 | |
97 | - $email = isset( $data['give-new-customer-email'] ) ? sanitize_text_field( $data['give-new-customer-email'] ) : ''; |
|
98 | - $names = isset( $data['give-new-customer-name'] ) ? sanitize_text_field( $data['give-new-customer-name'] ) : ''; |
|
97 | + $email = isset($data['give-new-customer-email']) ? sanitize_text_field($data['give-new-customer-email']) : ''; |
|
98 | + $names = isset($data['give-new-customer-name']) ? sanitize_text_field($data['give-new-customer-name']) : ''; |
|
99 | 99 | |
100 | - if ( empty( $email ) || empty( $names ) ) { |
|
101 | - wp_die( esc_html__( 'New Customers require a name and email address.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) ); |
|
100 | + if (empty($email) || empty($names)) { |
|
101 | + wp_die(esc_html__('New Customers require a name and email address.', 'give'), esc_html__('Error', 'give'), array('response' => 400)); |
|
102 | 102 | } |
103 | 103 | |
104 | - $customer = new Give_Customer( $email ); |
|
105 | - if ( empty( $customer->id ) ) { |
|
106 | - $customer_data = array( 'name' => $names, 'email' => $email ); |
|
107 | - $user_id = email_exists( $email ); |
|
108 | - if ( false !== $user_id ) { |
|
104 | + $customer = new Give_Customer($email); |
|
105 | + if (empty($customer->id)) { |
|
106 | + $customer_data = array('name' => $names, 'email' => $email); |
|
107 | + $user_id = email_exists($email); |
|
108 | + if (false !== $user_id) { |
|
109 | 109 | $customer_data['user_id'] = $user_id; |
110 | 110 | } |
111 | 111 | |
112 | - if ( ! $customer->create( $customer_data ) ) { |
|
112 | + if ( ! $customer->create($customer_data)) { |
|
113 | 113 | // Failed to crete the new donor, assume the previous donor |
114 | 114 | $customer_changed = false; |
115 | - $customer = new Give_Customer( $curr_customer_id ); |
|
116 | - give_set_error( 'give-payment-new-customer-fail', esc_html__( 'Error creating new donor.', 'give' ) ); |
|
115 | + $customer = new Give_Customer($curr_customer_id); |
|
116 | + give_set_error('give-payment-new-customer-fail', esc_html__('Error creating new donor.', 'give')); |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
120 | 120 | $new_customer_id = $customer->id; |
121 | 121 | |
122 | - $previous_customer = new Give_Customer( $curr_customer_id ); |
|
122 | + $previous_customer = new Give_Customer($curr_customer_id); |
|
123 | 123 | |
124 | 124 | $customer_changed = true; |
125 | 125 | |
126 | - } elseif ( $curr_customer_id !== $new_customer_id ) { |
|
126 | + } elseif ($curr_customer_id !== $new_customer_id) { |
|
127 | 127 | |
128 | - $customer = new Give_Customer( $new_customer_id ); |
|
128 | + $customer = new Give_Customer($new_customer_id); |
|
129 | 129 | $email = $customer->email; |
130 | 130 | $names = $customer->name; |
131 | 131 | |
132 | - $previous_customer = new Give_Customer( $curr_customer_id ); |
|
132 | + $previous_customer = new Give_Customer($curr_customer_id); |
|
133 | 133 | |
134 | 134 | $customer_changed = true; |
135 | 135 | |
136 | 136 | } else { |
137 | 137 | |
138 | - $customer = new Give_Customer( $curr_customer_id ); |
|
138 | + $customer = new Give_Customer($curr_customer_id); |
|
139 | 139 | $email = $customer->email; |
140 | 140 | $names = $customer->name; |
141 | 141 | |
@@ -143,38 +143,38 @@ discard block |
||
143 | 143 | |
144 | 144 | |
145 | 145 | // Setup first and last name from input values |
146 | - $names = explode( ' ', $names ); |
|
147 | - $first_name = ! empty( $names[0] ) ? $names[0] : ''; |
|
146 | + $names = explode(' ', $names); |
|
147 | + $first_name = ! empty($names[0]) ? $names[0] : ''; |
|
148 | 148 | $last_name = ''; |
149 | - if ( ! empty( $names[1] ) ) { |
|
150 | - unset( $names[0] ); |
|
151 | - $last_name = implode( ' ', $names ); |
|
149 | + if ( ! empty($names[1])) { |
|
150 | + unset($names[0]); |
|
151 | + $last_name = implode(' ', $names); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | |
155 | - if ( $customer_changed ) { |
|
155 | + if ($customer_changed) { |
|
156 | 156 | |
157 | 157 | // Remove the stats and payment from the previous customer and attach it to the new customer |
158 | - $previous_customer->remove_payment( $payment_id, false ); |
|
159 | - $customer->attach_payment( $payment_id, false ); |
|
158 | + $previous_customer->remove_payment($payment_id, false); |
|
159 | + $customer->attach_payment($payment_id, false); |
|
160 | 160 | |
161 | - if ( 'publish' == $status ) { |
|
161 | + if ('publish' == $status) { |
|
162 | 162 | |
163 | 163 | // Reduce previous user donation count and amount. |
164 | 164 | $previous_customer->decrease_purchase_count(); |
165 | - $previous_customer->decrease_value( $curr_total ); |
|
165 | + $previous_customer->decrease_value($curr_total); |
|
166 | 166 | |
167 | 167 | // If purchase was completed adjust stats of new customers. |
168 | 168 | $customer->increase_purchase_count(); |
169 | - $customer->increase_value( $new_total ); |
|
169 | + $customer->increase_value($new_total); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | $payment->customer_id = $customer->id; |
173 | - } else{ |
|
173 | + } else { |
|
174 | 174 | |
175 | - if( 'publish' === $status ){ |
|
175 | + if ('publish' === $status) { |
|
176 | 176 | // Update user donation stat. |
177 | - $customer->update_donation_value( $curr_total, $new_total ); |
|
177 | + $customer->update_donation_value($curr_total, $new_total); |
|
178 | 178 | } |
179 | 179 | } |
180 | 180 | |
@@ -188,10 +188,10 @@ discard block |
||
188 | 188 | |
189 | 189 | |
190 | 190 | // Check for payment notes |
191 | - if ( ! empty( $data['give-payment-note'] ) ) { |
|
191 | + if ( ! empty($data['give-payment-note'])) { |
|
192 | 192 | |
193 | - $note = wp_kses( $data['give-payment-note'], array() ); |
|
194 | - give_insert_payment_note( $payment_id, $note ); |
|
193 | + $note = wp_kses($data['give-payment-note'], array()); |
|
194 | + give_insert_payment_note($payment_id, $note); |
|
195 | 195 | |
196 | 196 | } |
197 | 197 | |
@@ -199,17 +199,17 @@ discard block |
||
199 | 199 | $payment->status = $status; |
200 | 200 | |
201 | 201 | // Adjust total store earnings if the payment total has been changed |
202 | - if ( $new_total !== $curr_total && 'publish' == $status ) { |
|
202 | + if ($new_total !== $curr_total && 'publish' == $status) { |
|
203 | 203 | |
204 | - if ( $new_total > $curr_total ) { |
|
204 | + if ($new_total > $curr_total) { |
|
205 | 205 | // Increase if our new total is higher |
206 | 206 | $difference = $new_total - $curr_total; |
207 | - give_increase_total_earnings( $difference ); |
|
207 | + give_increase_total_earnings($difference); |
|
208 | 208 | |
209 | - } elseif ( $curr_total > $new_total ) { |
|
209 | + } elseif ($curr_total > $new_total) { |
|
210 | 210 | // Decrease if our new total is lower |
211 | 211 | $difference = $curr_total - $new_total; |
212 | - give_decrease_total_earnings( $difference ); |
|
212 | + give_decrease_total_earnings($difference); |
|
213 | 213 | |
214 | 214 | } |
215 | 215 | |
@@ -218,16 +218,16 @@ discard block |
||
218 | 218 | $payment->save(); |
219 | 219 | |
220 | 220 | // Get new give form ID. |
221 | - $new_form_id = absint( $data['forms'] ); |
|
222 | - $current_form_id = absint( $payment->get_meta( '_give_payment_form_id' ) ); |
|
221 | + $new_form_id = absint($data['forms']); |
|
222 | + $current_form_id = absint($payment->get_meta('_give_payment_form_id')); |
|
223 | 223 | |
224 | 224 | // We are adding payment transfer code in last to remove any conflict with above functionality. |
225 | 225 | // For example: above code will automatically handle form stat (increase/decrease) when payment status changes. |
226 | 226 | /* Check if user want to transfer current payment to new give form id. */ |
227 | - if( $new_form_id != $current_form_id ) { |
|
227 | + if ($new_form_id != $current_form_id) { |
|
228 | 228 | |
229 | 229 | // Get new give form title. |
230 | - $new_form_title = get_the_title( $new_form_id ); |
|
230 | + $new_form_title = get_the_title($new_form_id); |
|
231 | 231 | |
232 | 232 | // Update new give form data in payment data. |
233 | 233 | $payment_meta = $payment->get_meta(); |
@@ -235,28 +235,28 @@ discard block |
||
235 | 235 | $payment_meta['form_id'] = $new_form_id; |
236 | 236 | |
237 | 237 | // Update price id post meta data for set donation form. |
238 | - if( ! give_has_variable_prices( $new_form_id ) ) { |
|
238 | + if ( ! give_has_variable_prices($new_form_id)) { |
|
239 | 239 | $payment_meta['price_id'] = ''; |
240 | 240 | } |
241 | 241 | |
242 | 242 | // Update payment give form meta data. |
243 | - $payment->update_meta( '_give_payment_form_id', $new_form_id ); |
|
244 | - $payment->update_meta( '_give_payment_form_title', $new_form_title ); |
|
245 | - $payment->update_meta( '_give_payment_meta', $payment_meta ); |
|
243 | + $payment->update_meta('_give_payment_form_id', $new_form_id); |
|
244 | + $payment->update_meta('_give_payment_form_title', $new_form_title); |
|
245 | + $payment->update_meta('_give_payment_meta', $payment_meta); |
|
246 | 246 | |
247 | 247 | // Update price id payment metadata. |
248 | - if( ! give_has_variable_prices( $new_form_id ) ) { |
|
249 | - $payment->update_meta( '_give_payment_price_id', '' ); |
|
248 | + if ( ! give_has_variable_prices($new_form_id)) { |
|
249 | + $payment->update_meta('_give_payment_price_id', ''); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | |
253 | 253 | // If purchase was completed, adjust stats of forms |
254 | - if ( 'publish' == $status ) { |
|
254 | + if ('publish' == $status) { |
|
255 | 255 | |
256 | 256 | // Decrease sale of old give form. For other payment status |
257 | - $current_form = new Give_Donate_Form( $current_form_id ); |
|
257 | + $current_form = new Give_Donate_Form($current_form_id); |
|
258 | 258 | $current_form->decrease_sales(); |
259 | - $current_form->decrease_earnings( $curr_total ); |
|
259 | + $current_form->decrease_earnings($curr_total); |
|
260 | 260 | |
261 | 261 | // Increase sale of new give form. |
262 | 262 | $new_form = new Give_Donate_Form($new_form_id); |
@@ -265,27 +265,27 @@ discard block |
||
265 | 265 | } |
266 | 266 | |
267 | 267 | // Re setup payment to update new meta value in object. |
268 | - $payment->update_payment_setup( $payment->ID ); |
|
268 | + $payment->update_payment_setup($payment->ID); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | // Update price id if current form is variable form. |
272 | - if( ! empty( $data['give-variable-price'] ) && give_has_variable_prices( $payment->form_id ) ) { |
|
272 | + if ( ! empty($data['give-variable-price']) && give_has_variable_prices($payment->form_id)) { |
|
273 | 273 | |
274 | 274 | // Get payment meta data. |
275 | 275 | $payment_meta = $payment->get_meta(); |
276 | 276 | |
277 | 277 | // Set payment id to empty string if variable price id is negative ( i.e. custom amount feature enabled ). |
278 | - $data['give-variable-price'] = ( 'custom' === $data['give-variable-price'] ) ? 'custom' : ( 0 < $data['give-variable-price'] ) ? $data['give-variable-price'] : ''; |
|
278 | + $data['give-variable-price'] = ('custom' === $data['give-variable-price']) ? 'custom' : (0 < $data['give-variable-price']) ? $data['give-variable-price'] : ''; |
|
279 | 279 | |
280 | 280 | // Update payment meta data. |
281 | 281 | $payment_meta['price_id'] = $data['give-variable-price']; |
282 | 282 | |
283 | 283 | // Update payment give form meta data. |
284 | - $payment->update_meta( '_give_payment_price_id', $data['give-variable-price'] ); |
|
285 | - $payment->update_meta( '_give_payment_meta', $payment_meta ); |
|
284 | + $payment->update_meta('_give_payment_price_id', $data['give-variable-price']); |
|
285 | + $payment->update_meta('_give_payment_meta', $payment_meta); |
|
286 | 286 | |
287 | 287 | // Re setup payment to update new meta value in object. |
288 | - $payment->update_payment_setup( $payment->ID ); |
|
288 | + $payment->update_payment_setup($payment->ID); |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
@@ -295,13 +295,13 @@ discard block |
||
295 | 295 | * |
296 | 296 | * @param int $payment_id The ID of the payment. |
297 | 297 | */ |
298 | - do_action( 'give_updated_edited_purchase', $payment_id ); |
|
298 | + do_action('give_updated_edited_purchase', $payment_id); |
|
299 | 299 | |
300 | - wp_safe_redirect( admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&give-message=payment-updated&id=' . $payment_id ) ); |
|
300 | + wp_safe_redirect(admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&give-message=payment-updated&id='.$payment_id)); |
|
301 | 301 | exit; |
302 | 302 | } |
303 | 303 | |
304 | -add_action( 'give_update_payment_details', 'give_update_payment_details' ); |
|
304 | +add_action('give_update_payment_details', 'give_update_payment_details'); |
|
305 | 305 | |
306 | 306 | /** |
307 | 307 | * Trigger a Purchase Deletion |
@@ -312,48 +312,48 @@ discard block |
||
312 | 312 | * |
313 | 313 | * @return void |
314 | 314 | */ |
315 | -function give_trigger_purchase_delete( $data ) { |
|
316 | - if ( wp_verify_nonce( $data['_wpnonce'], 'give_payment_nonce' ) ) { |
|
315 | +function give_trigger_purchase_delete($data) { |
|
316 | + if (wp_verify_nonce($data['_wpnonce'], 'give_payment_nonce')) { |
|
317 | 317 | |
318 | - $payment_id = absint( $data['purchase_id'] ); |
|
318 | + $payment_id = absint($data['purchase_id']); |
|
319 | 319 | |
320 | - if ( ! current_user_can( 'edit_give_payments', $payment_id ) ) { |
|
321 | - wp_die( esc_html__( 'You do not have permission to edit payments.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
320 | + if ( ! current_user_can('edit_give_payments', $payment_id)) { |
|
321 | + wp_die(esc_html__('You do not have permission to edit payments.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
322 | 322 | } |
323 | 323 | |
324 | - give_delete_purchase( $payment_id ); |
|
325 | - wp_redirect( admin_url( '/edit.php?post_type=give_forms&page=give-payment-history&give-message=payment_deleted' ) ); |
|
324 | + give_delete_purchase($payment_id); |
|
325 | + wp_redirect(admin_url('/edit.php?post_type=give_forms&page=give-payment-history&give-message=payment_deleted')); |
|
326 | 326 | give_die(); |
327 | 327 | } |
328 | 328 | } |
329 | 329 | |
330 | -add_action( 'give_delete_payment', 'give_trigger_purchase_delete' ); |
|
330 | +add_action('give_delete_payment', 'give_trigger_purchase_delete'); |
|
331 | 331 | |
332 | 332 | /** |
333 | 333 | * AJAX Store Payment Note |
334 | 334 | */ |
335 | 335 | function give_ajax_store_payment_note() { |
336 | 336 | |
337 | - $payment_id = absint( $_POST['payment_id'] ); |
|
338 | - $note = wp_kses( $_POST['note'], array() ); |
|
337 | + $payment_id = absint($_POST['payment_id']); |
|
338 | + $note = wp_kses($_POST['note'], array()); |
|
339 | 339 | |
340 | - if ( ! current_user_can( 'edit_give_payments', $payment_id ) ) { |
|
341 | - wp_die( esc_html__( 'You do not have permission to edit payments.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
340 | + if ( ! current_user_can('edit_give_payments', $payment_id)) { |
|
341 | + wp_die(esc_html__('You do not have permission to edit payments.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
342 | 342 | } |
343 | 343 | |
344 | - if ( empty( $payment_id ) ) { |
|
345 | - die( '-1' ); |
|
344 | + if (empty($payment_id)) { |
|
345 | + die('-1'); |
|
346 | 346 | } |
347 | 347 | |
348 | - if ( empty( $note ) ) { |
|
349 | - die( '-1' ); |
|
348 | + if (empty($note)) { |
|
349 | + die('-1'); |
|
350 | 350 | } |
351 | 351 | |
352 | - $note_id = give_insert_payment_note( $payment_id, $note ); |
|
353 | - die( give_get_payment_note_html( $note_id ) ); |
|
352 | + $note_id = give_insert_payment_note($payment_id, $note); |
|
353 | + die(give_get_payment_note_html($note_id)); |
|
354 | 354 | } |
355 | 355 | |
356 | -add_action( 'wp_ajax_give_insert_payment_note', 'give_ajax_store_payment_note' ); |
|
356 | +add_action('wp_ajax_give_insert_payment_note', 'give_ajax_store_payment_note'); |
|
357 | 357 | |
358 | 358 | /** |
359 | 359 | * Triggers a payment note deletion without ajax |
@@ -364,24 +364,24 @@ discard block |
||
364 | 364 | * |
365 | 365 | * @return void |
366 | 366 | */ |
367 | -function give_trigger_payment_note_deletion( $data ) { |
|
367 | +function give_trigger_payment_note_deletion($data) { |
|
368 | 368 | |
369 | - if ( ! wp_verify_nonce( $data['_wpnonce'], 'give_delete_payment_note_' . $data['note_id'] ) ) { |
|
369 | + if ( ! wp_verify_nonce($data['_wpnonce'], 'give_delete_payment_note_'.$data['note_id'])) { |
|
370 | 370 | return; |
371 | 371 | } |
372 | 372 | |
373 | - if ( ! current_user_can( 'edit_give_payments', $data['payment_id'] ) ) { |
|
374 | - wp_die( esc_html__( 'You do not have permission to edit payments.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
373 | + if ( ! current_user_can('edit_give_payments', $data['payment_id'])) { |
|
374 | + wp_die(esc_html__('You do not have permission to edit payments.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
375 | 375 | } |
376 | 376 | |
377 | - $edit_order_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&give-message=payment-note-deleted&id=' . absint( $data['payment_id'] ) ); |
|
377 | + $edit_order_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&give-message=payment-note-deleted&id='.absint($data['payment_id'])); |
|
378 | 378 | |
379 | - give_delete_payment_note( $data['note_id'], $data['payment_id'] ); |
|
379 | + give_delete_payment_note($data['note_id'], $data['payment_id']); |
|
380 | 380 | |
381 | - wp_redirect( $edit_order_url ); |
|
381 | + wp_redirect($edit_order_url); |
|
382 | 382 | } |
383 | 383 | |
384 | -add_action( 'give_delete_payment_note', 'give_trigger_payment_note_deletion' ); |
|
384 | +add_action('give_delete_payment_note', 'give_trigger_payment_note_deletion'); |
|
385 | 385 | |
386 | 386 | /** |
387 | 387 | * Delete a payment note deletion with ajax |
@@ -392,16 +392,16 @@ discard block |
||
392 | 392 | */ |
393 | 393 | function give_ajax_delete_payment_note() { |
394 | 394 | |
395 | - if ( ! current_user_can( 'edit_give_payments', $_POST['payment_id'] ) ) { |
|
396 | - wp_die( esc_html__( 'You do not have permission to edit payments.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
395 | + if ( ! current_user_can('edit_give_payments', $_POST['payment_id'])) { |
|
396 | + wp_die(esc_html__('You do not have permission to edit payments.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
397 | 397 | } |
398 | 398 | |
399 | - if ( give_delete_payment_note( $_POST['note_id'], $_POST['payment_id'] ) ) { |
|
400 | - die( '1' ); |
|
399 | + if (give_delete_payment_note($_POST['note_id'], $_POST['payment_id'])) { |
|
400 | + die('1'); |
|
401 | 401 | } else { |
402 | - die( '-1' ); |
|
402 | + die('-1'); |
|
403 | 403 | } |
404 | 404 | |
405 | 405 | } |
406 | 406 | |
407 | -add_action( 'wp_ajax_give_delete_payment_note', 'give_ajax_delete_payment_note' ); |
|
408 | 407 | \ No newline at end of file |
408 | +add_action('wp_ajax_give_delete_payment_note', 'give_ajax_delete_payment_note'); |
|
409 | 409 | \ 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 | |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | * @since 1.0 |
28 | 28 | */ |
29 | 29 | public function __construct() { |
30 | - add_action( 'admin_notices', array( $this, 'show_notices' ) ); |
|
31 | - add_action( 'give_dismiss_notices', array( $this, 'dismiss_notices' ) ); |
|
32 | - add_action( 'admin_bar_menu', array( $this, 'give_admin_bar_menu' ), 1000 ); |
|
30 | + add_action('admin_notices', array($this, 'show_notices')); |
|
31 | + add_action('give_dismiss_notices', array($this, 'dismiss_notices')); |
|
32 | + add_action('admin_bar_menu', array($this, 'give_admin_bar_menu'), 1000); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
@@ -42,18 +42,18 @@ discard block |
||
42 | 42 | public function give_admin_bar_menu() { |
43 | 43 | global $wp_admin_bar; |
44 | 44 | |
45 | - if ( ! give_is_test_mode() || ! current_user_can( 'view_give_reports' ) ) { |
|
45 | + if ( ! give_is_test_mode() || ! current_user_can('view_give_reports')) { |
|
46 | 46 | return false; |
47 | 47 | } |
48 | 48 | |
49 | 49 | //Add the main siteadmin menu item |
50 | - $wp_admin_bar->add_menu( array( |
|
50 | + $wp_admin_bar->add_menu(array( |
|
51 | 51 | 'id' => 'give-test-notice', |
52 | - 'href' => admin_url() . 'edit.php?post_type=give_forms&page=give-settings&tab=gateways', |
|
52 | + 'href' => admin_url().'edit.php?post_type=give_forms&page=give-settings&tab=gateways', |
|
53 | 53 | 'parent' => 'top-secondary', |
54 | - 'title' => esc_html__( 'Give Test Mode Active', 'give' ), |
|
55 | - 'meta' => array( 'class' => 'give-test-mode-active' ), |
|
56 | - ) ); |
|
54 | + 'title' => esc_html__('Give Test Mode Active', 'give'), |
|
55 | + 'meta' => array('class' => 'give-test-mode-active'), |
|
56 | + )); |
|
57 | 57 | |
58 | 58 | } |
59 | 59 | |
@@ -68,98 +68,98 @@ discard block |
||
68 | 68 | 'error' => array() |
69 | 69 | ); |
70 | 70 | |
71 | - if ( ! give_test_ajax_works() && ! get_user_meta( get_current_user_id(), '_give_admin_ajax_inaccessible_dismissed', true ) && current_user_can( 'manage_give_settings' ) ) { |
|
71 | + if ( ! give_test_ajax_works() && ! get_user_meta(get_current_user_id(), '_give_admin_ajax_inaccessible_dismissed', true) && current_user_can('manage_give_settings')) { |
|
72 | 72 | echo '<div class="error">'; |
73 | - echo '<p>' . esc_html__( 'Your site appears to be blocking the WordPress ajax interface. This may cause issues with Give.', 'give' ) . '</p>'; |
|
73 | + echo '<p>'.esc_html__('Your site appears to be blocking the WordPress ajax interface. This may cause issues with Give.', 'give').'</p>'; |
|
74 | 74 | /* translators: %s: https://givewp.com/documentation/core/troubleshooting/admin-ajax-blocked/ */ |
75 | - echo '<p>' . sprintf( __( 'Please see <a href="%s" target="_blank">this reference</a> for possible solutions.', 'give' ), esc_url( 'https://givewp.com/documentation/core/troubleshooting/admin-ajax-blocked/' ) ) . '</p>'; |
|
76 | - echo '<p><a href="' . add_query_arg( array( |
|
75 | + echo '<p>'.sprintf(__('Please see <a href="%s" target="_blank">this reference</a> for possible solutions.', 'give'), esc_url('https://givewp.com/documentation/core/troubleshooting/admin-ajax-blocked/')).'</p>'; |
|
76 | + echo '<p><a href="'.add_query_arg(array( |
|
77 | 77 | 'give_action' => 'dismiss_notices', |
78 | 78 | 'give_notice' => 'admin_ajax_inaccessible' |
79 | - ) ) . '">' . esc_attr__( 'Dismiss Notice', 'give' ) . '</a></p>'; |
|
79 | + )).'">'.esc_attr__('Dismiss Notice', 'give').'</a></p>'; |
|
80 | 80 | echo '</div>'; |
81 | 81 | } |
82 | 82 | |
83 | 83 | |
84 | - if ( isset( $_GET['give-message'] ) ) { |
|
84 | + if (isset($_GET['give-message'])) { |
|
85 | 85 | |
86 | 86 | // Donation reports errors |
87 | - if ( current_user_can( 'view_give_reports' ) ) { |
|
88 | - switch ( $_GET['give-message'] ) { |
|
87 | + if (current_user_can('view_give_reports')) { |
|
88 | + switch ($_GET['give-message']) { |
|
89 | 89 | case 'payment_deleted' : |
90 | - $notices['updated']['give-payment-deleted'] = esc_attr__( 'The payment has been deleted.', 'give' ); |
|
90 | + $notices['updated']['give-payment-deleted'] = esc_attr__('The payment has been deleted.', 'give'); |
|
91 | 91 | break; |
92 | 92 | case 'email_sent' : |
93 | - $notices['updated']['give-payment-sent'] = esc_attr__( 'The donation receipt has been resent.', 'give' ); |
|
93 | + $notices['updated']['give-payment-sent'] = esc_attr__('The donation receipt has been resent.', 'give'); |
|
94 | 94 | break; |
95 | 95 | case 'refreshed-reports' : |
96 | - $notices['updated']['give-refreshed-reports'] = esc_attr__( 'The reports cache has been cleared.', 'give' ); |
|
96 | + $notices['updated']['give-refreshed-reports'] = esc_attr__('The reports cache has been cleared.', 'give'); |
|
97 | 97 | break; |
98 | 98 | case 'payment-note-deleted' : |
99 | - $notices['updated']['give-payment-note-deleted'] = esc_attr__( 'The payment note has been deleted.', 'give' ); |
|
99 | + $notices['updated']['give-payment-note-deleted'] = esc_attr__('The payment note has been deleted.', 'give'); |
|
100 | 100 | break; |
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | 104 | // Give settings notices and errors |
105 | - if ( current_user_can( 'manage_give_settings' ) ) { |
|
106 | - switch ( $_GET['give-message'] ) { |
|
105 | + if (current_user_can('manage_give_settings')) { |
|
106 | + switch ($_GET['give-message']) { |
|
107 | 107 | case 'settings-imported' : |
108 | - $notices['updated']['give-settings-imported'] = esc_attr__( 'The settings have been imported.', 'give' ); |
|
108 | + $notices['updated']['give-settings-imported'] = esc_attr__('The settings have been imported.', 'give'); |
|
109 | 109 | break; |
110 | 110 | case 'api-key-generated' : |
111 | - $notices['updated']['give-api-key-generated'] = esc_attr__( 'API keys have been generated.', 'give' ); |
|
111 | + $notices['updated']['give-api-key-generated'] = esc_attr__('API keys have been generated.', 'give'); |
|
112 | 112 | break; |
113 | 113 | case 'api-key-exists' : |
114 | - $notices['error']['give-api-key-exists'] = esc_attr__( 'The specified user already has API keys.', 'give' ); |
|
114 | + $notices['error']['give-api-key-exists'] = esc_attr__('The specified user already has API keys.', 'give'); |
|
115 | 115 | break; |
116 | 116 | case 'api-key-regenerated' : |
117 | - $notices['updated']['give-api-key-regenerated'] = esc_attr__( 'API keys have been regenerated.', 'give' ); |
|
117 | + $notices['updated']['give-api-key-regenerated'] = esc_attr__('API keys have been regenerated.', 'give'); |
|
118 | 118 | break; |
119 | 119 | case 'api-key-revoked' : |
120 | - $notices['updated']['give-api-key-revoked'] = esc_attr__( 'API keys have been revoked.', 'give' ); |
|
120 | + $notices['updated']['give-api-key-revoked'] = esc_attr__('API keys have been revoked.', 'give'); |
|
121 | 121 | break; |
122 | 122 | case 'sent-test-email' : |
123 | - $notices['updated']['give-sent-test-email'] = esc_attr__( 'The test email has been sent.', 'give' ); |
|
123 | + $notices['updated']['give-sent-test-email'] = esc_attr__('The test email has been sent.', 'give'); |
|
124 | 124 | break; |
125 | 125 | } |
126 | 126 | } |
127 | 127 | // Payments errors |
128 | - if ( current_user_can( 'edit_give_payments' ) ) { |
|
129 | - switch ( $_GET['give-message'] ) { |
|
128 | + if (current_user_can('edit_give_payments')) { |
|
129 | + switch ($_GET['give-message']) { |
|
130 | 130 | case 'note-added' : |
131 | - $notices['updated']['give-note-added'] = esc_attr__( 'The payment note has been added.', 'give' ); |
|
131 | + $notices['updated']['give-note-added'] = esc_attr__('The payment note has been added.', 'give'); |
|
132 | 132 | break; |
133 | 133 | case 'payment-updated' : |
134 | - $notices['updated']['give-payment-updated'] = esc_attr__( 'The payment has been updated.', 'give' ); |
|
134 | + $notices['updated']['give-payment-updated'] = esc_attr__('The payment has been updated.', 'give'); |
|
135 | 135 | break; |
136 | 136 | } |
137 | 137 | } |
138 | 138 | |
139 | 139 | // Customer Notices |
140 | - if ( current_user_can( 'edit_give_payments' ) ) { |
|
141 | - switch ( $_GET['give-message'] ) { |
|
140 | + if (current_user_can('edit_give_payments')) { |
|
141 | + switch ($_GET['give-message']) { |
|
142 | 142 | case 'customer-deleted' : |
143 | - $notices['updated']['give-customer-deleted'] = esc_attr__( 'The donor has been deleted.', 'give' ); |
|
143 | + $notices['updated']['give-customer-deleted'] = esc_attr__('The donor has been deleted.', 'give'); |
|
144 | 144 | break; |
145 | 145 | } |
146 | 146 | } |
147 | 147 | |
148 | 148 | } |
149 | 149 | |
150 | - if ( count( $notices['updated'] ) > 0 ) { |
|
151 | - foreach ( $notices['updated'] as $notice => $message ) { |
|
152 | - add_settings_error( 'give-notices', $notice, $message, 'updated' ); |
|
150 | + if (count($notices['updated']) > 0) { |
|
151 | + foreach ($notices['updated'] as $notice => $message) { |
|
152 | + add_settings_error('give-notices', $notice, $message, 'updated'); |
|
153 | 153 | } |
154 | 154 | } |
155 | 155 | |
156 | - if ( count( $notices['error'] ) > 0 ) { |
|
157 | - foreach ( $notices['error'] as $notice => $message ) { |
|
158 | - add_settings_error( 'give-notices', $notice, $message, 'error' ); |
|
156 | + if (count($notices['error']) > 0) { |
|
157 | + foreach ($notices['error'] as $notice => $message) { |
|
158 | + add_settings_error('give-notices', $notice, $message, 'error'); |
|
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
162 | - settings_errors( 'give-notices' ); |
|
162 | + settings_errors('give-notices'); |
|
163 | 163 | |
164 | 164 | } |
165 | 165 | |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | * @return void |
172 | 172 | */ |
173 | 173 | function give_admin_addons_notices() { |
174 | - add_settings_error( 'give-notices', 'give-addons-feed-error', esc_attr__( 'There seems to be an issue with the server. Please try again in a few minutes.', 'give' ), 'error' ); |
|
175 | - settings_errors( 'give-notices' ); |
|
174 | + add_settings_error('give-notices', 'give-addons-feed-error', esc_attr__('There seems to be an issue with the server. Please try again in a few minutes.', 'give'), 'error'); |
|
175 | + settings_errors('give-notices'); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | |
@@ -183,9 +183,9 @@ discard block |
||
183 | 183 | * @return void |
184 | 184 | */ |
185 | 185 | function dismiss_notices() { |
186 | - if ( isset( $_GET['give_notice'] ) ) { |
|
187 | - update_user_meta( get_current_user_id(), '_give_' . $_GET['give_notice'] . '_dismissed', 1 ); |
|
188 | - wp_redirect( remove_query_arg( array( 'give_action', 'give_notice' ) ) ); |
|
186 | + if (isset($_GET['give_notice'])) { |
|
187 | + update_user_meta(get_current_user_id(), '_give_'.$_GET['give_notice'].'_dismissed', 1); |
|
188 | + wp_redirect(remove_query_arg(array('give_action', 'give_notice'))); |
|
189 | 189 | exit; |
190 | 190 | } |
191 | 191 | } |
@@ -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 | |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | function give_add_ons_page() { |
26 | 26 | ob_start(); ?> |
27 | 27 | <div class="wrap" id="give-add-ons"> |
28 | - <h1><?php esc_html_e( 'Give Add-ons', 'give' ); ?> |
|
29 | - — <a href="https://givewp.com/addons/" class="button-primary give-view-addons-all" target="_blank"><?php esc_html_e( 'View All Add-ons', 'give' ); ?> |
|
28 | + <h1><?php esc_html_e('Give Add-ons', 'give'); ?> |
|
29 | + — <a href="https://givewp.com/addons/" class="button-primary give-view-addons-all" target="_blank"><?php esc_html_e('View All Add-ons', 'give'); ?> |
|
30 | 30 | <span class="dashicons dashicons-external"></span></a> |
31 | 31 | </h1> |
32 | 32 | |
33 | - <p><?php esc_html_e( 'The following Add-ons extend the functionality of Give.', 'give' ); ?></p> |
|
33 | + <p><?php esc_html_e('The following Add-ons extend the functionality of Give.', 'give'); ?></p> |
|
34 | 34 | <?php echo give_add_ons_get_feed(); ?> |
35 | 35 | </div> |
36 | 36 | <?php |
@@ -48,18 +48,18 @@ discard block |
||
48 | 48 | function give_add_ons_get_feed() { |
49 | 49 | |
50 | 50 | $addons_debug = false; //set to true to debug |
51 | - $cache = get_transient( 'give_add_ons_feed' ); |
|
51 | + $cache = get_transient('give_add_ons_feed'); |
|
52 | 52 | |
53 | - if ( $cache === false || $addons_debug === true && WP_DEBUG === true ) { |
|
54 | - $feed = wp_remote_get( 'https://givewp.com/downloads/feed/', array( 'sslverify' => false ) ); |
|
53 | + if ($cache === false || $addons_debug === true && WP_DEBUG === true) { |
|
54 | + $feed = wp_remote_get('https://givewp.com/downloads/feed/', array('sslverify' => false)); |
|
55 | 55 | |
56 | - if ( ! is_wp_error( $feed ) ) { |
|
57 | - if ( isset( $feed['body'] ) && strlen( $feed['body'] ) > 0 ) { |
|
58 | - $cache = wp_remote_retrieve_body( $feed ); |
|
59 | - set_transient( 'give_add_ons_feed', $cache, 3600 ); |
|
56 | + if ( ! is_wp_error($feed)) { |
|
57 | + if (isset($feed['body']) && strlen($feed['body']) > 0) { |
|
58 | + $cache = wp_remote_retrieve_body($feed); |
|
59 | + set_transient('give_add_ons_feed', $cache, 3600); |
|
60 | 60 | } |
61 | 61 | } else { |
62 | - $cache = '<div class="error"><p>' . esc_html__( 'There was an error retrieving the Give Add-ons list from the server. Please try again later.', 'give' ) . '</div>'; |
|
62 | + $cache = '<div class="error"><p>'.esc_html__('There was an error retrieving the Give Add-ons list from the server. Please try again later.', 'give').'</div>'; |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | * @since 1.0 |
36 | 36 | */ |
37 | 37 | public function __construct() { |
38 | - add_action( 'admin_menu', array( $this, 'admin_menus' ) ); |
|
39 | - add_action( 'admin_head', array( $this, 'admin_head' ) ); |
|
40 | - add_action( 'admin_init', array( $this, 'welcome' ) ); |
|
38 | + add_action('admin_menu', array($this, 'admin_menus')); |
|
39 | + add_action('admin_head', array($this, 'admin_head')); |
|
40 | + add_action('admin_init', array($this, 'welcome')); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -51,38 +51,38 @@ discard block |
||
51 | 51 | public function admin_menus() { |
52 | 52 | // About Page |
53 | 53 | add_dashboard_page( |
54 | - esc_html__( 'Welcome to Give', 'give' ), |
|
55 | - esc_html__( 'Welcome to Give', 'give' ), |
|
54 | + esc_html__('Welcome to Give', 'give'), |
|
55 | + esc_html__('Welcome to Give', 'give'), |
|
56 | 56 | $this->minimum_capability, |
57 | 57 | 'give-about', |
58 | - array( $this, 'about_screen' ) |
|
58 | + array($this, 'about_screen') |
|
59 | 59 | ); |
60 | 60 | |
61 | 61 | // Changelog Page |
62 | 62 | add_dashboard_page( |
63 | - esc_html__( 'Give Changelog', 'give' ), |
|
64 | - esc_html__( 'Give Changelog', 'give' ), |
|
63 | + esc_html__('Give Changelog', 'give'), |
|
64 | + esc_html__('Give Changelog', 'give'), |
|
65 | 65 | $this->minimum_capability, |
66 | 66 | 'give-changelog', |
67 | - array( $this, 'changelog_screen' ) |
|
67 | + array($this, 'changelog_screen') |
|
68 | 68 | ); |
69 | 69 | |
70 | 70 | // Getting Started Page |
71 | 71 | add_dashboard_page( |
72 | - esc_html__( 'Getting started with Give', 'give' ), |
|
73 | - esc_html__( 'Getting started with Give', 'give' ), |
|
72 | + esc_html__('Getting started with Give', 'give'), |
|
73 | + esc_html__('Getting started with Give', 'give'), |
|
74 | 74 | $this->minimum_capability, |
75 | 75 | 'give-getting-started', |
76 | - array( $this, 'getting_started_screen' ) |
|
76 | + array($this, 'getting_started_screen') |
|
77 | 77 | ); |
78 | 78 | |
79 | 79 | // Credits Page |
80 | 80 | add_dashboard_page( |
81 | - esc_html__( 'The people that build Give', 'give' ), |
|
82 | - esc_html__( 'The people that build Give', 'give' ), |
|
81 | + esc_html__('The people that build Give', 'give'), |
|
82 | + esc_html__('The people that build Give', 'give'), |
|
83 | 83 | $this->minimum_capability, |
84 | 84 | 'give-credits', |
85 | - array( $this, 'credits_screen' ) |
|
85 | + array($this, 'credits_screen') |
|
86 | 86 | ); |
87 | 87 | } |
88 | 88 | |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function admin_head() { |
97 | 97 | |
98 | - remove_submenu_page( 'index.php', 'give-about' ); |
|
99 | - remove_submenu_page( 'index.php', 'give-changelog' ); |
|
100 | - remove_submenu_page( 'index.php', 'give-getting-started' ); |
|
101 | - remove_submenu_page( 'index.php', 'give-credits' ); |
|
98 | + remove_submenu_page('index.php', 'give-about'); |
|
99 | + remove_submenu_page('index.php', 'give-changelog'); |
|
100 | + remove_submenu_page('index.php', 'give-getting-started'); |
|
101 | + remove_submenu_page('index.php', 'give-credits'); |
|
102 | 102 | |
103 | 103 | // Badge for welcome page |
104 | - $badge_url = GIVE_PLUGIN_URL . 'assets/images/give-badge.png'; |
|
104 | + $badge_url = GIVE_PLUGIN_URL.'assets/images/give-badge.png'; |
|
105 | 105 | |
106 | 106 | ?> |
107 | 107 | <style type="text/css" media="screen"> |
@@ -215,20 +215,20 @@ discard block |
||
215 | 215 | * @return void |
216 | 216 | */ |
217 | 217 | public function tabs() { |
218 | - $selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about'; |
|
218 | + $selected = isset($_GET['page']) ? $_GET['page'] : 'give-about'; |
|
219 | 219 | ?> |
220 | 220 | <h2 class="nav-tab-wrapper"> |
221 | - <a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>"> |
|
222 | - <?php esc_html_e( 'About Give', 'give' ); ?> |
|
221 | + <a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-about'), 'index.php'))); ?>"> |
|
222 | + <?php esc_html_e('About Give', 'give'); ?> |
|
223 | 223 | </a> |
224 | - <a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>"> |
|
225 | - <?php esc_html_e( 'Getting Started', 'give' ); ?> |
|
224 | + <a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-getting-started'), 'index.php'))); ?>"> |
|
225 | + <?php esc_html_e('Getting Started', 'give'); ?> |
|
226 | 226 | </a> |
227 | - <a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>"> |
|
228 | - <?php esc_html_e( 'Credits', 'give' ); ?> |
|
227 | + <a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-credits'), 'index.php'))); ?>"> |
|
228 | + <?php esc_html_e('Credits', 'give'); ?> |
|
229 | 229 | </a> |
230 | - <a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( null, 'index.php' ) ) . 'edit.php?post_type=give_forms&page=give-addons'; ?>"> |
|
231 | - <?php esc_html_e( 'Add-ons', 'give' ); ?> |
|
230 | + <a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(null, 'index.php')).'edit.php?post_type=give_forms&page=give-addons'; ?>"> |
|
231 | + <?php esc_html_e('Add-ons', 'give'); ?> |
|
232 | 232 | </a> |
233 | 233 | </h2> |
234 | 234 | <?php |
@@ -242,13 +242,13 @@ discard block |
||
242 | 242 | * @return void |
243 | 243 | */ |
244 | 244 | public function about_screen() { |
245 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
245 | + list($display_version) = explode('-', GIVE_VERSION); |
|
246 | 246 | ?> |
247 | 247 | <div class="wrap about-wrap"> |
248 | 248 | <h1 class="welcome-h1"><?php |
249 | 249 | printf( |
250 | 250 | /* translators: %s: Give version */ |
251 | - esc_html__( 'Welcome to Give %s', 'give' ), |
|
251 | + esc_html__('Welcome to Give %s', 'give'), |
|
252 | 252 | $display_version |
253 | 253 | ); |
254 | 254 | ?></h1> |
@@ -258,19 +258,19 @@ discard block |
||
258 | 258 | <p class="about-text"><?php |
259 | 259 | printf( |
260 | 260 | /* translators: %s: https://givewp.com/documenation/ */ |
261 | - __( 'Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ), |
|
262 | - esc_url( 'https://givewp.com/documenation/' ) |
|
261 | + __('Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'), |
|
262 | + esc_url('https://givewp.com/documenation/') |
|
263 | 263 | ); |
264 | 264 | ?></p> |
265 | 265 | |
266 | - <p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p> |
|
266 | + <p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p> |
|
267 | 267 | |
268 | 268 | <?php give_get_newsletter() ?> |
269 | 269 | |
270 | 270 | <div class="give-badge"><?php |
271 | 271 | printf( |
272 | 272 | /* translators: %s: Give version */ |
273 | - esc_html__( 'Version %s', 'give' ), |
|
273 | + esc_html__('Version %s', 'give'), |
|
274 | 274 | $display_version |
275 | 275 | ); |
276 | 276 | ?></div> |
@@ -280,16 +280,16 @@ discard block |
||
280 | 280 | <div class="feature-section clearfix introduction"> |
281 | 281 | |
282 | 282 | <div class="video feature-section-item"> |
283 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-form-mockup.png' ?>" alt="<?php esc_attr_e( 'A Give donation form', 'give' ); ?>"> |
|
283 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-form-mockup.png' ?>" alt="<?php esc_attr_e('A Give donation form', 'give'); ?>"> |
|
284 | 284 | </div> |
285 | 285 | |
286 | 286 | <div class="content feature-section-item last-feature"> |
287 | 287 | |
288 | - <h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3> |
|
288 | + <h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3> |
|
289 | 289 | |
290 | - <p><?php esc_html_e( 'Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give' ); ?></p> |
|
290 | + <p><?php esc_html_e('Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give'); ?></p> |
|
291 | 291 | <a href="https://givewp.com" target="_blank" class="button-secondary"> |
292 | - <?php esc_html_e( 'Learn More', 'give' ); ?> |
|
292 | + <?php esc_html_e('Learn More', 'give'); ?> |
|
293 | 293 | <span class="dashicons dashicons-external"></span> |
294 | 294 | </a> |
295 | 295 | |
@@ -302,11 +302,11 @@ discard block |
||
302 | 302 | |
303 | 303 | <div class="content feature-section-item"> |
304 | 304 | |
305 | - <h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3> |
|
305 | + <h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3> |
|
306 | 306 | |
307 | - <p><?php esc_html_e( 'Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give' ); ?></p> |
|
307 | + <p><?php esc_html_e('Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give'); ?></p> |
|
308 | 308 | <a href="https://givewp.com/documentation" target="_blank" class="button-secondary"> |
309 | - <?php esc_html_e( 'View Documentation', 'give' ); ?> |
|
309 | + <?php esc_html_e('View Documentation', 'give'); ?> |
|
310 | 310 | <span class="dashicons dashicons-external"></span> |
311 | 311 | </a> |
312 | 312 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | |
315 | 315 | <div class="content feature-section-item last-feature"> |
316 | 316 | |
317 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-logo-photo-mashup.png' ?>" alt="<?php esc_attr_e( 'Give', 'give' ); ?>"> |
|
317 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-logo-photo-mashup.png' ?>" alt="<?php esc_attr_e('Give', 'give'); ?>"> |
|
318 | 318 | |
319 | 319 | </div> |
320 | 320 | |
@@ -334,22 +334,22 @@ discard block |
||
334 | 334 | * @return void |
335 | 335 | */ |
336 | 336 | public function changelog_screen() { |
337 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
337 | + list($display_version) = explode('-', GIVE_VERSION); |
|
338 | 338 | ?> |
339 | 339 | <div class="wrap about-wrap"> |
340 | - <h1><?php esc_html_e( 'Give Changelog', 'give' ); ?></h1> |
|
340 | + <h1><?php esc_html_e('Give Changelog', 'give'); ?></h1> |
|
341 | 341 | |
342 | 342 | <p class="about-text"><?php |
343 | 343 | printf( |
344 | 344 | /* translators: %s: Give version */ |
345 | - esc_html__( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ), |
|
345 | + esc_html__('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'), |
|
346 | 346 | $display_version |
347 | 347 | ); |
348 | 348 | ?></p> |
349 | 349 | <div class="give-badge"><?php |
350 | 350 | printf( |
351 | 351 | /* translators: %s: Give version */ |
352 | - esc_html__( 'Version %s', 'give' ), |
|
352 | + esc_html__('Version %s', 'give'), |
|
353 | 353 | $display_version |
354 | 354 | ); |
355 | 355 | ?></div> |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | <?php $this->tabs(); ?> |
358 | 358 | |
359 | 359 | <div class="changelog"> |
360 | - <h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3> |
|
360 | + <h3><?php esc_html_e('Full Changelog', 'give'); ?></h3> |
|
361 | 361 | |
362 | 362 | <div class="feature-section"> |
363 | 363 | <?php echo $this->parse_readme(); ?> |
@@ -365,10 +365,10 @@ discard block |
||
365 | 365 | </div> |
366 | 366 | |
367 | 367 | <div class="return-to-dashboard"> |
368 | - <a href="<?php echo esc_url( admin_url( add_query_arg( array( |
|
368 | + <a href="<?php echo esc_url(admin_url(add_query_arg(array( |
|
369 | 369 | 'post_type' => 'give_forms', |
370 | 370 | 'page' => 'give-settings' |
371 | - ), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Give Settings', 'give' ); ?></a> |
|
371 | + ), 'edit.php'))); ?>"><?php esc_html_e('Give Settings', 'give'); ?></a> |
|
372 | 372 | </div> |
373 | 373 | </div> |
374 | 374 | <?php |
@@ -382,45 +382,45 @@ discard block |
||
382 | 382 | * @return void |
383 | 383 | */ |
384 | 384 | public function getting_started_screen() { |
385 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
385 | + list($display_version) = explode('-', GIVE_VERSION); |
|
386 | 386 | ?> |
387 | 387 | <div class="wrap about-wrap get-started"> |
388 | 388 | <h1 class="welcome-h1"><?php |
389 | 389 | printf( |
390 | 390 | /* translators: %s: Give version */ |
391 | - esc_html__( 'Give %s - Getting Started Guide', 'give' ), |
|
391 | + esc_html__('Give %s - Getting Started Guide', 'give'), |
|
392 | 392 | $display_version |
393 | 393 | ); |
394 | 394 | ?></h1> |
395 | 395 | |
396 | 396 | <?php give_social_media_elements() ?> |
397 | 397 | |
398 | - <p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p> |
|
398 | + <p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p> |
|
399 | 399 | |
400 | - <p class="newsletter-intro"><?php esc_html_e( 'Don\'t forget to sign up for the newsletter!', 'give' ); ?></p> |
|
400 | + <p class="newsletter-intro"><?php esc_html_e('Don\'t forget to sign up for the newsletter!', 'give'); ?></p> |
|
401 | 401 | |
402 | 402 | <?php give_get_newsletter() ?> |
403 | 403 | |
404 | 404 | <div class="give-badge"><?php |
405 | 405 | printf( |
406 | 406 | /* translators: %s: Give version */ |
407 | - esc_html__( 'Version %s', 'give' ), |
|
407 | + esc_html__('Version %s', 'give'), |
|
408 | 408 | $display_version |
409 | 409 | ); |
410 | 410 | ?></div> |
411 | 411 | |
412 | 412 | <?php $this->tabs(); ?> |
413 | 413 | |
414 | - <p class="about-text"><?php printf( esc_html__( 'Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give' ), $display_version ); ?></p> |
|
414 | + <p class="about-text"><?php printf(esc_html__('Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give'), $display_version); ?></p> |
|
415 | 415 | |
416 | 416 | <div class="feature-section clearfix"> |
417 | 417 | |
418 | 418 | <div class="content feature-section-item"> |
419 | - <h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3> |
|
419 | + <h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3> |
|
420 | 420 | |
421 | - <p><?php esc_html_e( 'Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give' ); ?></p> |
|
421 | + <p><?php esc_html_e('Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give'); ?></p> |
|
422 | 422 | |
423 | - <p><?php esc_html_e( 'But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give' ); ?></p> |
|
423 | + <p><?php esc_html_e('But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give'); ?></p> |
|
424 | 424 | </div> |
425 | 425 | |
426 | 426 | <div class="content feature-section-item last-feature"> |
@@ -437,9 +437,9 @@ discard block |
||
437 | 437 | </div> |
438 | 438 | |
439 | 439 | <div class="content feature-section-item last-feature"> |
440 | - <h3><?php esc_html_e( 'STEP 2: Choose Your Levels', 'give' ); ?></h3> |
|
440 | + <h3><?php esc_html_e('STEP 2: Choose Your Levels', 'give'); ?></h3> |
|
441 | 441 | |
442 | - <p><?php esc_html_e( 'Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give' ); ?></p> |
|
442 | + <p><?php esc_html_e('Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give'); ?></p> |
|
443 | 443 | </div> |
444 | 444 | |
445 | 445 | </div> |
@@ -448,11 +448,11 @@ discard block |
||
448 | 448 | <div class="feature-section clearfix"> |
449 | 449 | |
450 | 450 | <div class="content feature-section-item add-content"> |
451 | - <h3><?php esc_html_e( 'STEP 3: Landing Page or Shortcode Mode?', 'give' ); ?></h3> |
|
451 | + <h3><?php esc_html_e('STEP 3: Landing Page or Shortcode Mode?', 'give'); ?></h3> |
|
452 | 452 | |
453 | - <p><?php esc_html_e( 'Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give' ); ?></p> |
|
453 | + <p><?php esc_html_e('Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give'); ?></p> |
|
454 | 454 | |
455 | - <p><?php esc_html_e( 'You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give' ); ?></p> |
|
455 | + <p><?php esc_html_e('You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give'); ?></p> |
|
456 | 456 | </div> |
457 | 457 | |
458 | 458 | <div class="content feature-section-item last-feature"> |
@@ -469,9 +469,9 @@ discard block |
||
469 | 469 | </div> |
470 | 470 | |
471 | 471 | <div class="content feature-section-item last-feature"> |
472 | - <h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3> |
|
472 | + <h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3> |
|
473 | 473 | |
474 | - <p><?php esc_html_e( 'Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give' ); ?></p> |
|
474 | + <p><?php esc_html_e('Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give'); ?></p> |
|
475 | 475 | </div> |
476 | 476 | |
477 | 477 | |
@@ -491,31 +491,31 @@ discard block |
||
491 | 491 | * @return void |
492 | 492 | */ |
493 | 493 | public function credits_screen() { |
494 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
494 | + list($display_version) = explode('-', GIVE_VERSION); |
|
495 | 495 | ?> |
496 | 496 | <div class="wrap about-wrap"> |
497 | 497 | <h1 class="welcome-h1"><?php |
498 | 498 | printf( |
499 | 499 | /* translators: %s: Give version */ |
500 | - esc_html__( 'Give %s - Credits', 'give' ), |
|
500 | + esc_html__('Give %s - Credits', 'give'), |
|
501 | 501 | $display_version |
502 | 502 | ); |
503 | 503 | ?></h1> |
504 | 504 | |
505 | 505 | <?php give_social_media_elements() ?> |
506 | 506 | |
507 | - <p class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly.', 'give' ); ?></p> |
|
507 | + <p class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly.', 'give'); ?></p> |
|
508 | 508 | |
509 | - <p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p> |
|
509 | + <p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p> |
|
510 | 510 | |
511 | - <p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p> |
|
511 | + <p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p> |
|
512 | 512 | |
513 | 513 | <?php give_get_newsletter() ?> |
514 | 514 | |
515 | 515 | <div class="give-badge"><?php |
516 | 516 | printf( |
517 | 517 | /* translators: %s: Give version */ |
518 | - esc_html__( 'Version %s', 'give' ), |
|
518 | + esc_html__('Version %s', 'give'), |
|
519 | 519 | $display_version |
520 | 520 | ); |
521 | 521 | ?></div> |
@@ -525,8 +525,8 @@ discard block |
||
525 | 525 | <p class="about-description"><?php |
526 | 526 | printf( |
527 | 527 | /* translators: %s: https://github.com/WordImpress/give */ |
528 | - __( 'Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give' ), |
|
529 | - esc_url( 'https://github.com/WordImpress/give' ) |
|
528 | + __('Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give'), |
|
529 | + esc_url('https://github.com/WordImpress/give') |
|
530 | 530 | ); |
531 | 531 | ?></p> |
532 | 532 | |
@@ -543,21 +543,21 @@ discard block |
||
543 | 543 | * @return string $readme HTML formatted readme file |
544 | 544 | */ |
545 | 545 | public function parse_readme() { |
546 | - $file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null; |
|
546 | + $file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR.'readme.txt' : null; |
|
547 | 547 | |
548 | - if ( ! $file ) { |
|
549 | - $readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>'; |
|
548 | + if ( ! $file) { |
|
549 | + $readme = '<p>'.esc_html__('No valid changlog was found.', 'give').'</p>'; |
|
550 | 550 | } else { |
551 | - $readme = file_get_contents( $file ); |
|
552 | - $readme = nl2br( esc_html( $readme ) ); |
|
553 | - $readme = explode( '== Changelog ==', $readme ); |
|
554 | - $readme = end( $readme ); |
|
555 | - |
|
556 | - $readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme ); |
|
557 | - $readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme ); |
|
558 | - $readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme ); |
|
559 | - $readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme ); |
|
560 | - $readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme ); |
|
551 | + $readme = file_get_contents($file); |
|
552 | + $readme = nl2br(esc_html($readme)); |
|
553 | + $readme = explode('== Changelog ==', $readme); |
|
554 | + $readme = end($readme); |
|
555 | + |
|
556 | + $readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme); |
|
557 | + $readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme); |
|
558 | + $readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme); |
|
559 | + $readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme); |
|
560 | + $readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme); |
|
561 | 561 | } |
562 | 562 | |
563 | 563 | return $readme; |
@@ -574,27 +574,27 @@ discard block |
||
574 | 574 | public function contributors() { |
575 | 575 | $contributors = $this->get_contributors(); |
576 | 576 | |
577 | - if ( empty( $contributors ) ) { |
|
577 | + if (empty($contributors)) { |
|
578 | 578 | return ''; |
579 | 579 | } |
580 | 580 | |
581 | 581 | $contributor_list = '<ul class="wp-people-group">'; |
582 | 582 | |
583 | - foreach ( $contributors as $contributor ) { |
|
583 | + foreach ($contributors as $contributor) { |
|
584 | 584 | $contributor_list .= '<li class="wp-person">'; |
585 | - $contributor_list .= sprintf( '<a href="%s" title="%s">', |
|
586 | - esc_url( 'https://github.com/' . $contributor->login ), |
|
585 | + $contributor_list .= sprintf('<a href="%s" title="%s">', |
|
586 | + esc_url('https://github.com/'.$contributor->login), |
|
587 | 587 | esc_html( |
588 | 588 | sprintf( |
589 | 589 | /* translators: %s: github contributor */ |
590 | - esc_html__( 'View %s', 'give' ), |
|
590 | + esc_html__('View %s', 'give'), |
|
591 | 591 | $contributor->login |
592 | 592 | ) |
593 | 593 | ) |
594 | 594 | ); |
595 | - $contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) ); |
|
595 | + $contributor_list .= sprintf('<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url($contributor->avatar_url), esc_html($contributor->login)); |
|
596 | 596 | $contributor_list .= '</a>'; |
597 | - $contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) ); |
|
597 | + $contributor_list .= sprintf('<a class="web" href="%s">%s</a>', esc_url('https://github.com/'.$contributor->login), esc_html($contributor->login)); |
|
598 | 598 | $contributor_list .= '</a>'; |
599 | 599 | $contributor_list .= '</li>'; |
600 | 600 | } |
@@ -612,25 +612,25 @@ discard block |
||
612 | 612 | * @return array $contributors List of contributors |
613 | 613 | */ |
614 | 614 | public function get_contributors() { |
615 | - $contributors = get_transient( 'give_contributors' ); |
|
615 | + $contributors = get_transient('give_contributors'); |
|
616 | 616 | |
617 | - if ( false !== $contributors ) { |
|
617 | + if (false !== $contributors) { |
|
618 | 618 | return $contributors; |
619 | 619 | } |
620 | 620 | |
621 | - $response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) ); |
|
621 | + $response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false)); |
|
622 | 622 | |
623 | - if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { |
|
623 | + if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) { |
|
624 | 624 | return array(); |
625 | 625 | } |
626 | 626 | |
627 | - $contributors = json_decode( wp_remote_retrieve_body( $response ) ); |
|
627 | + $contributors = json_decode(wp_remote_retrieve_body($response)); |
|
628 | 628 | |
629 | - if ( ! is_array( $contributors ) ) { |
|
629 | + if ( ! is_array($contributors)) { |
|
630 | 630 | return array(); |
631 | 631 | } |
632 | 632 | |
633 | - set_transient( 'give_contributors', $contributors, 3600 ); |
|
633 | + set_transient('give_contributors', $contributors, 3600); |
|
634 | 634 | |
635 | 635 | return $contributors; |
636 | 636 | } |
@@ -649,24 +649,24 @@ discard block |
||
649 | 649 | |
650 | 650 | |
651 | 651 | // Bail if no activation redirect |
652 | - if ( ! get_transient( '_give_activation_redirect' ) ) { |
|
652 | + if ( ! get_transient('_give_activation_redirect')) { |
|
653 | 653 | return; |
654 | 654 | } |
655 | 655 | |
656 | 656 | // Delete the redirect transient |
657 | - delete_transient( '_give_activation_redirect' ); |
|
657 | + delete_transient('_give_activation_redirect'); |
|
658 | 658 | |
659 | 659 | // Bail if activating from network, or bulk |
660 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
660 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
661 | 661 | return; |
662 | 662 | } |
663 | 663 | |
664 | - $upgrade = get_option( 'give_version_upgraded_from' ); |
|
664 | + $upgrade = get_option('give_version_upgraded_from'); |
|
665 | 665 | |
666 | - if ( ! $upgrade ) { // First time install |
|
667 | - wp_safe_redirect( admin_url( 'index.php?page=give-about' ) ); |
|
666 | + if ( ! $upgrade) { // First time install |
|
667 | + wp_safe_redirect(admin_url('index.php?page=give-about')); |
|
668 | 668 | exit; |
669 | - } elseif( isset( $give_options['disable_welcome'] ) ) { // Welcome is disabled in settings |
|
669 | + } elseif (isset($give_options['disable_welcome'])) { // Welcome is disabled in settings |
|
670 | 670 | |
671 | 671 | } else { // Welcome is NOT disabled in settings |
672 | 672 | wp_safe_redirect(admin_url('index.php?page=give-about')); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @since 1.3.0 |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) or exit; |
|
11 | +defined('ABSPATH') or exit; |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Class Give_Shortcode_Donation_Form_Goal |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function __construct() { |
22 | 22 | |
23 | - $this->shortcode['title'] = esc_html__( 'Donation Form Goal', 'give' ); |
|
24 | - $this->shortcode['label'] = esc_html__( 'Donation Form Goal', 'give' ); |
|
23 | + $this->shortcode['title'] = esc_html__('Donation Form Goal', 'give'); |
|
24 | + $this->shortcode['label'] = esc_html__('Donation Form Goal', 'give'); |
|
25 | 25 | |
26 | - parent::__construct( 'give_goal' ); |
|
26 | + parent::__construct('give_goal'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | |
36 | 36 | $create_form_link = sprintf( |
37 | 37 | /* translators: %s: create new form URL */ |
38 | - __( '<a href="%s">Create</a> a new Donation Form.', 'give' ), |
|
39 | - admin_url( 'post-new.php?post_type=give_forms' ) |
|
38 | + __('<a href="%s">Create</a> a new Donation Form.', 'give'), |
|
39 | + admin_url('post-new.php?post_type=give_forms') |
|
40 | 40 | ); |
41 | 41 | |
42 | 42 | return array( |
@@ -46,35 +46,35 @@ discard block |
||
46 | 46 | 'post_type' => 'give_forms', |
47 | 47 | ), |
48 | 48 | 'name' => 'id', |
49 | - 'tooltip' => esc_attr__( 'Select a Donation Form', 'give' ), |
|
50 | - 'placeholder' => esc_attr__( '- Select a Form -', 'give' ), |
|
49 | + 'tooltip' => esc_attr__('Select a Donation Form', 'give'), |
|
50 | + 'placeholder' => esc_attr__('- Select a Form -', 'give'), |
|
51 | 51 | 'required' => array( |
52 | - 'alert' => esc_html__( 'You must first select a Form!', 'give' ), |
|
53 | - 'error' => sprintf( '<p class="strong">%s</p><p class="no-margin">%s</p>', esc_html__( 'No donation forms found.', 'give' ), $create_form_link ), |
|
52 | + 'alert' => esc_html__('You must first select a Form!', 'give'), |
|
53 | + 'error' => sprintf('<p class="strong">%s</p><p class="no-margin">%s</p>', esc_html__('No donation forms found.', 'give'), $create_form_link), |
|
54 | 54 | ), |
55 | 55 | ), |
56 | 56 | array( |
57 | 57 | 'type' => 'container', |
58 | - 'html' => sprintf( '<p class="strong margin-top">%s</p>', esc_html__( 'Optional settings', 'give' ) ), |
|
58 | + 'html' => sprintf('<p class="strong margin-top">%s</p>', esc_html__('Optional settings', 'give')), |
|
59 | 59 | ), |
60 | 60 | array( |
61 | 61 | 'type' => 'listbox', |
62 | 62 | 'name' => 'show_text', |
63 | - 'label' => esc_attr__( 'Show Text:', 'give' ), |
|
64 | - 'tooltip' => esc_attr__( 'This text displays the amount of income raised compared to the goal.', 'give' ), |
|
63 | + 'label' => esc_attr__('Show Text:', 'give'), |
|
64 | + 'tooltip' => esc_attr__('This text displays the amount of income raised compared to the goal.', 'give'), |
|
65 | 65 | 'options' => array( |
66 | - 'true' => esc_html__( 'Show', 'give' ), |
|
67 | - 'false' => esc_html__( 'Hide', 'give' ), |
|
66 | + 'true' => esc_html__('Show', 'give'), |
|
67 | + 'false' => esc_html__('Hide', 'give'), |
|
68 | 68 | ), |
69 | 69 | ), |
70 | 70 | array( |
71 | 71 | 'type' => 'listbox', |
72 | 72 | 'name' => 'show_bar', |
73 | - 'label' => esc_attr__( 'Show Progress Bar:', 'give' ), |
|
74 | - 'tooltip' => esc_attr__( 'Do you want to display the goal\'s progress bar?', 'give' ), |
|
73 | + 'label' => esc_attr__('Show Progress Bar:', 'give'), |
|
74 | + 'tooltip' => esc_attr__('Do you want to display the goal\'s progress bar?', 'give'), |
|
75 | 75 | 'options' => array( |
76 | - 'true' => esc_html__( 'Show', 'give' ), |
|
77 | - 'false' => esc_html__( 'Hide', 'give' ), |
|
76 | + 'true' => esc_html__('Show', 'give'), |
|
77 | + 'false' => esc_html__('Hide', 'give'), |
|
78 | 78 | ), |
79 | 79 | ), |
80 | 80 | ); |