@@ -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 | |
@@ -348,11 +348,11 @@ discard block |
||
348 | 348 | * @param int|bool $_id Post id. Default is false. |
349 | 349 | * @param array $_args Arguments passed. |
350 | 350 | */ |
351 | - public function __construct( $_id = false, $_args = array() ) { |
|
351 | + public function __construct($_id = false, $_args = array()) { |
|
352 | 352 | |
353 | - $donation_form = WP_Post::get_instance( $_id ); |
|
353 | + $donation_form = WP_Post::get_instance($_id); |
|
354 | 354 | |
355 | - return $this->setup_donation_form( $donation_form ); |
|
355 | + return $this->setup_donation_form($donation_form); |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | /** |
@@ -365,23 +365,23 @@ discard block |
||
365 | 365 | * |
366 | 366 | * @return bool If the setup was successful or not. |
367 | 367 | */ |
368 | - private function setup_donation_form( $donation_form ) { |
|
368 | + private function setup_donation_form($donation_form) { |
|
369 | 369 | |
370 | - if ( ! is_object( $donation_form ) ) { |
|
370 | + if ( ! is_object($donation_form)) { |
|
371 | 371 | return false; |
372 | 372 | } |
373 | 373 | |
374 | - if ( ! is_a( $donation_form, 'WP_Post' ) ) { |
|
374 | + if ( ! is_a($donation_form, 'WP_Post')) { |
|
375 | 375 | return false; |
376 | 376 | } |
377 | 377 | |
378 | - if ( 'give_forms' !== $donation_form->post_type ) { |
|
378 | + if ('give_forms' !== $donation_form->post_type) { |
|
379 | 379 | return false; |
380 | 380 | } |
381 | 381 | |
382 | - foreach ( $donation_form as $key => $value ) { |
|
382 | + foreach ($donation_form as $key => $value) { |
|
383 | 383 | |
384 | - switch ( $key ) { |
|
384 | + switch ($key) { |
|
385 | 385 | |
386 | 386 | default: |
387 | 387 | $this->$key = $value; |
@@ -405,16 +405,16 @@ discard block |
||
405 | 405 | * |
406 | 406 | * @return mixed |
407 | 407 | */ |
408 | - public function __get( $key ) { |
|
408 | + public function __get($key) { |
|
409 | 409 | |
410 | - if ( method_exists( $this, 'get_' . $key ) ) { |
|
410 | + if (method_exists($this, 'get_'.$key)) { |
|
411 | 411 | |
412 | - return call_user_func( array( $this, 'get_' . $key ) ); |
|
412 | + return call_user_func(array($this, 'get_'.$key)); |
|
413 | 413 | |
414 | 414 | } else { |
415 | 415 | |
416 | 416 | /* translators: %s: property key */ |
417 | - return new WP_Error( 'give-form-invalid-property', sprintf( esc_html__( 'Can\'t get property %s.', 'give' ), $key ) ); |
|
417 | + return new WP_Error('give-form-invalid-property', sprintf(esc_html__('Can\'t get property %s.', 'give'), $key)); |
|
418 | 418 | |
419 | 419 | } |
420 | 420 | |
@@ -430,30 +430,30 @@ discard block |
||
430 | 430 | * |
431 | 431 | * @return bool|int False if data isn't passed and class not instantiated for creation, or New Form ID. |
432 | 432 | */ |
433 | - public function create( $data = array() ) { |
|
433 | + public function create($data = array()) { |
|
434 | 434 | |
435 | - if ( $this->id != 0 ) { |
|
435 | + if ($this->id != 0) { |
|
436 | 436 | return false; |
437 | 437 | } |
438 | 438 | |
439 | 439 | $defaults = array( |
440 | 440 | 'post_type' => 'give_forms', |
441 | 441 | 'post_status' => 'draft', |
442 | - 'post_title' => __( 'New Donation Form', 'give' ), |
|
442 | + 'post_title' => __('New Donation Form', 'give'), |
|
443 | 443 | ); |
444 | 444 | |
445 | - $args = wp_parse_args( $data, $defaults ); |
|
445 | + $args = wp_parse_args($data, $defaults); |
|
446 | 446 | |
447 | 447 | /** |
448 | 448 | * Fired before a donation form is created |
449 | 449 | * |
450 | 450 | * @param array $args The post object arguments used for creation. |
451 | 451 | */ |
452 | - do_action( 'give_form_pre_create', $args ); |
|
452 | + do_action('give_form_pre_create', $args); |
|
453 | 453 | |
454 | - $id = wp_insert_post( $args, true ); |
|
454 | + $id = wp_insert_post($args, true); |
|
455 | 455 | |
456 | - $donation_form = WP_Post::get_instance( $id ); |
|
456 | + $donation_form = WP_Post::get_instance($id); |
|
457 | 457 | |
458 | 458 | /** |
459 | 459 | * Fired after a donation form is created |
@@ -461,9 +461,9 @@ discard block |
||
461 | 461 | * @param int $id The post ID of the created item. |
462 | 462 | * @param array $args The post object arguments used for creation. |
463 | 463 | */ |
464 | - do_action( 'give_form_post_create', $id, $args ); |
|
464 | + do_action('give_form_post_create', $id, $args); |
|
465 | 465 | |
466 | - return $this->setup_donation_form( $donation_form ); |
|
466 | + return $this->setup_donation_form($donation_form); |
|
467 | 467 | |
468 | 468 | } |
469 | 469 | |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | * @return string Donation form name. |
489 | 489 | */ |
490 | 490 | public function get_name() { |
491 | - return get_the_title( $this->ID ); |
|
491 | + return get_the_title($this->ID); |
|
492 | 492 | } |
493 | 493 | |
494 | 494 | /** |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | */ |
502 | 502 | public function get_price() { |
503 | 503 | |
504 | - if ( ! isset( $this->price ) ) { |
|
504 | + if ( ! isset($this->price)) { |
|
505 | 505 | |
506 | 506 | $this->price = give_maybe_sanitize_amount( |
507 | 507 | give_get_meta( |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | ) |
512 | 512 | ); |
513 | 513 | |
514 | - if ( ! $this->price ) { |
|
514 | + if ( ! $this->price) { |
|
515 | 515 | $this->price = 0; |
516 | 516 | } |
517 | 517 | |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | * @param string $price The donation form price. |
526 | 526 | * @param string|int $id The form ID. |
527 | 527 | */ |
528 | - return apply_filters( 'give_get_set_price', $this->price, $this->ID ); |
|
528 | + return apply_filters('give_get_set_price', $this->price, $this->ID); |
|
529 | 529 | } |
530 | 530 | |
531 | 531 | /** |
@@ -538,22 +538,22 @@ discard block |
||
538 | 538 | */ |
539 | 539 | public function get_minimum_price() { |
540 | 540 | |
541 | - if ( ! isset( $this->minimum_price ) ) { |
|
541 | + if ( ! isset($this->minimum_price)) { |
|
542 | 542 | |
543 | - $this->minimum_price = give_get_meta( $this->ID, '_give_custom_amount_range_minimum', true ); |
|
543 | + $this->minimum_price = give_get_meta($this->ID, '_give_custom_amount_range_minimum', true); |
|
544 | 544 | |
545 | 545 | // Give backward < 2.1 |
546 | - if ( empty( $this->minimum_price ) ) { |
|
547 | - $this->minimum_price = give_get_meta( $this->ID, '_give_custom_amount_minimum', true ); |
|
546 | + if (empty($this->minimum_price)) { |
|
547 | + $this->minimum_price = give_get_meta($this->ID, '_give_custom_amount_minimum', true); |
|
548 | 548 | } |
549 | 549 | |
550 | - if ( ! $this->is_custom_price_mode() ) { |
|
551 | - $this->minimum_price = give_get_lowest_price_option( $this->ID ); |
|
550 | + if ( ! $this->is_custom_price_mode()) { |
|
551 | + $this->minimum_price = give_get_lowest_price_option($this->ID); |
|
552 | 552 | } |
553 | 553 | |
554 | 554 | } |
555 | 555 | |
556 | - return apply_filters( 'give_get_set_minimum_price', $this->minimum_price, $this->ID ); |
|
556 | + return apply_filters('give_get_set_minimum_price', $this->minimum_price, $this->ID); |
|
557 | 557 | } |
558 | 558 | |
559 | 559 | /** |
@@ -566,15 +566,15 @@ discard block |
||
566 | 566 | */ |
567 | 567 | public function get_maximum_price() { |
568 | 568 | |
569 | - if ( ! isset( $this->maximum_price ) ) { |
|
570 | - $this->maximum_price = give_get_meta( $this->ID, '_give_custom_amount_range_maximum', true ); |
|
569 | + if ( ! isset($this->maximum_price)) { |
|
570 | + $this->maximum_price = give_get_meta($this->ID, '_give_custom_amount_range_maximum', true); |
|
571 | 571 | |
572 | - if ( ! $this->is_custom_price_mode() ) { |
|
572 | + if ( ! $this->is_custom_price_mode()) { |
|
573 | 573 | $this->maximum_price = 999999.99; |
574 | 574 | } |
575 | 575 | } |
576 | 576 | |
577 | - return apply_filters( 'give_get_set_maximum_price', $this->maximum_price, $this->ID ); |
|
577 | + return apply_filters('give_get_set_maximum_price', $this->maximum_price, $this->ID); |
|
578 | 578 | } |
579 | 579 | |
580 | 580 | /** |
@@ -587,9 +587,9 @@ discard block |
||
587 | 587 | */ |
588 | 588 | public function get_prices() { |
589 | 589 | |
590 | - if ( ! isset( $this->prices ) ) { |
|
590 | + if ( ! isset($this->prices)) { |
|
591 | 591 | |
592 | - $this->prices = give_get_meta( $this->ID, '_give_donation_levels', true ); |
|
592 | + $this->prices = give_get_meta($this->ID, '_give_donation_levels', true); |
|
593 | 593 | |
594 | 594 | } |
595 | 595 | |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | * @param array $prices The array of mulit-level prices. |
602 | 602 | * @param int|string $ID The ID of the form. |
603 | 603 | */ |
604 | - return apply_filters( 'give_get_donation_levels', $this->prices, $this->ID ); |
|
604 | + return apply_filters('give_get_donation_levels', $this->prices, $this->ID); |
|
605 | 605 | |
606 | 606 | } |
607 | 607 | |
@@ -615,18 +615,18 @@ discard block |
||
615 | 615 | * |
616 | 616 | * @return array|null |
617 | 617 | */ |
618 | - public function get_level_info( $price_id ) { |
|
618 | + public function get_level_info($price_id) { |
|
619 | 619 | $level_info = array(); |
620 | 620 | |
621 | 621 | // Bailout. |
622 | - if ( 'multi' !== $this->get_type() ) { |
|
622 | + if ('multi' !== $this->get_type()) { |
|
623 | 623 | return null; |
624 | - } elseif ( ! ( $levels = $this->get_prices() ) ) { |
|
624 | + } elseif ( ! ($levels = $this->get_prices())) { |
|
625 | 625 | return $level_info; |
626 | 626 | } |
627 | 627 | |
628 | - foreach ( $levels as $level ) { |
|
629 | - if ( $price_id === $level['_give_id']['level_id'] ) { |
|
628 | + foreach ($levels as $level) { |
|
629 | + if ($price_id === $level['_give_id']['level_id']) { |
|
630 | 630 | $level_info = $level; |
631 | 631 | break; |
632 | 632 | } |
@@ -646,25 +646,25 @@ discard block |
||
646 | 646 | */ |
647 | 647 | public function get_goal() { |
648 | 648 | |
649 | - if ( ! isset( $this->goal ) ) { |
|
649 | + if ( ! isset($this->goal)) { |
|
650 | 650 | |
651 | - $goal_format = give_get_form_goal_format( $this->ID ); |
|
651 | + $goal_format = give_get_form_goal_format($this->ID); |
|
652 | 652 | |
653 | - if ( 'donation' === $goal_format ) { |
|
654 | - $this->goal = give_get_meta( $this->ID, '_give_number_of_donation_goal', true ); |
|
655 | - } elseif ( 'donors' === $goal_format ) { |
|
656 | - $this->goal = give_get_meta( $this->ID, '_give_number_of_donor_goal', true ); |
|
653 | + if ('donation' === $goal_format) { |
|
654 | + $this->goal = give_get_meta($this->ID, '_give_number_of_donation_goal', true); |
|
655 | + } elseif ('donors' === $goal_format) { |
|
656 | + $this->goal = give_get_meta($this->ID, '_give_number_of_donor_goal', true); |
|
657 | 657 | } else { |
658 | - $this->goal = give_get_meta( $this->ID, '_give_set_goal', true ); |
|
658 | + $this->goal = give_get_meta($this->ID, '_give_set_goal', true); |
|
659 | 659 | } |
660 | 660 | |
661 | - if ( ! $this->goal ) { |
|
661 | + if ( ! $this->goal) { |
|
662 | 662 | $this->goal = 0; |
663 | 663 | } |
664 | 664 | |
665 | 665 | } |
666 | 666 | |
667 | - return apply_filters( 'give_get_set_goal', $this->goal, $this->ID ); |
|
667 | + return apply_filters('give_get_set_goal', $this->goal, $this->ID); |
|
668 | 668 | |
669 | 669 | } |
670 | 670 | |
@@ -678,10 +678,10 @@ discard block |
||
678 | 678 | */ |
679 | 679 | public function is_single_price_mode() { |
680 | 680 | |
681 | - $option = give_get_meta( $this->ID, '_give_price_option', true ); |
|
681 | + $option = give_get_meta($this->ID, '_give_price_option', true); |
|
682 | 682 | $ret = 0; |
683 | 683 | |
684 | - if ( empty( $option ) || $option === 'set' ) { |
|
684 | + if (empty($option) || $option === 'set') { |
|
685 | 685 | $ret = 1; |
686 | 686 | } |
687 | 687 | |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | * @param bool $ret Is donation form in single price mode? |
694 | 694 | * @param int|string $ID The ID of the donation form. |
695 | 695 | */ |
696 | - return (bool) apply_filters( 'give_single_price_option_mode', $ret, $this->ID ); |
|
696 | + return (bool) apply_filters('give_single_price_option_mode', $ret, $this->ID); |
|
697 | 697 | |
698 | 698 | } |
699 | 699 | |
@@ -707,10 +707,10 @@ discard block |
||
707 | 707 | */ |
708 | 708 | public function is_custom_price_mode() { |
709 | 709 | |
710 | - $option = give_get_meta( $this->ID, '_give_custom_amount', true ); |
|
710 | + $option = give_get_meta($this->ID, '_give_custom_amount', true); |
|
711 | 711 | $ret = 0; |
712 | 712 | |
713 | - if ( give_is_setting_enabled( $option ) ) { |
|
713 | + if (give_is_setting_enabled($option)) { |
|
714 | 714 | $ret = 1; |
715 | 715 | } |
716 | 716 | |
@@ -722,7 +722,7 @@ discard block |
||
722 | 722 | * @param bool $ret Is donation form in custom price mode? |
723 | 723 | * @param int|string $ID The ID of the donation form. |
724 | 724 | */ |
725 | - return (bool) apply_filters( 'give_custom_price_option_mode', $ret, $this->ID ); |
|
725 | + return (bool) apply_filters('give_custom_price_option_mode', $ret, $this->ID); |
|
726 | 726 | |
727 | 727 | } |
728 | 728 | |
@@ -736,20 +736,20 @@ discard block |
||
736 | 736 | * |
737 | 737 | * @return bool |
738 | 738 | */ |
739 | - public function is_custom_price( $amount ) { |
|
739 | + public function is_custom_price($amount) { |
|
740 | 740 | $result = false; |
741 | - $amount = give_maybe_sanitize_amount( $amount ); |
|
741 | + $amount = give_maybe_sanitize_amount($amount); |
|
742 | 742 | |
743 | - if ( $this->is_custom_price_mode() ) { |
|
743 | + if ($this->is_custom_price_mode()) { |
|
744 | 744 | |
745 | - if ( 'set' === $this->get_type() ) { |
|
746 | - if ( $amount !== $this->get_price() ) { |
|
745 | + if ('set' === $this->get_type()) { |
|
746 | + if ($amount !== $this->get_price()) { |
|
747 | 747 | $result = true; |
748 | 748 | } |
749 | 749 | |
750 | - } elseif ( 'multi' === $this->get_type() ) { |
|
751 | - $level_amounts = array_map( 'give_maybe_sanitize_amount', wp_list_pluck( $this->get_prices(), '_give_amount' ) ); |
|
752 | - $result = ! in_array( $amount, $level_amounts ); |
|
750 | + } elseif ('multi' === $this->get_type()) { |
|
751 | + $level_amounts = array_map('give_maybe_sanitize_amount', wp_list_pluck($this->get_prices(), '_give_amount')); |
|
752 | + $result = ! in_array($amount, $level_amounts); |
|
753 | 753 | } |
754 | 754 | } |
755 | 755 | |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | * |
763 | 763 | * @since 1.8.18 |
764 | 764 | */ |
765 | - return (bool) apply_filters( 'give_is_custom_price', $result, $amount, $this->ID ); |
|
765 | + return (bool) apply_filters('give_is_custom_price', $result, $amount, $this->ID); |
|
766 | 766 | } |
767 | 767 | |
768 | 768 | /** |
@@ -777,10 +777,10 @@ discard block |
||
777 | 777 | */ |
778 | 778 | public function has_variable_prices() { |
779 | 779 | |
780 | - $option = give_get_meta( $this->ID, '_give_price_option', true ); |
|
780 | + $option = give_get_meta($this->ID, '_give_price_option', true); |
|
781 | 781 | $ret = 0; |
782 | 782 | |
783 | - if ( $option === 'multi' ) { |
|
783 | + if ($option === 'multi') { |
|
784 | 784 | $ret = 1; |
785 | 785 | } |
786 | 786 | |
@@ -790,7 +790,7 @@ discard block |
||
790 | 790 | * @param bool $ret Does donation form have variable prices? |
791 | 791 | * @param int|string $ID The ID of the donation form. |
792 | 792 | */ |
793 | - return (bool) apply_filters( 'give_has_variable_prices', $ret, $this->ID ); |
|
793 | + return (bool) apply_filters('give_has_variable_prices', $ret, $this->ID); |
|
794 | 794 | |
795 | 795 | } |
796 | 796 | |
@@ -804,17 +804,17 @@ discard block |
||
804 | 804 | */ |
805 | 805 | public function get_type() { |
806 | 806 | |
807 | - if ( ! isset( $this->type ) ) { |
|
807 | + if ( ! isset($this->type)) { |
|
808 | 808 | |
809 | - $this->type = give_get_meta( $this->ID, '_give_price_option', true ); |
|
809 | + $this->type = give_get_meta($this->ID, '_give_price_option', true); |
|
810 | 810 | |
811 | - if ( empty( $this->type ) ) { |
|
811 | + if (empty($this->type)) { |
|
812 | 812 | $this->type = 'set'; |
813 | 813 | } |
814 | 814 | |
815 | 815 | } |
816 | 816 | |
817 | - return apply_filters( 'give_get_form_type', $this->type, $this->ID ); |
|
817 | + return apply_filters('give_get_form_type', $this->type, $this->ID); |
|
818 | 818 | |
819 | 819 | } |
820 | 820 | |
@@ -830,23 +830,23 @@ discard block |
||
830 | 830 | * |
831 | 831 | * @return string |
832 | 832 | */ |
833 | - public function get_form_classes( $args ) { |
|
833 | + public function get_form_classes($args) { |
|
834 | 834 | |
835 | - $float_labels_option = give_is_float_labels_enabled( $args ) |
|
835 | + $float_labels_option = give_is_float_labels_enabled($args) |
|
836 | 836 | ? 'float-labels-enabled' |
837 | 837 | : ''; |
838 | 838 | |
839 | - $form_classes_array = apply_filters( 'give_form_classes', array( |
|
839 | + $form_classes_array = apply_filters('give_form_classes', array( |
|
840 | 840 | 'give-form', |
841 | - 'give-form-' . $this->ID, |
|
842 | - 'give-form-type-' . $this->get_type(), |
|
841 | + 'give-form-'.$this->ID, |
|
842 | + 'give-form-type-'.$this->get_type(), |
|
843 | 843 | $float_labels_option, |
844 | - ), $this->ID, $args ); |
|
844 | + ), $this->ID, $args); |
|
845 | 845 | |
846 | 846 | // Remove empty class names. |
847 | - $form_classes_array = array_filter( $form_classes_array ); |
|
847 | + $form_classes_array = array_filter($form_classes_array); |
|
848 | 848 | |
849 | - return implode( ' ', $form_classes_array ); |
|
849 | + return implode(' ', $form_classes_array); |
|
850 | 850 | |
851 | 851 | } |
852 | 852 | |
@@ -861,22 +861,22 @@ discard block |
||
861 | 861 | * |
862 | 862 | * @return string |
863 | 863 | */ |
864 | - public function get_form_wrap_classes( $args ) { |
|
864 | + public function get_form_wrap_classes($args) { |
|
865 | 865 | $custom_class = array( |
866 | 866 | 'give-form-wrap', |
867 | 867 | ); |
868 | 868 | |
869 | - if ( $this->is_close_donation_form() ) { |
|
869 | + if ($this->is_close_donation_form()) { |
|
870 | 870 | $custom_class[] = 'give-form-closed'; |
871 | 871 | } else { |
872 | - $display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) ) |
|
872 | + $display_option = (isset($args['display_style']) && ! empty($args['display_style'])) |
|
873 | 873 | ? $args['display_style'] |
874 | - : give_get_meta( $this->ID, '_give_payment_display', true ); |
|
874 | + : give_get_meta($this->ID, '_give_payment_display', true); |
|
875 | 875 | |
876 | 876 | $custom_class[] = "give-display-{$display_option}"; |
877 | 877 | |
878 | 878 | // If admin want to show only button for form then user inbuilt modal functionality. |
879 | - if ( 'button' === $display_option ) { |
|
879 | + if ('button' === $display_option) { |
|
880 | 880 | $custom_class[] = 'give-display-button-only'; |
881 | 881 | } |
882 | 882 | } |
@@ -887,10 +887,10 @@ discard block |
||
887 | 887 | * |
888 | 888 | * @since 1.0 |
889 | 889 | */ |
890 | - $form_wrap_classes_array = (array) apply_filters( 'give_form_wrap_classes', $custom_class, $this->ID, $args ); |
|
890 | + $form_wrap_classes_array = (array) apply_filters('give_form_wrap_classes', $custom_class, $this->ID, $args); |
|
891 | 891 | |
892 | 892 | |
893 | - return implode( ' ', $form_wrap_classes_array ); |
|
893 | + return implode(' ', $form_wrap_classes_array); |
|
894 | 894 | |
895 | 895 | } |
896 | 896 | |
@@ -905,7 +905,7 @@ discard block |
||
905 | 905 | public function is_set_type_donation_form() { |
906 | 906 | $form_type = $this->get_type(); |
907 | 907 | |
908 | - return ( 'set' === $form_type ? true : false ); |
|
908 | + return ('set' === $form_type ? true : false); |
|
909 | 909 | } |
910 | 910 | |
911 | 911 | /** |
@@ -919,7 +919,7 @@ discard block |
||
919 | 919 | public function is_multi_type_donation_form() { |
920 | 920 | $form_type = $this->get_type(); |
921 | 921 | |
922 | - return ( 'multi' === $form_type ? true : false ); |
|
922 | + return ('multi' === $form_type ? true : false); |
|
923 | 923 | |
924 | 924 | } |
925 | 925 | |
@@ -933,15 +933,15 @@ discard block |
||
933 | 933 | */ |
934 | 934 | public function get_sales() { |
935 | 935 | |
936 | - if ( ! isset( $this->sales ) ) { |
|
936 | + if ( ! isset($this->sales)) { |
|
937 | 937 | |
938 | - if ( '' == give_get_meta( $this->ID, '_give_form_sales', true ) ) { |
|
939 | - add_post_meta( $this->ID, '_give_form_sales', 0 ); |
|
938 | + if ('' == give_get_meta($this->ID, '_give_form_sales', true)) { |
|
939 | + add_post_meta($this->ID, '_give_form_sales', 0); |
|
940 | 940 | } // End if |
941 | 941 | |
942 | - $this->sales = give_get_meta( $this->ID, '_give_form_sales', true ); |
|
942 | + $this->sales = give_get_meta($this->ID, '_give_form_sales', true); |
|
943 | 943 | |
944 | - if ( $this->sales < 0 ) { |
|
944 | + if ($this->sales < 0) { |
|
945 | 945 | // Never let sales be less than zero. |
946 | 946 | $this->sales = 0; |
947 | 947 | } |
@@ -962,13 +962,13 @@ discard block |
||
962 | 962 | * |
963 | 963 | * @return int|false New number of total sales. |
964 | 964 | */ |
965 | - public function increase_sales( $quantity = 1 ) { |
|
965 | + public function increase_sales($quantity = 1) { |
|
966 | 966 | |
967 | - $sales = give_get_form_sales_stats( $this->ID ); |
|
968 | - $quantity = absint( $quantity ); |
|
967 | + $sales = give_get_form_sales_stats($this->ID); |
|
968 | + $quantity = absint($quantity); |
|
969 | 969 | $total_sales = $sales + $quantity; |
970 | 970 | |
971 | - if ( $this->update_meta( '_give_form_sales', $total_sales ) ) { |
|
971 | + if ($this->update_meta('_give_form_sales', $total_sales)) { |
|
972 | 972 | |
973 | 973 | $this->sales = $total_sales; |
974 | 974 | |
@@ -989,17 +989,17 @@ discard block |
||
989 | 989 | * |
990 | 990 | * @return int|false New number of total sales. |
991 | 991 | */ |
992 | - public function decrease_sales( $quantity = 1 ) { |
|
992 | + public function decrease_sales($quantity = 1) { |
|
993 | 993 | |
994 | - $sales = give_get_form_sales_stats( $this->ID ); |
|
994 | + $sales = give_get_form_sales_stats($this->ID); |
|
995 | 995 | |
996 | 996 | // Only decrease if not already zero |
997 | - if ( $sales > 0 ) { |
|
997 | + if ($sales > 0) { |
|
998 | 998 | |
999 | - $quantity = absint( $quantity ); |
|
999 | + $quantity = absint($quantity); |
|
1000 | 1000 | $total_sales = $sales - $quantity; |
1001 | 1001 | |
1002 | - if ( $this->update_meta( '_give_form_sales', $total_sales ) ) { |
|
1002 | + if ($this->update_meta('_give_form_sales', $total_sales)) { |
|
1003 | 1003 | |
1004 | 1004 | $this->sales = $sales; |
1005 | 1005 | |
@@ -1023,15 +1023,15 @@ discard block |
||
1023 | 1023 | */ |
1024 | 1024 | public function get_earnings() { |
1025 | 1025 | |
1026 | - if ( ! isset( $this->earnings ) ) { |
|
1026 | + if ( ! isset($this->earnings)) { |
|
1027 | 1027 | |
1028 | - if ( '' == give_get_meta( $this->ID, '_give_form_earnings', true ) ) { |
|
1029 | - add_post_meta( $this->ID, '_give_form_earnings', 0 ); |
|
1028 | + if ('' == give_get_meta($this->ID, '_give_form_earnings', true)) { |
|
1029 | + add_post_meta($this->ID, '_give_form_earnings', 0); |
|
1030 | 1030 | } |
1031 | 1031 | |
1032 | - $this->earnings = give_get_meta( $this->ID, '_give_form_earnings', true ); |
|
1032 | + $this->earnings = give_get_meta($this->ID, '_give_form_earnings', true); |
|
1033 | 1033 | |
1034 | - if ( $this->earnings < 0 ) { |
|
1034 | + if ($this->earnings < 0) { |
|
1035 | 1035 | // Never let earnings be less than zero |
1036 | 1036 | $this->earnings = 0; |
1037 | 1037 | } |
@@ -1055,9 +1055,9 @@ discard block |
||
1055 | 1055 | * |
1056 | 1056 | * @return float|false |
1057 | 1057 | */ |
1058 | - public function increase_earnings( $amount = 0, $payment_id = 0 ) { |
|
1058 | + public function increase_earnings($amount = 0, $payment_id = 0) { |
|
1059 | 1059 | |
1060 | - $earnings = give_get_form_earnings_stats( $this->ID ); |
|
1060 | + $earnings = give_get_form_earnings_stats($this->ID); |
|
1061 | 1061 | |
1062 | 1062 | /** |
1063 | 1063 | * Modify the earning amount when increasing. |
@@ -1068,11 +1068,11 @@ discard block |
||
1068 | 1068 | * @param int $form_id Donation form ID. |
1069 | 1069 | * @param int $payment_id Donation ID. |
1070 | 1070 | */ |
1071 | - $amount = apply_filters( 'give_increase_form_earnings_amount', $amount, $this->ID, $payment_id ); |
|
1071 | + $amount = apply_filters('give_increase_form_earnings_amount', $amount, $this->ID, $payment_id); |
|
1072 | 1072 | |
1073 | 1073 | $new_amount = $earnings + (float) $amount; |
1074 | 1074 | |
1075 | - if ( $this->update_meta( '_give_form_earnings', $new_amount ) ) { |
|
1075 | + if ($this->update_meta('_give_form_earnings', $new_amount)) { |
|
1076 | 1076 | |
1077 | 1077 | $this->earnings = $new_amount; |
1078 | 1078 | |
@@ -1095,11 +1095,11 @@ discard block |
||
1095 | 1095 | * |
1096 | 1096 | * @return float|false |
1097 | 1097 | */ |
1098 | - public function decrease_earnings( $amount, $payment_id = 0 ) { |
|
1098 | + public function decrease_earnings($amount, $payment_id = 0) { |
|
1099 | 1099 | |
1100 | - $earnings = give_get_form_earnings_stats( $this->ID ); |
|
1100 | + $earnings = give_get_form_earnings_stats($this->ID); |
|
1101 | 1101 | |
1102 | - if ( $earnings > 0 ) { |
|
1102 | + if ($earnings > 0) { |
|
1103 | 1103 | |
1104 | 1104 | /** |
1105 | 1105 | * Modify the earning value when decreasing it. |
@@ -1110,12 +1110,12 @@ discard block |
||
1110 | 1110 | * @param int $form_id Donation Form ID. |
1111 | 1111 | * @param int $payment_id Donation ID. |
1112 | 1112 | */ |
1113 | - $amount = apply_filters( 'give_decrease_form_earnings_amount', $amount, $this->ID, $payment_id ); |
|
1113 | + $amount = apply_filters('give_decrease_form_earnings_amount', $amount, $this->ID, $payment_id); |
|
1114 | 1114 | |
1115 | 1115 | // Only decrease if greater than zero |
1116 | 1116 | $new_amount = $earnings - (float) $amount; |
1117 | 1117 | |
1118 | - if ( $this->update_meta( '_give_form_earnings', $new_amount ) ) { |
|
1118 | + if ($this->update_meta('_give_form_earnings', $new_amount)) { |
|
1119 | 1119 | $this->earnings = $new_amount; |
1120 | 1120 | |
1121 | 1121 | return $this->earnings; |
@@ -1141,10 +1141,10 @@ discard block |
||
1141 | 1141 | * @return bool |
1142 | 1142 | */ |
1143 | 1143 | public function is_close_donation_form() { |
1144 | - $is_closed = ( 'closed' === give_get_meta( $this->ID, '_give_form_status', true, 'open' ) ); |
|
1144 | + $is_closed = ('closed' === give_get_meta($this->ID, '_give_form_status', true, 'open')); |
|
1145 | 1145 | |
1146 | 1146 | // If manual upgrade not completed, proceed with backward compatible code. |
1147 | - if ( ! give_has_upgrade_completed( 'v210_verify_form_status_upgrades' ) ) { |
|
1147 | + if ( ! give_has_upgrade_completed('v210_verify_form_status_upgrades')) { |
|
1148 | 1148 | |
1149 | 1149 | // Check for backward compatibility. |
1150 | 1150 | $is_closed = $this->bc_210_is_close_donation_form(); |
@@ -1174,17 +1174,17 @@ discard block |
||
1174 | 1174 | * |
1175 | 1175 | * @return bool The result of the update query. |
1176 | 1176 | */ |
1177 | - private function update_meta( $meta_key = '', $meta_value = '' ) { |
|
1177 | + private function update_meta($meta_key = '', $meta_value = '') { |
|
1178 | 1178 | |
1179 | 1179 | /* @var WPDB $wpdb */ |
1180 | 1180 | global $wpdb; |
1181 | 1181 | |
1182 | 1182 | // Bailout. |
1183 | - if ( empty( $meta_key ) ) { |
|
1183 | + if (empty($meta_key)) { |
|
1184 | 1184 | return false; |
1185 | 1185 | } |
1186 | 1186 | |
1187 | - if ( give_update_meta( $this->ID, $meta_key, $meta_value ) ) { |
|
1187 | + if (give_update_meta($this->ID, $meta_key, $meta_value)) { |
|
1188 | 1188 | return true; |
1189 | 1189 | } |
1190 | 1190 | |
@@ -1201,33 +1201,33 @@ discard block |
||
1201 | 1201 | private function bc_210_is_close_donation_form() { |
1202 | 1202 | |
1203 | 1203 | $close_form = false; |
1204 | - $is_goal_enabled = give_is_setting_enabled( give_get_meta( $this->ID, '_give_goal_option', true, 'disabled' ) ); |
|
1204 | + $is_goal_enabled = give_is_setting_enabled(give_get_meta($this->ID, '_give_goal_option', true, 'disabled')); |
|
1205 | 1205 | |
1206 | 1206 | // Proceed, if the form goal is enabled. |
1207 | - if ( $is_goal_enabled ) { |
|
1207 | + if ($is_goal_enabled) { |
|
1208 | 1208 | |
1209 | - $close_form_when_goal_achieved = give_is_setting_enabled( give_get_meta( $this->ID, '_give_close_form_when_goal_achieved', true, 'disabled' ) ); |
|
1209 | + $close_form_when_goal_achieved = give_is_setting_enabled(give_get_meta($this->ID, '_give_close_form_when_goal_achieved', true, 'disabled')); |
|
1210 | 1210 | |
1211 | 1211 | // Proceed, if close form when goal achieved option is enabled. |
1212 | - if ( $close_form_when_goal_achieved ) { |
|
1212 | + if ($close_form_when_goal_achieved) { |
|
1213 | 1213 | |
1214 | - $form = new Give_Donate_Form( $this->ID ); |
|
1215 | - $goal_format = give_get_form_goal_format( $this->ID ); |
|
1214 | + $form = new Give_Donate_Form($this->ID); |
|
1215 | + $goal_format = give_get_form_goal_format($this->ID); |
|
1216 | 1216 | |
1217 | 1217 | // Verify whether the form is closed or not after processing data based on goal format. |
1218 | - switch ( $goal_format ) { |
|
1218 | + switch ($goal_format) { |
|
1219 | 1219 | case 'donation': |
1220 | 1220 | $closed = $form->get_goal() <= $form->get_sales(); |
1221 | 1221 | break; |
1222 | 1222 | case 'donors': |
1223 | - $closed = $form->get_goal() <= give_get_form_donor_count( $this->ID ); |
|
1223 | + $closed = $form->get_goal() <= give_get_form_donor_count($this->ID); |
|
1224 | 1224 | break; |
1225 | 1225 | default : |
1226 | 1226 | $closed = $form->get_goal() <= $form->get_earnings(); |
1227 | 1227 | break; |
1228 | 1228 | } |
1229 | 1229 | |
1230 | - if ( $closed ) { |
|
1230 | + if ($closed) { |
|
1231 | 1231 | $close_form = true; |
1232 | 1232 | } |
1233 | 1233 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | |
25 | 25 | // Exit if accessed directly. |
26 | -if ( ! defined( 'ABSPATH' ) ) { |
|
26 | +if ( ! defined('ABSPATH')) { |
|
27 | 27 | exit; |
28 | 28 | } |
29 | 29 | |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | * @param callable $func Hook to run when email tag is found |
57 | 57 | * @param string $context Email tag category |
58 | 58 | */ |
59 | - public function add( $tag, $description, $func, $context = '' ) { |
|
60 | - if ( is_callable( $func ) ) { |
|
61 | - $this->tags[ $tag ] = array( |
|
59 | + public function add($tag, $description, $func, $context = '') { |
|
60 | + if (is_callable($func)) { |
|
61 | + $this->tags[$tag] = array( |
|
62 | 62 | 'tag' => $tag, |
63 | 63 | 'description' => $description, |
64 | 64 | 'func' => $func, |
65 | - 'context' => give_check_variable( $context, 'empty', 'general' ), |
|
65 | + 'context' => give_check_variable($context, 'empty', 'general'), |
|
66 | 66 | ); |
67 | 67 | } |
68 | 68 | } |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | * |
75 | 75 | * @param string $tag Email tag to remove hook from |
76 | 76 | */ |
77 | - public function remove( $tag ) { |
|
78 | - unset( $this->tags[ $tag ] ); |
|
77 | + public function remove($tag) { |
|
78 | + unset($this->tags[$tag]); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | * |
88 | 88 | * @return bool |
89 | 89 | */ |
90 | - public function email_tag_exists( $tag ) { |
|
91 | - return array_key_exists( $tag, $this->tags ); |
|
90 | + public function email_tag_exists($tag) { |
|
91 | + return array_key_exists($tag, $this->tags); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -102,23 +102,23 @@ discard block |
||
102 | 102 | * |
103 | 103 | * @return array |
104 | 104 | */ |
105 | - public function get_tags( $context_type = 'all', $field = '' ) { |
|
105 | + public function get_tags($context_type = 'all', $field = '') { |
|
106 | 106 | $tags = $this->tags; |
107 | 107 | |
108 | - if ( 'all' !== $context_type ) { |
|
108 | + if ('all' !== $context_type) { |
|
109 | 109 | $tags = array(); |
110 | 110 | |
111 | - foreach ( $this->tags as $tag ) { |
|
112 | - if ( empty( $tag['context'] ) || $context_type !== $tag['context'] ) { |
|
111 | + foreach ($this->tags as $tag) { |
|
112 | + if (empty($tag['context']) || $context_type !== $tag['context']) { |
|
113 | 113 | continue; |
114 | 114 | } |
115 | 115 | |
116 | - $tags[ $tag['tag'] ] = $tag; |
|
116 | + $tags[$tag['tag']] = $tag; |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
120 | - if ( ! empty( $tags ) && ! empty( $field ) ) { |
|
121 | - $tags = wp_list_pluck( $tags, $field ); |
|
120 | + if ( ! empty($tags) && ! empty($field)) { |
|
121 | + $tags = wp_list_pluck($tags, $field); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | return $tags; |
@@ -136,16 +136,16 @@ discard block |
||
136 | 136 | * |
137 | 137 | * @return string Content with email tags filtered out. |
138 | 138 | */ |
139 | - public function do_tags( $content, $tag_args ) { |
|
139 | + public function do_tags($content, $tag_args) { |
|
140 | 140 | |
141 | 141 | // Check if there is at least one tag added. |
142 | - if ( empty( $this->tags ) || ! is_array( $this->tags ) ) { |
|
142 | + if (empty($this->tags) || ! is_array($this->tags)) { |
|
143 | 143 | return $content; |
144 | 144 | } |
145 | 145 | |
146 | 146 | $this->tag_args = $tag_args; |
147 | 147 | |
148 | - $new_content = preg_replace_callback( "/{([A-z0-9\-\_]+)}/s", array( $this, 'do_tag' ), $content ); |
|
148 | + $new_content = preg_replace_callback("/{([A-z0-9\-\_]+)}/s", array($this, 'do_tag'), $content); |
|
149 | 149 | |
150 | 150 | $this->tag_args = null; |
151 | 151 | |
@@ -161,17 +161,17 @@ discard block |
||
161 | 161 | * |
162 | 162 | * @return mixed |
163 | 163 | */ |
164 | - public function do_tag( $m ) { |
|
164 | + public function do_tag($m) { |
|
165 | 165 | |
166 | 166 | // Get tag |
167 | 167 | $tag = $m[1]; |
168 | 168 | |
169 | 169 | // Return tag if tag not set |
170 | - if ( ! $this->email_tag_exists( $tag ) ) { |
|
170 | + if ( ! $this->email_tag_exists($tag)) { |
|
171 | 171 | return $m[0]; |
172 | 172 | } |
173 | 173 | |
174 | - return call_user_func( $this->tags[ $tag ]['func'], $this->tag_args, $tag ); |
|
174 | + return call_user_func($this->tags[$tag]['func'], $this->tag_args, $tag); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | } |
@@ -186,8 +186,8 @@ discard block |
||
186 | 186 | * @param callable $func Hook to run when email tag is found |
187 | 187 | * @param string $context Email tag category |
188 | 188 | */ |
189 | -function give_add_email_tag( $tag, $description, $func, $context = '' ) { |
|
190 | - Give()->email_tags->add( $tag, $description, $func, $context ); |
|
189 | +function give_add_email_tag($tag, $description, $func, $context = '') { |
|
190 | + Give()->email_tags->add($tag, $description, $func, $context); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | * |
198 | 198 | * @param string $tag Email tag to remove hook from |
199 | 199 | */ |
200 | -function give_remove_email_tag( $tag ) { |
|
201 | - Give()->email_tags->remove( $tag ); |
|
200 | +function give_remove_email_tag($tag) { |
|
201 | + Give()->email_tags->remove($tag); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
@@ -210,8 +210,8 @@ discard block |
||
210 | 210 | * |
211 | 211 | * @return bool |
212 | 212 | */ |
213 | -function give_email_tag_exists( $tag ) { |
|
214 | - return Give()->email_tags->email_tag_exists( $tag ); |
|
213 | +function give_email_tag_exists($tag) { |
|
214 | + return Give()->email_tags->email_tag_exists($tag); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
@@ -238,9 +238,9 @@ discard block |
||
238 | 238 | $email_tags = give_get_email_tags(); |
239 | 239 | |
240 | 240 | ob_start(); |
241 | - if ( count( $email_tags ) > 0 ) : ?> |
|
241 | + if (count($email_tags) > 0) : ?> |
|
242 | 242 | <div class="give-email-tags-wrap"> |
243 | - <?php foreach ( $email_tags as $email_tag ) : ?> |
|
243 | + <?php foreach ($email_tags as $email_tag) : ?> |
|
244 | 244 | <span class="give_<?php echo $email_tag['tag']; ?>_tag"> |
245 | 245 | <code>{<?php echo $email_tag['tag']; ?>}</code> - <?php echo $email_tag['description']; ?> |
246 | 246 | </span> |
@@ -264,14 +264,14 @@ discard block |
||
264 | 264 | * |
265 | 265 | * @return string Content with email tags filtered out. |
266 | 266 | */ |
267 | -function give_do_email_tags( $content, $tag_args ) { |
|
267 | +function give_do_email_tags($content, $tag_args) { |
|
268 | 268 | // Backward compatibility < 2.0 |
269 | - if ( ! is_array( $tag_args ) ) { |
|
270 | - $tag_args = array( 'payment_id' => $tag_args ); |
|
269 | + if ( ! is_array($tag_args)) { |
|
270 | + $tag_args = array('payment_id' => $tag_args); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | // Replace all tags |
274 | - $content = Give()->email_tags->do_tags( $content, $tag_args ); |
|
274 | + $content = Give()->email_tags->do_tags($content, $tag_args); |
|
275 | 275 | |
276 | 276 | /** |
277 | 277 | * Filter the filtered content text. |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | * @since 1.0 |
280 | 280 | * @since 2.0 $payment_meta, $payment_id removed and $tag_args added. |
281 | 281 | */ |
282 | - $content = apply_filters( 'give_email_template_tags', $content, $tag_args ); |
|
282 | + $content = apply_filters('give_email_template_tags', $content, $tag_args); |
|
283 | 283 | |
284 | 284 | // Return content |
285 | 285 | return $content; |
@@ -298,10 +298,10 @@ discard block |
||
298 | 298 | * |
299 | 299 | * @since 1.0 |
300 | 300 | */ |
301 | - do_action( 'give_add_email_tags' ); |
|
301 | + do_action('give_add_email_tags'); |
|
302 | 302 | } |
303 | 303 | |
304 | -add_action( 'init', 'give_load_email_tags', - 999 ); |
|
304 | +add_action('init', 'give_load_email_tags', - 999); |
|
305 | 305 | |
306 | 306 | |
307 | 307 | /** |
@@ -316,67 +316,67 @@ discard block |
||
316 | 316 | /* Donation Payment */ |
317 | 317 | array( |
318 | 318 | 'tag' => 'donation', |
319 | - 'description' => esc_html__( 'The donation form name, and the donation level (if applicable).', 'give' ), |
|
319 | + 'description' => esc_html__('The donation form name, and the donation level (if applicable).', 'give'), |
|
320 | 320 | 'function' => 'give_email_tag_donation', |
321 | 321 | 'context' => 'donation', |
322 | 322 | ), |
323 | 323 | array( |
324 | 324 | 'tag' => 'amount', |
325 | - 'description' => esc_html__( 'The total donation amount with currency sign.', 'give' ), |
|
325 | + 'description' => esc_html__('The total donation amount with currency sign.', 'give'), |
|
326 | 326 | 'function' => 'give_email_tag_amount', |
327 | 327 | 'context' => 'donation', |
328 | 328 | ), |
329 | 329 | array( |
330 | 330 | 'tag' => 'price', |
331 | - 'description' => esc_html__( 'The total donation amount with currency sign.', 'give' ), |
|
331 | + 'description' => esc_html__('The total donation amount with currency sign.', 'give'), |
|
332 | 332 | 'function' => 'give_email_tag_price', |
333 | 333 | 'context' => 'donation', |
334 | 334 | ), |
335 | 335 | array( |
336 | 336 | 'tag' => 'billing_address', |
337 | - 'description' => esc_html__( 'The donor\'s billing address.', 'give' ), |
|
337 | + 'description' => esc_html__('The donor\'s billing address.', 'give'), |
|
338 | 338 | 'function' => 'give_email_tag_billing_address', |
339 | 339 | 'context' => 'donation', |
340 | 340 | ), |
341 | 341 | array( |
342 | 342 | 'tag' => 'date', |
343 | - 'description' => esc_html__( 'The date of the donation.', 'give' ), |
|
343 | + 'description' => esc_html__('The date of the donation.', 'give'), |
|
344 | 344 | 'function' => 'give_email_tag_date', |
345 | 345 | 'context' => 'donation', |
346 | 346 | ), |
347 | 347 | array( |
348 | 348 | 'tag' => 'payment_id', |
349 | - 'description' => esc_html__( 'The unique ID number for this donation.', 'give' ), |
|
349 | + 'description' => esc_html__('The unique ID number for this donation.', 'give'), |
|
350 | 350 | 'function' => 'give_email_tag_payment_id', |
351 | 351 | 'context' => 'donation', |
352 | 352 | ), |
353 | 353 | array( |
354 | 354 | 'tag' => 'payment_method', |
355 | - 'description' => esc_html__( 'The method of payment used for this donation.', 'give' ), |
|
355 | + 'description' => esc_html__('The method of payment used for this donation.', 'give'), |
|
356 | 356 | 'function' => 'give_email_tag_payment_method', |
357 | 357 | 'context' => 'donation', |
358 | 358 | ), |
359 | 359 | array( |
360 | 360 | 'tag' => 'payment_total', |
361 | - 'description' => esc_html__( 'The payment total for this donation.', 'give' ), |
|
361 | + 'description' => esc_html__('The payment total for this donation.', 'give'), |
|
362 | 362 | 'function' => 'give_email_tag_payment_total', |
363 | 363 | 'context' => 'donation', |
364 | 364 | ), |
365 | 365 | array( |
366 | 366 | 'tag' => 'receipt_id', |
367 | - 'description' => esc_html__( 'The unique ID number for this donation receipt.', 'give' ), |
|
367 | + 'description' => esc_html__('The unique ID number for this donation receipt.', 'give'), |
|
368 | 368 | 'function' => 'give_email_tag_receipt_id', |
369 | 369 | 'context' => 'donation', |
370 | 370 | ), |
371 | 371 | array( |
372 | 372 | 'tag' => 'receipt_link', |
373 | - 'description' => esc_html__( 'The donation receipt direct link, to view the receipt on the website.', 'give' ), |
|
373 | + 'description' => esc_html__('The donation receipt direct link, to view the receipt on the website.', 'give'), |
|
374 | 374 | 'function' => 'give_email_tag_receipt_link', |
375 | 375 | 'context' => 'donation', |
376 | 376 | ), |
377 | 377 | array( |
378 | 378 | 'tag' => 'receipt_link_url', |
379 | - 'description' => esc_html__( 'The donation receipt direct URL, to view the receipt on the website.', 'give' ), |
|
379 | + 'description' => esc_html__('The donation receipt direct URL, to view the receipt on the website.', 'give'), |
|
380 | 380 | 'function' => 'give_email_tag_receipt_link_url', |
381 | 381 | 'context' => 'donation', |
382 | 382 | ), |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | /* Donation Form */ |
385 | 385 | array( |
386 | 386 | 'tag' => 'form_title', |
387 | - 'description' => esc_html__( 'The donation form name.', 'give' ), |
|
387 | + 'description' => esc_html__('The donation form name.', 'give'), |
|
388 | 388 | 'function' => 'give_email_tag_form_title', |
389 | 389 | 'context' => 'form', |
390 | 390 | ), |
@@ -392,37 +392,37 @@ discard block |
||
392 | 392 | /* Donor */ |
393 | 393 | array( |
394 | 394 | 'tag' => 'name', |
395 | - 'description' => esc_html__( 'The donor\'s first name.', 'give' ), |
|
395 | + 'description' => esc_html__('The donor\'s first name.', 'give'), |
|
396 | 396 | 'function' => 'give_email_tag_first_name', |
397 | 397 | 'context' => 'donor', |
398 | 398 | ), |
399 | 399 | array( |
400 | 400 | 'tag' => 'fullname', |
401 | - 'description' => esc_html__( 'The donor\'s full name, first and last.', 'give' ), |
|
401 | + 'description' => esc_html__('The donor\'s full name, first and last.', 'give'), |
|
402 | 402 | 'function' => 'give_email_tag_fullname', |
403 | 403 | 'context' => 'donor', |
404 | 404 | ), |
405 | 405 | array( |
406 | 406 | 'tag' => 'username', |
407 | - 'description' => esc_html__( 'The donor\'s user name on the site, if they registered an account.', 'give' ), |
|
407 | + 'description' => esc_html__('The donor\'s user name on the site, if they registered an account.', 'give'), |
|
408 | 408 | 'function' => 'give_email_tag_username', |
409 | 409 | 'context' => 'donor', |
410 | 410 | ), |
411 | 411 | array( |
412 | 412 | 'tag' => 'company_name', |
413 | - 'description' => esc_html__( 'Company name.', 'give' ), |
|
413 | + 'description' => esc_html__('Company name.', 'give'), |
|
414 | 414 | 'function' => 'give_email_tag_company_name', |
415 | 415 | 'context' => 'donation', |
416 | 416 | ), |
417 | 417 | array( |
418 | 418 | 'tag' => 'user_email', |
419 | - 'description' => esc_html__( 'The donor\'s email address.', 'give' ), |
|
419 | + 'description' => esc_html__('The donor\'s email address.', 'give'), |
|
420 | 420 | 'function' => 'give_email_tag_user_email', |
421 | 421 | 'context' => 'donor', |
422 | 422 | ), |
423 | 423 | array( |
424 | 424 | 'tag' => 'email_access_link', |
425 | - 'description' => esc_html__( 'The donor\'s email access link.', 'give' ), |
|
425 | + 'description' => esc_html__('The donor\'s email access link.', 'give'), |
|
426 | 426 | 'function' => 'give_email_tag_email_access_link', |
427 | 427 | 'context' => 'donor', |
428 | 428 | ), |
@@ -430,14 +430,14 @@ discard block |
||
430 | 430 | /* General */ |
431 | 431 | array( |
432 | 432 | 'tag' => 'sitename', |
433 | - 'description' => esc_html__( 'The name of your site.', 'give' ), |
|
433 | + 'description' => esc_html__('The name of your site.', 'give'), |
|
434 | 434 | 'function' => 'give_email_tag_sitename', |
435 | 435 | 'context' => 'general', |
436 | 436 | ), |
437 | 437 | |
438 | 438 | array( |
439 | 439 | 'tag' => 'reset_password_link', |
440 | - 'description' => esc_html__( 'The reset password link for user.', 'give' ), |
|
440 | + 'description' => esc_html__('The reset password link for user.', 'give'), |
|
441 | 441 | 'function' => 'give_email_tag_reset_password_link', |
442 | 442 | 'context' => 'general', |
443 | 443 | ), |
@@ -445,21 +445,21 @@ discard block |
||
445 | 445 | ); |
446 | 446 | |
447 | 447 | // Apply give_email_tags filter |
448 | - $email_tags = apply_filters( 'give_email_tags', $email_tags ); |
|
448 | + $email_tags = apply_filters('give_email_tags', $email_tags); |
|
449 | 449 | |
450 | 450 | // Add email tags |
451 | - foreach ( $email_tags as $email_tag ) { |
|
451 | + foreach ($email_tags as $email_tag) { |
|
452 | 452 | give_add_email_tag( |
453 | 453 | $email_tag['tag'], |
454 | 454 | $email_tag['description'], |
455 | 455 | $email_tag['function'], |
456 | - ( ! empty( $email_tag['context'] ) ? $email_tag['context'] : '' ) |
|
456 | + ( ! empty($email_tag['context']) ? $email_tag['context'] : '') |
|
457 | 457 | ); |
458 | 458 | } |
459 | 459 | |
460 | 460 | } |
461 | 461 | |
462 | -add_action( 'give_add_email_tags', 'give_setup_email_tags' ); |
|
462 | +add_action('give_add_email_tags', 'give_setup_email_tags'); |
|
463 | 463 | |
464 | 464 | |
465 | 465 | /** |
@@ -471,24 +471,24 @@ discard block |
||
471 | 471 | * |
472 | 472 | * @return string $firstname |
473 | 473 | */ |
474 | -function give_email_tag_first_name( $tag_args ) { |
|
474 | +function give_email_tag_first_name($tag_args) { |
|
475 | 475 | $user_info = array(); |
476 | 476 | $firstname = ''; |
477 | 477 | |
478 | 478 | // Backward compatibility. |
479 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
479 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
480 | 480 | |
481 | - switch ( true ) { |
|
482 | - case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ): |
|
483 | - $donor_info = give_get_payment_meta_user_info( $tag_args['payment_id'] ); |
|
484 | - $email_names = give_get_email_names( $donor_info ); |
|
481 | + switch (true) { |
|
482 | + case give_check_variable($tag_args, 'isset', 0, 'payment_id'): |
|
483 | + $donor_info = give_get_payment_meta_user_info($tag_args['payment_id']); |
|
484 | + $email_names = give_get_email_names($donor_info); |
|
485 | 485 | $firstname = $email_names['name']; |
486 | 486 | |
487 | 487 | break; |
488 | 488 | |
489 | - case give_check_variable( $tag_args, 'isset', 0, 'user_id' ): |
|
489 | + case give_check_variable($tag_args, 'isset', 0, 'user_id'): |
|
490 | 490 | $firstname = Give()->donor_meta->get_meta( |
491 | - Give()->donors->get_column_by( 'id', 'user_id', $tag_args['user_id'] ), |
|
491 | + Give()->donors->get_column_by('id', 'user_id', $tag_args['user_id']), |
|
492 | 492 | '_give_donor_first_name', |
493 | 493 | true |
494 | 494 | ); |
@@ -499,8 +499,8 @@ discard block |
||
499 | 499 | * |
500 | 500 | * @since 2.0 |
501 | 501 | */ |
502 | - case give_check_variable( $tag_args, 'isset', 0, 'donor_id' ): |
|
503 | - $firstname = Give()->donor_meta->get_meta( $tag_args['donor_id'], '_give_donor_first_name', true ); |
|
502 | + case give_check_variable($tag_args, 'isset', 0, 'donor_id'): |
|
503 | + $firstname = Give()->donor_meta->get_meta($tag_args['donor_id'], '_give_donor_first_name', true); |
|
504 | 504 | break; |
505 | 505 | } |
506 | 506 | |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | * @param string $firstname |
513 | 513 | * @param array $tag_args |
514 | 514 | */ |
515 | - $firstname = apply_filters( 'give_email_tag_first_name', $firstname, $tag_args ); |
|
515 | + $firstname = apply_filters('give_email_tag_first_name', $firstname, $tag_args); |
|
516 | 516 | |
517 | 517 | return $firstname; |
518 | 518 | } |
@@ -526,21 +526,21 @@ discard block |
||
526 | 526 | * |
527 | 527 | * @return string $fullname |
528 | 528 | */ |
529 | -function give_email_tag_fullname( $tag_args ) { |
|
529 | +function give_email_tag_fullname($tag_args) { |
|
530 | 530 | $fullname = ''; |
531 | 531 | |
532 | 532 | // Backward compatibility. |
533 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
533 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
534 | 534 | |
535 | - switch ( true ) { |
|
536 | - case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ): |
|
537 | - $donor_info = give_get_payment_meta_user_info( $tag_args['payment_id'] ); |
|
538 | - $email_names = give_get_email_names( $donor_info ); |
|
535 | + switch (true) { |
|
536 | + case give_check_variable($tag_args, 'isset', 0, 'payment_id'): |
|
537 | + $donor_info = give_get_payment_meta_user_info($tag_args['payment_id']); |
|
538 | + $email_names = give_get_email_names($donor_info); |
|
539 | 539 | $fullname = $email_names['fullname']; |
540 | 540 | break; |
541 | 541 | |
542 | - case give_check_variable( $tag_args, 'isset', 0, 'user_id' ): |
|
543 | - $fullname = Give()->donors->get_column_by( 'name', 'user_id', $tag_args['user_id'] ); |
|
542 | + case give_check_variable($tag_args, 'isset', 0, 'user_id'): |
|
543 | + $fullname = Give()->donors->get_column_by('name', 'user_id', $tag_args['user_id']); |
|
544 | 544 | break; |
545 | 545 | |
546 | 546 | /** |
@@ -548,8 +548,8 @@ discard block |
||
548 | 548 | * |
549 | 549 | * @since 2.0 |
550 | 550 | */ |
551 | - case give_check_variable( $tag_args, 'isset', 0, 'donor_id' ): |
|
552 | - $fullname = Give()->donors->get_column( 'name', $tag_args['donor_id'] ); |
|
551 | + case give_check_variable($tag_args, 'isset', 0, 'donor_id'): |
|
552 | + $fullname = Give()->donors->get_column('name', $tag_args['donor_id']); |
|
553 | 553 | break; |
554 | 554 | } |
555 | 555 | |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | * @param string $fullname |
562 | 562 | * @param array $tag_args |
563 | 563 | */ |
564 | - $fullname = apply_filters( 'give_email_tag_fullname', $fullname, $tag_args ); |
|
564 | + $fullname = apply_filters('give_email_tag_fullname', $fullname, $tag_args); |
|
565 | 565 | |
566 | 566 | return $fullname; |
567 | 567 | } |
@@ -575,21 +575,21 @@ discard block |
||
575 | 575 | * |
576 | 576 | * @return string username. |
577 | 577 | */ |
578 | -function give_email_tag_username( $tag_args ) { |
|
578 | +function give_email_tag_username($tag_args) { |
|
579 | 579 | $username = ''; |
580 | 580 | |
581 | 581 | // Backward compatibility. |
582 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
582 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
583 | 583 | |
584 | - switch ( true ) { |
|
585 | - case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ): |
|
586 | - $donor_info = give_get_payment_meta_user_info( $tag_args['payment_id'] ); |
|
587 | - $email_names = give_get_email_names( $donor_info ); |
|
584 | + switch (true) { |
|
585 | + case give_check_variable($tag_args, 'isset', 0, 'payment_id'): |
|
586 | + $donor_info = give_get_payment_meta_user_info($tag_args['payment_id']); |
|
587 | + $email_names = give_get_email_names($donor_info); |
|
588 | 588 | $username = $email_names['username']; |
589 | 589 | break; |
590 | 590 | |
591 | - case give_check_variable( $tag_args, 'isset', 0, 'user_id' ): |
|
592 | - $user_info = get_user_by( 'id', $tag_args['user_id'] ); |
|
591 | + case give_check_variable($tag_args, 'isset', 0, 'user_id'): |
|
592 | + $user_info = get_user_by('id', $tag_args['user_id']); |
|
593 | 593 | $username = $user_info->user_login; |
594 | 594 | break; |
595 | 595 | |
@@ -598,9 +598,9 @@ discard block |
||
598 | 598 | * |
599 | 599 | * @since 2.0 |
600 | 600 | */ |
601 | - case give_check_variable( $tag_args, 'isset', 0, 'donor_id' ): |
|
602 | - if ( $user_id = Give()->donors->get_column( 'user_id', $tag_args['donor_id'] ) ) { |
|
603 | - $user_info = get_user_by( 'id', $user_id ); |
|
601 | + case give_check_variable($tag_args, 'isset', 0, 'donor_id'): |
|
602 | + if ($user_id = Give()->donors->get_column('user_id', $tag_args['donor_id'])) { |
|
603 | + $user_info = get_user_by('id', $user_id); |
|
604 | 604 | $username = $user_info->user_login; |
605 | 605 | } |
606 | 606 | break; |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | * @param string $username |
615 | 615 | * @param array $tag_args |
616 | 616 | */ |
617 | - $username = apply_filters( 'give_email_tag_username', $username, $tag_args ); |
|
617 | + $username = apply_filters('give_email_tag_username', $username, $tag_args); |
|
618 | 618 | |
619 | 619 | return $username; |
620 | 620 | } |
@@ -628,19 +628,19 @@ discard block |
||
628 | 628 | * |
629 | 629 | * @return string user_email |
630 | 630 | */ |
631 | -function give_email_tag_user_email( $tag_args ) { |
|
631 | +function give_email_tag_user_email($tag_args) { |
|
632 | 632 | $email = ''; |
633 | 633 | |
634 | 634 | // Backward compatibility. |
635 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
635 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
636 | 636 | |
637 | - switch ( true ) { |
|
638 | - case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ): |
|
639 | - $email = give_get_donation_donor_email( $tag_args['payment_id'] ); |
|
637 | + switch (true) { |
|
638 | + case give_check_variable($tag_args, 'isset', 0, 'payment_id'): |
|
639 | + $email = give_get_donation_donor_email($tag_args['payment_id']); |
|
640 | 640 | break; |
641 | 641 | |
642 | - case give_check_variable( $tag_args, 'isset', 0, 'user_id' ): |
|
643 | - $user_info = get_user_by( 'id', $tag_args['user_id'] ); |
|
642 | + case give_check_variable($tag_args, 'isset', 0, 'user_id'): |
|
643 | + $user_info = get_user_by('id', $tag_args['user_id']); |
|
644 | 644 | $email = $user_info->user_email; |
645 | 645 | break; |
646 | 646 | |
@@ -649,8 +649,8 @@ discard block |
||
649 | 649 | * |
650 | 650 | * @since 2.0 |
651 | 651 | */ |
652 | - case give_check_variable( $tag_args, 'isset', 0, 'donor_id' ): |
|
653 | - $email = Give()->donors->get_column( 'email', $tag_args['donor_id'] ); |
|
652 | + case give_check_variable($tag_args, 'isset', 0, 'donor_id'): |
|
653 | + $email = Give()->donors->get_column('email', $tag_args['donor_id']); |
|
654 | 654 | break; |
655 | 655 | } |
656 | 656 | |
@@ -662,7 +662,7 @@ discard block |
||
662 | 662 | * @param string $email |
663 | 663 | * @param array $tag_args |
664 | 664 | */ |
665 | - $email = apply_filters( 'give_email_tag_user_email', $email, $tag_args ); |
|
665 | + $email = apply_filters('give_email_tag_user_email', $email, $tag_args); |
|
666 | 666 | |
667 | 667 | return $email; |
668 | 668 | } |
@@ -676,22 +676,22 @@ discard block |
||
676 | 676 | * |
677 | 677 | * @return string billing_address |
678 | 678 | */ |
679 | -function give_email_tag_billing_address( $tag_args ) { |
|
679 | +function give_email_tag_billing_address($tag_args) { |
|
680 | 680 | $address = ''; |
681 | 681 | |
682 | 682 | // Backward compatibility. |
683 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
683 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
684 | 684 | |
685 | - switch ( true ) { |
|
686 | - case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ): |
|
687 | - $donation_address = give_get_donation_address( $tag_args['payment_id'] ); |
|
688 | - $address = $donation_address['line1'] . "\n"; |
|
685 | + switch (true) { |
|
686 | + case give_check_variable($tag_args, 'isset', 0, 'payment_id'): |
|
687 | + $donation_address = give_get_donation_address($tag_args['payment_id']); |
|
688 | + $address = $donation_address['line1']."\n"; |
|
689 | 689 | |
690 | - if ( ! empty( $donation_address['line2'] ) ) { |
|
691 | - $address .= $donation_address['line2'] . "\n"; |
|
690 | + if ( ! empty($donation_address['line2'])) { |
|
691 | + $address .= $donation_address['line2']."\n"; |
|
692 | 692 | } |
693 | 693 | |
694 | - $address .= $donation_address['city'] . ' ' . $donation_address['zip'] . ' ' . $donation_address['state'] . "\n"; |
|
694 | + $address .= $donation_address['city'].' '.$donation_address['zip'].' '.$donation_address['state']."\n"; |
|
695 | 695 | $address .= $donation_address['country']; |
696 | 696 | break; |
697 | 697 | } |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | * @param string $address |
705 | 705 | * @param array $tag_args |
706 | 706 | */ |
707 | - $address = apply_filters( 'give_email_tag_billing_address', $address, $tag_args ); |
|
707 | + $address = apply_filters('give_email_tag_billing_address', $address, $tag_args); |
|
708 | 708 | |
709 | 709 | return $address; |
710 | 710 | } |
@@ -718,15 +718,15 @@ discard block |
||
718 | 718 | * |
719 | 719 | * @return string date |
720 | 720 | */ |
721 | -function give_email_tag_date( $tag_args ) { |
|
721 | +function give_email_tag_date($tag_args) { |
|
722 | 722 | $date = ''; |
723 | 723 | |
724 | 724 | // Backward compatibility. |
725 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
725 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
726 | 726 | |
727 | - switch ( true ) { |
|
728 | - case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ): |
|
729 | - $date = date_i18n( give_date_format(), strtotime( get_the_date( $tag_args['payment_id'] ) ) ); |
|
727 | + switch (true) { |
|
728 | + case give_check_variable($tag_args, 'isset', 0, 'payment_id'): |
|
729 | + $date = date_i18n(give_date_format(), strtotime(get_the_date($tag_args['payment_id']))); |
|
730 | 730 | break; |
731 | 731 | } |
732 | 732 | |
@@ -738,7 +738,7 @@ discard block |
||
738 | 738 | * @param string $date |
739 | 739 | * @param array $tag_args |
740 | 740 | */ |
741 | - $date = apply_filters( 'give_email_tag_date', $date, $tag_args ); |
|
741 | + $date = apply_filters('give_email_tag_date', $date, $tag_args); |
|
742 | 742 | |
743 | 743 | return $date; |
744 | 744 | } |
@@ -752,16 +752,16 @@ discard block |
||
752 | 752 | * |
753 | 753 | * @return string amount |
754 | 754 | */ |
755 | -function give_email_tag_amount( $tag_args ) { |
|
755 | +function give_email_tag_amount($tag_args) { |
|
756 | 756 | $amount = ''; |
757 | 757 | |
758 | 758 | // Backward compatibility. |
759 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
759 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
760 | 760 | |
761 | - switch ( true ) { |
|
762 | - case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ): |
|
763 | - $give_amount = give_donation_amount( $tag_args['payment_id'], true ); |
|
764 | - $amount = html_entity_decode( $give_amount, ENT_COMPAT, 'UTF-8' ); |
|
761 | + switch (true) { |
|
762 | + case give_check_variable($tag_args, 'isset', 0, 'payment_id'): |
|
763 | + $give_amount = give_donation_amount($tag_args['payment_id'], true); |
|
764 | + $amount = html_entity_decode($give_amount, ENT_COMPAT, 'UTF-8'); |
|
765 | 765 | break; |
766 | 766 | } |
767 | 767 | |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | * @param string $amount |
774 | 774 | * @param array $tag_args |
775 | 775 | */ |
776 | - $amount = apply_filters( 'give_email_tag_amount', $amount, $tag_args ); |
|
776 | + $amount = apply_filters('give_email_tag_amount', $amount, $tag_args); |
|
777 | 777 | |
778 | 778 | return $amount; |
779 | 779 | } |
@@ -787,8 +787,8 @@ discard block |
||
787 | 787 | * |
788 | 788 | * @return string price |
789 | 789 | */ |
790 | -function give_email_tag_price( $tag_args ) { |
|
791 | - return give_email_tag_amount( $tag_args ); |
|
790 | +function give_email_tag_price($tag_args) { |
|
791 | + return give_email_tag_amount($tag_args); |
|
792 | 792 | } |
793 | 793 | |
794 | 794 | /** |
@@ -800,15 +800,15 @@ discard block |
||
800 | 800 | * |
801 | 801 | * @return int payment_id |
802 | 802 | */ |
803 | -function give_email_tag_payment_id( $tag_args ) { |
|
803 | +function give_email_tag_payment_id($tag_args) { |
|
804 | 804 | $payment_id = ''; |
805 | 805 | |
806 | 806 | // Backward compatibility. |
807 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
807 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
808 | 808 | |
809 | - switch ( true ) { |
|
810 | - case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ): |
|
811 | - $payment_id = Give()->seq_donation_number->get_serial_code( $tag_args['payment_id'] ); |
|
809 | + switch (true) { |
|
810 | + case give_check_variable($tag_args, 'isset', 0, 'payment_id'): |
|
811 | + $payment_id = Give()->seq_donation_number->get_serial_code($tag_args['payment_id']); |
|
812 | 812 | break; |
813 | 813 | } |
814 | 814 | |
@@ -820,7 +820,7 @@ discard block |
||
820 | 820 | * @param string $payment_id |
821 | 821 | * @param array $tag_args |
822 | 822 | */ |
823 | - return apply_filters( 'give_email_tag_payment_id', $payment_id, $tag_args ); |
|
823 | + return apply_filters('give_email_tag_payment_id', $payment_id, $tag_args); |
|
824 | 824 | } |
825 | 825 | |
826 | 826 | /** |
@@ -832,15 +832,15 @@ discard block |
||
832 | 832 | * |
833 | 833 | * @return string receipt_id |
834 | 834 | */ |
835 | -function give_email_tag_receipt_id( $tag_args ) { |
|
835 | +function give_email_tag_receipt_id($tag_args) { |
|
836 | 836 | $receipt_id = ''; |
837 | 837 | |
838 | 838 | // Backward compatibility. |
839 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
839 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
840 | 840 | |
841 | - switch ( true ) { |
|
842 | - case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ): |
|
843 | - $receipt_id = give_get_payment_key( $tag_args['payment_id'] ); |
|
841 | + switch (true) { |
|
842 | + case give_check_variable($tag_args, 'isset', 0, 'payment_id'): |
|
843 | + $receipt_id = give_get_payment_key($tag_args['payment_id']); |
|
844 | 844 | break; |
845 | 845 | } |
846 | 846 | |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | * @param string $receipt_id |
853 | 853 | * @param array $tag_args |
854 | 854 | */ |
855 | - return apply_filters( 'give_email_tag_receipt_id', $receipt_id, $tag_args ); |
|
855 | + return apply_filters('give_email_tag_receipt_id', $receipt_id, $tag_args); |
|
856 | 856 | } |
857 | 857 | |
858 | 858 | /** |
@@ -864,21 +864,21 @@ discard block |
||
864 | 864 | * |
865 | 865 | * @return string $form_title |
866 | 866 | */ |
867 | -function give_email_tag_donation( $tag_args ) { |
|
867 | +function give_email_tag_donation($tag_args) { |
|
868 | 868 | $donation_form_title = ''; |
869 | 869 | |
870 | 870 | // Backward compatibility. |
871 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
871 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
872 | 872 | |
873 | - switch ( true ) { |
|
874 | - case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ): |
|
875 | - $level_title = give_has_variable_prices( give_get_payment_form_id( $tag_args['payment_id'] ) ); |
|
873 | + switch (true) { |
|
874 | + case give_check_variable($tag_args, 'isset', 0, 'payment_id'): |
|
875 | + $level_title = give_has_variable_prices(give_get_payment_form_id($tag_args['payment_id'])); |
|
876 | 876 | $separator = $level_title ? '-' : ''; |
877 | 877 | $donation_form_title = strip_tags( |
878 | 878 | give_check_variable( |
879 | 879 | give_get_donation_form_title( |
880 | 880 | $tag_args['payment_id'], |
881 | - array( 'separator' => $separator, ) |
|
881 | + array('separator' => $separator,) |
|
882 | 882 | ), |
883 | 883 | 'empty', |
884 | 884 | '' |
@@ -911,15 +911,15 @@ discard block |
||
911 | 911 | * |
912 | 912 | * @return string $form_title |
913 | 913 | */ |
914 | -function give_email_tag_form_title( $tag_args ) { |
|
914 | +function give_email_tag_form_title($tag_args) { |
|
915 | 915 | $donation_form_title = ''; |
916 | 916 | |
917 | 917 | // Backward compatibility. |
918 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
918 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
919 | 919 | |
920 | - switch ( true ) { |
|
921 | - case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ): |
|
922 | - $donation_form_title = give_get_payment_meta( $tag_args['payment_id'], '_give_payment_form_title' ); |
|
920 | + switch (true) { |
|
921 | + case give_check_variable($tag_args, 'isset', 0, 'payment_id'): |
|
922 | + $donation_form_title = give_get_payment_meta($tag_args['payment_id'], '_give_payment_form_title'); |
|
923 | 923 | break; |
924 | 924 | } |
925 | 925 | |
@@ -948,15 +948,15 @@ discard block |
||
948 | 948 | * |
949 | 949 | * @return string $company_name |
950 | 950 | */ |
951 | -function give_email_tag_company_name( $tag_args ) { |
|
951 | +function give_email_tag_company_name($tag_args) { |
|
952 | 952 | $company_name = ''; |
953 | 953 | |
954 | 954 | // Backward compatibility. |
955 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
955 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
956 | 956 | |
957 | - switch ( true ) { |
|
958 | - case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ): |
|
959 | - $company_name = give_get_payment_meta( $tag_args['payment_id'], '_give_donation_company', true ); |
|
957 | + switch (true) { |
|
958 | + case give_check_variable($tag_args, 'isset', 0, 'payment_id'): |
|
959 | + $company_name = give_get_payment_meta($tag_args['payment_id'], '_give_donation_company', true); |
|
960 | 960 | break; |
961 | 961 | } |
962 | 962 | |
@@ -984,18 +984,18 @@ discard block |
||
984 | 984 | * |
985 | 985 | * @return string gateway |
986 | 986 | */ |
987 | -function give_email_tag_payment_method( $tag_args ) { |
|
987 | +function give_email_tag_payment_method($tag_args) { |
|
988 | 988 | $payment_method = ''; |
989 | 989 | |
990 | 990 | // Backward compatibility. |
991 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
991 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
992 | 992 | |
993 | 993 | // Backward compatibility. |
994 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
994 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
995 | 995 | |
996 | - switch ( true ) { |
|
997 | - case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ): |
|
998 | - $payment_method = give_get_gateway_checkout_label( give_get_payment_gateway( $tag_args['payment_id'] ) ); |
|
996 | + switch (true) { |
|
997 | + case give_check_variable($tag_args, 'isset', 0, 'payment_id'): |
|
998 | + $payment_method = give_get_gateway_checkout_label(give_get_payment_gateway($tag_args['payment_id'])); |
|
999 | 999 | break; |
1000 | 1000 | } |
1001 | 1001 | |
@@ -1026,15 +1026,15 @@ discard block |
||
1026 | 1026 | * |
1027 | 1027 | * @return string |
1028 | 1028 | */ |
1029 | -function give_email_tag_payment_total( $tag_args ) { |
|
1029 | +function give_email_tag_payment_total($tag_args) { |
|
1030 | 1030 | $payment_total = ''; |
1031 | 1031 | |
1032 | 1032 | // Backward compatibility. |
1033 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
1033 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
1034 | 1034 | |
1035 | - switch ( true ) { |
|
1036 | - case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ): |
|
1037 | - $payment_total = give_currency_filter( give_get_payment_total( $tag_args['payment_id'] ) ); |
|
1035 | + switch (true) { |
|
1036 | + case give_check_variable($tag_args, 'isset', 0, 'payment_id'): |
|
1037 | + $payment_total = give_currency_filter(give_get_payment_total($tag_args['payment_id'])); |
|
1038 | 1038 | break; |
1039 | 1039 | } |
1040 | 1040 | |
@@ -1062,11 +1062,11 @@ discard block |
||
1062 | 1062 | * |
1063 | 1063 | * @return string |
1064 | 1064 | */ |
1065 | -function give_email_tag_sitename( $tag_args = array() ) { |
|
1066 | - $sitename = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ); |
|
1065 | +function give_email_tag_sitename($tag_args = array()) { |
|
1066 | + $sitename = wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES); |
|
1067 | 1067 | |
1068 | 1068 | // Backward compatibility. |
1069 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
1069 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
1070 | 1070 | |
1071 | 1071 | /** |
1072 | 1072 | * Filter the {sitename} email template tag output. |
@@ -1092,26 +1092,26 @@ discard block |
||
1092 | 1092 | * |
1093 | 1093 | * @return string receipt_link |
1094 | 1094 | */ |
1095 | -function give_email_tag_receipt_link( $tag_args ) { |
|
1095 | +function give_email_tag_receipt_link($tag_args) { |
|
1096 | 1096 | // Backward compatibility. |
1097 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
1097 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
1098 | 1098 | |
1099 | - $receipt_url = give_get_receipt_url( give_check_variable( $tag_args, 'empty', 0, 'payment_id' ) ); |
|
1099 | + $receipt_url = give_get_receipt_url(give_check_variable($tag_args, 'empty', 0, 'payment_id')); |
|
1100 | 1100 | |
1101 | 1101 | // Bailout. |
1102 | - if ( give_get_option( 'email_template' ) === 'none' ) { |
|
1102 | + if (give_get_option('email_template') === 'none') { |
|
1103 | 1103 | return $receipt_url; |
1104 | 1104 | } |
1105 | 1105 | |
1106 | 1106 | |
1107 | - $receipt_url = esc_url( add_query_arg( array( |
|
1108 | - 'payment_key' => give_get_payment_key( $tag_args['payment_id'] ), |
|
1109 | - ), give_get_history_page_uri() ) ); |
|
1107 | + $receipt_url = esc_url(add_query_arg(array( |
|
1108 | + 'payment_key' => give_get_payment_key($tag_args['payment_id']), |
|
1109 | + ), give_get_history_page_uri())); |
|
1110 | 1110 | |
1111 | 1111 | $formatted = sprintf( |
1112 | 1112 | '<a href="%1$s">%2$s</a>', |
1113 | 1113 | $receipt_url, |
1114 | - __( 'View it in your browser »', 'give' ) |
|
1114 | + __('View it in your browser »', 'give') |
|
1115 | 1115 | ); |
1116 | 1116 | |
1117 | 1117 | /** |
@@ -1140,11 +1140,11 @@ discard block |
||
1140 | 1140 | * |
1141 | 1141 | * @return string receipt_url |
1142 | 1142 | */ |
1143 | -function give_email_tag_receipt_link_url( $tag_args ) { |
|
1143 | +function give_email_tag_receipt_link_url($tag_args) { |
|
1144 | 1144 | // Backward compatibility. |
1145 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
1145 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
1146 | 1146 | |
1147 | - $receipt_link_url = give_get_receipt_url( give_check_variable( $tag_args, 'empty', 0, 'payment_id' ) ); |
|
1147 | + $receipt_link_url = give_get_receipt_url(give_check_variable($tag_args, 'empty', 0, 'payment_id')); |
|
1148 | 1148 | |
1149 | 1149 | /** |
1150 | 1150 | * Filter the {receipt_link_url} email template tag output. |
@@ -1171,13 +1171,13 @@ discard block |
||
1171 | 1171 | * |
1172 | 1172 | * @return string |
1173 | 1173 | */ |
1174 | -function give_get_receipt_url( $payment_id ) { |
|
1174 | +function give_get_receipt_url($payment_id) { |
|
1175 | 1175 | $receipt_url = ''; |
1176 | 1176 | |
1177 | - if ( $payment_id ) { |
|
1178 | - $receipt_url = esc_url( add_query_arg( array( |
|
1179 | - 'payment_key' => give_get_payment_key( $payment_id ), |
|
1180 | - ), give_get_history_page_uri() ) ); |
|
1177 | + if ($payment_id) { |
|
1178 | + $receipt_url = esc_url(add_query_arg(array( |
|
1179 | + 'payment_key' => give_get_payment_key($payment_id), |
|
1180 | + ), give_get_history_page_uri())); |
|
1181 | 1181 | } |
1182 | 1182 | |
1183 | 1183 | return $receipt_url; |
@@ -1193,22 +1193,22 @@ discard block |
||
1193 | 1193 | * |
1194 | 1194 | * @return string |
1195 | 1195 | */ |
1196 | -function give_email_tag_email_access_link( $tag_args ) { |
|
1196 | +function give_email_tag_email_access_link($tag_args) { |
|
1197 | 1197 | $donor_id = 0; |
1198 | 1198 | $donor = array(); |
1199 | 1199 | $email_access_link = ''; |
1200 | 1200 | |
1201 | 1201 | // Backward compatibility. |
1202 | - $tag_args = __give_20_bc_str_type_email_tag_param( $tag_args ); |
|
1202 | + $tag_args = __give_20_bc_str_type_email_tag_param($tag_args); |
|
1203 | 1203 | |
1204 | - switch ( true ) { |
|
1205 | - case ! empty( $tag_args['donor_id'] ): |
|
1204 | + switch (true) { |
|
1205 | + case ! empty($tag_args['donor_id']): |
|
1206 | 1206 | $donor_id = $tag_args['donor_id']; |
1207 | - $donor = Give()->donors->get_by( 'id', $tag_args['donor_id'] ); |
|
1207 | + $donor = Give()->donors->get_by('id', $tag_args['donor_id']); |
|
1208 | 1208 | break; |
1209 | 1209 | |
1210 | - case ! empty( $tag_args['user_id'] ): |
|
1211 | - $donor = Give()->donors->get_by( 'user_id', $tag_args['user_id'] ); |
|
1210 | + case ! empty($tag_args['user_id']): |
|
1211 | + $donor = Give()->donors->get_by('user_id', $tag_args['user_id']); |
|
1212 | 1212 | $donor_id = $donor->id; |
1213 | 1213 | break; |
1214 | 1214 | |
@@ -1217,11 +1217,11 @@ discard block |
||
1217 | 1217 | } |
1218 | 1218 | |
1219 | 1219 | // Set email access link if donor exist. |
1220 | - if ( $donor_id ) { |
|
1221 | - $verify_key = wp_generate_password( 20, false ); |
|
1220 | + if ($donor_id) { |
|
1221 | + $verify_key = wp_generate_password(20, false); |
|
1222 | 1222 | |
1223 | 1223 | // Generate a new verify key |
1224 | - Give()->email_access->set_verify_key( $donor_id, $donor->email, $verify_key ); |
|
1224 | + Give()->email_access->set_verify_key($donor_id, $donor->email, $verify_key); |
|
1225 | 1225 | |
1226 | 1226 | $access_url = add_query_arg( |
1227 | 1227 | array( |
@@ -1231,28 +1231,28 @@ discard block |
||
1231 | 1231 | ); |
1232 | 1232 | |
1233 | 1233 | // Add Payment Key to email access url, if it exists. |
1234 | - if ( ! empty( $_GET['payment_key'] ) ) { |
|
1234 | + if ( ! empty($_GET['payment_key'])) { |
|
1235 | 1235 | $access_url = add_query_arg( |
1236 | 1236 | array( |
1237 | - 'payment_key' => give_clean( $_GET['payment_key'] ), |
|
1237 | + 'payment_key' => give_clean($_GET['payment_key']), |
|
1238 | 1238 | ), |
1239 | 1239 | $access_url |
1240 | 1240 | ); |
1241 | 1241 | } |
1242 | 1242 | |
1243 | - if ( empty( $tag_args['email_content_type'] ) || 'text/html' === $tag_args['email_content_type'] ) { |
|
1243 | + if (empty($tag_args['email_content_type']) || 'text/html' === $tag_args['email_content_type']) { |
|
1244 | 1244 | $email_access_link = sprintf( |
1245 | 1245 | '<a href="%1$s" target="_blank">%2$s</a>', |
1246 | - esc_url( $access_url ), |
|
1247 | - __( 'View your donation history »', 'give' ) |
|
1246 | + esc_url($access_url), |
|
1247 | + __('View your donation history »', 'give') |
|
1248 | 1248 | ); |
1249 | 1249 | |
1250 | 1250 | } else { |
1251 | 1251 | |
1252 | 1252 | $email_access_link = sprintf( |
1253 | 1253 | '%1$s: %2$s', |
1254 | - __( 'View your donation history', 'give' ), |
|
1255 | - esc_url( $access_url ) |
|
1254 | + __('View your donation history', 'give'), |
|
1255 | + esc_url($access_url) |
|
1256 | 1256 | ); |
1257 | 1257 | } |
1258 | 1258 | } |
@@ -1284,23 +1284,23 @@ discard block |
||
1284 | 1284 | * |
1285 | 1285 | * @return array |
1286 | 1286 | */ |
1287 | -function __give_20_bc_str_type_email_tag_param( $tag_args ) { |
|
1288 | - if ( ! is_array( $tag_args ) ) { |
|
1289 | - switch ( true ) { |
|
1290 | - case ( 'give_payment' === get_post_type( $tag_args ) ): |
|
1291 | - $tag_args = array( 'payment_id' => $tag_args ); |
|
1287 | +function __give_20_bc_str_type_email_tag_param($tag_args) { |
|
1288 | + if ( ! is_array($tag_args)) { |
|
1289 | + switch (true) { |
|
1290 | + case ('give_payment' === get_post_type($tag_args)): |
|
1291 | + $tag_args = array('payment_id' => $tag_args); |
|
1292 | 1292 | break; |
1293 | 1293 | |
1294 | - case ( ! is_wp_error( get_user_by( 'id', $tag_args ) ) ): |
|
1295 | - $tag_args = array( 'user_id' => $tag_args ); |
|
1294 | + case ( ! is_wp_error(get_user_by('id', $tag_args))): |
|
1295 | + $tag_args = array('user_id' => $tag_args); |
|
1296 | 1296 | break; |
1297 | 1297 | |
1298 | - case ( Give()->donors->get_by( 'id', $tag_args ) ): |
|
1299 | - $tag_args = array( 'donor_id' => $tag_args ); |
|
1298 | + case (Give()->donors->get_by('id', $tag_args)): |
|
1299 | + $tag_args = array('donor_id' => $tag_args); |
|
1300 | 1300 | break; |
1301 | 1301 | |
1302 | - case ( Give()->donors->get_by( 'user_id', $tag_args ) ): |
|
1303 | - $tag_args = array( 'user_id' => $tag_args ); |
|
1302 | + case (Give()->donors->get_by('user_id', $tag_args)): |
|
1303 | + $tag_args = array('user_id' => $tag_args); |
|
1304 | 1304 | break; |
1305 | 1305 | } |
1306 | 1306 | } |
@@ -1318,36 +1318,36 @@ discard block |
||
1318 | 1318 | * |
1319 | 1319 | * @return array |
1320 | 1320 | */ |
1321 | -function give_email_tag_reset_password_link( $tag_args, $payment_id ) { |
|
1321 | +function give_email_tag_reset_password_link($tag_args, $payment_id) { |
|
1322 | 1322 | |
1323 | 1323 | $reset_password_url = ''; |
1324 | 1324 | |
1325 | - switch ( true ) { |
|
1326 | - case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ): |
|
1327 | - $payment_id = Give()->seq_donation_number->get_serial_code( $tag_args['payment_id'] ); |
|
1325 | + switch (true) { |
|
1326 | + case give_check_variable($tag_args, 'isset', 0, 'payment_id'): |
|
1327 | + $payment_id = Give()->seq_donation_number->get_serial_code($tag_args['payment_id']); |
|
1328 | 1328 | break; |
1329 | 1329 | |
1330 | - case give_check_variable( $tag_args, 'isset', 0, 'user_id' ): |
|
1331 | - $reset_password_url = give_get_reset_password_url( $tag_args['user_id'] ); |
|
1330 | + case give_check_variable($tag_args, 'isset', 0, 'user_id'): |
|
1331 | + $reset_password_url = give_get_reset_password_url($tag_args['user_id']); |
|
1332 | 1332 | break; |
1333 | 1333 | |
1334 | - case give_check_variable( $tag_args, 'isset', 0, 'donor_id' ): |
|
1335 | - $reset_password_url = give_get_reset_password_url( Give()->donors->get_column( 'user_id', $tag_args['donor_id'] ) ); |
|
1334 | + case give_check_variable($tag_args, 'isset', 0, 'donor_id'): |
|
1335 | + $reset_password_url = give_get_reset_password_url(Give()->donors->get_column('user_id', $tag_args['donor_id'])); |
|
1336 | 1336 | break; |
1337 | 1337 | } |
1338 | 1338 | |
1339 | - if ( empty( $tag_args['email_content_type'] ) || 'text/html' === $tag_args['email_content_type'] ) { |
|
1339 | + if (empty($tag_args['email_content_type']) || 'text/html' === $tag_args['email_content_type']) { |
|
1340 | 1340 | // Generate link, if Email content type is html. |
1341 | 1341 | $reset_password_link = sprintf( |
1342 | 1342 | '<a href="%1$s" target="_blank">%2$s</a>', |
1343 | - esc_url( $reset_password_url ), |
|
1344 | - __( 'Reset your password »', 'give' ) |
|
1343 | + esc_url($reset_password_url), |
|
1344 | + __('Reset your password »', 'give') |
|
1345 | 1345 | ); |
1346 | 1346 | } else { |
1347 | 1347 | $reset_password_link = sprintf( |
1348 | 1348 | '%1$s: %2$s', |
1349 | - __( 'Reset your password', 'give' ), |
|
1350 | - esc_url( $reset_password_url ) |
|
1349 | + __('Reset your password', 'give'), |
|
1350 | + esc_url($reset_password_url) |
|
1351 | 1351 | ); |
1352 | 1352 | } |
1353 | 1353 | |
@@ -1376,21 +1376,21 @@ discard block |
||
1376 | 1376 | * |
1377 | 1377 | * @return mixed|string |
1378 | 1378 | */ |
1379 | -function give_get_reset_password_url( $user_id ) { |
|
1379 | +function give_get_reset_password_url($user_id) { |
|
1380 | 1380 | $reset_password_url = ''; |
1381 | 1381 | |
1382 | 1382 | // Proceed further only, if user_id exists. |
1383 | - if ( $user_id ) { |
|
1383 | + if ($user_id) { |
|
1384 | 1384 | |
1385 | 1385 | // Get User Object Details. |
1386 | - $user = get_user_by( 'ID', $user_id ); |
|
1386 | + $user = get_user_by('ID', $user_id); |
|
1387 | 1387 | |
1388 | 1388 | // Prepare Reset Password URL. |
1389 | - $reset_password_url = esc_url( add_query_arg( array( |
|
1389 | + $reset_password_url = esc_url(add_query_arg(array( |
|
1390 | 1390 | 'action' => 'rp', |
1391 | - 'key' => get_password_reset_key( $user ), |
|
1391 | + 'key' => get_password_reset_key($user), |
|
1392 | 1392 | 'login' => $user->user_login, |
1393 | - ), wp_login_url() ) ); |
|
1393 | + ), wp_login_url())); |
|
1394 | 1394 | } |
1395 | 1395 | |
1396 | 1396 | return $reset_password_url; |
@@ -1409,94 +1409,94 @@ discard block |
||
1409 | 1409 | * |
1410 | 1410 | * @return mixed |
1411 | 1411 | */ |
1412 | -function __give_render_metadata_email_tag( $content, $tag_args ) { |
|
1413 | - preg_match_all( "/{meta_([A-z0-9\-\_\ ]+)}/s", $content, $matches ); |
|
1412 | +function __give_render_metadata_email_tag($content, $tag_args) { |
|
1413 | + preg_match_all("/{meta_([A-z0-9\-\_\ ]+)}/s", $content, $matches); |
|
1414 | 1414 | |
1415 | - if ( ! empty( $matches[0] ) ) { |
|
1415 | + if ( ! empty($matches[0])) { |
|
1416 | 1416 | $search = $replace = array(); |
1417 | - foreach ( $matches[0] as $index => $meta_tag ) { |
|
1418 | - if ( in_array( $meta_tag, $search ) ) { |
|
1417 | + foreach ($matches[0] as $index => $meta_tag) { |
|
1418 | + if (in_array($meta_tag, $search)) { |
|
1419 | 1419 | continue; |
1420 | 1420 | } |
1421 | 1421 | |
1422 | 1422 | $search[] = $meta_tag; |
1423 | 1423 | |
1424 | - $meta_tag = str_replace( array( '{', 'meta_', '}' ), '', $meta_tag ); |
|
1425 | - $meta_tag_arr = array_map( 'trim', explode( ' ', $meta_tag, 2 ) ); |
|
1426 | - $meta_tag = current( $meta_tag_arr ); |
|
1424 | + $meta_tag = str_replace(array('{', 'meta_', '}'), '', $meta_tag); |
|
1425 | + $meta_tag_arr = array_map('trim', explode(' ', $meta_tag, 2)); |
|
1426 | + $meta_tag = current($meta_tag_arr); |
|
1427 | 1427 | |
1428 | - $meta_tag = str_replace( array( '{', 'meta_', '}' ), '', $meta_tag ); |
|
1429 | - $type = current( explode( '_', $meta_tag, 2 ) ); |
|
1430 | - $meta_name = preg_replace( "/^{$type}_/", '', $meta_tag ); |
|
1428 | + $meta_tag = str_replace(array('{', 'meta_', '}'), '', $meta_tag); |
|
1429 | + $type = current(explode('_', $meta_tag, 2)); |
|
1430 | + $meta_name = preg_replace("/^{$type}_/", '', $meta_tag); |
|
1431 | 1431 | |
1432 | - switch ( $type ) { |
|
1432 | + switch ($type) { |
|
1433 | 1433 | case 'donation': |
1434 | 1434 | |
1435 | 1435 | //Bailout. |
1436 | - if ( ! isset( $tag_args['payment_id'] ) ) { |
|
1436 | + if ( ! isset($tag_args['payment_id'])) { |
|
1437 | 1437 | $replace[] = ''; |
1438 | 1438 | continue; |
1439 | 1439 | } |
1440 | 1440 | |
1441 | - $meta_data = give_get_meta( absint( $tag_args['payment_id'] ), $meta_name, true, '' ); |
|
1441 | + $meta_data = give_get_meta(absint($tag_args['payment_id']), $meta_name, true, ''); |
|
1442 | 1442 | |
1443 | - if ( ! isset( $meta_tag_arr[1] ) || ! is_array( $meta_data ) ) { |
|
1443 | + if ( ! isset($meta_tag_arr[1]) || ! is_array($meta_data)) { |
|
1444 | 1444 | $replace[] = $meta_data; |
1445 | - } elseif ( in_array( $meta_tag_arr[1], array_keys( $meta_data ) ) ) { |
|
1446 | - $replace[] = $meta_data[ $meta_tag_arr[1] ]; |
|
1445 | + } elseif (in_array($meta_tag_arr[1], array_keys($meta_data))) { |
|
1446 | + $replace[] = $meta_data[$meta_tag_arr[1]]; |
|
1447 | 1447 | } |
1448 | 1448 | |
1449 | 1449 | break; |
1450 | 1450 | |
1451 | 1451 | case 'form': |
1452 | - $form_id = isset( $tag_args['form_id'] ) ? absint( $tag_args['form_id'] ) : 0; |
|
1452 | + $form_id = isset($tag_args['form_id']) ? absint($tag_args['form_id']) : 0; |
|
1453 | 1453 | |
1454 | 1454 | // Bailout. |
1455 | - if ( ! $form_id && isset( $tag_args['payment_id'] ) ) { |
|
1456 | - $form_id = give_get_payment_form_id( $tag_args['payment_id'] ); |
|
1455 | + if ( ! $form_id && isset($tag_args['payment_id'])) { |
|
1456 | + $form_id = give_get_payment_form_id($tag_args['payment_id']); |
|
1457 | 1457 | } |
1458 | 1458 | |
1459 | - $meta_data = give_get_meta( $form_id, $meta_name, true, '' ); |
|
1460 | - if ( ! isset( $meta_tag_arr[1] ) || ! is_array( $meta_data ) ) { |
|
1459 | + $meta_data = give_get_meta($form_id, $meta_name, true, ''); |
|
1460 | + if ( ! isset($meta_tag_arr[1]) || ! is_array($meta_data)) { |
|
1461 | 1461 | $replace[] = $meta_data; |
1462 | - } elseif ( in_array( $meta_tag_arr[1], array_keys( $meta_data ) ) ) { |
|
1463 | - $replace[] = $meta_data[ $meta_tag_arr[1] ]; |
|
1462 | + } elseif (in_array($meta_tag_arr[1], array_keys($meta_data))) { |
|
1463 | + $replace[] = $meta_data[$meta_tag_arr[1]]; |
|
1464 | 1464 | } |
1465 | 1465 | break; |
1466 | 1466 | |
1467 | 1467 | case 'donor': |
1468 | - $donor_id = isset( $tag_args['donor_id'] ) ? absint( $tag_args['donor_id'] ) : 0; |
|
1468 | + $donor_id = isset($tag_args['donor_id']) ? absint($tag_args['donor_id']) : 0; |
|
1469 | 1469 | |
1470 | 1470 | // Bailout. |
1471 | - if ( ! $donor_id ) { |
|
1472 | - if ( isset( $tag_args['payment_id'] ) ) { |
|
1473 | - $donor_id = give_get_payment_donor_id( $tag_args['payment_id'] ); |
|
1474 | - } elseif ( isset( $tag_args['user_id'] ) ) { |
|
1475 | - $donor_id = Give()->donors->get_column_by( 'id', 'user_id', $tag_args['user_id'] ); |
|
1471 | + if ( ! $donor_id) { |
|
1472 | + if (isset($tag_args['payment_id'])) { |
|
1473 | + $donor_id = give_get_payment_donor_id($tag_args['payment_id']); |
|
1474 | + } elseif (isset($tag_args['user_id'])) { |
|
1475 | + $donor_id = Give()->donors->get_column_by('id', 'user_id', $tag_args['user_id']); |
|
1476 | 1476 | } |
1477 | 1477 | } |
1478 | 1478 | |
1479 | - $meta_data = Give()->donor_meta->get_meta( $donor_id, $meta_name, true ); |
|
1479 | + $meta_data = Give()->donor_meta->get_meta($donor_id, $meta_name, true); |
|
1480 | 1480 | |
1481 | - if( empty( $meta_data ) && in_array( $meta_name, array_keys( Give()->donors->get_columns() ) ) ) { |
|
1482 | - $meta_data = Give()->donors->get_column_by( $meta_name, 'id', $donor_id ); |
|
1481 | + if (empty($meta_data) && in_array($meta_name, array_keys(Give()->donors->get_columns()))) { |
|
1482 | + $meta_data = Give()->donors->get_column_by($meta_name, 'id', $donor_id); |
|
1483 | 1483 | } |
1484 | 1484 | |
1485 | - if ( ! isset( $meta_tag_arr[1] ) || ! is_array( $meta_data ) ) { |
|
1485 | + if ( ! isset($meta_tag_arr[1]) || ! is_array($meta_data)) { |
|
1486 | 1486 | $replace[] = $meta_data; |
1487 | - } elseif ( in_array( $meta_tag_arr[1], array_keys( $meta_data ) ) ) { |
|
1488 | - $replace[] = $meta_data[ $meta_tag_arr[1] ]; |
|
1487 | + } elseif (in_array($meta_tag_arr[1], array_keys($meta_data))) { |
|
1488 | + $replace[] = $meta_data[$meta_tag_arr[1]]; |
|
1489 | 1489 | } |
1490 | 1490 | |
1491 | 1491 | break; |
1492 | 1492 | |
1493 | 1493 | default: |
1494 | - $replace[] = end( $search ); |
|
1494 | + $replace[] = end($search); |
|
1495 | 1495 | } |
1496 | 1496 | } |
1497 | 1497 | |
1498 | - if ( ! empty( $search ) && ! empty( $replace ) ) { |
|
1499 | - $content = str_replace( $search, $replace, $content ); |
|
1498 | + if ( ! empty($search) && ! empty($replace)) { |
|
1499 | + $content = str_replace($search, $replace, $content); |
|
1500 | 1500 | } |
1501 | 1501 | } |
1502 | 1502 | |
@@ -1504,4 +1504,4 @@ discard block |
||
1504 | 1504 | return $content; |
1505 | 1505 | } |
1506 | 1506 | |
1507 | -add_filter( 'give_email_template_tags', '__give_render_metadata_email_tag', 10, 2 ); |
|
1507 | +add_filter('give_email_template_tags', '__give_render_metadata_email_tag', 10, 2); |
@@ -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,14 +26,14 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @return void |
28 | 28 | */ |
29 | -function give_email_donation_receipt( $payment_id, $admin_notice = true ) { |
|
29 | +function give_email_donation_receipt($payment_id, $admin_notice = true) { |
|
30 | 30 | /** |
31 | 31 | * Fire the action |
32 | 32 | */ |
33 | - do_action( 'give_donation-receipt_email_notification', $payment_id ); |
|
33 | + do_action('give_donation-receipt_email_notification', $payment_id); |
|
34 | 34 | |
35 | 35 | // If admin notifications are on, send the admin notice. |
36 | - if ( $admin_notice && give_is_setting_enabled( Give_Email_Notification::get_instance('new-donation' )->get_notification_status() ) ) { |
|
36 | + if ($admin_notice && give_is_setting_enabled(Give_Email_Notification::get_instance('new-donation')->get_notification_status())) { |
|
37 | 37 | /** |
38 | 38 | * Fires in the donation email receipt. |
39 | 39 | * |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param int $payment_id Payment id. |
45 | 45 | * @param mixed $payment_data Payment meta data. |
46 | 46 | */ |
47 | - do_action( 'give_new-donation_email_notification', $payment_id, give_get_payment_meta( $payment_id ) ); |
|
47 | + do_action('give_new-donation_email_notification', $payment_id, give_get_payment_meta($payment_id)); |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @return void |
59 | 59 | */ |
60 | -function give_admin_email_notice( $payment_id ) { |
|
60 | +function give_admin_email_notice($payment_id) { |
|
61 | 61 | /** |
62 | 62 | * Fires in the donation email receipt. |
63 | 63 | * |
@@ -68,10 +68,10 @@ discard block |
||
68 | 68 | * @param int $payment_id Payment id. |
69 | 69 | * @param mixed $payment_data Payment meta data. |
70 | 70 | */ |
71 | - do_action( 'give_new-donation_email_notification', $payment_id ); |
|
71 | + do_action('give_new-donation_email_notification', $payment_id); |
|
72 | 72 | } |
73 | 73 | |
74 | -add_action( 'give_admin_donation_email', 'give_admin_email_notice' ); |
|
74 | +add_action('give_admin_donation_email', 'give_admin_email_notice'); |
|
75 | 75 | |
76 | 76 | |
77 | 77 | /** |
@@ -84,16 +84,16 @@ discard block |
||
84 | 84 | */ |
85 | 85 | function give_get_default_donation_notification_email() { |
86 | 86 | |
87 | - $default_email_body = __( 'Hi there,', 'give' ) . "\n\n"; |
|
88 | - $default_email_body .= __( 'This email is to inform you that a new donation has been made on your website:', 'give' ) . ' <a href="' . get_bloginfo( 'url' ) . '" target="_blank">' . get_bloginfo( 'url' ) . '</a>' . ".\n\n"; |
|
89 | - $default_email_body .= '<strong>' . __( 'Donor:', 'give' ) . '</strong> {name}' . "\n"; |
|
90 | - $default_email_body .= '<strong>' . __( 'Donation:', 'give' ) . '</strong> {donation}' . "\n"; |
|
91 | - $default_email_body .= '<strong>' . __( 'Amount:', 'give' ) . '</strong> {amount}' . "\n"; |
|
92 | - $default_email_body .= '<strong>' . __( 'Payment Method:', 'give' ) . '</strong> {payment_method}' . "\n\n"; |
|
93 | - $default_email_body .= __( 'Thank you,', 'give' ) . "\n\n"; |
|
94 | - $default_email_body .= '{sitename}' . "\n"; |
|
87 | + $default_email_body = __('Hi there,', 'give')."\n\n"; |
|
88 | + $default_email_body .= __('This email is to inform you that a new donation has been made on your website:', 'give').' <a href="'.get_bloginfo('url').'" target="_blank">'.get_bloginfo('url').'</a>'.".\n\n"; |
|
89 | + $default_email_body .= '<strong>'.__('Donor:', 'give').'</strong> {name}'."\n"; |
|
90 | + $default_email_body .= '<strong>'.__('Donation:', 'give').'</strong> {donation}'."\n"; |
|
91 | + $default_email_body .= '<strong>'.__('Amount:', 'give').'</strong> {amount}'."\n"; |
|
92 | + $default_email_body .= '<strong>'.__('Payment Method:', 'give').'</strong> {payment_method}'."\n\n"; |
|
93 | + $default_email_body .= __('Thank you,', 'give')."\n\n"; |
|
94 | + $default_email_body .= '{sitename}'."\n"; |
|
95 | 95 | |
96 | - return apply_filters( 'give_default_donation_notification_email', $default_email_body ); |
|
96 | + return apply_filters('give_default_donation_notification_email', $default_email_body); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | |
@@ -107,21 +107,21 @@ discard block |
||
107 | 107 | */ |
108 | 108 | function give_get_default_donation_receipt_email() { |
109 | 109 | |
110 | - $default_email_body = __( 'Dear', 'give' ) . " {name},\n\n"; |
|
111 | - $default_email_body .= __( 'Thank you for your donation. Your generosity is appreciated! Here are the details of your donation:', 'give' ) . "\n\n"; |
|
112 | - $default_email_body .= '<strong>' . __( 'Donor:', 'give' ) . '</strong> {fullname}' . "\n"; |
|
113 | - $default_email_body .= '<strong>' . __( 'Donation:', 'give' ) . '</strong> {donation}' . "\n"; |
|
114 | - $default_email_body .= '<strong>' . __( 'Donation Date:', 'give' ) . '</strong> {date}' . "\n"; |
|
115 | - $default_email_body .= '<strong>' . __( 'Amount:', 'give' ) . '</strong> {amount}' . "\n"; |
|
116 | - $default_email_body .= '<strong>' . __( 'Payment Method:', 'give' ) . '</strong> {payment_method}' . "\n"; |
|
117 | - $default_email_body .= '<strong>' . __( 'Payment ID:', 'give' ) . '</strong> {payment_id}' . "\n"; |
|
118 | - $default_email_body .= '<strong>' . __( 'Receipt ID:', 'give' ) . '</strong> {receipt_id}' . "\n\n"; |
|
119 | - $default_email_body .= '{receipt_link}' . "\n\n"; |
|
110 | + $default_email_body = __('Dear', 'give')." {name},\n\n"; |
|
111 | + $default_email_body .= __('Thank you for your donation. Your generosity is appreciated! Here are the details of your donation:', 'give')."\n\n"; |
|
112 | + $default_email_body .= '<strong>'.__('Donor:', 'give').'</strong> {fullname}'."\n"; |
|
113 | + $default_email_body .= '<strong>'.__('Donation:', 'give').'</strong> {donation}'."\n"; |
|
114 | + $default_email_body .= '<strong>'.__('Donation Date:', 'give').'</strong> {date}'."\n"; |
|
115 | + $default_email_body .= '<strong>'.__('Amount:', 'give').'</strong> {amount}'."\n"; |
|
116 | + $default_email_body .= '<strong>'.__('Payment Method:', 'give').'</strong> {payment_method}'."\n"; |
|
117 | + $default_email_body .= '<strong>'.__('Payment ID:', 'give').'</strong> {payment_id}'."\n"; |
|
118 | + $default_email_body .= '<strong>'.__('Receipt ID:', 'give').'</strong> {receipt_id}'."\n\n"; |
|
119 | + $default_email_body .= '{receipt_link}'."\n\n"; |
|
120 | 120 | $default_email_body .= "\n\n"; |
121 | - $default_email_body .= __( 'Sincerely,', 'give' ) . "\n"; |
|
122 | - $default_email_body .= '{sitename}' . "\n"; |
|
121 | + $default_email_body .= __('Sincerely,', 'give')."\n"; |
|
122 | + $default_email_body .= '{sitename}'."\n"; |
|
123 | 123 | |
124 | - return apply_filters( 'give_default_donation_receipt_email', $default_email_body ); |
|
124 | + return apply_filters('give_default_donation_receipt_email', $default_email_body); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -134,22 +134,22 @@ discard block |
||
134 | 134 | * |
135 | 135 | * @return array $email_names |
136 | 136 | */ |
137 | -function give_get_email_names( $user_info, $payment = false ) { |
|
137 | +function give_get_email_names($user_info, $payment = false) { |
|
138 | 138 | $email_names = array(); |
139 | 139 | |
140 | - if ( is_a( $payment, 'Give_Payment' ) ) { |
|
140 | + if (is_a($payment, 'Give_Payment')) { |
|
141 | 141 | |
142 | - if ( $payment->user_id > 0 ) { |
|
142 | + if ($payment->user_id > 0) { |
|
143 | 143 | |
144 | - $user_data = get_userdata( $payment->user_id ); |
|
144 | + $user_data = get_userdata($payment->user_id); |
|
145 | 145 | $email_names['name'] = $payment->first_name; |
146 | - $email_names['fullname'] = trim( $payment->first_name . ' ' . $payment->last_name ); |
|
146 | + $email_names['fullname'] = trim($payment->first_name.' '.$payment->last_name); |
|
147 | 147 | $email_names['username'] = $user_data->user_login; |
148 | 148 | |
149 | - } elseif ( ! empty( $payment->first_name ) ) { |
|
149 | + } elseif ( ! empty($payment->first_name)) { |
|
150 | 150 | |
151 | 151 | $email_names['name'] = $payment->first_name; |
152 | - $email_names['fullname'] = trim( $payment->first_name . ' ' . $payment->last_name ); |
|
152 | + $email_names['fullname'] = trim($payment->first_name.' '.$payment->last_name); |
|
153 | 153 | $email_names['username'] = $payment->first_name; |
154 | 154 | |
155 | 155 | } else { |
@@ -162,30 +162,30 @@ discard block |
||
162 | 162 | } else { |
163 | 163 | |
164 | 164 | // Support for old serialized data. |
165 | - if ( is_serialized( $user_info ) ) { |
|
165 | + if (is_serialized($user_info)) { |
|
166 | 166 | |
167 | 167 | // Security check. |
168 | - preg_match( '/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $user_info, $matches ); |
|
169 | - if ( ! empty( $matches ) ) { |
|
168 | + preg_match('/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $user_info, $matches); |
|
169 | + if ( ! empty($matches)) { |
|
170 | 170 | return array( |
171 | 171 | 'name' => '', |
172 | 172 | 'fullname' => '', |
173 | 173 | 'username' => '', |
174 | 174 | ); |
175 | 175 | } else { |
176 | - $user_info = maybe_unserialize( $user_info ); |
|
176 | + $user_info = maybe_unserialize($user_info); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | } |
180 | 180 | |
181 | - if ( isset( $user_info['id'] ) && $user_info['id'] > 0 && isset( $user_info['first_name'] ) ) { |
|
182 | - $user_data = get_userdata( $user_info['id'] ); |
|
181 | + if (isset($user_info['id']) && $user_info['id'] > 0 && isset($user_info['first_name'])) { |
|
182 | + $user_data = get_userdata($user_info['id']); |
|
183 | 183 | $email_names['name'] = $user_info['first_name']; |
184 | - $email_names['fullname'] = $user_info['first_name'] . ' ' . $user_info['last_name']; |
|
184 | + $email_names['fullname'] = $user_info['first_name'].' '.$user_info['last_name']; |
|
185 | 185 | $email_names['username'] = $user_data->user_login; |
186 | - } elseif ( isset( $user_info['first_name'] ) ) { |
|
186 | + } elseif (isset($user_info['first_name'])) { |
|
187 | 187 | $email_names['name'] = $user_info['first_name']; |
188 | - $email_names['fullname'] = $user_info['first_name'] . ' ' . $user_info['last_name']; |
|
188 | + $email_names['fullname'] = $user_info['first_name'].' '.$user_info['last_name']; |
|
189 | 189 | $email_names['username'] = $user_info['first_name']; |
190 | 190 | } else { |
191 | 191 | $email_names['name'] = $user_info['email']; |
@@ -205,37 +205,37 @@ discard block |
||
205 | 205 | * |
206 | 206 | * @since 1.8.14 |
207 | 207 | */ |
208 | -function give_admin_email_user_donor_disconnection( $user_id, $donor_id ) { |
|
208 | +function give_admin_email_user_donor_disconnection($user_id, $donor_id) { |
|
209 | 209 | |
210 | - $user_id = absint( $user_id ); |
|
211 | - $donor_id = absint( $donor_id ); |
|
210 | + $user_id = absint($user_id); |
|
211 | + $donor_id = absint($donor_id); |
|
212 | 212 | |
213 | 213 | // Bail Out, if user id doesn't exists. |
214 | - if ( empty( $user_id ) ) { |
|
214 | + if (empty($user_id)) { |
|
215 | 215 | return; |
216 | 216 | } |
217 | 217 | |
218 | 218 | // Bail Out, if donor id doesn't exists. |
219 | - if ( empty( $donor_id ) ) { |
|
219 | + if (empty($donor_id)) { |
|
220 | 220 | return; |
221 | 221 | } |
222 | 222 | |
223 | - $from_name = give_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) ); |
|
223 | + $from_name = give_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES)); |
|
224 | 224 | |
225 | - $from_email = give_get_option( 'from_email', get_bloginfo( 'admin_email' ) ); |
|
225 | + $from_email = give_get_option('from_email', get_bloginfo('admin_email')); |
|
226 | 226 | |
227 | 227 | /* translators: %s: payment id */ |
228 | - $subject = __( 'Attention: User tries to login whose Donor profile is disconnected!', 'give' ); |
|
228 | + $subject = __('Attention: User tries to login whose Donor profile is disconnected!', 'give'); |
|
229 | 229 | |
230 | 230 | /** |
231 | 231 | * Filters the Donor-User Disconnection notification subject. |
232 | 232 | * |
233 | 233 | * @since 1.8.14 |
234 | 234 | */ |
235 | - $subject = apply_filters( 'give_admin_donor_user_disconnection_notification_subject', wp_strip_all_tags( $subject ) ); |
|
235 | + $subject = apply_filters('give_admin_donor_user_disconnection_notification_subject', wp_strip_all_tags($subject)); |
|
236 | 236 | |
237 | - $headers = "From: " . stripslashes_deep( html_entity_decode( $from_name, ENT_COMPAT, 'UTF-8' ) ) . " <$from_email>\r\n"; |
|
238 | - $headers .= "Reply-To: " . $from_email . "\r\n"; |
|
237 | + $headers = "From: ".stripslashes_deep(html_entity_decode($from_name, ENT_COMPAT, 'UTF-8'))." <$from_email>\r\n"; |
|
238 | + $headers .= "Reply-To: ".$from_email."\r\n"; |
|
239 | 239 | $headers .= "Content-Type: text/html; charset=utf-8\r\n"; |
240 | 240 | |
241 | 241 | /** |
@@ -243,25 +243,25 @@ discard block |
||
243 | 243 | * |
244 | 244 | * @since 1.8.14 |
245 | 245 | */ |
246 | - $headers = apply_filters( 'give_admin_donor_user_disconnection_notification_headers', $headers ); |
|
246 | + $headers = apply_filters('give_admin_donor_user_disconnection_notification_headers', $headers); |
|
247 | 247 | |
248 | - $message = __( 'Hi Admin,', 'give' ) . "\n\n"; |
|
249 | - $message .= __( 'This email is to inform you that a user has tried logging in. But, User was unable to login due to User-Donor profile disconnection.', 'give' ) . "\n\n"; |
|
250 | - $message .= __( 'Do you want to reconnect User and Donor profile again?', 'give' ) . "\n\n"; |
|
248 | + $message = __('Hi Admin,', 'give')."\n\n"; |
|
249 | + $message .= __('This email is to inform you that a user has tried logging in. But, User was unable to login due to User-Donor profile disconnection.', 'give')."\n\n"; |
|
250 | + $message .= __('Do you want to reconnect User and Donor profile again?', 'give')."\n\n"; |
|
251 | 251 | $message .= sprintf( |
252 | 252 | '<a href="%1$s">%2$s</a>', |
253 | - esc_url( admin_url() . 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor_id . '&user_id=' . $user_id . '&give-message=reconnect-user' ), |
|
254 | - __( 'Reconnect User', 'give' ) . "\n\n" |
|
253 | + esc_url(admin_url().'edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor_id.'&user_id='.$user_id.'&give-message=reconnect-user'), |
|
254 | + __('Reconnect User', 'give')."\n\n" |
|
255 | 255 | ); |
256 | - $message .= __( 'Thank you,', 'give' ) . "\n\n"; |
|
257 | - $message .= '{sitename}' . "\n"; |
|
256 | + $message .= __('Thank you,', 'give')."\n\n"; |
|
257 | + $message .= '{sitename}'."\n"; |
|
258 | 258 | |
259 | 259 | $emails = Give()->emails; |
260 | - $emails->__set( 'from_name', $from_name ); |
|
261 | - $emails->__set( 'from_email', $from_email ); |
|
262 | - $emails->__set( 'headers', $headers ); |
|
263 | - $emails->__set( 'heading', __( 'User - Donor Profile Disconnection', 'give' ) ); |
|
260 | + $emails->__set('from_name', $from_name); |
|
261 | + $emails->__set('from_email', $from_email); |
|
262 | + $emails->__set('headers', $headers); |
|
263 | + $emails->__set('heading', __('User - Donor Profile Disconnection', 'give')); |
|
264 | 264 | |
265 | - $emails->send( give_get_admin_notice_emails(), $subject, give_do_email_tags( $message ) ); |
|
265 | + $emails->send(give_get_admin_notice_emails(), $subject, give_do_email_tags($message)); |
|
266 | 266 | |
267 | 267 | } |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_Advanced' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Advanced')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Advanced. |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | 29 | $this->id = 'advanced'; |
30 | - $this->label = __( 'Advanced', 'give' ); |
|
30 | + $this->label = __('Advanced', 'give'); |
|
31 | 31 | |
32 | 32 | $this->default_tab = 'advanced-options'; |
33 | 33 | |
34 | - if ( $this->id === give_get_current_setting_tab() ) { |
|
35 | - add_action( 'give_admin_field_remove_cache_button', array( $this, 'render_remove_cache_button' ), 10, 1 ); |
|
34 | + if ($this->id === give_get_current_setting_tab()) { |
|
35 | + add_action('give_admin_field_remove_cache_button', array($this, 'render_remove_cache_button'), 10, 1); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | parent::__construct(); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | $current_section = give_get_current_setting_section(); |
51 | 51 | |
52 | - switch ( $current_section ) { |
|
52 | + switch ($current_section) { |
|
53 | 53 | case 'advanced-options': |
54 | 54 | $settings = array( |
55 | 55 | array( |
@@ -57,19 +57,19 @@ discard block |
||
57 | 57 | 'type' => 'title', |
58 | 58 | ), |
59 | 59 | array( |
60 | - 'name' => __( 'Remove Data on Uninstall', 'give' ), |
|
61 | - 'desc' => __( 'When the plugin is deleted, completely remove all Give data. This includes all Give settings, forms, form meta, donor, donor data, donations. Everything.', 'give' ), |
|
60 | + 'name' => __('Remove Data on Uninstall', 'give'), |
|
61 | + 'desc' => __('When the plugin is deleted, completely remove all Give data. This includes all Give settings, forms, form meta, donor, donor data, donations. Everything.', 'give'), |
|
62 | 62 | 'id' => 'uninstall_on_delete', |
63 | 63 | 'type' => 'radio_inline', |
64 | 64 | 'default' => 'disabled', |
65 | 65 | 'options' => array( |
66 | - 'enabled' => __( 'Yes, Remove all data', 'give' ), |
|
67 | - 'disabled' => __( 'No, keep my Give settings and donation data', 'give' ), |
|
66 | + 'enabled' => __('Yes, Remove all data', 'give'), |
|
67 | + 'disabled' => __('No, keep my Give settings and donation data', 'give'), |
|
68 | 68 | ), |
69 | 69 | ), |
70 | 70 | array( |
71 | - 'name' => __( 'Default User Role', 'give' ), |
|
72 | - 'desc' => __( 'Assign default user roles for donors when donors opt to register as a WP User.', 'give' ), |
|
71 | + 'name' => __('Default User Role', 'give'), |
|
72 | + 'desc' => __('Assign default user roles for donors when donors opt to register as a WP User.', 'give'), |
|
73 | 73 | 'id' => 'donor_default_user_role', |
74 | 74 | 'type' => 'select', |
75 | 75 | 'default' => 'give_donor', |
@@ -77,51 +77,51 @@ discard block |
||
77 | 77 | ), |
78 | 78 | array( |
79 | 79 | /* translators: %s: the_content */ |
80 | - 'name' => sprintf( __( '%s filter', 'give' ), '<code>the_content</code>' ), |
|
80 | + 'name' => sprintf(__('%s filter', 'give'), '<code>the_content</code>'), |
|
81 | 81 | /* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */ |
82 | - 'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ), |
|
82 | + 'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'), |
|
83 | 83 | 'id' => 'the_content_filter', |
84 | 84 | 'default' => 'enabled', |
85 | 85 | 'type' => 'radio_inline', |
86 | 86 | 'options' => array( |
87 | - 'enabled' => __( 'Enabled', 'give' ), |
|
88 | - 'disabled' => __( 'Disabled', 'give' ), |
|
87 | + 'enabled' => __('Enabled', 'give'), |
|
88 | + 'disabled' => __('Disabled', 'give'), |
|
89 | 89 | ), |
90 | 90 | ), |
91 | 91 | array( |
92 | - 'name' => __( 'Script Loading Location', 'give' ), |
|
93 | - 'desc' => __( 'This allows you to load your Give scripts either in the <code><head></code> or footer of your website.', 'give' ), |
|
92 | + 'name' => __('Script Loading Location', 'give'), |
|
93 | + 'desc' => __('This allows you to load your Give scripts either in the <code><head></code> or footer of your website.', 'give'), |
|
94 | 94 | 'id' => 'scripts_footer', |
95 | 95 | 'type' => 'radio_inline', |
96 | 96 | 'default' => 'disabled', |
97 | 97 | 'options' => array( |
98 | - 'disabled' => __( 'Head', 'give' ), |
|
99 | - 'enabled' => __( 'Footer', 'give' ), |
|
98 | + 'disabled' => __('Head', 'give'), |
|
99 | + 'enabled' => __('Footer', 'give'), |
|
100 | 100 | ), |
101 | 101 | ), |
102 | 102 | array( |
103 | - 'name' => __( 'Akismet SPAM Protection', 'give' ), |
|
104 | - 'desc' => __( 'Add a layer of SPAM protection to your donation submissions with Akismet. When enabled, donation submissions will be first sent to Akismet\'s API if you have the plugin activated and configured.', 'give' ), |
|
103 | + 'name' => __('Akismet SPAM Protection', 'give'), |
|
104 | + 'desc' => __('Add a layer of SPAM protection to your donation submissions with Akismet. When enabled, donation submissions will be first sent to Akismet\'s API if you have the plugin activated and configured.', 'give'), |
|
105 | 105 | 'id' => 'akismet_spam_protection', |
106 | 106 | 'type' => 'radio_inline', |
107 | - 'default' => ( give_check_akismet_key() ) ? 'enabled' : 'disabled', |
|
107 | + 'default' => (give_check_akismet_key()) ? 'enabled' : 'disabled', |
|
108 | 108 | 'options' => array( |
109 | - 'enabled' => __( 'Enabled', 'give' ), |
|
110 | - 'disabled' => __( 'Disabled', 'give' ), |
|
109 | + 'enabled' => __('Enabled', 'give'), |
|
110 | + 'disabled' => __('Disabled', 'give'), |
|
111 | 111 | ), |
112 | 112 | ), |
113 | 113 | array( |
114 | 114 | 'name' => 'Give Cache', |
115 | 115 | 'id' => 'give-clear-cache', |
116 | - 'buttonTitle' => __( 'Clear Cache', 'give' ), |
|
117 | - 'desc' => __( 'Click this button if you want to clear Give\'s cache. The plugin stores common settings and queries in cache to optimize performance. Clearing cache will remove and begin rebuilding these saved queries.', 'give' ), |
|
116 | + 'buttonTitle' => __('Clear Cache', 'give'), |
|
117 | + 'desc' => __('Click this button if you want to clear Give\'s cache. The plugin stores common settings and queries in cache to optimize performance. Clearing cache will remove and begin rebuilding these saved queries.', 'give'), |
|
118 | 118 | 'type' => 'remove_cache_button' |
119 | 119 | ), |
120 | 120 | array( |
121 | - 'name' => __( 'Advanced Settings Docs Link', 'give' ), |
|
121 | + 'name' => __('Advanced Settings Docs Link', 'give'), |
|
122 | 122 | 'id' => 'advanced_settings_docs_link', |
123 | - 'url' => esc_url( 'http://docs.givewp.com/settings-advanced' ), |
|
124 | - 'title' => __( 'Advanced Settings', 'give' ), |
|
123 | + 'url' => esc_url('http://docs.givewp.com/settings-advanced'), |
|
124 | + 'title' => __('Advanced Settings', 'give'), |
|
125 | 125 | 'type' => 'give_docs_link', |
126 | 126 | ), |
127 | 127 | array( |
@@ -137,20 +137,20 @@ discard block |
||
137 | 137 | * |
138 | 138 | * @since 2.0 |
139 | 139 | */ |
140 | - if ( apply_filters( 'give_settings_advanced_show_cache_setting', false ) ) { |
|
141 | - array_splice( $settings, 1, 0, array( |
|
140 | + if (apply_filters('give_settings_advanced_show_cache_setting', false)) { |
|
141 | + array_splice($settings, 1, 0, array( |
|
142 | 142 | array( |
143 | - 'name' => __( 'Cache', 'give' ), |
|
144 | - 'desc' => __( 'If caching is enabled the plugin will start caching custom post type related queries and reduce the overall load time.', 'give' ), |
|
143 | + 'name' => __('Cache', 'give'), |
|
144 | + 'desc' => __('If caching is enabled the plugin will start caching custom post type related queries and reduce the overall load time.', 'give'), |
|
145 | 145 | 'id' => 'cache', |
146 | 146 | 'type' => 'radio_inline', |
147 | 147 | 'default' => 'enabled', |
148 | 148 | 'options' => array( |
149 | - 'enabled' => __( 'Enabled', 'give' ), |
|
150 | - 'disabled' => __( 'Disabled', 'give' ), |
|
149 | + 'enabled' => __('Enabled', 'give'), |
|
150 | + 'disabled' => __('Disabled', 'give'), |
|
151 | 151 | ), |
152 | 152 | ) |
153 | - ) ); |
|
153 | + )); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * Filter the advanced settings. |
159 | 159 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
160 | 160 | */ |
161 | - $settings = apply_filters( 'give_settings_advanced', $settings ); |
|
161 | + $settings = apply_filters('give_settings_advanced', $settings); |
|
162 | 162 | |
163 | 163 | /** |
164 | 164 | * Filter the settings. |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * |
168 | 168 | * @param array $settings |
169 | 169 | */ |
170 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
170 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
171 | 171 | |
172 | 172 | // Output. |
173 | 173 | return $settings; |
@@ -181,10 +181,10 @@ discard block |
||
181 | 181 | */ |
182 | 182 | public function get_sections() { |
183 | 183 | $sections = array( |
184 | - 'advanced-options' => __( 'Advanced Options', 'give' ), |
|
184 | + 'advanced-options' => __('Advanced Options', 'give'), |
|
185 | 185 | ); |
186 | 186 | |
187 | - return apply_filters( 'give_get_sections_' . $this->id, $sections ); |
|
187 | + return apply_filters('give_get_sections_'.$this->id, $sections); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | |
@@ -196,17 +196,17 @@ discard block |
||
196 | 196 | * |
197 | 197 | * @param array $field |
198 | 198 | */ |
199 | - public function render_remove_cache_button( $field ) { |
|
199 | + public function render_remove_cache_button($field) { |
|
200 | 200 | ?> |
201 | - <tr valign="top" <?php echo ! empty( $field['wrapper_class'] ) ? 'class="' . $field['wrapper_class'] . '"' : '' ?>> |
|
201 | + <tr valign="top" <?php echo ! empty($field['wrapper_class']) ? 'class="'.$field['wrapper_class'].'"' : '' ?>> |
|
202 | 202 | <th scope="row" class="titledesc"> |
203 | 203 | <label |
204 | - for="<?php echo esc_attr( $field['id'] ); ?>"><?php echo esc_html( $field['name'] ) ?></label> |
|
204 | + for="<?php echo esc_attr($field['id']); ?>"><?php echo esc_html($field['name']) ?></label> |
|
205 | 205 | </th> |
206 | 206 | <td class="give-forminp"> |
207 | - <button type="button" id="<?php echo esc_attr( $field['id'] ); ?>" |
|
208 | - class="button button-secondary"><?php echo esc_html( $field['buttonTitle'] ) ?></button> |
|
209 | - <?php echo Give_Admin_Settings::get_field_description( $field ); ?> |
|
207 | + <button type="button" id="<?php echo esc_attr($field['id']); ?>" |
|
208 | + class="button button-secondary"><?php echo esc_html($field['buttonTitle']) ?></button> |
|
209 | + <?php echo Give_Admin_Settings::get_field_description($field); ?> |
|
210 | 210 | </td> |
211 | 211 | </tr> |
212 | 212 | <?php |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly. |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_General' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_General')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_General. |
@@ -27,14 +27,14 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | 29 | $this->id = 'general'; |
30 | - $this->label = __( 'General', 'give' ); |
|
30 | + $this->label = __('General', 'give'); |
|
31 | 31 | |
32 | 32 | $this->default_tab = 'general-settings'; |
33 | 33 | |
34 | - if ( $this->id === give_get_current_setting_tab() ) { |
|
35 | - add_action( 'give_save_settings_give_settings', array( $this, '__give_change_donation_stating_number' ), 10, 3 ); |
|
36 | - add_action( 'give_admin_field_give_sequential_donation_code_preview', array( $this, '__render_give_sequential_donation_code_preview' ), 10, 3 ); |
|
37 | - add_action( 'give_admin_field_give_unlock_all_settings', array( $this, '__render_give_unlock_all_settings' ), 10, 3 ); |
|
34 | + if ($this->id === give_get_current_setting_tab()) { |
|
35 | + add_action('give_save_settings_give_settings', array($this, '__give_change_donation_stating_number'), 10, 3); |
|
36 | + add_action('give_admin_field_give_sequential_donation_code_preview', array($this, '__render_give_sequential_donation_code_preview'), 10, 3); |
|
37 | + add_action('give_admin_field_give_unlock_all_settings', array($this, '__render_give_unlock_all_settings'), 10, 3); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | parent::__construct(); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $settings = array(); |
51 | 51 | $current_section = give_get_current_setting_section(); |
52 | 52 | |
53 | - switch ( $current_section ) { |
|
53 | + switch ($current_section) { |
|
54 | 54 | case 'access-control': |
55 | 55 | $settings = array( |
56 | 56 | // Section 3: Access control. |
@@ -60,20 +60,20 @@ discard block |
||
60 | 60 | ), |
61 | 61 | array( |
62 | 62 | 'id' => 'session_lifetime', |
63 | - 'name' => __( 'Session Lifetime', 'give' ), |
|
64 | - 'desc' => __( 'The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give' ), |
|
63 | + 'name' => __('Session Lifetime', 'give'), |
|
64 | + 'desc' => __('The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give'), |
|
65 | 65 | 'type' => 'select', |
66 | 66 | 'options' => array( |
67 | - '86400' => __( '24 Hours', 'give' ), |
|
68 | - '172800' => __( '48 Hours', 'give' ), |
|
69 | - '259200' => __( '72 Hours', 'give' ), |
|
70 | - '604800' => __( '1 Week', 'give' ), |
|
67 | + '86400' => __('24 Hours', 'give'), |
|
68 | + '172800' => __('48 Hours', 'give'), |
|
69 | + '259200' => __('72 Hours', 'give'), |
|
70 | + '604800' => __('1 Week', 'give'), |
|
71 | 71 | ), |
72 | 72 | ), |
73 | 73 | array( |
74 | 74 | 'id' => 'limit_display_donations', |
75 | - 'name' => __( 'Limit Donations Displayed', 'give' ), |
|
76 | - 'desc' => __( 'Adjusts the number of donations displayed to a non logged-in user when they attempt to access the Donation History page without an active session. For security reasons, it\'s best to leave this at 1-3 donations.', 'give' ), |
|
75 | + 'name' => __('Limit Donations Displayed', 'give'), |
|
76 | + 'desc' => __('Adjusts the number of donations displayed to a non logged-in user when they attempt to access the Donation History page without an active session. For security reasons, it\'s best to leave this at 1-3 donations.', 'give'), |
|
77 | 77 | 'default' => '1', |
78 | 78 | 'type' => 'number', |
79 | 79 | 'css' => 'width:50px;', |
@@ -83,47 +83,47 @@ discard block |
||
83 | 83 | ), |
84 | 84 | ), |
85 | 85 | array( |
86 | - 'name' => __( 'Email Access', 'give' ), |
|
87 | - 'desc' => __( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ), |
|
86 | + 'name' => __('Email Access', 'give'), |
|
87 | + 'desc' => __('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'), |
|
88 | 88 | 'id' => 'email_access', |
89 | 89 | 'type' => 'radio_inline', |
90 | 90 | 'default' => 'disabled', |
91 | 91 | 'options' => array( |
92 | - 'enabled' => __( 'Enabled', 'give' ), |
|
93 | - 'disabled' => __( 'Disabled', 'give' ), |
|
92 | + 'enabled' => __('Enabled', 'give'), |
|
93 | + 'disabled' => __('Disabled', 'give'), |
|
94 | 94 | ), |
95 | 95 | ), |
96 | 96 | array( |
97 | - 'name' => __( 'Enable reCAPTCHA', 'give' ), |
|
98 | - 'desc' => __( 'Would you like to enable the reCAPTCHA feature?', 'give' ), |
|
97 | + 'name' => __('Enable reCAPTCHA', 'give'), |
|
98 | + 'desc' => __('Would you like to enable the reCAPTCHA feature?', 'give'), |
|
99 | 99 | 'id' => 'enable_recaptcha', |
100 | 100 | 'type' => 'radio_inline', |
101 | 101 | 'default' => 'disabled', |
102 | 102 | 'options' => array( |
103 | - 'enabled' => __( 'Enabled', 'give' ), |
|
104 | - 'disabled' => __( 'Disabled', 'give' ), |
|
103 | + 'enabled' => __('Enabled', 'give'), |
|
104 | + 'disabled' => __('Disabled', 'give'), |
|
105 | 105 | ), |
106 | 106 | ), |
107 | 107 | array( |
108 | 108 | 'id' => 'recaptcha_key', |
109 | - 'name' => __( 'reCAPTCHA Site Key', 'give' ), |
|
109 | + 'name' => __('reCAPTCHA Site Key', 'give'), |
|
110 | 110 | /* translators: %s: https://www.google.com/recaptcha/ */ |
111 | - 'desc' => sprintf( __( 'If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key and paste your reCAPTCHA site key here. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'http://docs.givewp.com/recaptcha' ) ), |
|
111 | + 'desc' => sprintf(__('If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key and paste your reCAPTCHA site key here. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('http://docs.givewp.com/recaptcha')), |
|
112 | 112 | 'default' => '', |
113 | 113 | 'type' => 'text', |
114 | 114 | ), |
115 | 115 | array( |
116 | 116 | 'id' => 'recaptcha_secret', |
117 | - 'name' => __( 'reCAPTCHA Secret Key', 'give' ), |
|
118 | - 'desc' => __( 'Please paste the reCAPTCHA secret key here from your reCAPTCHA API Keys panel.', 'give' ), |
|
117 | + 'name' => __('reCAPTCHA Secret Key', 'give'), |
|
118 | + 'desc' => __('Please paste the reCAPTCHA secret key here from your reCAPTCHA API Keys panel.', 'give'), |
|
119 | 119 | 'default' => '', |
120 | 120 | 'type' => 'text', |
121 | 121 | ), |
122 | 122 | array( |
123 | - 'name' => __( 'Access Control Docs Link', 'give' ), |
|
123 | + 'name' => __('Access Control Docs Link', 'give'), |
|
124 | 124 | 'id' => 'access_control_docs_link', |
125 | - 'url' => esc_url( 'http://docs.givewp.com/settings-access-control' ), |
|
126 | - 'title' => __( 'Access Control', 'give' ), |
|
125 | + 'url' => esc_url('http://docs.givewp.com/settings-access-control'), |
|
126 | + 'title' => __('Access Control', 'give'), |
|
127 | 127 | 'type' => 'give_docs_link', |
128 | 128 | ), |
129 | 129 | array( |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | break; |
135 | 135 | |
136 | 136 | case 'currency-settings' : |
137 | - $currency_position_before = __( 'Before - %s‎10', 'give' ); |
|
138 | - $currency_position_after = __( 'After - 10%s‏', 'give' ); |
|
137 | + $currency_position_before = __('Before - %s‎10', 'give'); |
|
138 | + $currency_position_after = __('After - 10%s‏', 'give'); |
|
139 | 139 | |
140 | 140 | $settings = array( |
141 | 141 | // Section 2: Currency |
@@ -144,14 +144,14 @@ discard block |
||
144 | 144 | 'id' => 'give_title_general_settings_2', |
145 | 145 | ), |
146 | 146 | array( |
147 | - 'name' => __( 'Currency Settings', 'give' ), |
|
147 | + 'name' => __('Currency Settings', 'give'), |
|
148 | 148 | 'desc' => '', |
149 | 149 | 'type' => 'give_title', |
150 | 150 | 'id' => 'give_title_general_settings_2', |
151 | 151 | ), |
152 | 152 | array( |
153 | - 'name' => __( 'Currency', 'give' ), |
|
154 | - 'desc' => __( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ), |
|
153 | + 'name' => __('Currency', 'give'), |
|
154 | + 'desc' => __('The donation currency. Note that some payment gateways have currency restrictions.', 'give'), |
|
155 | 155 | 'id' => 'currency', |
156 | 156 | 'class' => 'give-select-chosen', |
157 | 157 | 'type' => 'select', |
@@ -159,51 +159,51 @@ discard block |
||
159 | 159 | 'default' => 'USD', |
160 | 160 | ), |
161 | 161 | array( |
162 | - 'name' => __( 'Currency Position', 'give' ), |
|
163 | - 'desc' => __( 'The position of the currency symbol.', 'give' ), |
|
162 | + 'name' => __('Currency Position', 'give'), |
|
163 | + 'desc' => __('The position of the currency symbol.', 'give'), |
|
164 | 164 | 'id' => 'currency_position', |
165 | 165 | 'type' => 'select', |
166 | 166 | 'options' => array( |
167 | 167 | /* translators: %s: currency symbol */ |
168 | - 'before' => sprintf( $currency_position_before, give_currency_symbol( give_get_currency() ) ), |
|
168 | + 'before' => sprintf($currency_position_before, give_currency_symbol(give_get_currency())), |
|
169 | 169 | /* translators: %s: currency symbol */ |
170 | - 'after' => sprintf( $currency_position_after, give_currency_symbol( give_get_currency() ) ), |
|
170 | + 'after' => sprintf($currency_position_after, give_currency_symbol(give_get_currency())), |
|
171 | 171 | ), |
172 | 172 | 'default' => 'before', |
173 | 173 | 'attributes' => array( |
174 | - 'data-before-template' => sprintf( $currency_position_before, '{currency_pos}' ), |
|
175 | - 'data-after-template' => sprintf( $currency_position_after, '{currency_pos}' ), |
|
174 | + 'data-before-template' => sprintf($currency_position_before, '{currency_pos}'), |
|
175 | + 'data-after-template' => sprintf($currency_position_after, '{currency_pos}'), |
|
176 | 176 | ), |
177 | 177 | ), |
178 | 178 | array( |
179 | - 'name' => __( 'Thousands Separator', 'give' ), |
|
180 | - 'desc' => __( 'The symbol (typically , or .) to separate thousands.', 'give' ), |
|
179 | + 'name' => __('Thousands Separator', 'give'), |
|
180 | + 'desc' => __('The symbol (typically , or .) to separate thousands.', 'give'), |
|
181 | 181 | 'id' => 'thousands_separator', |
182 | 182 | 'type' => 'text', |
183 | 183 | 'default' => ',', |
184 | 184 | 'css' => 'width:12em;', |
185 | 185 | ), |
186 | 186 | array( |
187 | - 'name' => __( 'Decimal Separator', 'give' ), |
|
188 | - 'desc' => __( 'The symbol (usually , or .) to separate decimal points.', 'give' ), |
|
187 | + 'name' => __('Decimal Separator', 'give'), |
|
188 | + 'desc' => __('The symbol (usually , or .) to separate decimal points.', 'give'), |
|
189 | 189 | 'id' => 'decimal_separator', |
190 | 190 | 'type' => 'text', |
191 | 191 | 'default' => '.', |
192 | 192 | 'css' => 'width:12em;', |
193 | 193 | ), |
194 | 194 | array( |
195 | - 'name' => __( 'Number of Decimals', 'give' ), |
|
196 | - 'desc' => __( 'The number of decimal points displayed in amounts.', 'give' ), |
|
195 | + 'name' => __('Number of Decimals', 'give'), |
|
196 | + 'desc' => __('The number of decimal points displayed in amounts.', 'give'), |
|
197 | 197 | 'id' => 'number_decimals', |
198 | 198 | 'type' => 'text', |
199 | 199 | 'default' => 2, |
200 | 200 | 'css' => 'width:12em;', |
201 | 201 | ), |
202 | 202 | array( |
203 | - 'name' => __( 'Currency Options Docs Link', 'give' ), |
|
203 | + 'name' => __('Currency Options Docs Link', 'give'), |
|
204 | 204 | 'id' => 'currency_settings_docs_link', |
205 | - 'url' => esc_url( 'http://docs.givewp.com/settings-currency' ), |
|
206 | - 'title' => __( 'Currency Settings', 'give' ), |
|
205 | + 'url' => esc_url('http://docs.givewp.com/settings-currency'), |
|
206 | + 'title' => __('Currency Settings', 'give'), |
|
207 | 207 | 'type' => 'give_docs_link', |
208 | 208 | ), |
209 | 209 | array( |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $country = give_get_country(); |
220 | 220 | |
221 | 221 | // get the list of the states of which default country is selected. |
222 | - $states = give_get_states( $country ); |
|
222 | + $states = give_get_states($country); |
|
223 | 223 | |
224 | 224 | // Get the country list that does not have any states init. |
225 | 225 | $no_states_country = give_no_states_country_list(); |
@@ -231,58 +231,58 @@ discard block |
||
231 | 231 | 'id' => 'give_title_general_settings_1', |
232 | 232 | ), |
233 | 233 | array( |
234 | - 'name' => __( 'General Settings', 'give' ), |
|
234 | + 'name' => __('General Settings', 'give'), |
|
235 | 235 | 'desc' => '', |
236 | 236 | 'type' => 'give_title', |
237 | 237 | 'id' => 'give_title_general_settings_1', |
238 | 238 | ), |
239 | 239 | array( |
240 | - 'name' => __( 'Success Page', 'give' ), |
|
240 | + 'name' => __('Success Page', 'give'), |
|
241 | 241 | /* translators: %s: [give_receipt] */ |
242 | - 'desc' => sprintf( __( 'The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give' ), '<code>[give_receipt]</code>' ), |
|
242 | + 'desc' => sprintf(__('The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give'), '<code>[give_receipt]</code>'), |
|
243 | 243 | 'id' => 'success_page', |
244 | 244 | 'class' => 'give-select give-select-chosen', |
245 | 245 | 'type' => 'select', |
246 | - 'options' => give_cmb2_get_post_options( array( |
|
246 | + 'options' => give_cmb2_get_post_options(array( |
|
247 | 247 | 'post_type' => 'page', |
248 | 248 | 'numberposts' => 30, |
249 | - ) ), |
|
249 | + )), |
|
250 | 250 | 'attributes' => array( |
251 | 251 | 'data-search-type' => 'pages' |
252 | 252 | ) |
253 | 253 | ), |
254 | 254 | array( |
255 | - 'name' => __( 'Failed Donation Page', 'give' ), |
|
256 | - 'desc' => __( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ), |
|
255 | + 'name' => __('Failed Donation Page', 'give'), |
|
256 | + 'desc' => __('The page donors are sent to if their donation is cancelled or fails.', 'give'), |
|
257 | 257 | 'class' => 'give-select give-select-chosen', |
258 | 258 | 'id' => 'failure_page', |
259 | 259 | 'type' => 'select', |
260 | - 'options' => give_cmb2_get_post_options( array( |
|
260 | + 'options' => give_cmb2_get_post_options(array( |
|
261 | 261 | 'post_type' => 'page', |
262 | 262 | 'numberposts' => 30, |
263 | - ) ), |
|
263 | + )), |
|
264 | 264 | 'attributes' => array( |
265 | 265 | 'data-search-type' => 'pages' |
266 | 266 | ) |
267 | 267 | ), |
268 | 268 | array( |
269 | - 'name' => __( 'Donation History Page', 'give' ), |
|
269 | + 'name' => __('Donation History Page', 'give'), |
|
270 | 270 | /* translators: %s: [donation_history] */ |
271 | - 'desc' => sprintf( __( 'The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give' ), '<code>[donation_history]</code>' ), |
|
271 | + 'desc' => sprintf(__('The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give'), '<code>[donation_history]</code>'), |
|
272 | 272 | 'id' => 'history_page', |
273 | 273 | 'class' => 'give-select give-select-chosen', |
274 | 274 | 'type' => 'select', |
275 | - 'options' => give_cmb2_get_post_options( array( |
|
275 | + 'options' => give_cmb2_get_post_options(array( |
|
276 | 276 | 'post_type' => 'page', |
277 | 277 | 'numberposts' => 30, |
278 | - ) ), |
|
278 | + )), |
|
279 | 279 | 'attributes' => array( |
280 | 280 | 'data-search-type' => 'pages' |
281 | 281 | ) |
282 | 282 | ), |
283 | 283 | array( |
284 | - 'name' => __( 'Base Country', 'give' ), |
|
285 | - 'desc' => __( 'The country your site operates from.', 'give' ), |
|
284 | + 'name' => __('Base Country', 'give'), |
|
285 | + 'desc' => __('The country your site operates from.', 'give'), |
|
286 | 286 | 'id' => 'base_country', |
287 | 287 | 'type' => 'select', |
288 | 288 | 'options' => give_get_country_list(), |
@@ -293,18 +293,18 @@ discard block |
||
293 | 293 | * @since 1.8.14 |
294 | 294 | */ |
295 | 295 | array( |
296 | - 'wrapper_class' => ( array_key_exists( $country, $no_states_country ) ? 'give-hidden' : '' ), |
|
297 | - 'name' => __( 'Base State/Province', 'give' ), |
|
298 | - 'desc' => __( 'The state/province your site operates from.', 'give' ), |
|
296 | + 'wrapper_class' => (array_key_exists($country, $no_states_country) ? 'give-hidden' : ''), |
|
297 | + 'name' => __('Base State/Province', 'give'), |
|
298 | + 'desc' => __('The state/province your site operates from.', 'give'), |
|
299 | 299 | 'id' => 'base_state', |
300 | - 'type' => ( empty( $states ) ? 'text' : 'select' ), |
|
300 | + 'type' => (empty($states) ? 'text' : 'select'), |
|
301 | 301 | 'options' => $states, |
302 | 302 | ), |
303 | 303 | array( |
304 | - 'name' => __( 'General Options Docs Link', 'give' ), |
|
304 | + 'name' => __('General Options Docs Link', 'give'), |
|
305 | 305 | 'id' => 'general_options_docs_link', |
306 | - 'url' => esc_url( 'http://docs.givewp.com/settings-general' ), |
|
307 | - 'title' => __( 'General Options', 'give' ), |
|
306 | + 'url' => esc_url('http://docs.givewp.com/settings-general'), |
|
307 | + 'title' => __('General Options', 'give'), |
|
308 | 308 | 'type' => 'give_docs_link', |
309 | 309 | ), |
310 | 310 | array( |
@@ -324,48 +324,48 @@ discard block |
||
324 | 324 | 'type' => 'title' |
325 | 325 | ), |
326 | 326 | array( |
327 | - 'name' => __( 'Sequential Ordering', 'give' ), |
|
327 | + 'name' => __('Sequential Ordering', 'give'), |
|
328 | 328 | 'id' => "{$current_section}_status", |
329 | - 'desc' => __( 'Custom donation numbering that increases sequentially to prevent gaps between donation IDs. If disabled, then donation numbers are generated from WordPress post IDs, which will result in gaps between numbers.', 'give' ), |
|
329 | + 'desc' => __('Custom donation numbering that increases sequentially to prevent gaps between donation IDs. If disabled, then donation numbers are generated from WordPress post IDs, which will result in gaps between numbers.', 'give'), |
|
330 | 330 | 'type' => 'radio_inline', |
331 | 331 | 'default' => 'disabled', |
332 | 332 | 'options' => array( |
333 | - 'enabled' => __( 'Enabled', 'give' ), |
|
334 | - 'disabled' => __( 'Disabled', 'give' ) |
|
333 | + 'enabled' => __('Enabled', 'give'), |
|
334 | + 'disabled' => __('Disabled', 'give') |
|
335 | 335 | ) |
336 | 336 | ), |
337 | 337 | array( |
338 | - 'name' => __( 'Next Donation Number', 'give' ), |
|
338 | + 'name' => __('Next Donation Number', 'give'), |
|
339 | 339 | 'id' => "{$current_section}_number", |
340 | 340 | 'desc' => sprintf( |
341 | - __( 'The number used to generate the next donation ID. This value must be greater than or equal to %s to avoid conflicts with existing donation IDs.', 'give' ), |
|
342 | - '<code>' . Give()->seq_donation_number->get_next_number() . '</code>' |
|
341 | + __('The number used to generate the next donation ID. This value must be greater than or equal to %s to avoid conflicts with existing donation IDs.', 'give'), |
|
342 | + '<code>'.Give()->seq_donation_number->get_next_number().'</code>' |
|
343 | 343 | ), |
344 | 344 | 'type' => 'number', |
345 | 345 | ), |
346 | 346 | array( |
347 | - 'name' => __( 'Number Prefix', 'give' ), |
|
347 | + 'name' => __('Number Prefix', 'give'), |
|
348 | 348 | 'id' => "{$current_section}_number_prefix", |
349 | 349 | 'desc' => sprintf( |
350 | - __( 'The prefix appended to all sequential donation numbers. Spaces are replaced by %s.', 'give' ), |
|
350 | + __('The prefix appended to all sequential donation numbers. Spaces are replaced by %s.', 'give'), |
|
351 | 351 | '<code>-</code>' |
352 | 352 | ), |
353 | 353 | 'type' => 'text', |
354 | 354 | ), |
355 | 355 | array( |
356 | - 'name' => __( 'Number Suffix', 'give' ), |
|
356 | + 'name' => __('Number Suffix', 'give'), |
|
357 | 357 | 'id' => "{$current_section}_number_suffix", |
358 | 358 | 'desc' => sprintf( |
359 | - __( 'The suffix appended to all sequential donation numbers. Spaces are replaced by %s.', 'give' ), |
|
359 | + __('The suffix appended to all sequential donation numbers. Spaces are replaced by %s.', 'give'), |
|
360 | 360 | '<code>-</code>' |
361 | 361 | ), |
362 | 362 | 'type' => 'text', |
363 | 363 | ), |
364 | 364 | array( |
365 | - 'name' => __( 'Number Padding', 'give' ), |
|
365 | + 'name' => __('Number Padding', 'give'), |
|
366 | 366 | 'id' => "{$current_section}_number_padding", |
367 | 367 | 'desc' => sprintf( |
368 | - __( 'The minimum number of digits in the sequential donation number. Enter %s to display %s as %s.', 'give' ), |
|
368 | + __('The minimum number of digits in the sequential donation number. Enter %s to display %s as %s.', 'give'), |
|
369 | 369 | '<code>4</code>', |
370 | 370 | '<code>1</code>', |
371 | 371 | '<code>0001</code>' |
@@ -374,16 +374,16 @@ discard block |
||
374 | 374 | 'default' => '0', |
375 | 375 | ), |
376 | 376 | array( |
377 | - 'name' => __( 'Donation ID Preview', 'give' ), |
|
377 | + 'name' => __('Donation ID Preview', 'give'), |
|
378 | 378 | 'id' => "{$current_section}_preview", |
379 | 379 | 'type' => 'give_sequential_donation_code_preview', |
380 | - 'desc' => __( 'A preview of the next sequential donation ID. This preview cannot be edited directly as it is generated from the settings above.', 'give' ), |
|
380 | + 'desc' => __('A preview of the next sequential donation ID. This preview cannot be edited directly as it is generated from the settings above.', 'give'), |
|
381 | 381 | ), |
382 | 382 | array( |
383 | - 'name' => __( 'Sequential Ordering Docs Link', 'give' ), |
|
383 | + 'name' => __('Sequential Ordering Docs Link', 'give'), |
|
384 | 384 | 'id' => "{$current_section}_doc link", |
385 | - 'url' => esc_url( 'http://docs.givewp.com/settings-sequential-ordering' ), |
|
386 | - 'title' => __( 'Sequential Ordering', 'give' ), |
|
385 | + 'url' => esc_url('http://docs.givewp.com/settings-sequential-ordering'), |
|
386 | + 'title' => __('Sequential Ordering', 'give'), |
|
387 | 387 | 'type' => 'give_docs_link', |
388 | 388 | ), |
389 | 389 | array( |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | * Filter the general settings. |
398 | 398 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
399 | 399 | */ |
400 | - $settings = apply_filters( 'give_settings_general', $settings ); |
|
400 | + $settings = apply_filters('give_settings_general', $settings); |
|
401 | 401 | |
402 | 402 | /** |
403 | 403 | * Filter the settings. |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | * |
407 | 407 | * @param array $settings |
408 | 408 | */ |
409 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
409 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
410 | 410 | |
411 | 411 | // Output. |
412 | 412 | return $settings; |
@@ -420,13 +420,13 @@ discard block |
||
420 | 420 | */ |
421 | 421 | public function get_sections() { |
422 | 422 | $sections = array( |
423 | - 'general-settings' => __( 'General', 'give' ), |
|
424 | - 'currency-settings' => __( 'Currency', 'give' ), |
|
425 | - 'access-control' => __( 'Access Control', 'give' ), |
|
426 | - 'sequential-ordering' => __( 'Sequential Ordering', 'give' ), |
|
423 | + 'general-settings' => __('General', 'give'), |
|
424 | + 'currency-settings' => __('Currency', 'give'), |
|
425 | + 'access-control' => __('Access Control', 'give'), |
|
426 | + 'sequential-ordering' => __('Sequential Ordering', 'give'), |
|
427 | 427 | ); |
428 | 428 | |
429 | - return apply_filters( 'give_get_sections_' . $this->id, $sections ); |
|
429 | + return apply_filters('give_get_sections_'.$this->id, $sections); |
|
430 | 430 | } |
431 | 431 | |
432 | 432 | |
@@ -442,23 +442,23 @@ discard block |
||
442 | 442 | * |
443 | 443 | * @return bool |
444 | 444 | */ |
445 | - public function __give_change_donation_stating_number( $update_options, $option_name, $old_options ) { |
|
446 | - if ( ! isset( $_POST['sequential-ordering_number'] ) ) { |
|
445 | + public function __give_change_donation_stating_number($update_options, $option_name, $old_options) { |
|
446 | + if ( ! isset($_POST['sequential-ordering_number'])) { |
|
447 | 447 | return false; |
448 | 448 | } |
449 | 449 | |
450 | - if ( ( $next_number = Give()->seq_donation_number->get_next_number() ) > $update_options['sequential-ordering_number'] ) { |
|
451 | - give_update_option( 'sequential-ordering_number', $next_number ); |
|
450 | + if (($next_number = Give()->seq_donation_number->get_next_number()) > $update_options['sequential-ordering_number']) { |
|
451 | + give_update_option('sequential-ordering_number', $next_number); |
|
452 | 452 | |
453 | 453 | Give_Admin_Settings::add_error( |
454 | 454 | 'give-invalid-sequential-starting-number', |
455 | 455 | sprintf( |
456 | - __( 'Next Donation Number must be equal to or larger than %s to avoid conflicts with existing donation IDs.', 'give' ), |
|
456 | + __('Next Donation Number must be equal to or larger than %s to avoid conflicts with existing donation IDs.', 'give'), |
|
457 | 457 | $next_number |
458 | 458 | ) |
459 | 459 | ); |
460 | - } elseif ( $update_options['sequential-ordering_number'] !== $old_options['sequential-ordering_number'] ) { |
|
461 | - update_option( '_give_reset_sequential_number', 1 ); |
|
460 | + } elseif ($update_options['sequential-ordering_number'] !== $old_options['sequential-ordering_number']) { |
|
461 | + update_option('_give_reset_sequential_number', 1); |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | return true; |
@@ -473,16 +473,16 @@ discard block |
||
473 | 473 | * |
474 | 474 | * @param $field |
475 | 475 | */ |
476 | - public function __render_give_sequential_donation_code_preview( $field ) { |
|
476 | + public function __render_give_sequential_donation_code_preview($field) { |
|
477 | 477 | ?> |
478 | - <tr valign="top" <?php echo ! empty( $field['wrapper_class'] ) ? 'class="' . $field['wrapper_class'] . '"' : '' ?>> |
|
478 | + <tr valign="top" <?php echo ! empty($field['wrapper_class']) ? 'class="'.$field['wrapper_class'].'"' : '' ?>> |
|
479 | 479 | <th scope="row" class="titledesc"> |
480 | 480 | <label |
481 | - for="<?php echo esc_attr( $field['id'] ); ?>"><?php echo esc_html( $field['name'] ) ?></label> |
|
481 | + for="<?php echo esc_attr($field['id']); ?>"><?php echo esc_html($field['name']) ?></label> |
|
482 | 482 | </th> |
483 | 483 | <td class="give-forminp"> |
484 | - <input id="<?php echo esc_attr( $field['id'] ); ?>" class="give-input-field" type="text" disabled> |
|
485 | - <?php echo Give_Admin_Settings::get_field_description( $field ); ?> |
|
484 | + <input id="<?php echo esc_attr($field['id']); ?>" class="give-input-field" type="text" disabled> |
|
485 | + <?php echo Give_Admin_Settings::get_field_description($field); ?> |
|
486 | 486 | </td> |
487 | 487 | </tr> |
488 | 488 | <?php |
@@ -497,16 +497,16 @@ discard block |
||
497 | 497 | * |
498 | 498 | * @param $field |
499 | 499 | */ |
500 | - public function __render_give_unlock_all_settings( $field ) { |
|
500 | + public function __render_give_unlock_all_settings($field) { |
|
501 | 501 | ?> |
502 | - <tr valign="top" <?php echo ! empty( $field['wrapper_class'] ) ? 'class="' . $field['wrapper_class'] . '"' : '' ?>> |
|
502 | + <tr valign="top" <?php echo ! empty($field['wrapper_class']) ? 'class="'.$field['wrapper_class'].'"' : '' ?>> |
|
503 | 503 | <th scope="row" class="titledesc"> |
504 | 504 | <label |
505 | - for="<?php echo esc_attr( $field['id'] ); ?>"><?php echo esc_html( $field['name'] ) ?></label> |
|
505 | + for="<?php echo esc_attr($field['id']); ?>"><?php echo esc_html($field['name']) ?></label> |
|
506 | 506 | </th> |
507 | 507 | <td class="give-forminp"> |
508 | - <?php echo Give_Admin_Settings::get_field_description( $field ); ?> |
|
509 | - <a href="" id="<?php echo $field['id']; ?>" data-message="<?php echo $field['confirmation_msg'] ?>"><?php echo __( 'Unlock all settings', 'give' ); ?></a> |
|
508 | + <?php echo Give_Admin_Settings::get_field_description($field); ?> |
|
509 | + <a href="" id="<?php echo $field['id']; ?>" data-message="<?php echo $field['confirmation_msg'] ?>"><?php echo __('Unlock all settings', 'give'); ?></a> |
|
510 | 510 | </td> |
511 | 511 | </tr> |
512 | 512 | <?php |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_Display' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Display')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Display. |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | 29 | $this->id = 'display'; |
30 | - $this->label = __( 'Display Options', 'give' ); |
|
30 | + $this->label = __('Display Options', 'give'); |
|
31 | 31 | |
32 | 32 | $this->default_tab = 'display-settings'; |
33 | 33 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $settings = array(); |
45 | 45 | $current_section = give_get_current_setting_section(); |
46 | 46 | |
47 | - switch ( $current_section ) { |
|
47 | + switch ($current_section) { |
|
48 | 48 | case 'display-settings' : |
49 | 49 | $settings = array( |
50 | 50 | // Section 1: Display |
@@ -53,67 +53,67 @@ discard block |
||
53 | 53 | 'type' => 'title', |
54 | 54 | ), |
55 | 55 | array( |
56 | - 'name' => __( 'Default Give Styles', 'give' ), |
|
57 | - 'desc' => __( 'You can disable Give\'s default styles for donation forms and other frontend elements.', 'give' ), |
|
56 | + 'name' => __('Default Give Styles', 'give'), |
|
57 | + 'desc' => __('You can disable Give\'s default styles for donation forms and other frontend elements.', 'give'), |
|
58 | 58 | 'id' => 'css', |
59 | 59 | 'type' => 'radio_inline', |
60 | 60 | 'default' => 'enabled', |
61 | 61 | 'options' => array( |
62 | - 'enabled' => __( 'Enabled', 'give' ), |
|
63 | - 'disabled' => __( 'Disabled', 'give' ), |
|
62 | + 'enabled' => __('Enabled', 'give'), |
|
63 | + 'disabled' => __('Disabled', 'give'), |
|
64 | 64 | ), |
65 | 65 | ), |
66 | 66 | array( |
67 | - 'name' => __( 'Floating Labels', 'give' ), |
|
67 | + 'name' => __('Floating Labels', 'give'), |
|
68 | 68 | /* translators: %s: http://docs.givewp.com/form-floating-labels */ |
69 | - 'desc' => sprintf( wp_kses( __( '<a href="%s" target="_blank">Floating labels</a> allows your labels to be inset within the form fields to provide a cleaner form appearance. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array( |
|
69 | + 'desc' => sprintf(wp_kses(__('<a href="%s" target="_blank">Floating labels</a> allows your labels to be inset within the form fields to provide a cleaner form appearance. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array( |
|
70 | 70 | 'a' => array( |
71 | 71 | 'href' => array(), |
72 | 72 | 'target' => array(), |
73 | 73 | ), |
74 | - ) ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ), |
|
74 | + )), esc_url('http://docs.givewp.com/form-floating-labels')), |
|
75 | 75 | 'id' => 'floatlabels', |
76 | 76 | 'type' => 'radio_inline', |
77 | 77 | 'default' => 'disabled', |
78 | 78 | 'options' => array( |
79 | - 'enabled' => __( 'Enabled', 'give' ), |
|
80 | - 'disabled' => __( 'Disabled', 'give' ), |
|
79 | + 'enabled' => __('Enabled', 'give'), |
|
80 | + 'disabled' => __('Disabled', 'give'), |
|
81 | 81 | ), |
82 | 82 | ), |
83 | 83 | array( |
84 | - 'name' => __( 'Welcome Screen', 'give' ), |
|
84 | + 'name' => __('Welcome Screen', 'give'), |
|
85 | 85 | /* translators: %s: about page URL */ |
86 | - 'desc' => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> that displays each time Give is activated or updated.', 'give' ), array( |
|
86 | + 'desc' => sprintf(wp_kses(__('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> that displays each time Give is activated or updated.', 'give'), array( |
|
87 | 87 | 'a' => array( |
88 | 88 | 'href' => array(), |
89 | 89 | 'target' => array(), |
90 | 90 | ), |
91 | - ) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ), |
|
91 | + )), esc_url(admin_url('index.php?page=give-about'))), |
|
92 | 92 | 'id' => 'welcome', |
93 | 93 | 'type' => 'radio_inline', |
94 | 94 | 'default' => 'enabled', |
95 | 95 | 'options' => array( |
96 | - 'enabled' => __( 'Enabled', 'give' ), |
|
97 | - 'disabled' => __( 'Disabled', 'give' ), |
|
96 | + 'enabled' => __('Enabled', 'give'), |
|
97 | + 'disabled' => __('Disabled', 'give'), |
|
98 | 98 | ), |
99 | 99 | ), |
100 | 100 | array( |
101 | - 'name' => __( 'Company Donations', 'give' ), |
|
102 | - 'desc' => __( 'Do you want a Company field to appear after First Name and Last Name?', 'give' ), |
|
101 | + 'name' => __('Company Donations', 'give'), |
|
102 | + 'desc' => __('Do you want a Company field to appear after First Name and Last Name?', 'give'), |
|
103 | 103 | 'id' => 'company_field', |
104 | 104 | 'type' => 'radio_inline', |
105 | 105 | 'default' => 'disabled', |
106 | 106 | 'options' => array( |
107 | - 'disabled' => __( 'Disabled', 'give' ), |
|
108 | - 'required' => __( 'Required', 'give' ), |
|
109 | - 'optional' => __( 'Optional', 'give' ), |
|
107 | + 'disabled' => __('Disabled', 'give'), |
|
108 | + 'required' => __('Required', 'give'), |
|
109 | + 'optional' => __('Optional', 'give'), |
|
110 | 110 | ), |
111 | 111 | ), |
112 | 112 | array( |
113 | - 'name' => __( 'Display Settings Docs Link', 'give' ), |
|
113 | + 'name' => __('Display Settings Docs Link', 'give'), |
|
114 | 114 | 'id' => 'display_settings_docs_link', |
115 | - 'url' => esc_url( 'http://docs.givewp.com/form-display-options' ), |
|
116 | - 'title' => __( 'Display Options Settings', 'give' ), |
|
115 | + 'url' => esc_url('http://docs.givewp.com/form-display-options'), |
|
116 | + 'title' => __('Display Options Settings', 'give'), |
|
117 | 117 | 'type' => 'give_docs_link', |
118 | 118 | ), |
119 | 119 | array( |
@@ -130,78 +130,78 @@ discard block |
||
130 | 130 | 'type' => 'title', |
131 | 131 | ), |
132 | 132 | array( |
133 | - 'name' => __( 'Form Single Views', 'give' ), |
|
134 | - 'desc' => __( 'By default, all donation form have single views enabled which creates a specific URL on your website for that form. This option disables the singular posts from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ), |
|
133 | + 'name' => __('Form Single Views', 'give'), |
|
134 | + 'desc' => __('By default, all donation form have single views enabled which creates a specific URL on your website for that form. This option disables the singular posts from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'), |
|
135 | 135 | 'id' => 'forms_singular', |
136 | 136 | 'type' => 'radio_inline', |
137 | 137 | 'default' => 'enabled', |
138 | 138 | 'options' => array( |
139 | - 'enabled' => __( 'Enabled', 'give' ), |
|
140 | - 'disabled' => __( 'Disabled', 'give' ), |
|
139 | + 'enabled' => __('Enabled', 'give'), |
|
140 | + 'disabled' => __('Disabled', 'give'), |
|
141 | 141 | ), |
142 | 142 | ), |
143 | 143 | array( |
144 | - 'name' => __( 'Form Archives', 'give' ), |
|
145 | - 'desc' => sprintf( wp_kses( __( 'Archives pages list all the donation forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to <a href="%s">refresh your permalinks</a> after this option has been enabled.', 'give' ), array( |
|
144 | + 'name' => __('Form Archives', 'give'), |
|
145 | + 'desc' => sprintf(wp_kses(__('Archives pages list all the donation forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to <a href="%s">refresh your permalinks</a> after this option has been enabled.', 'give'), array( |
|
146 | 146 | 'a' => array( |
147 | 147 | 'href' => array(), |
148 | 148 | 'target' => array(), |
149 | 149 | ), |
150 | - ) ), esc_url( admin_url( 'options-permalink.php' ) ) ), |
|
150 | + )), esc_url(admin_url('options-permalink.php'))), |
|
151 | 151 | 'id' => 'forms_archives', |
152 | 152 | 'type' => 'radio_inline', |
153 | 153 | 'default' => 'enabled', |
154 | 154 | 'options' => array( |
155 | - 'enabled' => __( 'Enabled', 'give' ), |
|
156 | - 'disabled' => __( 'Disabled', 'give' ), |
|
155 | + 'enabled' => __('Enabled', 'give'), |
|
156 | + 'disabled' => __('Disabled', 'give'), |
|
157 | 157 | ), |
158 | 158 | ), |
159 | 159 | array( |
160 | - 'name' => __( 'Form Excerpts', 'give' ), |
|
161 | - 'desc' => __( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ), |
|
160 | + 'name' => __('Form Excerpts', 'give'), |
|
161 | + 'desc' => __('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'), |
|
162 | 162 | 'id' => 'forms_excerpt', |
163 | 163 | 'type' => 'radio_inline', |
164 | 164 | 'default' => 'enabled', |
165 | 165 | 'options' => array( |
166 | - 'enabled' => __( 'Enabled', 'give' ), |
|
167 | - 'disabled' => __( 'Disabled', 'give' ), |
|
166 | + 'enabled' => __('Enabled', 'give'), |
|
167 | + 'disabled' => __('Disabled', 'give'), |
|
168 | 168 | ), |
169 | 169 | ), |
170 | 170 | array( |
171 | - 'name' => __( 'Form Featured Image', 'give' ), |
|
172 | - 'desc' => __( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ), |
|
171 | + 'name' => __('Form Featured Image', 'give'), |
|
172 | + 'desc' => __('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'), |
|
173 | 173 | 'id' => 'form_featured_img', |
174 | 174 | 'type' => 'radio_inline', |
175 | 175 | 'default' => 'enabled', |
176 | 176 | 'options' => array( |
177 | - 'enabled' => __( 'Enabled', 'give' ), |
|
178 | - 'disabled' => __( 'Disabled', 'give' ), |
|
177 | + 'enabled' => __('Enabled', 'give'), |
|
178 | + 'disabled' => __('Disabled', 'give'), |
|
179 | 179 | ), |
180 | 180 | ), |
181 | 181 | array( |
182 | - 'name' => __( 'Featured Image Size', 'give' ), |
|
183 | - 'desc' => __( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give' ), |
|
182 | + 'name' => __('Featured Image Size', 'give'), |
|
183 | + 'desc' => __('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give'), |
|
184 | 184 | 'id' => 'featured_image_size', |
185 | 185 | 'type' => 'select', |
186 | 186 | 'default' => 'large', |
187 | 187 | 'options' => give_get_featured_image_sizes(), |
188 | 188 | ), |
189 | 189 | array( |
190 | - 'name' => __( 'Single Form Sidebar', 'give' ), |
|
191 | - 'desc' => __( 'The sidebar allows you to add additional widgets to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ), |
|
190 | + 'name' => __('Single Form Sidebar', 'give'), |
|
191 | + 'desc' => __('The sidebar allows you to add additional widgets to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'), |
|
192 | 192 | 'id' => 'form_sidebar', |
193 | 193 | 'type' => 'radio_inline', |
194 | 194 | 'default' => 'enabled', |
195 | 195 | 'options' => array( |
196 | - 'enabled' => __( 'Enabled', 'give' ), |
|
197 | - 'disabled' => __( 'Disabled', 'give' ), |
|
196 | + 'enabled' => __('Enabled', 'give'), |
|
197 | + 'disabled' => __('Disabled', 'give'), |
|
198 | 198 | ), |
199 | 199 | ), |
200 | 200 | array( |
201 | - 'name' => __( 'Post Types Docs Link', 'give' ), |
|
201 | + 'name' => __('Post Types Docs Link', 'give'), |
|
202 | 202 | 'id' => 'post_types_settings_docs_link', |
203 | - 'url' => esc_url( 'http://docs.givewp.com/settings-post-types' ), |
|
204 | - 'title' => __( 'Post Types Settings', 'give' ), |
|
203 | + 'url' => esc_url('http://docs.givewp.com/settings-post-types'), |
|
204 | + 'title' => __('Post Types Settings', 'give'), |
|
205 | 205 | 'type' => 'give_docs_link', |
206 | 206 | ), |
207 | 207 | array( |
@@ -218,32 +218,32 @@ discard block |
||
218 | 218 | 'type' => 'title', |
219 | 219 | ), |
220 | 220 | array( |
221 | - 'name' => __( 'Form Categories', 'give' ), |
|
222 | - 'desc' => __( 'Enable Categories for all Give forms.', 'give' ), |
|
221 | + 'name' => __('Form Categories', 'give'), |
|
222 | + 'desc' => __('Enable Categories for all Give forms.', 'give'), |
|
223 | 223 | 'id' => 'categories', |
224 | 224 | 'type' => 'radio_inline', |
225 | 225 | 'default' => 'disabled', |
226 | 226 | 'options' => array( |
227 | - 'enabled' => __( 'Enabled', 'give' ), |
|
228 | - 'disabled' => __( 'Disabled', 'give' ), |
|
227 | + 'enabled' => __('Enabled', 'give'), |
|
228 | + 'disabled' => __('Disabled', 'give'), |
|
229 | 229 | ), |
230 | 230 | ), |
231 | 231 | array( |
232 | - 'name' => __( 'Form Tags', 'give' ), |
|
233 | - 'desc' => __( 'Enable Tags for all Give forms.', 'give' ), |
|
232 | + 'name' => __('Form Tags', 'give'), |
|
233 | + 'desc' => __('Enable Tags for all Give forms.', 'give'), |
|
234 | 234 | 'id' => 'tags', |
235 | 235 | 'type' => 'radio_inline', |
236 | 236 | 'default' => 'disabled', |
237 | 237 | 'options' => array( |
238 | - 'enabled' => __( 'Enabled', 'give' ), |
|
239 | - 'disabled' => __( 'Disabled', 'give' ), |
|
238 | + 'enabled' => __('Enabled', 'give'), |
|
239 | + 'disabled' => __('Disabled', 'give'), |
|
240 | 240 | ), |
241 | 241 | ), |
242 | 242 | array( |
243 | - 'name' => __( 'Taxonomies Docs Link', 'give' ), |
|
243 | + 'name' => __('Taxonomies Docs Link', 'give'), |
|
244 | 244 | 'id' => 'taxonomies_settings_docs_link', |
245 | - 'url' => esc_url( 'http://docs.givewp.com/settings-taxonomies' ), |
|
246 | - 'title' => __( 'Taxonomies Settings', 'give' ), |
|
245 | + 'url' => esc_url('http://docs.givewp.com/settings-taxonomies'), |
|
246 | + 'title' => __('Taxonomies Settings', 'give'), |
|
247 | 247 | 'type' => 'give_docs_link', |
248 | 248 | ), |
249 | 249 | array( |
@@ -260,36 +260,36 @@ discard block |
||
260 | 260 | 'type' => 'title', |
261 | 261 | ), |
262 | 262 | array( |
263 | - 'name' => __( 'Terms and Conditions', 'give' ), |
|
264 | - 'desc' => __( 'Would you like donors to require that donors agree to your terms when donating? Note: You can enable/disable this option and customize the terms per form as well.', 'give' ), |
|
263 | + 'name' => __('Terms and Conditions', 'give'), |
|
264 | + 'desc' => __('Would you like donors to require that donors agree to your terms when donating? Note: You can enable/disable this option and customize the terms per form as well.', 'give'), |
|
265 | 265 | 'id' => 'terms', |
266 | 266 | 'type' => 'radio_inline', |
267 | 267 | 'default' => 'disabled', |
268 | 268 | 'options' => array( |
269 | - 'enabled' => __( 'Enabled', 'give' ), |
|
270 | - 'disabled' => __( 'Disabled', 'give' ), |
|
269 | + 'enabled' => __('Enabled', 'give'), |
|
270 | + 'disabled' => __('Disabled', 'give'), |
|
271 | 271 | ), |
272 | 272 | ), |
273 | 273 | array( |
274 | - 'name' => __( 'Agree to Terms Label', 'give' ), |
|
275 | - 'desc' => __( 'The label shown next to the agree to terms check box. Customize it here or leave blank to use the default placeholder text. Note: You can customize the label per form.', 'give' ), |
|
274 | + 'name' => __('Agree to Terms Label', 'give'), |
|
275 | + 'desc' => __('The label shown next to the agree to terms check box. Customize it here or leave blank to use the default placeholder text. Note: You can customize the label per form.', 'give'), |
|
276 | 276 | 'id' => 'agree_to_terms_label', |
277 | 277 | 'attributes' => array( |
278 | - 'placeholder' => esc_attr__( 'Agree to Terms?', 'give' ), |
|
278 | + 'placeholder' => esc_attr__('Agree to Terms?', 'give'), |
|
279 | 279 | ), |
280 | 280 | 'type' => 'text', |
281 | 281 | ), |
282 | 282 | array( |
283 | - 'name' => __( 'Agreement Text', 'give' ), |
|
284 | - 'desc' => __( 'This is the actual text which the user will be asked to agree to in order to donate. Note: You can customize the content per form as needed.', 'give' ), |
|
283 | + 'name' => __('Agreement Text', 'give'), |
|
284 | + 'desc' => __('This is the actual text which the user will be asked to agree to in order to donate. Note: You can customize the content per form as needed.', 'give'), |
|
285 | 285 | 'id' => 'agreement_text', |
286 | 286 | 'type' => 'wysiwyg', |
287 | 287 | ), |
288 | 288 | array( |
289 | - 'name' => __( 'Terms and Conditions Docs Link', 'give' ), |
|
289 | + 'name' => __('Terms and Conditions Docs Link', 'give'), |
|
290 | 290 | 'id' => 'terms_settings_docs_link', |
291 | - 'url' => esc_url( 'http://docs.givewp.com/settings-terms' ), |
|
292 | - 'title' => __( 'Terms and Conditions Settings', 'give' ), |
|
291 | + 'url' => esc_url('http://docs.givewp.com/settings-terms'), |
|
292 | + 'title' => __('Terms and Conditions Settings', 'give'), |
|
293 | 293 | 'type' => 'give_docs_link', |
294 | 294 | ), |
295 | 295 | array( |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | * Filter the display options settings. |
305 | 305 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
306 | 306 | */ |
307 | - $settings = apply_filters( 'give_settings_display', $settings ); |
|
307 | + $settings = apply_filters('give_settings_display', $settings); |
|
308 | 308 | |
309 | 309 | /** |
310 | 310 | * Filter the settings. |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | * |
314 | 314 | * @param array $settings |
315 | 315 | */ |
316 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
316 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
317 | 317 | |
318 | 318 | // Output. |
319 | 319 | return $settings; |
@@ -327,13 +327,13 @@ discard block |
||
327 | 327 | */ |
328 | 328 | public function get_sections() { |
329 | 329 | $sections = array( |
330 | - 'display-settings' => __( 'Display', 'give' ), |
|
331 | - 'post-types' => __( 'Post Types', 'give' ), |
|
332 | - 'taxonomies' => __( 'Taxonomies', 'give' ), |
|
333 | - 'term-and-conditions' => __( 'Terms and Conditions', 'give' ), |
|
330 | + 'display-settings' => __('Display', 'give'), |
|
331 | + 'post-types' => __('Post Types', 'give'), |
|
332 | + 'taxonomies' => __('Taxonomies', 'give'), |
|
333 | + 'term-and-conditions' => __('Terms and Conditions', 'give'), |
|
334 | 334 | ); |
335 | 335 | |
336 | - return apply_filters( 'give_get_sections_' . $this->id, $sections ); |
|
336 | + return apply_filters('give_get_sections_'.$this->id, $sections); |
|
337 | 337 | } |
338 | 338 | } |
339 | 339 |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_Email' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Email')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Email. |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | 29 | $this->id = 'emails'; |
30 | - $this->label = esc_html__( 'Emails', 'give' ); |
|
30 | + $this->label = esc_html__('Emails', 'give'); |
|
31 | 31 | |
32 | 32 | $this->default_tab = 'email-settings'; |
33 | 33 | |
34 | 34 | parent::__construct(); |
35 | 35 | |
36 | - add_action( 'give_admin_field_email_notification', array( $this, 'email_notification_setting' ) ); |
|
36 | + add_action('give_admin_field_email_notification', array($this, 'email_notification_setting')); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | $settings = array(); |
47 | 47 | $current_section = give_get_current_setting_section(); |
48 | 48 | |
49 | - switch ( $current_section ) { |
|
49 | + switch ($current_section) { |
|
50 | 50 | case 'email-settings' : |
51 | 51 | $settings = array( |
52 | 52 | |
53 | 53 | // Section 1: Email Notification Listing. |
54 | 54 | array( |
55 | - 'desc' => __( 'Email notifications sent from Give are listed below. Click on an email to configure it.', 'give' ), |
|
55 | + 'desc' => __('Email notifications sent from Give are listed below. Click on an email to configure it.', 'give'), |
|
56 | 56 | 'type' => 'title', |
57 | 57 | 'id' => 'give_email_notification_settings', |
58 | 58 | 'table_html' => false, |
@@ -67,42 +67,42 @@ discard block |
||
67 | 67 | |
68 | 68 | // Section 2: Email Sender Setting |
69 | 69 | array( |
70 | - 'title' => __( 'Email Sender Options', 'give' ), |
|
70 | + 'title' => __('Email Sender Options', 'give'), |
|
71 | 71 | 'id' => 'give_title_email_settings_1', |
72 | 72 | 'type' => 'title', |
73 | 73 | ), |
74 | 74 | array( |
75 | 75 | 'id' => 'email_template', |
76 | - 'name' => esc_html__( 'Email Template', 'give' ), |
|
77 | - 'desc' => esc_html__( 'Choose your template from the available registered template types.', 'give' ), |
|
76 | + 'name' => esc_html__('Email Template', 'give'), |
|
77 | + 'desc' => esc_html__('Choose your template from the available registered template types.', 'give'), |
|
78 | 78 | 'type' => 'select', |
79 | 79 | 'options' => give_get_email_templates(), |
80 | 80 | ), |
81 | 81 | array( |
82 | 82 | 'id' => 'email_logo', |
83 | - 'name' => esc_html__( 'Logo', 'give' ), |
|
84 | - 'desc' => esc_html__( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ), |
|
83 | + 'name' => esc_html__('Logo', 'give'), |
|
84 | + 'desc' => esc_html__('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'), |
|
85 | 85 | 'type' => 'file', |
86 | 86 | ), |
87 | 87 | array( |
88 | 88 | 'id' => 'from_name', |
89 | - 'name' => esc_html__( 'From Name', 'give' ), |
|
90 | - 'desc' => esc_html__( 'The name which appears in the "From" field in all Give donation emails.', 'give' ), |
|
91 | - 'default' => get_bloginfo( 'name' ), |
|
89 | + 'name' => esc_html__('From Name', 'give'), |
|
90 | + 'desc' => esc_html__('The name which appears in the "From" field in all Give donation emails.', 'give'), |
|
91 | + 'default' => get_bloginfo('name'), |
|
92 | 92 | 'type' => 'text', |
93 | 93 | ), |
94 | 94 | array( |
95 | 95 | 'id' => 'from_email', |
96 | - 'name' => esc_html__( 'From Email', 'give' ), |
|
97 | - 'desc' => esc_html__( 'Email address from which all Give emails are sent from. This will act as the "from" and "reply-to" email address.', 'give' ), |
|
98 | - 'default' => get_bloginfo( 'admin_email' ), |
|
96 | + 'name' => esc_html__('From Email', 'give'), |
|
97 | + 'desc' => esc_html__('Email address from which all Give emails are sent from. This will act as the "from" and "reply-to" email address.', 'give'), |
|
98 | + 'default' => get_bloginfo('admin_email'), |
|
99 | 99 | 'type' => 'text', |
100 | 100 | ), |
101 | 101 | array( |
102 | - 'name' => esc_html__( 'Donation Notification Settings Docs Link', 'give' ), |
|
102 | + 'name' => esc_html__('Donation Notification Settings Docs Link', 'give'), |
|
103 | 103 | 'id' => 'donation_notification_settings_docs_link', |
104 | - 'url' => esc_url( 'http://docs.givewp.com/settings-donation-notification' ), |
|
105 | - 'title' => __( 'Donation Notification Settings', 'give' ), |
|
104 | + 'url' => esc_url('http://docs.givewp.com/settings-donation-notification'), |
|
105 | + 'title' => __('Donation Notification Settings', 'give'), |
|
106 | 106 | 'type' => 'give_docs_link', |
107 | 107 | ), |
108 | 108 | array( |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * Filter the emails settings. |
118 | 118 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
119 | 119 | */ |
120 | - $settings = apply_filters( 'give_settings_emails', $settings ); |
|
120 | + $settings = apply_filters('give_settings_emails', $settings); |
|
121 | 121 | |
122 | 122 | /** |
123 | 123 | * Filter the settings. |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * |
127 | 127 | * @param array $settings |
128 | 128 | */ |
129 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
129 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
130 | 130 | |
131 | 131 | // Output. |
132 | 132 | return $settings; |
@@ -140,10 +140,10 @@ discard block |
||
140 | 140 | */ |
141 | 141 | public function get_sections() { |
142 | 142 | $sections = array( |
143 | - 'email-settings' => esc_html__( 'Email Settings', 'give' ), |
|
143 | + 'email-settings' => esc_html__('Email Settings', 'give'), |
|
144 | 144 | ); |
145 | 145 | |
146 | - return apply_filters( 'give_get_sections_' . $this->id, $sections ); |
|
146 | + return apply_filters('give_get_sections_'.$this->id, $sections); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function email_notification_setting() { |
156 | 156 | // Load email notification table. |
157 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/emails/class-email-notification-table.php'; |
|
157 | + require_once GIVE_PLUGIN_DIR.'includes/admin/emails/class-email-notification-table.php'; |
|
158 | 158 | |
159 | 159 | // Init table. |
160 | 160 | $email_notifications_table = new Give_Email_Notification_Table(); |
@@ -173,13 +173,13 @@ discard block |
||
173 | 173 | * @return void |
174 | 174 | */ |
175 | 175 | public function output() { |
176 | - if ( $this->enable_save ) { |
|
177 | - $GLOBALS['give_hide_save_button'] = apply_filters( 'give_hide_save_button_on_email_admin_setting_page', false ); |
|
176 | + if ($this->enable_save) { |
|
177 | + $GLOBALS['give_hide_save_button'] = apply_filters('give_hide_save_button_on_email_admin_setting_page', false); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | $settings = $this->get_settings(); |
181 | 181 | |
182 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
182 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
183 | 183 | } |
184 | 184 | } |
185 | 185 |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_Gateways' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Gateways')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Gateways. |
@@ -27,15 +27,15 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | 29 | $this->id = 'gateways'; |
30 | - $this->label = esc_html__( 'Payment Gateways', 'give' ); |
|
30 | + $this->label = esc_html__('Payment Gateways', 'give'); |
|
31 | 31 | |
32 | 32 | $this->default_tab = 'gateways-settings'; |
33 | 33 | |
34 | 34 | parent::__construct(); |
35 | 35 | |
36 | 36 | // Do not use main form for this tab. |
37 | - if ( give_get_current_setting_tab() === $this->id ) { |
|
38 | - add_action( 'give_admin_field_enabled_gateways', array( $this, 'render_enabled_gateways' ), 10, 2 ); |
|
37 | + if (give_get_current_setting_tab() === $this->id) { |
|
38 | + add_action('give_admin_field_enabled_gateways', array($this, 'render_enabled_gateways'), 10, 2); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $settings = array(); |
50 | 50 | $current_section = give_get_current_setting_section(); |
51 | 51 | |
52 | - switch ( $current_section ) { |
|
52 | + switch ($current_section) { |
|
53 | 53 | case 'paypal-standard': |
54 | 54 | $settings = array( |
55 | 55 | // Section 2: PayPal Standard. |
@@ -58,55 +58,55 @@ discard block |
||
58 | 58 | 'id' => 'give_title_gateway_settings_2', |
59 | 59 | ), |
60 | 60 | array( |
61 | - 'name' => __( 'PayPal Email', 'give' ), |
|
62 | - 'desc' => __( 'Enter your PayPal account\'s email.', 'give' ), |
|
61 | + 'name' => __('PayPal Email', 'give'), |
|
62 | + 'desc' => __('Enter your PayPal account\'s email.', 'give'), |
|
63 | 63 | 'id' => 'paypal_email', |
64 | 64 | 'type' => 'email', |
65 | 65 | ), |
66 | 66 | array( |
67 | - 'name' => __( 'PayPal Page Style', 'give' ), |
|
68 | - 'desc' => __( 'Enter the name of the PayPal page style to use, or leave blank to use the default.', 'give' ), |
|
67 | + 'name' => __('PayPal Page Style', 'give'), |
|
68 | + 'desc' => __('Enter the name of the PayPal page style to use, or leave blank to use the default.', 'give'), |
|
69 | 69 | 'id' => 'paypal_page_style', |
70 | 70 | 'type' => 'text', |
71 | 71 | ), |
72 | 72 | array( |
73 | - 'name' => __( 'PayPal Transaction Type', 'give' ), |
|
74 | - 'desc' => __( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ), |
|
73 | + 'name' => __('PayPal Transaction Type', 'give'), |
|
74 | + 'desc' => __('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'), |
|
75 | 75 | 'id' => 'paypal_button_type', |
76 | 76 | 'type' => 'radio_inline', |
77 | 77 | 'options' => array( |
78 | - 'donation' => __( 'Donation', 'give' ), |
|
79 | - 'standard' => __( 'Standard Transaction', 'give' ) |
|
78 | + 'donation' => __('Donation', 'give'), |
|
79 | + 'standard' => __('Standard Transaction', 'give') |
|
80 | 80 | ), |
81 | 81 | 'default' => 'donation', |
82 | 82 | ), |
83 | 83 | array( |
84 | - 'name' => __( 'Billing Details', 'give' ), |
|
85 | - 'desc' => __( 'This option will enable the billing details section for PayPal Standard which requires the donor\'s address to complete the donation. These fields are not required by PayPal to process the transaction, but you may have a need to collect the data.', 'give' ), |
|
84 | + 'name' => __('Billing Details', 'give'), |
|
85 | + 'desc' => __('This option will enable the billing details section for PayPal Standard which requires the donor\'s address to complete the donation. These fields are not required by PayPal to process the transaction, but you may have a need to collect the data.', 'give'), |
|
86 | 86 | 'id' => 'paypal_standard_billing_details', |
87 | 87 | 'type' => 'radio_inline', |
88 | 88 | 'default' => 'disabled', |
89 | 89 | 'options' => array( |
90 | - 'enabled' => __( 'Enabled', 'give' ), |
|
91 | - 'disabled' => __( 'Disabled', 'give' ), |
|
90 | + 'enabled' => __('Enabled', 'give'), |
|
91 | + 'disabled' => __('Disabled', 'give'), |
|
92 | 92 | ) |
93 | 93 | ), |
94 | 94 | array( |
95 | - 'name' => __( 'PayPal IPN Verification', 'give' ), |
|
96 | - 'desc' => __( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ), |
|
95 | + 'name' => __('PayPal IPN Verification', 'give'), |
|
96 | + 'desc' => __('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'), |
|
97 | 97 | 'id' => 'paypal_verification', |
98 | 98 | 'type' => 'radio_inline', |
99 | 99 | 'default' => 'enabled', |
100 | 100 | 'options' => array( |
101 | - 'enabled' => __( 'Enabled', 'give' ), |
|
102 | - 'disabled' => __( 'Disabled', 'give' ), |
|
101 | + 'enabled' => __('Enabled', 'give'), |
|
102 | + 'disabled' => __('Disabled', 'give'), |
|
103 | 103 | ) |
104 | 104 | ), |
105 | 105 | array( |
106 | - 'name' => __( 'PayPal Standard Gateway Settings Docs Link', 'give' ), |
|
106 | + 'name' => __('PayPal Standard Gateway Settings Docs Link', 'give'), |
|
107 | 107 | 'id' => 'paypal_standard_gateway_settings_docs_link', |
108 | - 'url' => esc_url( 'http://docs.givewp.com/settings-gateway-paypal-standard' ), |
|
109 | - 'title' => __( 'PayPal Standard Gateway Settings', 'give' ), |
|
108 | + 'url' => esc_url('http://docs.givewp.com/settings-gateway-paypal-standard'), |
|
109 | + 'title' => __('PayPal Standard Gateway Settings', 'give'), |
|
110 | 110 | 'type' => 'give_docs_link', |
111 | 111 | ), |
112 | 112 | array( |
@@ -124,19 +124,19 @@ discard block |
||
124 | 124 | 'id' => 'give_title_gateway_settings_3', |
125 | 125 | ), |
126 | 126 | array( |
127 | - 'name' => __( 'Collect Billing Details', 'give' ), |
|
128 | - 'desc' => __( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ), |
|
127 | + 'name' => __('Collect Billing Details', 'give'), |
|
128 | + 'desc' => __('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'), |
|
129 | 129 | 'id' => 'give_offline_donation_enable_billing_fields', |
130 | 130 | 'type' => 'radio_inline', |
131 | 131 | 'default' => 'disabled', |
132 | 132 | 'options' => array( |
133 | - 'enabled' => __( 'Enabled', 'give' ), |
|
134 | - 'disabled' => __( 'Disabled', 'give' ) |
|
133 | + 'enabled' => __('Enabled', 'give'), |
|
134 | + 'disabled' => __('Disabled', 'give') |
|
135 | 135 | ) |
136 | 136 | ), |
137 | 137 | array( |
138 | - 'name' => __( 'Offline Donation Instructions', 'give' ), |
|
139 | - 'desc' => __( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ), |
|
138 | + 'name' => __('Offline Donation Instructions', 'give'), |
|
139 | + 'desc' => __('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'), |
|
140 | 140 | 'id' => 'global_offline_donation_content', |
141 | 141 | 'default' => give_get_default_offline_donation_content(), |
142 | 142 | 'type' => 'wysiwyg', |
@@ -145,10 +145,10 @@ discard block |
||
145 | 145 | ) |
146 | 146 | ), |
147 | 147 | array( |
148 | - 'name' => esc_html__( 'Offline Donations Settings Docs Link', 'give' ), |
|
148 | + 'name' => esc_html__('Offline Donations Settings Docs Link', 'give'), |
|
149 | 149 | 'id' => 'offline_gateway_settings_docs_link', |
150 | - 'url' => esc_url( 'http://docs.givewp.com/offlinegateway' ), |
|
151 | - 'title' => __( 'Offline Gateway Settings', 'give' ), |
|
150 | + 'url' => esc_url('http://docs.givewp.com/offlinegateway'), |
|
151 | + 'title' => __('Offline Gateway Settings', 'give'), |
|
152 | 152 | 'type' => 'give_docs_link', |
153 | 153 | ), |
154 | 154 | array( |
@@ -166,19 +166,19 @@ discard block |
||
166 | 166 | 'type' => 'title' |
167 | 167 | ), |
168 | 168 | array( |
169 | - 'name' => __( 'Test Mode', 'give' ), |
|
170 | - 'desc' => __( 'While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ), |
|
169 | + 'name' => __('Test Mode', 'give'), |
|
170 | + 'desc' => __('While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'), |
|
171 | 171 | 'id' => 'test_mode', |
172 | 172 | 'type' => 'radio_inline', |
173 | 173 | 'default' => 'disabled', |
174 | 174 | 'options' => array( |
175 | - 'enabled' => __( 'Enabled', 'give' ), |
|
176 | - 'disabled' => __( 'Disabled', 'give' ), |
|
175 | + 'enabled' => __('Enabled', 'give'), |
|
176 | + 'disabled' => __('Disabled', 'give'), |
|
177 | 177 | ) |
178 | 178 | ), |
179 | 179 | array( |
180 | - 'name' => __( 'Enabled Gateways', 'give' ), |
|
181 | - 'desc' => __( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ), |
|
180 | + 'name' => __('Enabled Gateways', 'give'), |
|
181 | + 'desc' => __('Enable your payment gateway. Can be ordered by dragging.', 'give'), |
|
182 | 182 | 'id' => 'gateways', |
183 | 183 | 'type' => 'enabled_gateways' |
184 | 184 | ), |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * This setting will not render on admin setting screen but help internal code to recognize "gateways_label" setting and add them to give setting when save. |
191 | 191 | */ |
192 | 192 | array( |
193 | - 'name' => __( 'Gateways Label', 'give' ), |
|
193 | + 'name' => __('Gateways Label', 'give'), |
|
194 | 194 | 'desc' => '', |
195 | 195 | 'id' => 'gateways_label', |
196 | 196 | 'type' => 'gateways_label_hidden' |
@@ -203,17 +203,17 @@ discard block |
||
203 | 203 | * This setting will not render on admin setting screen but help internal code to recognize "default_gateway" setting and add them to give setting when save. |
204 | 204 | */ |
205 | 205 | array( |
206 | - 'name' => __( 'Default Gateway', 'give' ), |
|
207 | - 'desc' => __( 'The gateway that will be selected by default.', 'give' ), |
|
206 | + 'name' => __('Default Gateway', 'give'), |
|
207 | + 'desc' => __('The gateway that will be selected by default.', 'give'), |
|
208 | 208 | 'id' => 'default_gateway', |
209 | 209 | 'type' => 'default_gateway_hidden' |
210 | 210 | ), |
211 | 211 | |
212 | 212 | array( |
213 | - 'name' => __( 'Gateways Docs Link', 'give' ), |
|
213 | + 'name' => __('Gateways Docs Link', 'give'), |
|
214 | 214 | 'id' => 'gateway_settings_docs_link', |
215 | - 'url' => esc_url( 'http://docs.givewp.com/settings-gateways' ), |
|
216 | - 'title' => __( 'Gateway Settings', 'give' ), |
|
215 | + 'url' => esc_url('http://docs.givewp.com/settings-gateways'), |
|
216 | + 'title' => __('Gateway Settings', 'give'), |
|
217 | 217 | 'type' => 'give_docs_link', |
218 | 218 | ), |
219 | 219 | array( |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | * Filter the payment gateways settings. |
229 | 229 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
230 | 230 | */ |
231 | - $settings = apply_filters( 'give_settings_gateways', $settings ); |
|
231 | + $settings = apply_filters('give_settings_gateways', $settings); |
|
232 | 232 | |
233 | 233 | /** |
234 | 234 | * Filter the settings. |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * |
238 | 238 | * @param array $settings |
239 | 239 | */ |
240 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
240 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
241 | 241 | |
242 | 242 | // Output. |
243 | 243 | return $settings; |
@@ -251,12 +251,12 @@ discard block |
||
251 | 251 | */ |
252 | 252 | public function get_sections() { |
253 | 253 | $sections = array( |
254 | - 'gateways-settings' => __( 'Gateways', 'give' ), |
|
255 | - 'paypal-standard' => __( 'PayPal Standard', 'give' ), |
|
256 | - 'offline-donations' => __( 'Offline Donations', 'give' ) |
|
254 | + 'gateways-settings' => __('Gateways', 'give'), |
|
255 | + 'paypal-standard' => __('PayPal Standard', 'give'), |
|
256 | + 'offline-donations' => __('Offline Donations', 'give') |
|
257 | 257 | ); |
258 | 258 | |
259 | - return apply_filters( 'give_get_sections_' . $this->id, $sections ); |
|
259 | + return apply_filters('give_get_sections_'.$this->id, $sections); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | |
@@ -269,11 +269,11 @@ discard block |
||
269 | 269 | * @param $field |
270 | 270 | * @param $settings |
271 | 271 | */ |
272 | - public function render_enabled_gateways( $field, $settings ) { |
|
272 | + public function render_enabled_gateways($field, $settings) { |
|
273 | 273 | $id = $field['id']; |
274 | - $gateways = give_get_ordered_payment_gateways( give_get_payment_gateways() ); |
|
275 | - $gateways_label = give_get_option( 'gateways_label', array() ); |
|
276 | - $default_gateway = give_get_option( 'default_gateway', current( array_keys( $gateways ) ) ); |
|
274 | + $gateways = give_get_ordered_payment_gateways(give_get_payment_gateways()); |
|
275 | + $gateways_label = give_get_option('gateways_label', array()); |
|
276 | + $default_gateway = give_get_option('default_gateway', current(array_keys($gateways))); |
|
277 | 277 | |
278 | 278 | ob_start(); |
279 | 279 | |
@@ -288,50 +288,50 @@ discard block |
||
288 | 288 | <span>%3$s</span> |
289 | 289 | <span>%4$s</span> |
290 | 290 | ', |
291 | - __( 'Gateway', 'give' ), |
|
292 | - __( 'Label', 'give' ), |
|
293 | - __( 'Default', 'give' ), |
|
294 | - __( 'Enabled', 'give' ) |
|
291 | + __('Gateway', 'give'), |
|
292 | + __('Label', 'give'), |
|
293 | + __('Default', 'give'), |
|
294 | + __('Enabled', 'give') |
|
295 | 295 | ); |
296 | 296 | echo '</div>'; |
297 | 297 | |
298 | 298 | echo '<ul class="give-checklist-fields give-payment-gatways-list">'; |
299 | - foreach ( $gateways as $key => $option ) : |
|
299 | + foreach ($gateways as $key => $option) : |
|
300 | 300 | $enabled = null; |
301 | - if ( is_array( $settings ) && array_key_exists( $key, $settings ) ) { |
|
301 | + if (is_array($settings) && array_key_exists($key, $settings)) { |
|
302 | 302 | $enabled = '1'; |
303 | 303 | } |
304 | 304 | |
305 | 305 | echo '<li>'; |
306 | - printf( '<span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span>' ); |
|
307 | - printf( '<span class="admin-label">%s</span>', esc_html( $option['admin_label'] ) ); |
|
306 | + printf('<span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span>'); |
|
307 | + printf('<span class="admin-label">%s</span>', esc_html($option['admin_label'])); |
|
308 | 308 | |
309 | 309 | $label = ''; |
310 | - if ( ! empty( $gateways_label[ $key ] ) ) { |
|
311 | - $label = $gateways_label[ $key ]; |
|
310 | + if ( ! empty($gateways_label[$key])) { |
|
311 | + $label = $gateways_label[$key]; |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | printf( |
315 | 315 | '<input class="checkout-label" type="text" id="%1$s[%2$s]" name="%1$s[%2$s]" value="%3$s" placeholder="%4$s"/>', |
316 | 316 | 'gateways_label', |
317 | - esc_attr( $key ), |
|
318 | - esc_html( $label ), |
|
319 | - esc_html( $option['checkout_label'] ) |
|
317 | + esc_attr($key), |
|
318 | + esc_html($label), |
|
319 | + esc_html($option['checkout_label']) |
|
320 | 320 | ); |
321 | 321 | |
322 | 322 | printf( |
323 | 323 | '<input class="gateways-radio" type="radio" name="%1$s" value="%2$s" %3$s>', |
324 | 324 | 'default_gateway', |
325 | 325 | $key, |
326 | - checked( $key, $default_gateway, false ) |
|
326 | + checked($key, $default_gateway, false) |
|
327 | 327 | ); |
328 | 328 | |
329 | 329 | printf( |
330 | 330 | '<input class="gateways-checkbox" name="%1$s[%2$s]" id="%1$s[%2$s]" type="checkbox" value="1" %3$s data-payment-gateway="%4$s"/>', |
331 | - esc_attr( $id ), |
|
332 | - esc_attr( $key ), |
|
333 | - checked( '1', $enabled, false ), |
|
334 | - esc_html( $option['admin_label'] ) |
|
331 | + esc_attr($id), |
|
332 | + esc_attr($key), |
|
333 | + checked('1', $enabled, false), |
|
334 | + esc_html($option['admin_label']) |
|
335 | 335 | ); |
336 | 336 | echo '</li>'; |
337 | 337 | endforeach; |
@@ -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 | /** |
@@ -49,45 +49,45 @@ discard block |
||
49 | 49 | * @return void |
50 | 50 | */ |
51 | 51 | public function admin_menus() { |
52 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
52 | + list($display_version) = explode('-', GIVE_VERSION); |
|
53 | 53 | |
54 | 54 | // About Page |
55 | 55 | add_dashboard_page( |
56 | 56 | /* translators: %s: Give version */ |
57 | - sprintf( esc_html__( 'Welcome to Give %s', 'give' ), $display_version ), |
|
58 | - esc_html__( 'Welcome to Give', 'give' ), |
|
57 | + sprintf(esc_html__('Welcome to Give %s', 'give'), $display_version), |
|
58 | + esc_html__('Welcome to Give', 'give'), |
|
59 | 59 | $this->minimum_capability, |
60 | 60 | 'give-about', |
61 | - array( $this, 'about_screen' ) |
|
61 | + array($this, 'about_screen') |
|
62 | 62 | ); |
63 | 63 | |
64 | 64 | // Changelog Page |
65 | 65 | add_dashboard_page( |
66 | - esc_html__( 'Give Changelog', 'give' ), |
|
67 | - esc_html__( 'Give Changelog', 'give' ), |
|
66 | + esc_html__('Give Changelog', 'give'), |
|
67 | + esc_html__('Give Changelog', 'give'), |
|
68 | 68 | $this->minimum_capability, |
69 | 69 | 'give-changelog', |
70 | - array( $this, 'changelog_screen' ) |
|
70 | + array($this, 'changelog_screen') |
|
71 | 71 | ); |
72 | 72 | |
73 | 73 | // Getting Started Page |
74 | 74 | add_dashboard_page( |
75 | 75 | /* translators: %s: Give version */ |
76 | - sprintf( esc_html__( 'Give %s - Getting Started Guide', 'give' ), $display_version ), |
|
77 | - esc_html__( 'Getting started with Give', 'give' ), |
|
76 | + sprintf(esc_html__('Give %s - Getting Started Guide', 'give'), $display_version), |
|
77 | + esc_html__('Getting started with Give', 'give'), |
|
78 | 78 | $this->minimum_capability, |
79 | 79 | 'give-getting-started', |
80 | - array( $this, 'getting_started_screen' ) |
|
80 | + array($this, 'getting_started_screen') |
|
81 | 81 | ); |
82 | 82 | |
83 | 83 | // Credits Page |
84 | 84 | add_dashboard_page( |
85 | 85 | /* translators: %s: Give version */ |
86 | - sprintf( esc_html__( 'Give %s - Credits', 'give' ), $display_version ), |
|
87 | - esc_html__( 'The people that build Give', 'give' ), |
|
86 | + sprintf(esc_html__('Give %s - Credits', 'give'), $display_version), |
|
87 | + esc_html__('The people that build Give', 'give'), |
|
88 | 88 | $this->minimum_capability, |
89 | 89 | 'give-credits', |
90 | - array( $this, 'credits_screen' ) |
|
90 | + array($this, 'credits_screen') |
|
91 | 91 | ); |
92 | 92 | } |
93 | 93 | |
@@ -100,10 +100,10 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function admin_head() { |
102 | 102 | |
103 | - remove_submenu_page( 'index.php', 'give-about' ); |
|
104 | - remove_submenu_page( 'index.php', 'give-changelog' ); |
|
105 | - remove_submenu_page( 'index.php', 'give-getting-started' ); |
|
106 | - remove_submenu_page( 'index.php', 'give-credits' ); |
|
103 | + remove_submenu_page('index.php', 'give-about'); |
|
104 | + remove_submenu_page('index.php', 'give-changelog'); |
|
105 | + remove_submenu_page('index.php', 'give-getting-started'); |
|
106 | + remove_submenu_page('index.php', 'give-credits'); |
|
107 | 107 | |
108 | 108 | } |
109 | 109 | |
@@ -115,24 +115,24 @@ discard block |
||
115 | 115 | * @return void |
116 | 116 | */ |
117 | 117 | public function tabs() { |
118 | - $selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about'; |
|
118 | + $selected = isset($_GET['page']) ? $_GET['page'] : 'give-about'; |
|
119 | 119 | ?> |
120 | 120 | <h2 class="nav-tab-wrapper"> |
121 | 121 | <a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" |
122 | - href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>"> |
|
123 | - <?php esc_html_e( 'About Give', 'give' ); ?> |
|
122 | + href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-about'), 'index.php'))); ?>"> |
|
123 | + <?php esc_html_e('About Give', 'give'); ?> |
|
124 | 124 | </a> |
125 | 125 | <a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" |
126 | - href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>"> |
|
127 | - <?php esc_html_e( 'Getting Started', 'give' ); ?> |
|
126 | + href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-getting-started'), 'index.php'))); ?>"> |
|
127 | + <?php esc_html_e('Getting Started', 'give'); ?> |
|
128 | 128 | </a> |
129 | 129 | <a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" |
130 | - href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>"> |
|
131 | - <?php esc_html_e( 'Credits', 'give' ); ?> |
|
130 | + href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-credits'), 'index.php'))); ?>"> |
|
131 | + <?php esc_html_e('Credits', 'give'); ?> |
|
132 | 132 | </a> |
133 | 133 | <a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" |
134 | - href="<?php echo esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-addons' ) ); ?>"> |
|
135 | - <?php esc_html_e( 'Add-ons', 'give' ); ?> |
|
134 | + href="<?php echo esc_url(admin_url('edit.php?post_type=give_forms&page=give-addons')); ?>"> |
|
135 | + <?php esc_html_e('Add-ons', 'give'); ?> |
|
136 | 136 | </a> |
137 | 137 | </h2> |
138 | 138 | <?php |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @return void |
147 | 147 | */ |
148 | 148 | public function about_screen() { |
149 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
149 | + list($display_version) = explode('-', GIVE_VERSION); |
|
150 | 150 | ?> |
151 | 151 | <div class="wrap about-wrap"> |
152 | 152 | |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | <p class="about-text"><?php |
156 | 156 | printf( |
157 | 157 | /* translators: %s: http://docs.givewp.com/docs */ |
158 | - __( '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. We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ), |
|
159 | - esc_url( 'http://docs.givewp.com/docs' ) |
|
158 | + __('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. We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'), |
|
159 | + esc_url('http://docs.givewp.com/docs') |
|
160 | 160 | ); |
161 | 161 | ?></p> |
162 | 162 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | <div class="give-badge"><?php |
166 | 166 | printf( |
167 | 167 | /* translators: %s: Give version */ |
168 | - esc_html__( 'Version %s', 'give' ), |
|
168 | + esc_html__('Version %s', 'give'), |
|
169 | 169 | $display_version |
170 | 170 | ); |
171 | 171 | ?></div> |
@@ -175,17 +175,17 @@ discard block |
||
175 | 175 | <div class="feature-section clearfix introduction"> |
176 | 176 | |
177 | 177 | <div class="video feature-section-item"> |
178 | - <img src="<?php echo GIVE_PLUGIN_URL . 'assets/dist/images/give-logo-photo-mashup.png' ?>" |
|
179 | - alt="<?php esc_attr_e( 'Give', 'give' ); ?>"> |
|
178 | + <img src="<?php echo GIVE_PLUGIN_URL.'assets/dist/images/give-logo-photo-mashup.png' ?>" |
|
179 | + alt="<?php esc_attr_e('Give', 'give'); ?>"> |
|
180 | 180 | </div> |
181 | 181 | |
182 | 182 | <div class="content feature-section-item last-feature"> |
183 | 183 | |
184 | - <h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3> |
|
184 | + <h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3> |
|
185 | 185 | |
186 | - <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> |
|
186 | + <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> |
|
187 | 187 | <a href="https://givewp.com" target="_blank" class="button-secondary"> |
188 | - <?php esc_html_e( 'Learn More', 'give' ); ?> |
|
188 | + <?php esc_html_e('Learn More', 'give'); ?> |
|
189 | 189 | <span class="dashicons dashicons-external"></span> |
190 | 190 | </a> |
191 | 191 | |
@@ -198,22 +198,22 @@ discard block |
||
198 | 198 | |
199 | 199 | <div class="content feature-section-item"> |
200 | 200 | |
201 | - <h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3> |
|
201 | + <h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3> |
|
202 | 202 | |
203 | - <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 a 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> |
|
203 | + <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 a 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> |
|
204 | 204 | |
205 | 205 | <h4>Find Out More:</h4> |
206 | 206 | <ul class="ul-disc"> |
207 | - <li><a href="https://givewp.com/" target="_blank"><?php esc_html_e( 'Visit the Give Website', 'give' ); ?></a></li> |
|
208 | - <li><a href="https://givewp.com/features/" target="_blank"><?php esc_html_e( 'View the Give Features', 'give' ); ?></a></li> |
|
209 | - <li><a href="https://givewp.com/documentation/" target="_blank"><?php esc_html_e( 'Read the Documentation', 'give' ); ?></a></li> |
|
207 | + <li><a href="https://givewp.com/" target="_blank"><?php esc_html_e('Visit the Give Website', 'give'); ?></a></li> |
|
208 | + <li><a href="https://givewp.com/features/" target="_blank"><?php esc_html_e('View the Give Features', 'give'); ?></a></li> |
|
209 | + <li><a href="https://givewp.com/documentation/" target="_blank"><?php esc_html_e('Read the Documentation', 'give'); ?></a></li> |
|
210 | 210 | </ul> |
211 | 211 | |
212 | 212 | </div> |
213 | 213 | |
214 | 214 | <div class="content feature-section-item last-feature"> |
215 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/dist/images/admin/give-form-mockup.png' ?>" |
|
216 | - alt="<?php esc_attr_e( 'A Give donation form', 'give' ); ?>"> |
|
215 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/dist/images/admin/give-form-mockup.png' ?>" |
|
216 | + alt="<?php esc_attr_e('A Give donation form', 'give'); ?>"> |
|
217 | 217 | </div> |
218 | 218 | |
219 | 219 | </div> |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * @return void |
233 | 233 | */ |
234 | 234 | public function changelog_screen() { |
235 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
235 | + list($display_version) = explode('-', GIVE_VERSION); |
|
236 | 236 | ?> |
237 | 237 | <div class="wrap about-wrap"> |
238 | 238 | <h1><?php echo get_admin_page_title(); ?></h1> |
@@ -240,14 +240,14 @@ discard block |
||
240 | 240 | <p class="about-text"><?php |
241 | 241 | printf( |
242 | 242 | /* translators: %s: Give version */ |
243 | - esc_html__( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ), |
|
243 | + esc_html__('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'), |
|
244 | 244 | $display_version |
245 | 245 | ); |
246 | 246 | ?></p> |
247 | 247 | <div class="give-badge"><?php |
248 | 248 | printf( |
249 | 249 | /* translators: %s: Give version */ |
250 | - esc_html__( 'Version %s', 'give' ), |
|
250 | + esc_html__('Version %s', 'give'), |
|
251 | 251 | $display_version |
252 | 252 | ); |
253 | 253 | ?></div> |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | <?php $this->tabs(); ?> |
256 | 256 | |
257 | 257 | <div class="changelog"> |
258 | - <h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3> |
|
258 | + <h3><?php esc_html_e('Full Changelog', 'give'); ?></h3> |
|
259 | 259 | |
260 | 260 | <div class="feature-section"> |
261 | 261 | <?php echo $this->parse_readme(); ?> |
@@ -263,10 +263,10 @@ discard block |
||
263 | 263 | </div> |
264 | 264 | |
265 | 265 | <div class="return-to-dashboard"> |
266 | - <a href="<?php echo esc_url( admin_url( add_query_arg( array( |
|
266 | + <a href="<?php echo esc_url(admin_url(add_query_arg(array( |
|
267 | 267 | 'post_type' => 'give_forms', |
268 | 268 | 'page' => 'give-settings' |
269 | - ), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Give Settings', 'give' ); ?></a> |
|
269 | + ), 'edit.php'))); ?>"><?php esc_html_e('Give Settings', 'give'); ?></a> |
|
270 | 270 | </div> |
271 | 271 | </div> |
272 | 272 | <?php |
@@ -280,36 +280,36 @@ discard block |
||
280 | 280 | * @return void |
281 | 281 | */ |
282 | 282 | public function getting_started_screen() { |
283 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
283 | + list($display_version) = explode('-', GIVE_VERSION); |
|
284 | 284 | ?> |
285 | 285 | <div class="wrap about-wrap get-started"> |
286 | 286 | |
287 | 287 | <?php $this->get_welcome_header() ?> |
288 | 288 | |
289 | - <p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p> |
|
289 | + <p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p> |
|
290 | 290 | |
291 | 291 | <?php give_get_newsletter(); ?> |
292 | 292 | |
293 | 293 | <div class="give-badge"><?php |
294 | 294 | printf( |
295 | 295 | /* translators: %s: Give version */ |
296 | - esc_html__( 'Version %s', 'give' ), |
|
296 | + esc_html__('Version %s', 'give'), |
|
297 | 297 | $display_version |
298 | 298 | ); |
299 | 299 | ?></div> |
300 | 300 | |
301 | 301 | <?php $this->tabs(); ?> |
302 | 302 | |
303 | - <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> |
|
303 | + <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> |
|
304 | 304 | |
305 | 305 | <div class="feature-section clearfix"> |
306 | 306 | |
307 | 307 | <div class="content feature-section-item"> |
308 | - <h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3> |
|
308 | + <h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3> |
|
309 | 309 | |
310 | - <p><?php esc_html_e( 'Give is driven by it\'s powerful donation form building features. However, it is much more than just a "donation form". From the "Add Form" page you\'ll be able to choose how and where you want to receive your donations. You will also be able to set the preferred donation amounts.', 'give' ); ?></p> |
|
310 | + <p><?php esc_html_e('Give is driven by it\'s powerful donation form building features. However, it is much more than just a "donation form". From the "Add Form" page you\'ll be able to choose how and where you want to receive your donations. You will also be able to set the preferred donation amounts.', 'give'); ?></p> |
|
311 | 311 | |
312 | - <p><?php esc_html_e( 'All of these features begin by simply going to the menu and choosing "Donations > Add Form".', 'give' ); ?></p> |
|
312 | + <p><?php esc_html_e('All of these features begin by simply going to the menu and choosing "Donations > Add Form".', 'give'); ?></p> |
|
313 | 313 | </div> |
314 | 314 | |
315 | 315 | <div class="content feature-section-item last-feature"> |
@@ -326,9 +326,9 @@ discard block |
||
326 | 326 | </div> |
327 | 327 | |
328 | 328 | <div class="content feature-section-item last-feature"> |
329 | - <h3><?php esc_html_e( 'STEP 2: Customize Your Donation Forms', 'give' ); ?></h3> |
|
329 | + <h3><?php esc_html_e('STEP 2: Customize Your Donation Forms', 'give'); ?></h3> |
|
330 | 330 | |
331 | - <p><?php esc_html_e( 'Each donation form you create can be customized to receive either a pre-determined set donation amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the donation levels view where you can add as many levels as you\'d like with your own custom names and suggested amounts. As well, you can allow donors to give a custom amount and even set up donation goals.', 'give' ); ?></p> |
|
331 | + <p><?php esc_html_e('Each donation form you create can be customized to receive either a pre-determined set donation amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the donation levels view where you can add as many levels as you\'d like with your own custom names and suggested amounts. As well, you can allow donors to give a custom amount and even set up donation goals.', 'give'); ?></p> |
|
332 | 332 | </div> |
333 | 333 | |
334 | 334 | </div> |
@@ -337,11 +337,11 @@ discard block |
||
337 | 337 | <div class="feature-section clearfix"> |
338 | 338 | |
339 | 339 | <div class="content feature-section-item add-content"> |
340 | - <h3><?php esc_html_e( 'STEP 3: Add Additional Content', 'give' ); ?></h3> |
|
340 | + <h3><?php esc_html_e('STEP 3: Add Additional Content', 'give'); ?></h3> |
|
341 | 341 | |
342 | - <p><?php esc_html_e( 'Every donation form you create with Give can be used on its own stand-alone page, or it can be inserted into any other page or post throughout your site via a shortcode or widget.', 'give' ); ?></p> |
|
342 | + <p><?php esc_html_e('Every donation form you create with Give can be used on its own stand-alone page, or it can be inserted into any other page or post throughout your site via a shortcode or widget.', 'give'); ?></p> |
|
343 | 343 | |
344 | - <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> |
|
344 | + <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> |
|
345 | 345 | </div> |
346 | 346 | |
347 | 347 | <div class="content feature-section-item last-feature"> |
@@ -358,9 +358,9 @@ discard block |
||
358 | 358 | </div> |
359 | 359 | |
360 | 360 | <div class="content feature-section-item last-feature"> |
361 | - <h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3> |
|
361 | + <h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3> |
|
362 | 362 | |
363 | - <p><?php esc_html_e( 'Lastly, you can present the form in a number of different ways that each create their own unique donor experience. The "Modal" display mode opens the credit card fieldset within a popup window. The "Reveal" mode will slide into place the additional fields. If you\'re looking for a simple button, then "Button" more is the way to go. This allows you to create a customizable "Donate Now" button which will open the donation form upon clicking. There\'s tons of possibilities here, give it a try!', 'give' ); ?></p> |
|
363 | + <p><?php esc_html_e('Lastly, you can present the form in a number of different ways that each create their own unique donor experience. The "Modal" display mode opens the credit card fieldset within a popup window. The "Reveal" mode will slide into place the additional fields. If you\'re looking for a simple button, then "Button" more is the way to go. This allows you to create a customizable "Donate Now" button which will open the donation form upon clicking. There\'s tons of possibilities here, give it a try!', 'give'); ?></p> |
|
364 | 364 | </div> |
365 | 365 | |
366 | 366 | |
@@ -380,20 +380,20 @@ discard block |
||
380 | 380 | * @return void |
381 | 381 | */ |
382 | 382 | public function credits_screen() { |
383 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
383 | + list($display_version) = explode('-', GIVE_VERSION); |
|
384 | 384 | ?> |
385 | 385 | <div class="wrap about-wrap"> |
386 | 386 | |
387 | 387 | <?php $this->get_welcome_header() ?> |
388 | 388 | |
389 | - <p class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly.', 'give' ); ?></p> |
|
389 | + <p class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly.', 'give'); ?></p> |
|
390 | 390 | |
391 | 391 | <?php give_get_newsletter(); ?> |
392 | 392 | |
393 | 393 | <div class="give-badge"><?php |
394 | 394 | printf( |
395 | 395 | /* translators: %s: Give version */ |
396 | - esc_html__( 'Version %s', 'give' ), |
|
396 | + esc_html__('Version %s', 'give'), |
|
397 | 397 | $display_version |
398 | 398 | ); |
399 | 399 | ?></div> |
@@ -403,8 +403,8 @@ discard block |
||
403 | 403 | <p class="about-description"><?php |
404 | 404 | printf( |
405 | 405 | /* translators: %s: https://github.com/WordImpress/give */ |
406 | - __( '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' ), |
|
407 | - esc_url( 'https://github.com/WordImpress/give' ) |
|
406 | + __('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'), |
|
407 | + esc_url('https://github.com/WordImpress/give') |
|
408 | 408 | ); |
409 | 409 | ?></p> |
410 | 410 | |
@@ -421,21 +421,21 @@ discard block |
||
421 | 421 | * @return string $readme HTML formatted readme file |
422 | 422 | */ |
423 | 423 | public function parse_readme() { |
424 | - $file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null; |
|
424 | + $file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR . 'readme.txt' : null; |
|
425 | 425 | |
426 | - if ( ! $file ) { |
|
427 | - $readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>'; |
|
426 | + if ( ! $file) { |
|
427 | + $readme = '<p>'.esc_html__('No valid changlog was found.', 'give').'</p>'; |
|
428 | 428 | } else { |
429 | - $readme = file_get_contents( $file ); |
|
430 | - $readme = nl2br( esc_html( $readme ) ); |
|
431 | - $readme = explode( '== Changelog ==', $readme ); |
|
432 | - $readme = end( $readme ); |
|
433 | - |
|
434 | - $readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme ); |
|
435 | - $readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme ); |
|
436 | - $readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme ); |
|
437 | - $readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme ); |
|
438 | - $readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme ); |
|
429 | + $readme = file_get_contents($file); |
|
430 | + $readme = nl2br(esc_html($readme)); |
|
431 | + $readme = explode('== Changelog ==', $readme); |
|
432 | + $readme = end($readme); |
|
433 | + |
|
434 | + $readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme); |
|
435 | + $readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme); |
|
436 | + $readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme); |
|
437 | + $readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme); |
|
438 | + $readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | return $readme; |
@@ -452,24 +452,24 @@ discard block |
||
452 | 452 | public function contributors() { |
453 | 453 | $contributors = $this->get_contributors(); |
454 | 454 | |
455 | - if ( empty( $contributors ) ) { |
|
455 | + if (empty($contributors)) { |
|
456 | 456 | return ''; |
457 | 457 | } |
458 | 458 | |
459 | 459 | $contributor_list = '<ul class="wp-people-group">'; |
460 | 460 | |
461 | - foreach ( $contributors as $contributor ) { |
|
461 | + foreach ($contributors as $contributor) { |
|
462 | 462 | $contributor_list .= '<li class="wp-person">'; |
463 | 463 | $contributor_list .= sprintf( |
464 | 464 | '<a href="%1$s" target="_blank"><img src="%2$s" width="64" height="64" class="gravatar" alt="%3$s" /></a>', |
465 | - esc_url( 'https://github.com/' . $contributor->login ), |
|
466 | - esc_url( $contributor->avatar_url ), |
|
467 | - esc_attr( $contributor->login ) |
|
465 | + esc_url('https://github.com/'.$contributor->login), |
|
466 | + esc_url($contributor->avatar_url), |
|
467 | + esc_attr($contributor->login) |
|
468 | 468 | ); |
469 | 469 | $contributor_list .= sprintf( |
470 | 470 | '<a class="web" target="_blank" href="%1$s">%2$s</a>', |
471 | - esc_url( 'https://github.com/' . $contributor->login ), |
|
472 | - esc_html( $contributor->login ) |
|
471 | + esc_url('https://github.com/'.$contributor->login), |
|
472 | + esc_html($contributor->login) |
|
473 | 473 | ); |
474 | 474 | $contributor_list .= '</li>'; |
475 | 475 | } |
@@ -487,25 +487,25 @@ discard block |
||
487 | 487 | * @return array $contributors List of contributors |
488 | 488 | */ |
489 | 489 | public function get_contributors() { |
490 | - $contributors = Give_Cache::get( 'give_contributors', true ); |
|
490 | + $contributors = Give_Cache::get('give_contributors', true); |
|
491 | 491 | |
492 | - if ( false !== $contributors ) { |
|
492 | + if (false !== $contributors) { |
|
493 | 493 | return $contributors; |
494 | 494 | } |
495 | 495 | |
496 | - $response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) ); |
|
496 | + $response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false)); |
|
497 | 497 | |
498 | - if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { |
|
498 | + if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) { |
|
499 | 499 | return array(); |
500 | 500 | } |
501 | 501 | |
502 | - $contributors = json_decode( wp_remote_retrieve_body( $response ) ); |
|
502 | + $contributors = json_decode(wp_remote_retrieve_body($response)); |
|
503 | 503 | |
504 | - if ( ! is_array( $contributors ) ) { |
|
504 | + if ( ! is_array($contributors)) { |
|
505 | 505 | return array(); |
506 | 506 | } |
507 | 507 | |
508 | - Give_Cache::set( 'give_contributors', $contributors, HOUR_IN_SECONDS, true ); |
|
508 | + Give_Cache::set('give_contributors', $contributors, HOUR_IN_SECONDS, true); |
|
509 | 509 | |
510 | 510 | return $contributors; |
511 | 511 | } |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | */ |
518 | 518 | public function get_welcome_header() { |
519 | 519 | // Badge for welcome page |
520 | - $badge_url = GIVE_PLUGIN_URL . 'assets/dist/images/give-badge.png'; |
|
520 | + $badge_url = GIVE_PLUGIN_URL.'assets/dist/images/give-badge.png'; |
|
521 | 521 | ?> |
522 | 522 | <h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1> |
523 | 523 | <?php $this->social_media_elements(); ?> |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | <a href="https://twitter.com/givewp" class="twitter-follow-button" data-show-count="false"><?php |
611 | 611 | printf( |
612 | 612 | /* translators: %s: Give twitter user @givewp */ |
613 | - esc_html_e( 'Follow %s', 'give' ), |
|
613 | + esc_html_e('Follow %s', 'give'), |
|
614 | 614 | '@givewp' |
615 | 615 | ); |
616 | 616 | ?></a> |
@@ -644,27 +644,27 @@ discard block |
||
644 | 644 | public function welcome() { |
645 | 645 | |
646 | 646 | // Bail if no activation redirect |
647 | - if ( ! Give_Cache::get( '_give_activation_redirect', true ) || wp_doing_ajax() ) { |
|
647 | + if ( ! Give_Cache::get('_give_activation_redirect', true) || wp_doing_ajax()) { |
|
648 | 648 | return; |
649 | 649 | } |
650 | 650 | |
651 | 651 | // Delete the redirect transient |
652 | - Give_Cache::delete( Give_Cache::get_key( '_give_activation_redirect' ) ); |
|
652 | + Give_Cache::delete(Give_Cache::get_key('_give_activation_redirect')); |
|
653 | 653 | |
654 | 654 | // Bail if activating from network, or bulk |
655 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
655 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
656 | 656 | return; |
657 | 657 | } |
658 | 658 | |
659 | - $upgrade = get_option( 'give_version_upgraded_from' ); |
|
659 | + $upgrade = get_option('give_version_upgraded_from'); |
|
660 | 660 | |
661 | - if ( ! $upgrade ) { // First time install |
|
662 | - wp_safe_redirect( admin_url( 'index.php?page=give-about' ) ); |
|
661 | + if ( ! $upgrade) { // First time install |
|
662 | + wp_safe_redirect(admin_url('index.php?page=give-about')); |
|
663 | 663 | exit; |
664 | - } elseif ( ! give_is_setting_enabled( give_get_option( 'welcome' ) ) ) { // Welcome is disabled in settings |
|
664 | + } elseif ( ! give_is_setting_enabled(give_get_option('welcome'))) { // Welcome is disabled in settings |
|
665 | 665 | |
666 | 666 | } else { // Welcome is NOT disabled in settings |
667 | - wp_safe_redirect( admin_url( 'index.php?page=give-about' ) ); |
|
667 | + wp_safe_redirect(admin_url('index.php?page=give-about')); |
|
668 | 668 | exit; |
669 | 669 | } |
670 | 670 | } |