@@ -6,16 +6,16 @@ discard block |
||
6 | 6 | * @version 1.0 |
7 | 7 | */ |
8 | 8 | |
9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
9 | +if ( ! defined('ABSPATH')) { |
|
10 | 10 | exit; |
11 | 11 | } // Exit if accessed directly. |
12 | 12 | |
13 | 13 | // For gmail compatibility, including CSS styles in head/body are stripped out therefore styles need to be inline. These variables contain rules which are added to the template inline. !important; is a gmail hack to prevent styles being stripped if it doesn't like something. |
14 | -$body = " |
|
14 | +$body = " |
|
15 | 15 | background-color: #f6f6f6; |
16 | 16 | font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; |
17 | 17 | "; |
18 | -$wrapper = " |
|
18 | +$wrapper = " |
|
19 | 19 | width:100%; |
20 | 20 | -webkit-text-size-adjust:none !important; |
21 | 21 | margin:0; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | text-align: center; |
43 | 43 | vertical-align:middle; |
44 | 44 | "; |
45 | -$body_content = " |
|
45 | +$body_content = " |
|
46 | 46 | border-radius:3px !important; |
47 | 47 | font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; |
48 | 48 | "; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | line-height:150%; |
54 | 54 | text-align:left; |
55 | 55 | "; |
56 | -$header_content_h1 = " |
|
56 | +$header_content_h1 = " |
|
57 | 57 | color: #000000; |
58 | 58 | margin:0; |
59 | 59 | padding: 28px 24px; |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | font-weight: 500; |
64 | 64 | line-height: 1.2; |
65 | 65 | "; |
66 | -$header_img = give_get_option( 'email_logo', '' ); |
|
66 | +$header_img = give_get_option('email_logo', ''); |
|
67 | 67 | ?> |
68 | 68 | <!DOCTYPE html> |
69 | 69 | <html> |
70 | 70 | <head> |
71 | 71 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
72 | - <title><?php echo get_bloginfo( 'name' ); ?></title> |
|
72 | + <title><?php echo get_bloginfo('name'); ?></title> |
|
73 | 73 | </head> |
74 | 74 | <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" style="<?php echo $body; ?>"> |
75 | 75 | <div style="<?php echo $wrapper; ?>"> |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | <tr> |
78 | 78 | <td align="center" valign="top"> |
79 | 79 | <?php |
80 | - if ( ! empty( $header_img ) ) : ?> |
|
80 | + if ( ! empty($header_img)) : ?> |
|
81 | 81 | <div id="template_header_image"> |
82 | - <?php echo '<p style="margin-top:0;"><img style="' . $template_image . '" src="' . esc_url( $header_img ) . '" alt="' . get_bloginfo( 'name' ) . '" /></p>'; ?> |
|
82 | + <?php echo '<p style="margin-top:0;"><img style="'.$template_image.'" src="'.esc_url($header_img).'" alt="'.get_bloginfo('name').'" /></p>'; ?> |
|
83 | 83 | </div> |
84 | 84 | <?php endif; ?> |
85 | 85 | <table border="0" cellpadding="0" cellspacing="0" width="600" id="template_container" style="<?php echo $template_container; ?>"> |
@@ -6,7 +6,7 @@ |
||
6 | 6 | * @version 1.0 |
7 | 7 | */ |
8 | 8 | |
9 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. |
|
9 | +if ( ! defined('ABSPATH')) exit; // Exit if accessed directly. |
|
10 | 10 | |
11 | 11 | // {email} is replaced by the content entered in Donations > Settings > Emails |
12 | 12 |
@@ -6,7 +6,10 @@ |
||
6 | 6 | * @version 1.0 |
7 | 7 | */ |
8 | 8 | |
9 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. |
|
9 | +if ( ! defined( 'ABSPATH' ) ) { |
|
10 | + exit; |
|
11 | +} |
|
12 | +// Exit if accessed directly. |
|
10 | 13 | |
11 | 14 | // {email} is replaced by the content entered in Donations > Settings > Emails |
12 | 15 |
@@ -39,8 +39,8 @@ |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | if ( ( is_plugin_active( 'wordpress-seo/wp-seo.php' ) |
42 | - || is_plugin_active( 'wordpress-seo-premium/wp-seo-premium.php' ) ) |
|
43 | - && class_exists( 'WPSEO_Sitemaps_Cache' ) |
|
42 | + || is_plugin_active( 'wordpress-seo-premium/wp-seo-premium.php' ) ) |
|
43 | + && class_exists( 'WPSEO_Sitemaps_Cache' ) |
|
44 | 44 | ) { |
45 | 45 | |
46 | 46 | $forms_singular_option = give_get_option( 'forms_singular' ); |
@@ -19,10 +19,10 @@ discard block |
||
19 | 19 | * @return void |
20 | 20 | */ |
21 | 21 | function give_disable_mandrill_nl2br() { |
22 | - add_filter( 'mandrill_nl2br', '__return_false' ); |
|
22 | + add_filter('mandrill_nl2br', '__return_false'); |
|
23 | 23 | } |
24 | 24 | |
25 | -add_action( 'give_email_send_before', 'give_disable_mandrill_nl2br' ); |
|
25 | +add_action('give_email_send_before', 'give_disable_mandrill_nl2br'); |
|
26 | 26 | |
27 | 27 | |
28 | 28 | /** |
@@ -34,30 +34,30 @@ discard block |
||
34 | 34 | */ |
35 | 35 | function give_clear_seo_sitemap_cache_on_settings_change() { |
36 | 36 | // Load required file if the fn 'is_plugin_active' doesn't exists. |
37 | - if ( ! function_exists( 'is_plugin_active' ) ) { |
|
38 | - require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
37 | + if ( ! function_exists('is_plugin_active')) { |
|
38 | + require_once ABSPATH.'wp-admin/includes/plugin.php'; |
|
39 | 39 | } |
40 | 40 | |
41 | - if ( ( is_plugin_active( 'wordpress-seo/wp-seo.php' ) |
|
42 | - || is_plugin_active( 'wordpress-seo-premium/wp-seo-premium.php' ) ) |
|
43 | - && class_exists( 'WPSEO_Sitemaps_Cache' ) |
|
41 | + if ((is_plugin_active('wordpress-seo/wp-seo.php') |
|
42 | + || is_plugin_active('wordpress-seo-premium/wp-seo-premium.php')) |
|
43 | + && class_exists('WPSEO_Sitemaps_Cache') |
|
44 | 44 | ) { |
45 | 45 | |
46 | - $forms_singular_option = give_get_option( 'forms_singular' ); |
|
47 | - $forms_archive_option = give_get_option( 'forms_singular' ); |
|
46 | + $forms_singular_option = give_get_option('forms_singular'); |
|
47 | + $forms_archive_option = give_get_option('forms_singular'); |
|
48 | 48 | |
49 | 49 | // If there is change detected for Single Form View and Form Archives options then proceed. |
50 | 50 | if ( |
51 | - ( isset( $_POST['forms_singular'] ) && $_POST['forms_singular'] !== $forms_singular_option ) || |
|
52 | - ( isset( $_POST['forms_archives'] ) && $_POST['forms_archives'] !== $forms_archive_option ) |
|
51 | + (isset($_POST['forms_singular']) && $_POST['forms_singular'] !== $forms_singular_option) || |
|
52 | + (isset($_POST['forms_archives']) && $_POST['forms_archives'] !== $forms_archive_option) |
|
53 | 53 | ) { |
54 | 54 | // If Yoast SEO or Yoast SEO Premium plugin exists, then update seo sitemap cache. |
55 | 55 | $yoast_sitemaps_cache = new WPSEO_Sitemaps_Cache(); |
56 | - if ( method_exists( $yoast_sitemaps_cache, 'clear' ) ) { |
|
56 | + if (method_exists($yoast_sitemaps_cache, 'clear')) { |
|
57 | 57 | WPSEO_Sitemaps_Cache::clear(); |
58 | 58 | } |
59 | 59 | } |
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | -add_action( 'give-settings_save_display', 'give_clear_seo_sitemap_cache_on_settings_change' ); |
|
63 | +add_action('give-settings_save_display', 'give_clear_seo_sitemap_cache_on_settings_change'); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly. |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -23,36 +23,36 @@ discard block |
||
23 | 23 | function give_setup_post_types() { |
24 | 24 | |
25 | 25 | // Give Forms single post and archive options. |
26 | - $give_forms_singular = give_is_setting_enabled( give_get_option( 'forms_singular' ) ); |
|
27 | - $give_forms_archives = give_is_setting_enabled( give_get_option( 'forms_archives' ) ); |
|
26 | + $give_forms_singular = give_is_setting_enabled(give_get_option('forms_singular')); |
|
27 | + $give_forms_archives = give_is_setting_enabled(give_get_option('forms_archives')); |
|
28 | 28 | |
29 | - $give_forms_slug = defined( 'GIVE_SLUG' ) ? GIVE_SLUG : 'donations'; |
|
29 | + $give_forms_slug = defined('GIVE_SLUG') ? GIVE_SLUG : 'donations'; |
|
30 | 30 | // Support for old 'GIVE_FORMS_SLUG' constant |
31 | - if ( defined( 'GIVE_FORMS_SLUG' ) ) { |
|
31 | + if (defined('GIVE_FORMS_SLUG')) { |
|
32 | 32 | $give_forms_slug = GIVE_FORMS_SLUG; |
33 | 33 | } |
34 | 34 | |
35 | - $give_forms_rewrite = defined( 'GIVE_DISABLE_FORMS_REWRITE' ) && GIVE_DISABLE_FORMS_REWRITE ? false : array( |
|
35 | + $give_forms_rewrite = defined('GIVE_DISABLE_FORMS_REWRITE') && GIVE_DISABLE_FORMS_REWRITE ? false : array( |
|
36 | 36 | 'slug' => $give_forms_slug, |
37 | 37 | 'with_front' => false, |
38 | 38 | ); |
39 | 39 | |
40 | - $give_forms_labels = apply_filters( 'give_forms_labels', array( |
|
41 | - 'name' => __( 'Donation Forms', 'give' ), |
|
42 | - 'singular_name' => __( 'Form', 'give' ), |
|
43 | - 'add_new' => __( 'Add Form', 'give' ), |
|
44 | - 'add_new_item' => __( 'Add New Donation Form', 'give' ), |
|
45 | - 'edit_item' => __( 'Edit Donation Form', 'give' ), |
|
46 | - 'new_item' => __( 'New Form', 'give' ), |
|
47 | - 'all_items' => __( 'All Forms', 'give' ), |
|
48 | - 'view_item' => __( 'View Form', 'give' ), |
|
49 | - 'search_items' => __( 'Search Forms', 'give' ), |
|
50 | - 'not_found' => __( 'No forms found.', 'give' ), |
|
51 | - 'not_found_in_trash' => __( 'No forms found in Trash.', 'give' ), |
|
40 | + $give_forms_labels = apply_filters('give_forms_labels', array( |
|
41 | + 'name' => __('Donation Forms', 'give'), |
|
42 | + 'singular_name' => __('Form', 'give'), |
|
43 | + 'add_new' => __('Add Form', 'give'), |
|
44 | + 'add_new_item' => __('Add New Donation Form', 'give'), |
|
45 | + 'edit_item' => __('Edit Donation Form', 'give'), |
|
46 | + 'new_item' => __('New Form', 'give'), |
|
47 | + 'all_items' => __('All Forms', 'give'), |
|
48 | + 'view_item' => __('View Form', 'give'), |
|
49 | + 'search_items' => __('Search Forms', 'give'), |
|
50 | + 'not_found' => __('No forms found.', 'give'), |
|
51 | + 'not_found_in_trash' => __('No forms found in Trash.', 'give'), |
|
52 | 52 | 'parent_item_colon' => '', |
53 | - 'menu_name' => apply_filters( 'give_menu_name', __( 'Donations', 'give' ) ), |
|
54 | - 'name_admin_bar' => apply_filters( 'give_name_admin_bar_name', __( 'Donation Form', 'give' ) ), |
|
55 | - ) ); |
|
53 | + 'menu_name' => apply_filters('give_menu_name', __('Donations', 'give')), |
|
54 | + 'name_admin_bar' => apply_filters('give_name_admin_bar_name', __('Donation Form', 'give')), |
|
55 | + )); |
|
56 | 56 | |
57 | 57 | // Default give_forms supports. |
58 | 58 | $give_form_supports = array( |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | ); |
65 | 65 | |
66 | 66 | // Has the user disabled the excerpt? |
67 | - if ( ! give_is_setting_enabled( give_get_option( 'forms_excerpt' ) ) ) { |
|
68 | - unset( $give_form_supports[2] ); |
|
67 | + if ( ! give_is_setting_enabled(give_get_option('forms_excerpt'))) { |
|
68 | + unset($give_form_supports[2]); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | // Has user disabled the featured image? |
72 | - if ( ! give_is_setting_enabled( give_get_option( 'form_featured_img' ) ) ) { |
|
73 | - unset( $give_form_supports[1] ); |
|
74 | - remove_action( 'give_before_single_form_summary', 'give_show_form_images' ); |
|
72 | + if ( ! give_is_setting_enabled(give_get_option('form_featured_img'))) { |
|
73 | + unset($give_form_supports[1]); |
|
74 | + remove_action('give_before_single_form_summary', 'give_show_form_images'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $give_forms_args = array( |
@@ -86,42 +86,42 @@ discard block |
||
86 | 86 | 'has_archive' => $give_forms_archives, |
87 | 87 | 'menu_icon' => 'dashicons-give', |
88 | 88 | 'hierarchical' => false, |
89 | - 'supports' => apply_filters( 'give_forms_supports', $give_form_supports ), |
|
89 | + 'supports' => apply_filters('give_forms_supports', $give_form_supports), |
|
90 | 90 | ); |
91 | - register_post_type( 'give_forms', apply_filters( 'give_forms_post_type_args', $give_forms_args ) ); |
|
91 | + register_post_type('give_forms', apply_filters('give_forms_post_type_args', $give_forms_args)); |
|
92 | 92 | |
93 | 93 | /** Donation Post Type */ |
94 | 94 | $payment_labels = array( |
95 | - 'name' => _x( 'Donations', 'post type general name', 'give' ), |
|
96 | - 'singular_name' => _x( 'Donation', 'post type singular name', 'give' ), |
|
97 | - 'add_new' => __( 'Add New', 'give' ), |
|
98 | - 'add_new_item' => __( 'Add New Donation', 'give' ), |
|
99 | - 'edit_item' => __( 'Edit Donation', 'give' ), |
|
100 | - 'new_item' => __( 'New Donation', 'give' ), |
|
101 | - 'all_items' => __( 'All Donations', 'give' ), |
|
102 | - 'view_item' => __( 'View Donation', 'give' ), |
|
103 | - 'search_items' => __( 'Search Donations', 'give' ), |
|
104 | - 'not_found' => __( 'No donations found.', 'give' ), |
|
105 | - 'not_found_in_trash' => __( 'No donations found in Trash.', 'give' ), |
|
95 | + 'name' => _x('Donations', 'post type general name', 'give'), |
|
96 | + 'singular_name' => _x('Donation', 'post type singular name', 'give'), |
|
97 | + 'add_new' => __('Add New', 'give'), |
|
98 | + 'add_new_item' => __('Add New Donation', 'give'), |
|
99 | + 'edit_item' => __('Edit Donation', 'give'), |
|
100 | + 'new_item' => __('New Donation', 'give'), |
|
101 | + 'all_items' => __('All Donations', 'give'), |
|
102 | + 'view_item' => __('View Donation', 'give'), |
|
103 | + 'search_items' => __('Search Donations', 'give'), |
|
104 | + 'not_found' => __('No donations found.', 'give'), |
|
105 | + 'not_found_in_trash' => __('No donations found in Trash.', 'give'), |
|
106 | 106 | 'parent_item_colon' => '', |
107 | - 'menu_name' => __( 'Donations', 'give' ), |
|
107 | + 'menu_name' => __('Donations', 'give'), |
|
108 | 108 | ); |
109 | 109 | |
110 | 110 | $payment_args = array( |
111 | - 'labels' => apply_filters( 'give_payment_labels', $payment_labels ), |
|
111 | + 'labels' => apply_filters('give_payment_labels', $payment_labels), |
|
112 | 112 | 'public' => false, |
113 | 113 | 'query_var' => false, |
114 | 114 | 'rewrite' => false, |
115 | 115 | 'map_meta_cap' => true, |
116 | 116 | 'capability_type' => 'give_payment', |
117 | - 'supports' => array( 'title' ), |
|
117 | + 'supports' => array('title'), |
|
118 | 118 | 'can_export' => true, |
119 | 119 | ); |
120 | - register_post_type( 'give_payment', $payment_args ); |
|
120 | + register_post_type('give_payment', $payment_args); |
|
121 | 121 | |
122 | 122 | } |
123 | 123 | |
124 | -add_action( 'init', 'give_setup_post_types', 1 ); |
|
124 | +add_action('init', 'give_setup_post_types', 1); |
|
125 | 125 | |
126 | 126 | |
127 | 127 | /** |
@@ -134,30 +134,30 @@ discard block |
||
134 | 134 | */ |
135 | 135 | function give_setup_taxonomies() { |
136 | 136 | |
137 | - $slug = defined( 'GIVE_FORMS_SLUG' ) ? GIVE_FORMS_SLUG : 'donations'; |
|
137 | + $slug = defined('GIVE_FORMS_SLUG') ? GIVE_FORMS_SLUG : 'donations'; |
|
138 | 138 | |
139 | 139 | /** Categories */ |
140 | 140 | $category_labels = array( |
141 | - 'name' => _x( 'Form Categories', 'taxonomy general name', 'give' ), |
|
142 | - 'singular_name' => _x( 'Category', 'taxonomy singular name', 'give' ), |
|
143 | - 'search_items' => __( 'Search Categories', 'give' ), |
|
144 | - 'all_items' => __( 'All Categories', 'give' ), |
|
145 | - 'parent_item' => __( 'Parent Category', 'give' ), |
|
146 | - 'parent_item_colon' => __( 'Parent Category:', 'give' ), |
|
147 | - 'edit_item' => __( 'Edit Category', 'give' ), |
|
148 | - 'update_item' => __( 'Update Category', 'give' ), |
|
149 | - 'add_new_item' => __( 'Add New Category', 'give' ), |
|
150 | - 'new_item_name' => __( 'New Category Name', 'give' ), |
|
151 | - 'menu_name' => __( 'Categories', 'give' ), |
|
141 | + 'name' => _x('Form Categories', 'taxonomy general name', 'give'), |
|
142 | + 'singular_name' => _x('Category', 'taxonomy singular name', 'give'), |
|
143 | + 'search_items' => __('Search Categories', 'give'), |
|
144 | + 'all_items' => __('All Categories', 'give'), |
|
145 | + 'parent_item' => __('Parent Category', 'give'), |
|
146 | + 'parent_item_colon' => __('Parent Category:', 'give'), |
|
147 | + 'edit_item' => __('Edit Category', 'give'), |
|
148 | + 'update_item' => __('Update Category', 'give'), |
|
149 | + 'add_new_item' => __('Add New Category', 'give'), |
|
150 | + 'new_item_name' => __('New Category Name', 'give'), |
|
151 | + 'menu_name' => __('Categories', 'give'), |
|
152 | 152 | ); |
153 | 153 | |
154 | - $category_args = apply_filters( 'give_forms_category_args', array( |
|
154 | + $category_args = apply_filters('give_forms_category_args', array( |
|
155 | 155 | 'hierarchical' => true, |
156 | - 'labels' => apply_filters( 'give_forms_category_labels', $category_labels ), |
|
156 | + 'labels' => apply_filters('give_forms_category_labels', $category_labels), |
|
157 | 157 | 'show_ui' => true, |
158 | 158 | 'query_var' => 'give_forms_category', |
159 | 159 | 'rewrite' => array( |
160 | - 'slug' => $slug . '/category', |
|
160 | + 'slug' => $slug.'/category', |
|
161 | 161 | 'with_front' => false, |
162 | 162 | 'hierarchical' => true, |
163 | 163 | ), |
@@ -171,33 +171,33 @@ discard block |
||
171 | 171 | ); |
172 | 172 | |
173 | 173 | // Does the user want categories? |
174 | - if ( give_is_setting_enabled( give_get_option( 'categories', 'disabled' ) ) ) { |
|
175 | - register_taxonomy( 'give_forms_category', array( 'give_forms' ), $category_args ); |
|
176 | - register_taxonomy_for_object_type( 'give_forms_category', 'give_forms' ); |
|
174 | + if (give_is_setting_enabled(give_get_option('categories', 'disabled'))) { |
|
175 | + register_taxonomy('give_forms_category', array('give_forms'), $category_args); |
|
176 | + register_taxonomy_for_object_type('give_forms_category', 'give_forms'); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** Tags */ |
180 | 180 | $tag_labels = array( |
181 | - 'name' => _x( 'Form Tags', 'taxonomy general name', 'give' ), |
|
182 | - 'singular_name' => _x( 'Tag', 'taxonomy singular name', 'give' ), |
|
183 | - 'search_items' => __( 'Search Tags', 'give' ), |
|
184 | - 'all_items' => __( 'All Tags', 'give' ), |
|
185 | - 'parent_item' => __( 'Parent Tag', 'give' ), |
|
186 | - 'parent_item_colon' => __( 'Parent Tag:', 'give' ), |
|
187 | - 'edit_item' => __( 'Edit Tag', 'give' ), |
|
188 | - 'update_item' => __( 'Update Tag', 'give' ), |
|
189 | - 'add_new_item' => __( 'Add New Tag', 'give' ), |
|
190 | - 'new_item_name' => __( 'New Tag Name', 'give' ), |
|
191 | - 'menu_name' => __( 'Tags', 'give' ), |
|
192 | - 'choose_from_most_used' => __( 'Choose from most used tags.', 'give' ), |
|
181 | + 'name' => _x('Form Tags', 'taxonomy general name', 'give'), |
|
182 | + 'singular_name' => _x('Tag', 'taxonomy singular name', 'give'), |
|
183 | + 'search_items' => __('Search Tags', 'give'), |
|
184 | + 'all_items' => __('All Tags', 'give'), |
|
185 | + 'parent_item' => __('Parent Tag', 'give'), |
|
186 | + 'parent_item_colon' => __('Parent Tag:', 'give'), |
|
187 | + 'edit_item' => __('Edit Tag', 'give'), |
|
188 | + 'update_item' => __('Update Tag', 'give'), |
|
189 | + 'add_new_item' => __('Add New Tag', 'give'), |
|
190 | + 'new_item_name' => __('New Tag Name', 'give'), |
|
191 | + 'menu_name' => __('Tags', 'give'), |
|
192 | + 'choose_from_most_used' => __('Choose from most used tags.', 'give'), |
|
193 | 193 | ); |
194 | 194 | |
195 | - $tag_args = apply_filters( 'give_forms_tag_args', array( |
|
195 | + $tag_args = apply_filters('give_forms_tag_args', array( |
|
196 | 196 | 'hierarchical' => false, |
197 | - 'labels' => apply_filters( 'give_forms_tag_labels', $tag_labels ), |
|
197 | + 'labels' => apply_filters('give_forms_tag_labels', $tag_labels), |
|
198 | 198 | 'show_ui' => true, |
199 | 199 | 'query_var' => 'give_forms_tag', |
200 | - 'rewrite' => array( 'slug' => $slug . '/tag', 'with_front' => false, 'hierarchical' => true ), |
|
200 | + 'rewrite' => array('slug' => $slug.'/tag', 'with_front' => false, 'hierarchical' => true), |
|
201 | 201 | 'capabilities' => array( |
202 | 202 | 'manage_terms' => 'manage_give_form_terms', |
203 | 203 | 'edit_terms' => 'edit_give_form_terms', |
@@ -207,14 +207,14 @@ discard block |
||
207 | 207 | ) |
208 | 208 | ); |
209 | 209 | |
210 | - if ( give_is_setting_enabled( give_get_option( 'tags', 'disabled' ) ) ) { |
|
211 | - register_taxonomy( 'give_forms_tag', array( 'give_forms' ), $tag_args ); |
|
212 | - register_taxonomy_for_object_type( 'give_forms_tag', 'give_forms' ); |
|
210 | + if (give_is_setting_enabled(give_get_option('tags', 'disabled'))) { |
|
211 | + register_taxonomy('give_forms_tag', array('give_forms'), $tag_args); |
|
212 | + register_taxonomy_for_object_type('give_forms_tag', 'give_forms'); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | } |
216 | 216 | |
217 | -add_action( 'init', 'give_setup_taxonomies', 0 ); |
|
217 | +add_action('init', 'give_setup_taxonomies', 0); |
|
218 | 218 | |
219 | 219 | |
220 | 220 | /** |
@@ -225,11 +225,11 @@ discard block |
||
225 | 225 | */ |
226 | 226 | function give_get_default_form_labels() { |
227 | 227 | $defaults = array( |
228 | - 'singular' => __( 'Form', 'give' ), |
|
229 | - 'plural' => __( 'Forms', 'give' ), |
|
228 | + 'singular' => __('Form', 'give'), |
|
229 | + 'plural' => __('Forms', 'give'), |
|
230 | 230 | ); |
231 | 231 | |
232 | - return apply_filters( 'give_default_form_name', $defaults ); |
|
232 | + return apply_filters('give_default_form_name', $defaults); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | /** |
@@ -241,10 +241,10 @@ discard block |
||
241 | 241 | * |
242 | 242 | * @return string $defaults['singular'] Singular label |
243 | 243 | */ |
244 | -function give_get_forms_label_singular( $lowercase = false ) { |
|
244 | +function give_get_forms_label_singular($lowercase = false) { |
|
245 | 245 | $defaults = give_get_default_form_labels(); |
246 | 246 | |
247 | - return ( $lowercase ) ? strtolower( $defaults['singular'] ) : $defaults['singular']; |
|
247 | + return ($lowercase) ? strtolower($defaults['singular']) : $defaults['singular']; |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | /** |
@@ -253,10 +253,10 @@ discard block |
||
253 | 253 | * @since 1.0 |
254 | 254 | * @return string $defaults['plural'] Plural label |
255 | 255 | */ |
256 | -function give_get_forms_label_plural( $lowercase = false ) { |
|
256 | +function give_get_forms_label_plural($lowercase = false) { |
|
257 | 257 | $defaults = give_get_default_form_labels(); |
258 | 258 | |
259 | - return ( $lowercase ) ? strtolower( $defaults['plural'] ) : $defaults['plural']; |
|
259 | + return ($lowercase) ? strtolower($defaults['plural']) : $defaults['plural']; |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | /** |
@@ -268,24 +268,24 @@ discard block |
||
268 | 268 | * |
269 | 269 | * @return string $title New placeholder text |
270 | 270 | */ |
271 | -function give_change_default_title( $title ) { |
|
271 | +function give_change_default_title($title) { |
|
272 | 272 | // If a frontend plugin uses this filter (check extensions before changing this function) |
273 | - if ( ! is_admin() ) { |
|
274 | - $title = __( 'Enter form title here', 'give' ); |
|
273 | + if ( ! is_admin()) { |
|
274 | + $title = __('Enter form title here', 'give'); |
|
275 | 275 | |
276 | 276 | return $title; |
277 | 277 | } |
278 | 278 | |
279 | 279 | $screen = get_current_screen(); |
280 | 280 | |
281 | - if ( 'give_forms' == $screen->post_type ) { |
|
282 | - $title = __( 'Enter form title here', 'give' ); |
|
281 | + if ('give_forms' == $screen->post_type) { |
|
282 | + $title = __('Enter form title here', 'give'); |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | return $title; |
286 | 286 | } |
287 | 287 | |
288 | -add_filter( 'enter_title_here', 'give_change_default_title' ); |
|
288 | +add_filter('enter_title_here', 'give_change_default_title'); |
|
289 | 289 | |
290 | 290 | /** |
291 | 291 | * Registers Custom Post Statuses which are used by the Payments |
@@ -295,67 +295,67 @@ discard block |
||
295 | 295 | */ |
296 | 296 | function give_register_post_type_statuses() { |
297 | 297 | // Payment Statuses |
298 | - register_post_status( 'refunded', array( |
|
299 | - 'label' => __( 'Refunded', 'give' ), |
|
298 | + register_post_status('refunded', array( |
|
299 | + 'label' => __('Refunded', 'give'), |
|
300 | 300 | 'public' => true, |
301 | 301 | 'exclude_from_search' => false, |
302 | 302 | 'show_in_admin_all_list' => true, |
303 | 303 | 'show_in_admin_status_list' => true, |
304 | - 'label_count' => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'give' ), |
|
305 | - ) ); |
|
306 | - register_post_status( 'failed', array( |
|
307 | - 'label' => __( 'Failed', 'give' ), |
|
304 | + 'label_count' => _n_noop('Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'give'), |
|
305 | + )); |
|
306 | + register_post_status('failed', array( |
|
307 | + 'label' => __('Failed', 'give'), |
|
308 | 308 | 'public' => true, |
309 | 309 | 'exclude_from_search' => false, |
310 | 310 | 'show_in_admin_all_list' => true, |
311 | 311 | 'show_in_admin_status_list' => true, |
312 | - 'label_count' => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'give' ), |
|
313 | - ) ); |
|
314 | - register_post_status( 'revoked', array( |
|
315 | - 'label' => __( 'Revoked', 'give' ), |
|
312 | + 'label_count' => _n_noop('Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'give'), |
|
313 | + )); |
|
314 | + register_post_status('revoked', array( |
|
315 | + 'label' => __('Revoked', 'give'), |
|
316 | 316 | 'public' => true, |
317 | 317 | 'exclude_from_search' => false, |
318 | 318 | 'show_in_admin_all_list' => true, |
319 | 319 | 'show_in_admin_status_list' => true, |
320 | - 'label_count' => _n_noop( 'Revoked <span class="count">(%s)</span>', 'Revoked <span class="count">(%s)</span>', 'give' ), |
|
321 | - ) ); |
|
322 | - register_post_status( 'cancelled', array( |
|
323 | - 'label' => __( 'Cancelled', 'give' ), |
|
320 | + 'label_count' => _n_noop('Revoked <span class="count">(%s)</span>', 'Revoked <span class="count">(%s)</span>', 'give'), |
|
321 | + )); |
|
322 | + register_post_status('cancelled', array( |
|
323 | + 'label' => __('Cancelled', 'give'), |
|
324 | 324 | 'public' => true, |
325 | 325 | 'exclude_from_search' => false, |
326 | 326 | 'show_in_admin_all_list' => true, |
327 | 327 | 'show_in_admin_status_list' => true, |
328 | - 'label_count' => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'give' ), |
|
329 | - ) ); |
|
330 | - register_post_status( 'abandoned', array( |
|
331 | - 'label' => __( 'Abandoned', 'give' ), |
|
328 | + 'label_count' => _n_noop('Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'give'), |
|
329 | + )); |
|
330 | + register_post_status('abandoned', array( |
|
331 | + 'label' => __('Abandoned', 'give'), |
|
332 | 332 | 'public' => true, |
333 | 333 | 'exclude_from_search' => false, |
334 | 334 | 'show_in_admin_all_list' => true, |
335 | 335 | 'show_in_admin_status_list' => true, |
336 | - 'label_count' => _n_noop( 'Abandoned <span class="count">(%s)</span>', 'Abandoned <span class="count">(%s)</span>', 'give' ), |
|
337 | - ) ); |
|
338 | - register_post_status( 'processing', array( |
|
339 | - 'label' => _x( 'Processing', 'Processing payment status', 'give' ), |
|
336 | + 'label_count' => _n_noop('Abandoned <span class="count">(%s)</span>', 'Abandoned <span class="count">(%s)</span>', 'give'), |
|
337 | + )); |
|
338 | + register_post_status('processing', array( |
|
339 | + 'label' => _x('Processing', 'Processing payment status', 'give'), |
|
340 | 340 | 'public' => true, |
341 | 341 | 'exclude_from_search' => false, |
342 | 342 | 'show_in_admin_all_list' => true, |
343 | 343 | 'show_in_admin_status_list' => true, |
344 | - 'label_count' => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'give' ) |
|
345 | - ) ); |
|
344 | + 'label_count' => _n_noop('Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'give') |
|
345 | + )); |
|
346 | 346 | |
347 | - register_post_status( 'preapproval', array( |
|
348 | - 'label' => _x( 'Preapproval', 'Preapproval payment status', 'give' ), |
|
347 | + register_post_status('preapproval', array( |
|
348 | + 'label' => _x('Preapproval', 'Preapproval payment status', 'give'), |
|
349 | 349 | 'public' => true, |
350 | 350 | 'exclude_from_search' => false, |
351 | 351 | 'show_in_admin_all_list' => true, |
352 | 352 | 'show_in_admin_status_list' => true, |
353 | - 'label_count' => _n_noop( 'Preapproval <span class="count">(%s)</span>', 'Preapproval <span class="count">(%s)</span>', 'give' ), |
|
354 | - ) ); |
|
353 | + 'label_count' => _n_noop('Preapproval <span class="count">(%s)</span>', 'Preapproval <span class="count">(%s)</span>', 'give'), |
|
354 | + )); |
|
355 | 355 | |
356 | 356 | } |
357 | 357 | |
358 | -add_action( 'init', 'give_register_post_type_statuses' ); |
|
358 | +add_action('init', 'give_register_post_type_statuses'); |
|
359 | 359 | |
360 | 360 | /** |
361 | 361 | * Updated Messages |
@@ -368,27 +368,27 @@ discard block |
||
368 | 368 | * |
369 | 369 | * @return array $messages New post updated messages |
370 | 370 | */ |
371 | -function give_updated_messages( $messages ) { |
|
371 | +function give_updated_messages($messages) { |
|
372 | 372 | global $post, $post_ID; |
373 | 373 | |
374 | - if ( ! give_is_setting_enabled( give_get_option( 'forms_singular' ) ) ) { |
|
374 | + if ( ! give_is_setting_enabled(give_get_option('forms_singular'))) { |
|
375 | 375 | |
376 | 376 | $messages['give_forms'] = array( |
377 | - 1 => __( 'Form updated.', 'give' ), |
|
378 | - 4 => __( 'Form updated.', 'give' ), |
|
379 | - 6 => __( 'Form published.', 'give' ), |
|
380 | - 7 => __( 'Form saved.', 'give' ), |
|
381 | - 8 => __( 'Form submitted.', 'give' ), |
|
377 | + 1 => __('Form updated.', 'give'), |
|
378 | + 4 => __('Form updated.', 'give'), |
|
379 | + 6 => __('Form published.', 'give'), |
|
380 | + 7 => __('Form saved.', 'give'), |
|
381 | + 8 => __('Form submitted.', 'give'), |
|
382 | 382 | ); |
383 | 383 | |
384 | 384 | } else { |
385 | 385 | |
386 | 386 | $messages['give_forms'] = array( |
387 | - 1 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form updated.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ), |
|
388 | - 4 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form updated.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ), |
|
389 | - 6 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form published.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ), |
|
390 | - 7 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form saved.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ), |
|
391 | - 8 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form submitted.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ), |
|
387 | + 1 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form updated.', 'give'), get_permalink($post_ID), __('View Form', 'give')), |
|
388 | + 4 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form updated.', 'give'), get_permalink($post_ID), __('View Form', 'give')), |
|
389 | + 6 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form published.', 'give'), get_permalink($post_ID), __('View Form', 'give')), |
|
390 | + 7 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form saved.', 'give'), get_permalink($post_ID), __('View Form', 'give')), |
|
391 | + 8 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form submitted.', 'give'), get_permalink($post_ID), __('View Form', 'give')), |
|
392 | 392 | ); |
393 | 393 | |
394 | 394 | } |
@@ -396,24 +396,24 @@ discard block |
||
396 | 396 | return $messages; |
397 | 397 | } |
398 | 398 | |
399 | -add_filter( 'post_updated_messages', 'give_updated_messages' ); |
|
399 | +add_filter('post_updated_messages', 'give_updated_messages'); |
|
400 | 400 | |
401 | 401 | /** |
402 | 402 | * Ensure post thumbnail support is turned on |
403 | 403 | */ |
404 | 404 | function give_add_thumbnail_support() { |
405 | - if ( ! give_is_setting_enabled( give_get_option( 'form_featured_img' ) ) ) { |
|
405 | + if ( ! give_is_setting_enabled(give_get_option('form_featured_img'))) { |
|
406 | 406 | return; |
407 | 407 | } |
408 | 408 | |
409 | - if ( ! current_theme_supports( 'post-thumbnails' ) ) { |
|
410 | - add_theme_support( 'post-thumbnails' ); |
|
409 | + if ( ! current_theme_supports('post-thumbnails')) { |
|
410 | + add_theme_support('post-thumbnails'); |
|
411 | 411 | } |
412 | 412 | |
413 | - add_post_type_support( 'give_forms', 'thumbnail' ); |
|
413 | + add_post_type_support('give_forms', 'thumbnail'); |
|
414 | 414 | } |
415 | 415 | |
416 | -add_action( 'after_setup_theme', 'give_add_thumbnail_support', 10 ); |
|
416 | +add_action('after_setup_theme', 'give_add_thumbnail_support', 10); |
|
417 | 417 | |
418 | 418 | /** |
419 | 419 | * Give Sidebars |
@@ -424,21 +424,21 @@ discard block |
||
424 | 424 | |
425 | 425 | // Single Give Forms (disabled if single turned off in settings) |
426 | 426 | if ( |
427 | - give_is_setting_enabled( give_get_option( 'forms_singular' ) ) |
|
428 | - && give_is_setting_enabled( give_get_option( 'form_sidebar' ) ) |
|
427 | + give_is_setting_enabled(give_get_option('forms_singular')) |
|
428 | + && give_is_setting_enabled(give_get_option('form_sidebar')) |
|
429 | 429 | ) { |
430 | 430 | |
431 | - register_sidebar( apply_filters( 'give_forms_single_sidebar', array( |
|
432 | - 'name' => __( 'Give Single Form Sidebar', 'give' ), |
|
431 | + register_sidebar(apply_filters('give_forms_single_sidebar', array( |
|
432 | + 'name' => __('Give Single Form Sidebar', 'give'), |
|
433 | 433 | 'id' => 'give-forms-sidebar', |
434 | - 'description' => __( 'Widgets in this area will be shown on the single Give forms aside area. This sidebar will not display for embedded forms.', 'give' ), |
|
434 | + 'description' => __('Widgets in this area will be shown on the single Give forms aside area. This sidebar will not display for embedded forms.', 'give'), |
|
435 | 435 | 'before_widget' => '<div id="%1$s" class="widget %2$s">', |
436 | 436 | 'after_widget' => '</div>', |
437 | 437 | 'before_title' => '<h3 class="widgettitle widget-title">', |
438 | 438 | 'after_title' => '</h3>', |
439 | - ) ) ); |
|
439 | + ))); |
|
440 | 440 | |
441 | 441 | } |
442 | 442 | } |
443 | 443 | |
444 | -add_action( 'widgets_init', 'give_widgets_init', 999 ); |
|
444 | +add_action('widgets_init', 'give_widgets_init', 999); |
@@ -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 | |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | */ |
25 | 25 | function give_donors_page() { |
26 | 26 | $default_views = give_donor_views(); |
27 | - $requested_view = isset( $_GET['view'] ) ? sanitize_text_field( $_GET['view'] ) : 'donors'; |
|
28 | - if ( array_key_exists( $requested_view, $default_views ) && function_exists( $default_views[ $requested_view ] ) ) { |
|
29 | - give_render_donor_view( $requested_view, $default_views ); |
|
27 | + $requested_view = isset($_GET['view']) ? sanitize_text_field($_GET['view']) : 'donors'; |
|
28 | + if (array_key_exists($requested_view, $default_views) && function_exists($default_views[$requested_view])) { |
|
29 | + give_render_donor_view($requested_view, $default_views); |
|
30 | 30 | } else { |
31 | 31 | give_donors_list(); |
32 | 32 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $views = array(); |
44 | 44 | |
45 | - return apply_filters( 'give_donor_views', $views ); |
|
45 | + return apply_filters('give_donor_views', $views); |
|
46 | 46 | |
47 | 47 | } |
48 | 48 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $tabs = array(); |
58 | 58 | |
59 | - return apply_filters( 'give_donor_tabs', $tabs ); |
|
59 | + return apply_filters('give_donor_tabs', $tabs); |
|
60 | 60 | |
61 | 61 | } |
62 | 62 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @return void |
68 | 68 | */ |
69 | 69 | function give_donors_list() { |
70 | - include dirname( __FILE__ ) . '/class-donor-table.php'; |
|
70 | + include dirname(__FILE__).'/class-donor-table.php'; |
|
71 | 71 | |
72 | 72 | $donors_table = new Give_Donor_List_Table(); |
73 | 73 | $donors_table->prepare_items(); |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @since 1.0 |
82 | 82 | */ |
83 | - do_action( 'give_donors_table_top' ); |
|
83 | + do_action('give_donors_table_top'); |
|
84 | 84 | ?> |
85 | - <form id="give-donors-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors' ); ?>"> |
|
85 | + <form id="give-donors-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors'); ?>"> |
|
86 | 86 | <?php |
87 | - $donors_table->search_box( esc_html__( 'Search Donors', 'give' ), 'give-donors' ); |
|
87 | + $donors_table->search_box(esc_html__('Search Donors', 'give'), 'give-donors'); |
|
88 | 88 | $donors_table->display(); |
89 | 89 | ?> |
90 | 90 | <input type="hidden" name="post_type" value="give_forms" /> |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @since 1.0 |
99 | 99 | */ |
100 | - do_action( 'give_donors_table_bottom' ); |
|
100 | + do_action('give_donors_table_bottom'); |
|
101 | 101 | ?> |
102 | 102 | </div> |
103 | 103 | <?php |
@@ -113,27 +113,27 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @return void |
115 | 115 | */ |
116 | -function give_render_donor_view( $view, $callbacks ) { |
|
116 | +function give_render_donor_view($view, $callbacks) { |
|
117 | 117 | |
118 | 118 | $render = true; |
119 | 119 | |
120 | - $donor_view_role = apply_filters( 'give_view_donors_role', 'view_give_reports' ); |
|
120 | + $donor_view_role = apply_filters('give_view_donors_role', 'view_give_reports'); |
|
121 | 121 | |
122 | - if ( ! current_user_can( $donor_view_role ) ) { |
|
123 | - give_set_error( 'give-no-access', __( 'You are not permitted to view this data.', 'give' ) ); |
|
122 | + if ( ! current_user_can($donor_view_role)) { |
|
123 | + give_set_error('give-no-access', __('You are not permitted to view this data.', 'give')); |
|
124 | 124 | $render = false; |
125 | 125 | } |
126 | 126 | |
127 | - if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
|
128 | - give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) ); |
|
127 | + if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) { |
|
128 | + give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give')); |
|
129 | 129 | $render = false; |
130 | 130 | } |
131 | 131 | |
132 | 132 | $donor_id = (int) $_GET['id']; |
133 | - $donor = new Give_Donor( $donor_id ); |
|
133 | + $donor = new Give_Donor($donor_id); |
|
134 | 134 | |
135 | - if ( empty( $donor->id ) ) { |
|
136 | - give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) ); |
|
135 | + if (empty($donor->id)) { |
|
136 | + give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give')); |
|
137 | 137 | $render = false; |
138 | 138 | } |
139 | 139 | |
@@ -142,34 +142,34 @@ discard block |
||
142 | 142 | |
143 | 143 | <div class='wrap'> |
144 | 144 | |
145 | - <?php if ( give_get_errors() ) : ?> |
|
145 | + <?php if (give_get_errors()) : ?> |
|
146 | 146 | <div class="error settings-error"> |
147 | - <?php Give()->notices->render_frontend_notices( 0 ); ?> |
|
147 | + <?php Give()->notices->render_frontend_notices(0); ?> |
|
148 | 148 | </div> |
149 | 149 | <?php endif; ?> |
150 | 150 | |
151 | - <h1 class="screen-reader-text"><?php esc_html_e( 'Donor', 'give' ); ?></h1> |
|
151 | + <h1 class="screen-reader-text"><?php esc_html_e('Donor', 'give'); ?></h1> |
|
152 | 152 | |
153 | - <?php if ( $donor && $render ) : ?> |
|
153 | + <?php if ($donor && $render) : ?> |
|
154 | 154 | |
155 | 155 | <h2 class="nav-tab-wrapper"> |
156 | 156 | <?php |
157 | - foreach ( $donor_tabs as $key => $tab ) : |
|
157 | + foreach ($donor_tabs as $key => $tab) : |
|
158 | 158 | $active = $key === $view ? true : false; |
159 | 159 | $class = $active ? 'nav-tab nav-tab-active' : 'nav-tab'; |
160 | 160 | printf( |
161 | - '<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>' . "\n", |
|
162 | - esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=' . $key . '&id=' . $donor->id ) ), |
|
163 | - esc_attr( $class ), |
|
164 | - sanitize_html_class( $tab['dashicon'] ), |
|
165 | - esc_html( $tab['title'] ) |
|
161 | + '<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>'."\n", |
|
162 | + esc_url(admin_url('edit.php?post_type=give_forms&page=give-donors&view='.$key.'&id='.$donor->id)), |
|
163 | + esc_attr($class), |
|
164 | + sanitize_html_class($tab['dashicon']), |
|
165 | + esc_html($tab['title']) |
|
166 | 166 | ); |
167 | 167 | endforeach; |
168 | 168 | ?> |
169 | 169 | </h2> |
170 | 170 | |
171 | 171 | <div id="give-donor-card-wrapper"> |
172 | - <?php $callbacks[ $view ]( $donor ) ?> |
|
172 | + <?php $callbacks[$view]($donor) ?> |
|
173 | 173 | </div> |
174 | 174 | |
175 | 175 | <?php endif; ?> |
@@ -189,9 +189,9 @@ discard block |
||
189 | 189 | * |
190 | 190 | * @return void |
191 | 191 | */ |
192 | -function give_donor_view( $donor ) { |
|
192 | +function give_donor_view($donor) { |
|
193 | 193 | |
194 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
194 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
195 | 195 | |
196 | 196 | /** |
197 | 197 | * Fires in donor profile screen, above the donor card. |
@@ -200,32 +200,32 @@ discard block |
||
200 | 200 | * |
201 | 201 | * @param object $donor The donor object being displayed. |
202 | 202 | */ |
203 | - do_action( 'give_donor_card_top', $donor ); |
|
203 | + do_action('give_donor_card_top', $donor); |
|
204 | 204 | ?> |
205 | 205 | |
206 | 206 | <div id="donor-summary" class="info-wrapper donor-section postbox"> |
207 | 207 | |
208 | - <form id="edit-donor-info" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); ?>"> |
|
208 | + <form id="edit-donor-info" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); ?>"> |
|
209 | 209 | |
210 | 210 | <div class="donor-info"> |
211 | 211 | |
212 | 212 | <div class="donor-bio-header clearfix"> |
213 | 213 | |
214 | 214 | <div class="avatar-wrap left" id="donor-avatar"> |
215 | - <?php echo get_avatar( $donor->email ); ?> |
|
215 | + <?php echo get_avatar($donor->email); ?> |
|
216 | 216 | </div> |
217 | 217 | |
218 | 218 | <div id="donor-name-wrap" class="left"> |
219 | 219 | <span class="donor-id">#<?php echo $donor->id; ?></span> |
220 | - <span class="donor-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr( $donor->name ); ?>" placeholder="<?php esc_attr_e( 'Donor Name', 'give' ); ?>" /></span> |
|
220 | + <span class="donor-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr($donor->name); ?>" placeholder="<?php esc_attr_e('Donor Name', 'give'); ?>" /></span> |
|
221 | 221 | <span class="donor-name info-item editable"><span data-key="name"><?php echo $donor->name; ?></span></span> |
222 | 222 | </div> |
223 | 223 | <p class="donor-since info-item"> |
224 | - <?php esc_html_e( 'Donor since', 'give' ); ?> |
|
225 | - <?php echo date_i18n( give_date_format(), strtotime( $donor->date_created ) ) ?> |
|
224 | + <?php esc_html_e('Donor since', 'give'); ?> |
|
225 | + <?php echo date_i18n(give_date_format(), strtotime($donor->date_created)) ?> |
|
226 | 226 | </p> |
227 | - <?php if ( current_user_can( $donor_edit_role ) ) : ?> |
|
228 | - <a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php esc_html_e( 'Edit Donor', 'give' ); ?></a> |
|
227 | + <?php if (current_user_can($donor_edit_role)) : ?> |
|
228 | + <a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php esc_html_e('Edit Donor', 'give'); ?></a> |
|
229 | 229 | <?php endif; ?> |
230 | 230 | </div> |
231 | 231 | <!-- /donor-bio-header --> |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | <table class="widefat"> |
236 | 236 | <tbody> |
237 | 237 | <tr class="alternate"> |
238 | - <th scope="col"><label for="tablecell"><?php esc_html_e( 'User:', 'give' ); ?></label></th> |
|
238 | + <th scope="col"><label for="tablecell"><?php esc_html_e('User:', 'give'); ?></label></th> |
|
239 | 239 | <td> |
240 | 240 | <span class="donor-user-id info-item edit-item"> |
241 | 241 | <?php |
@@ -252,37 +252,37 @@ discard block |
||
252 | 252 | 'data' => $data_atts, |
253 | 253 | ); |
254 | 254 | |
255 | - if ( ! empty( $user_id ) ) { |
|
256 | - $userdata = get_userdata( $user_id ); |
|
255 | + if ( ! empty($user_id)) { |
|
256 | + $userdata = get_userdata($user_id); |
|
257 | 257 | $user_args['selected'] = $user_id; |
258 | 258 | } |
259 | 259 | |
260 | - echo Give()->html->ajax_user_search( $user_args ); |
|
260 | + echo Give()->html->ajax_user_search($user_args); |
|
261 | 261 | ?> |
262 | 262 | </span> |
263 | 263 | |
264 | 264 | <span class="donor-user-id info-item editable"> |
265 | - <?php if ( ! empty( $userdata ) ) { ?> |
|
266 | - <span data-key="user_id">#<?php echo $donor->user_id . ' - ' . $userdata->display_name; ?></span> |
|
265 | + <?php if ( ! empty($userdata)) { ?> |
|
266 | + <span data-key="user_id">#<?php echo $donor->user_id.' - '.$userdata->display_name; ?></span> |
|
267 | 267 | <?php } else { ?> |
268 | - <span data-key="user_id"><?php esc_html_e( 'None', 'give' ); ?></span> |
|
268 | + <span data-key="user_id"><?php esc_html_e('None', 'give'); ?></span> |
|
269 | 269 | <?php } ?> |
270 | - <?php if ( current_user_can( $donor_edit_role ) && intval( $donor->user_id ) > 0 ) { ?> |
|
271 | - <span class="disconnect-user"> - <a id="disconnect-donor" href="#disconnect" aria-label="<?php esc_attr_e( 'Disconnects the current user ID from this donor record.', 'give' ); ?>"><?php esc_html_e( 'Disconnect User', 'give' ); ?></a></span> |
|
270 | + <?php if (current_user_can($donor_edit_role) && intval($donor->user_id) > 0) { ?> |
|
271 | + <span class="disconnect-user"> - <a id="disconnect-donor" href="#disconnect" aria-label="<?php esc_attr_e('Disconnects the current user ID from this donor record.', 'give'); ?>"><?php esc_html_e('Disconnect User', 'give'); ?></a></span> |
|
272 | 272 | <?php } ?> |
273 | 273 | </span> |
274 | 274 | </td> |
275 | 275 | </tr> |
276 | - <?php if ( isset( $donor->user_id ) && $donor->user_id > 0 ) : ?> |
|
276 | + <?php if (isset($donor->user_id) && $donor->user_id > 0) : ?> |
|
277 | 277 | |
278 | 278 | <tr> |
279 | - <th scope="col"><?php esc_html_e( 'Address:', 'give' ); ?></th> |
|
279 | + <th scope="col"><?php esc_html_e('Address:', 'give'); ?></th> |
|
280 | 280 | <td class="row-title"> |
281 | 281 | |
282 | 282 | <div class="donor-address-wrapper"> |
283 | 283 | |
284 | 284 | <?php |
285 | - $address = get_user_meta( $donor->user_id, '_give_user_address', true ); |
|
285 | + $address = get_user_meta($donor->user_id, '_give_user_address', true); |
|
286 | 286 | $defaults = array( |
287 | 287 | 'line1' => '', |
288 | 288 | 'line2' => '', |
@@ -292,10 +292,10 @@ discard block |
||
292 | 292 | 'zip' => '', |
293 | 293 | ); |
294 | 294 | |
295 | - $address = wp_parse_args( $address, $defaults ); |
|
295 | + $address = wp_parse_args($address, $defaults); |
|
296 | 296 | ?> |
297 | 297 | |
298 | - <?php if ( ! empty( $address ) ) { ?> |
|
298 | + <?php if ( ! empty($address)) { ?> |
|
299 | 299 | <span class="donor-address info-item editable"> |
300 | 300 | <span class="info-item" data-key="line1"><?php echo $address['line1']; ?></span> |
301 | 301 | <span class="info-item" data-key="line2"><?php echo $address['line2']; ?></span> |
@@ -306,43 +306,43 @@ discard block |
||
306 | 306 | </span> |
307 | 307 | <?php } ?> |
308 | 308 | <span class="donor-address info-item edit-item"> |
309 | - <input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e( 'Address 1', 'give' ); ?>" value="<?php echo $address['line1']; ?>" /> |
|
310 | - <input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e( 'Address 2', 'give' ); ?>" value="<?php echo $address['line2']; ?>" /> |
|
311 | - <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e( 'City', 'give' ); ?>" value="<?php echo $address['city']; ?>" /> |
|
309 | + <input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e('Address 1', 'give'); ?>" value="<?php echo $address['line1']; ?>" /> |
|
310 | + <input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e('Address 2', 'give'); ?>" value="<?php echo $address['line2']; ?>" /> |
|
311 | + <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e('City', 'give'); ?>" value="<?php echo $address['city']; ?>" /> |
|
312 | 312 | <select data-key="country" name="customerinfo[country]" id="billing_country" class="billing_country give-select edit-item"> |
313 | 313 | <?php |
314 | 314 | |
315 | 315 | $selected_country = $address['country']; |
316 | 316 | |
317 | 317 | $countries = give_get_country_list(); |
318 | - foreach ( $countries as $country_code => $country ) { |
|
319 | - echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>'; |
|
318 | + foreach ($countries as $country_code => $country) { |
|
319 | + echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>'; |
|
320 | 320 | } |
321 | 321 | ?> |
322 | 322 | </select> |
323 | 323 | <?php |
324 | 324 | $selected_state = give_get_state(); |
325 | - $states = give_get_states( $selected_country ); |
|
325 | + $states = give_get_states($selected_country); |
|
326 | 326 | |
327 | - $selected_state = isset( $address['state'] ) ? $address['state'] : $selected_state; |
|
327 | + $selected_state = isset($address['state']) ? $address['state'] : $selected_state; |
|
328 | 328 | |
329 | - if ( ! empty( $states ) ) { |
|
329 | + if ( ! empty($states)) { |
|
330 | 330 | ?> |
331 | 331 | <select data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-select info-item"> |
332 | 332 | <?php |
333 | - foreach ( $states as $state_code => $state ) { |
|
334 | - echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>'; |
|
333 | + foreach ($states as $state_code => $state) { |
|
334 | + echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>'; |
|
335 | 335 | } |
336 | 336 | ?> |
337 | 337 | </select> |
338 | 338 | <?php |
339 | 339 | } else { |
340 | 340 | ?> |
341 | - <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e( 'State / Province / County', 'give' ); ?>" /> |
|
341 | + <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e('State / Province / County', 'give'); ?>" /> |
|
342 | 342 | <?php |
343 | 343 | } |
344 | 344 | ?> |
345 | - <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e( 'Zip / Postal Code', 'give' ); ?>" value="<?php echo $address['zip']; ?>" /> |
|
345 | + <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e('Zip / Postal Code', 'give'); ?>" value="<?php echo $address['zip']; ?>" /> |
|
346 | 346 | </span> |
347 | 347 | |
348 | 348 | </div> |
@@ -358,10 +358,10 @@ discard block |
||
358 | 358 | |
359 | 359 | <span id="donor-edit-actions" class="edit-item"> |
360 | 360 | <input type="hidden" data-key="id" name="customerinfo[id]" value="<?php echo $donor->id; ?>" /> |
361 | - <?php wp_nonce_field( 'edit-donor', '_wpnonce', false, true ); ?> |
|
361 | + <?php wp_nonce_field('edit-donor', '_wpnonce', false, true); ?> |
|
362 | 362 | <input type="hidden" name="give_action" value="edit-donor" /> |
363 | - <input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php esc_attr_e( 'Update Donor', 'give' ); ?>" /> |
|
364 | - <a id="give-edit-donor-cancel" href="" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
363 | + <input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php esc_attr_e('Update Donor', 'give'); ?>" /> |
|
364 | + <a id="give-edit-donor-cancel" href="" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
365 | 365 | </span> |
366 | 366 | |
367 | 367 | </form> |
@@ -376,24 +376,24 @@ discard block |
||
376 | 376 | * |
377 | 377 | * @param object $donor The donor object being displayed. |
378 | 378 | */ |
379 | - do_action( 'give_donor_before_stats', $donor ); |
|
379 | + do_action('give_donor_before_stats', $donor); |
|
380 | 380 | ?> |
381 | 381 | |
382 | 382 | <div id="donor-stats-wrapper" class="donor-section postbox clear"> |
383 | 383 | <ul> |
384 | 384 | <li> |
385 | - <a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . absint( $donor->id ) ); ?>"> |
|
385 | + <a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history&donor='.absint($donor->id)); ?>"> |
|
386 | 386 | <span class="dashicons dashicons-heart"></span> |
387 | 387 | <?php |
388 | 388 | // Completed Donations |
389 | - $completed_donations_text = sprintf( _n( '%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give' ), $donor->purchase_count ); |
|
390 | - echo apply_filters( 'give_donor_completed_donations', $completed_donations_text, $donor ); |
|
389 | + $completed_donations_text = sprintf(_n('%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give'), $donor->purchase_count); |
|
390 | + echo apply_filters('give_donor_completed_donations', $completed_donations_text, $donor); |
|
391 | 391 | ?> |
392 | 392 | </a> |
393 | 393 | </li> |
394 | 394 | <li> |
395 | 395 | <span class="dashicons dashicons-chart-area"></span> |
396 | - <?php echo give_currency_filter( give_format_amount( $donor->purchase_value, array( 'sanitize' => false ) ) ); ?> <?php esc_html_e( 'Lifetime Donations', 'give' ); ?> |
|
396 | + <?php echo give_currency_filter(give_format_amount($donor->purchase_value, array('sanitize' => false))); ?> <?php esc_html_e('Lifetime Donations', 'give'); ?> |
|
397 | 397 | </li> |
398 | 398 | <?php |
399 | 399 | /** |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | * |
406 | 406 | * @param object $donor The donor object being displayed. |
407 | 407 | */ |
408 | - do_action( 'give_donor_stats_list', $donor ); |
|
408 | + do_action('give_donor_stats_list', $donor); |
|
409 | 409 | ?> |
410 | 410 | </ul> |
411 | 411 | </div> |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | * |
419 | 419 | * @param object $donor The donor object being displayed. |
420 | 420 | */ |
421 | - do_action( 'give_donor_before_tables_wrapper', $donor ); |
|
421 | + do_action('give_donor_before_tables_wrapper', $donor); |
|
422 | 422 | ?> |
423 | 423 | |
424 | 424 | <div id="donor-tables-wrapper" class="donor-section"> |
@@ -431,46 +431,46 @@ discard block |
||
431 | 431 | * |
432 | 432 | * @param object $donor The donor object being displayed. |
433 | 433 | */ |
434 | - do_action( 'give_donor_before_tables', $donor ); |
|
434 | + do_action('give_donor_before_tables', $donor); |
|
435 | 435 | ?> |
436 | 436 | |
437 | - <h3><?php _e( 'Donor Emails', 'give' ); ?></h3> |
|
437 | + <h3><?php _e('Donor Emails', 'give'); ?></h3> |
|
438 | 438 | |
439 | 439 | <table class="wp-list-table widefat striped emails"> |
440 | 440 | <thead> |
441 | 441 | <tr> |
442 | - <th><?php _e( 'Email', 'give' ); ?></th> |
|
443 | - <th><?php _e( 'Actions', 'give' ); ?></th> |
|
442 | + <th><?php _e('Email', 'give'); ?></th> |
|
443 | + <th><?php _e('Actions', 'give'); ?></th> |
|
444 | 444 | </tr> |
445 | 445 | </thead> |
446 | 446 | |
447 | 447 | <tbody> |
448 | - <?php if ( ! empty( $donor->emails ) ) { ?> |
|
448 | + <?php if ( ! empty($donor->emails)) { ?> |
|
449 | 449 | |
450 | - <?php foreach ( $donor->emails as $key => $email ) : ?> |
|
450 | + <?php foreach ($donor->emails as $key => $email) : ?> |
|
451 | 451 | <tr data-key="<?php echo $key; ?>"> |
452 | 452 | <td> |
453 | 453 | <?php echo $email; ?> |
454 | - <?php if ( 'primary' === $key ) : ?> |
|
454 | + <?php if ('primary' === $key) : ?> |
|
455 | 455 | <span class="dashicons dashicons-star-filled primary-email-icon"></span> |
456 | 456 | <?php endif; ?> |
457 | 457 | </td> |
458 | 458 | <td> |
459 | - <?php if ( 'primary' !== $key ) : ?> |
|
459 | + <?php if ('primary' !== $key) : ?> |
|
460 | 460 | <?php |
461 | - $base_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); |
|
462 | - $promote_url = wp_nonce_url( add_query_arg( array( |
|
463 | - 'email' => rawurlencode( $email ), |
|
461 | + $base_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); |
|
462 | + $promote_url = wp_nonce_url(add_query_arg(array( |
|
463 | + 'email' => rawurlencode($email), |
|
464 | 464 | 'give_action' => 'set_donor_primary_email', |
465 | - ), $base_url ), 'give-set-donor-primary-email' ); |
|
466 | - $remove_url = wp_nonce_url( add_query_arg( array( |
|
467 | - 'email' => rawurlencode( $email ), |
|
465 | + ), $base_url), 'give-set-donor-primary-email'); |
|
466 | + $remove_url = wp_nonce_url(add_query_arg(array( |
|
467 | + 'email' => rawurlencode($email), |
|
468 | 468 | 'give_action' => 'remove_donor_email', |
469 | - ), $base_url ), 'give-remove-donor-email' ); |
|
469 | + ), $base_url), 'give-remove-donor-email'); |
|
470 | 470 | ?> |
471 | - <a href="<?php echo $promote_url; ?>"><?php _e( 'Make Primary', 'give' ); ?></a> |
|
471 | + <a href="<?php echo $promote_url; ?>"><?php _e('Make Primary', 'give'); ?></a> |
|
472 | 472 | | |
473 | - <a href="<?php echo $remove_url; ?>" class="delete"><?php _e( 'Remove', 'give' ); ?></a> |
|
473 | + <a href="<?php echo $remove_url; ?>" class="delete"><?php _e('Remove', 'give'); ?></a> |
|
474 | 474 | <?php endif; ?> |
475 | 475 | </td> |
476 | 476 | </tr> |
@@ -480,59 +480,59 @@ discard block |
||
480 | 480 | <td colspan="2" class="add-donor-email-td"> |
481 | 481 | <div class="add-donor-email-wrapper"> |
482 | 482 | <input type="hidden" name="donor-id" value="<?php echo $donor->id; ?>" /> |
483 | - <?php wp_nonce_field( 'give_add_donor_email', 'add_email_nonce', false, true ); ?> |
|
484 | - <input type="email" name="additional-email" value="" placeholder="<?php _e( 'Email Address', 'give' ); ?>" /> |
|
485 | - <input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" /> <label for="make-additional-primary"><?php _e( 'Make Primary', 'give' ); ?></label> |
|
486 | - <button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e( 'Add Email', 'give' ); ?></button> |
|
483 | + <?php wp_nonce_field('give_add_donor_email', 'add_email_nonce', false, true); ?> |
|
484 | + <input type="email" name="additional-email" value="" placeholder="<?php _e('Email Address', 'give'); ?>" /> |
|
485 | + <input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" /> <label for="make-additional-primary"><?php _e('Make Primary', 'give'); ?></label> |
|
486 | + <button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e('Add Email', 'give'); ?></button> |
|
487 | 487 | <span class="spinner"></span> |
488 | 488 | </div> |
489 | 489 | <div class="notice-wrap"></div> |
490 | 490 | </td> |
491 | 491 | </tr> |
492 | 492 | <?php } else { ?> |
493 | - <tr><td colspan="2"><?php _e( 'No Emails Found', 'give' ); ?></td></tr> |
|
493 | + <tr><td colspan="2"><?php _e('No Emails Found', 'give'); ?></td></tr> |
|
494 | 494 | <?php }// End if(). |
495 | 495 | ?> |
496 | 496 | </tbody> |
497 | 497 | </table> |
498 | 498 | |
499 | - <h3><?php esc_html_e( 'Recent Donations', 'give' ); ?></h3> |
|
499 | + <h3><?php esc_html_e('Recent Donations', 'give'); ?></h3> |
|
500 | 500 | <?php |
501 | - $payment_ids = explode( ',', $donor->payment_ids ); |
|
502 | - $payments = give_get_payments( array( |
|
501 | + $payment_ids = explode(',', $donor->payment_ids); |
|
502 | + $payments = give_get_payments(array( |
|
503 | 503 | 'post__in' => $payment_ids, |
504 | - ) ); |
|
505 | - $payments = array_slice( $payments, 0, 10 ); |
|
504 | + )); |
|
505 | + $payments = array_slice($payments, 0, 10); |
|
506 | 506 | ?> |
507 | 507 | <table class="wp-list-table widefat striped payments"> |
508 | 508 | <thead> |
509 | 509 | <tr> |
510 | - <th scope="col"><?php esc_html_e( 'ID', 'give' ); ?></th> |
|
511 | - <th scope="col"><?php esc_html_e( 'Amount', 'give' ); ?></th> |
|
512 | - <th scope="col"><?php esc_html_e( 'Date', 'give' ); ?></th> |
|
513 | - <th scope="col"><?php esc_html_e( 'Status', 'give' ); ?></th> |
|
514 | - <th scope="col"><?php esc_html_e( 'Actions', 'give' ); ?></th> |
|
510 | + <th scope="col"><?php esc_html_e('ID', 'give'); ?></th> |
|
511 | + <th scope="col"><?php esc_html_e('Amount', 'give'); ?></th> |
|
512 | + <th scope="col"><?php esc_html_e('Date', 'give'); ?></th> |
|
513 | + <th scope="col"><?php esc_html_e('Status', 'give'); ?></th> |
|
514 | + <th scope="col"><?php esc_html_e('Actions', 'give'); ?></th> |
|
515 | 515 | </tr> |
516 | 516 | </thead> |
517 | 517 | <tbody> |
518 | - <?php if ( ! empty( $payments ) ) { ?> |
|
519 | - <?php foreach ( $payments as $payment ) : ?> |
|
518 | + <?php if ( ! empty($payments)) { ?> |
|
519 | + <?php foreach ($payments as $payment) : ?> |
|
520 | 520 | <tr> |
521 | 521 | <td><?php echo $payment->ID; ?></td> |
522 | - <td><?php echo give_payment_amount( $payment->ID ); ?></td> |
|
523 | - <td><?php echo date_i18n( give_date_format(), strtotime( $payment->post_date ) ); ?></td> |
|
524 | - <td><?php echo give_get_payment_status( $payment, true ); ?></td> |
|
522 | + <td><?php echo give_payment_amount($payment->ID); ?></td> |
|
523 | + <td><?php echo date_i18n(give_date_format(), strtotime($payment->post_date)); ?></td> |
|
524 | + <td><?php echo give_get_payment_status($payment, true); ?></td> |
|
525 | 525 | <td> |
526 | 526 | <?php |
527 | 527 | printf( |
528 | 528 | '<a href="%1$s" aria-label="%2$s">%3$s</a>', |
529 | - admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $payment->ID ), |
|
529 | + admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id='.$payment->ID), |
|
530 | 530 | sprintf( |
531 | 531 | /* translators: %s: Donation ID */ |
532 | - esc_attr__( 'View Donation %s.', 'give' ), |
|
532 | + esc_attr__('View Donation %s.', 'give'), |
|
533 | 533 | $payment->ID |
534 | 534 | ), |
535 | - esc_html__( 'View Donation', 'give' ) |
|
535 | + esc_html__('View Donation', 'give') |
|
536 | 536 | ); |
537 | 537 | ?> |
538 | 538 | |
@@ -547,47 +547,47 @@ discard block |
||
547 | 547 | * @param object $donor The donor object being displayed. |
548 | 548 | * @param object $payment The payment object being displayed. |
549 | 549 | */ |
550 | - do_action( 'give_donor_recent_purchases_actions', $donor, $payment ); |
|
550 | + do_action('give_donor_recent_purchases_actions', $donor, $payment); |
|
551 | 551 | ?> |
552 | 552 | </td> |
553 | 553 | </tr> |
554 | 554 | <?php endforeach; ?> |
555 | 555 | <?php } else { ?> |
556 | 556 | <tr> |
557 | - <td colspan="5"><?php esc_html_e( 'No donations found.', 'give' ); ?></td> |
|
557 | + <td colspan="5"><?php esc_html_e('No donations found.', 'give'); ?></td> |
|
558 | 558 | </tr> |
559 | 559 | <?php }// End if(). |
560 | 560 | ?> |
561 | 561 | </tbody> |
562 | 562 | </table> |
563 | 563 | |
564 | - <h3><?php esc_html_e( 'Completed Forms', 'give' ); ?></h3> |
|
564 | + <h3><?php esc_html_e('Completed Forms', 'give'); ?></h3> |
|
565 | 565 | <?php |
566 | - $donations = give_get_users_completed_donations( $donor->email ); |
|
566 | + $donations = give_get_users_completed_donations($donor->email); |
|
567 | 567 | ?> |
568 | 568 | <table class="wp-list-table widefat striped donations"> |
569 | 569 | <thead> |
570 | 570 | <tr> |
571 | - <th scope="col"><?php esc_html_e( 'Form', 'give' ); ?></th> |
|
572 | - <th scope="col" width="120px"><?php esc_html_e( 'Actions', 'give' ); ?></th> |
|
571 | + <th scope="col"><?php esc_html_e('Form', 'give'); ?></th> |
|
572 | + <th scope="col" width="120px"><?php esc_html_e('Actions', 'give'); ?></th> |
|
573 | 573 | </tr> |
574 | 574 | </thead> |
575 | 575 | <tbody> |
576 | - <?php if ( ! empty( $donations ) ) { ?> |
|
577 | - <?php foreach ( $donations as $donation ) : ?> |
|
576 | + <?php if ( ! empty($donations)) { ?> |
|
577 | + <?php foreach ($donations as $donation) : ?> |
|
578 | 578 | <tr> |
579 | 579 | <td><?php echo $donation->post_title; ?></td> |
580 | 580 | <td> |
581 | 581 | <?php |
582 | 582 | printf( |
583 | 583 | '<a href="%1$s" aria-label="%2$s">%3$s</a>', |
584 | - esc_url( admin_url( 'post.php?action=edit&post=' . $donation->ID ) ), |
|
584 | + esc_url(admin_url('post.php?action=edit&post='.$donation->ID)), |
|
585 | 585 | sprintf( |
586 | 586 | /* translators: %s: form name */ |
587 | - esc_attr__( 'View Form %s.', 'give' ), |
|
587 | + esc_attr__('View Form %s.', 'give'), |
|
588 | 588 | $donation->post_title |
589 | 589 | ), |
590 | - esc_html__( 'View Form', 'give' ) |
|
590 | + esc_html__('View Form', 'give') |
|
591 | 591 | ); |
592 | 592 | ?> |
593 | 593 | </td> |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | <?php endforeach; ?> |
596 | 596 | <?php } else { ?> |
597 | 597 | <tr> |
598 | - <td colspan="2"><?php esc_html_e( 'No completed donations found.', 'give' ); ?></td> |
|
598 | + <td colspan="2"><?php esc_html_e('No completed donations found.', 'give'); ?></td> |
|
599 | 599 | </tr> |
600 | 600 | <?php } ?> |
601 | 601 | </tbody> |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | * |
610 | 610 | * @param object $donor The donor object being displayed. |
611 | 611 | */ |
612 | - do_action( 'give_donor_after_tables', $donor ); |
|
612 | + do_action('give_donor_after_tables', $donor); |
|
613 | 613 | ?> |
614 | 614 | |
615 | 615 | </div> |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | * |
623 | 623 | * @param object $donor The donor object being displayed. |
624 | 624 | */ |
625 | - do_action( 'give_donor_card_bottom', $donor ); |
|
625 | + do_action('give_donor_card_bottom', $donor); |
|
626 | 626 | |
627 | 627 | } |
628 | 628 | |
@@ -635,30 +635,30 @@ discard block |
||
635 | 635 | * |
636 | 636 | * @return void |
637 | 637 | */ |
638 | -function give_donor_notes_view( $donor ) { |
|
638 | +function give_donor_notes_view($donor) { |
|
639 | 639 | |
640 | - $paged = isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) ? $_GET['paged'] : 1; |
|
641 | - $paged = absint( $paged ); |
|
640 | + $paged = isset($_GET['paged']) && is_numeric($_GET['paged']) ? $_GET['paged'] : 1; |
|
641 | + $paged = absint($paged); |
|
642 | 642 | $note_count = $donor->get_notes_count(); |
643 | - $per_page = apply_filters( 'give_donor_notes_per_page', 20 ); |
|
644 | - $total_pages = ceil( $note_count / $per_page ); |
|
645 | - $donor_notes = $donor->get_notes( $per_page, $paged ); |
|
643 | + $per_page = apply_filters('give_donor_notes_per_page', 20); |
|
644 | + $total_pages = ceil($note_count / $per_page); |
|
645 | + $donor_notes = $donor->get_notes($per_page, $paged); |
|
646 | 646 | ?> |
647 | 647 | |
648 | 648 | <div id="donor-notes-wrapper"> |
649 | 649 | <div class="donor-notes-header"> |
650 | - <?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span> |
|
650 | + <?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span> |
|
651 | 651 | </div> |
652 | - <h3><?php esc_html_e( 'Notes', 'give' ); ?></h3> |
|
652 | + <h3><?php esc_html_e('Notes', 'give'); ?></h3> |
|
653 | 653 | |
654 | - <?php if ( 1 == $paged ) : ?> |
|
654 | + <?php if (1 == $paged) : ?> |
|
655 | 655 | <div style="display: block; margin-bottom: 55px;"> |
656 | - <form id="give-add-donor-note" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=notes&id=' . $donor->id ); ?>"> |
|
656 | + <form id="give-add-donor-note" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=notes&id='.$donor->id); ?>"> |
|
657 | 657 | <textarea id="donor-note" name="donor_note" class="donor-note-input" rows="10"></textarea> |
658 | 658 | <br /> |
659 | 659 | <input type="hidden" id="donor-id" name="customer_id" value="<?php echo $donor->id; ?>" /> |
660 | 660 | <input type="hidden" name="give_action" value="add-donor-note" /> |
661 | - <?php wp_nonce_field( 'add-donor-note', 'add_donor_note_nonce', true, true ); ?> |
|
661 | + <?php wp_nonce_field('add-donor-note', 'add_donor_note_nonce', true, true); ?> |
|
662 | 662 | <input id="add-donor-note" class="right button-primary" type="submit" value="Add Note" /> |
663 | 663 | </form> |
664 | 664 | </div> |
@@ -673,26 +673,26 @@ discard block |
||
673 | 673 | 'show_all' => true, |
674 | 674 | ); |
675 | 675 | |
676 | - echo paginate_links( $pagination_args ); |
|
676 | + echo paginate_links($pagination_args); |
|
677 | 677 | ?> |
678 | 678 | |
679 | 679 | <div id="give-donor-notes" class="postbox"> |
680 | - <?php if ( count( $donor_notes ) > 0 ) { ?> |
|
681 | - <?php foreach ( $donor_notes as $key => $note ) : ?> |
|
680 | + <?php if (count($donor_notes) > 0) { ?> |
|
681 | + <?php foreach ($donor_notes as $key => $note) : ?> |
|
682 | 682 | <div class="donor-note-wrapper dashboard-comment-wrap comment-item"> |
683 | 683 | <span class="note-content-wrap"> |
684 | - <?php echo stripslashes( $note ); ?> |
|
684 | + <?php echo stripslashes($note); ?> |
|
685 | 685 | </span> |
686 | 686 | </div> |
687 | 687 | <?php endforeach; ?> |
688 | 688 | <?php } else { ?> |
689 | 689 | <div class="give-no-donor-notes"> |
690 | - <?php esc_html_e( 'No donor notes found.', 'give' ); ?> |
|
690 | + <?php esc_html_e('No donor notes found.', 'give'); ?> |
|
691 | 691 | </div> |
692 | 692 | <?php } ?> |
693 | 693 | </div> |
694 | 694 | |
695 | - <?php echo paginate_links( $pagination_args ); ?> |
|
695 | + <?php echo paginate_links($pagination_args); ?> |
|
696 | 696 | |
697 | 697 | </div> |
698 | 698 | |
@@ -708,9 +708,9 @@ discard block |
||
708 | 708 | * |
709 | 709 | * @return void |
710 | 710 | */ |
711 | -function give_donor_delete_view( $donor ) { |
|
711 | +function give_donor_delete_view($donor) { |
|
712 | 712 | |
713 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
713 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
714 | 714 | |
715 | 715 | /** |
716 | 716 | * Fires in donor delete screen, above the content. |
@@ -719,15 +719,15 @@ discard block |
||
719 | 719 | * |
720 | 720 | * @param object $donor The donor object being displayed. |
721 | 721 | */ |
722 | - do_action( 'give_donor_delete_top', $donor ); |
|
722 | + do_action('give_donor_delete_top', $donor); |
|
723 | 723 | ?> |
724 | 724 | |
725 | 725 | <div class="info-wrapper donor-section"> |
726 | 726 | |
727 | - <form id="delete-donor" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $donor->id ); ?>"> |
|
727 | + <form id="delete-donor" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$donor->id); ?>"> |
|
728 | 728 | |
729 | 729 | <div class="donor-notes-header"> |
730 | - <?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span> |
|
730 | + <?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span> |
|
731 | 731 | </div> |
732 | 732 | |
733 | 733 | |
@@ -735,20 +735,20 @@ discard block |
||
735 | 735 | |
736 | 736 | <span class="delete-donor-options"> |
737 | 737 | <p> |
738 | - <?php echo Give()->html->checkbox( array( |
|
738 | + <?php echo Give()->html->checkbox(array( |
|
739 | 739 | 'name' => 'give-donor-delete-confirm', |
740 | - ) ); ?> |
|
741 | - <label for="give-donor-delete-confirm"><?php esc_html_e( 'Are you sure you want to delete this donor?', 'give' ); ?></label> |
|
740 | + )); ?> |
|
741 | + <label for="give-donor-delete-confirm"><?php esc_html_e('Are you sure you want to delete this donor?', 'give'); ?></label> |
|
742 | 742 | </p> |
743 | 743 | |
744 | 744 | <p> |
745 | - <?php echo Give()->html->checkbox( array( |
|
745 | + <?php echo Give()->html->checkbox(array( |
|
746 | 746 | 'name' => 'give-donor-delete-records', |
747 | 747 | 'options' => array( |
748 | 748 | 'disabled' => true, |
749 | 749 | ), |
750 | - ) ); ?> |
|
751 | - <label for="give-donor-delete-records"><?php esc_html_e( 'Delete all associated donations and records?', 'give' ); ?></label> |
|
750 | + )); ?> |
|
751 | + <label for="give-donor-delete-records"><?php esc_html_e('Delete all associated donations and records?', 'give'); ?></label> |
|
752 | 752 | </p> |
753 | 753 | |
754 | 754 | <?php |
@@ -761,16 +761,16 @@ discard block |
||
761 | 761 | * |
762 | 762 | * @param object $donor The donor object being displayed. |
763 | 763 | */ |
764 | - do_action( 'give_donor_delete_inputs', $donor ); |
|
764 | + do_action('give_donor_delete_inputs', $donor); |
|
765 | 765 | ?> |
766 | 766 | </span> |
767 | 767 | |
768 | 768 | <span id="donor-edit-actions"> |
769 | 769 | <input type="hidden" name="customer_id" value="<?php echo $donor->id; ?>" /> |
770 | - <?php wp_nonce_field( 'delete-donor', '_wpnonce', false, true ); ?> |
|
770 | + <?php wp_nonce_field('delete-donor', '_wpnonce', false, true); ?> |
|
771 | 771 | <input type="hidden" name="give_action" value="delete-donor" /> |
772 | - <input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php esc_attr_e( 'Delete Donor', 'give' ); ?>" /> |
|
773 | - <a id="give-delete-donor-cancel" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); ?>" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
772 | + <input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php esc_attr_e('Delete Donor', 'give'); ?>" /> |
|
773 | + <a id="give-delete-donor-cancel" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); ?>" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
774 | 774 | </span> |
775 | 775 | |
776 | 776 | </div> |
@@ -786,5 +786,5 @@ discard block |
||
786 | 786 | * |
787 | 787 | * @param object $donor The donor object being displayed. |
788 | 788 | */ |
789 | - do_action( 'give_donor_delete_bottom', $donor ); |
|
789 | + do_action('give_donor_delete_bottom', $donor); |
|
790 | 790 | } |
@@ -6,25 +6,25 @@ discard block |
||
6 | 6 | global $give_receipt_args, $payment; |
7 | 7 | |
8 | 8 | // Validation: Ensure $payment var is set. |
9 | -if ( empty( $payment ) ) { |
|
10 | - $payment = ! empty( $give_receipt_args['id'] ) ? get_post( $give_receipt_args['id'] ) : 0; |
|
9 | +if (empty($payment)) { |
|
10 | + $payment = ! empty($give_receipt_args['id']) ? get_post($give_receipt_args['id']) : 0; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | // Double-Validation: Check for $payment global. |
14 | -if ( empty( $payment ) ) { |
|
15 | - Give()->notices->print_frontend_notice( __( 'The specified receipt ID appears to be invalid.', 'give' ) ); |
|
14 | +if (empty($payment)) { |
|
15 | + Give()->notices->print_frontend_notice(__('The specified receipt ID appears to be invalid.', 'give')); |
|
16 | 16 | |
17 | 17 | return; |
18 | 18 | } |
19 | 19 | |
20 | 20 | $donation_id = $payment->ID; |
21 | -$form_id = give_get_payment_meta( $donation_id, '_give_payment_form_id', true ); |
|
22 | -$meta = give_get_payment_meta( $donation_id ); |
|
23 | -$donation = give_get_payment_form_title( $meta ); |
|
24 | -$user = give_get_payment_meta_user_info( $donation_id ); |
|
25 | -$email = give_get_payment_user_email( $donation_id ); |
|
21 | +$form_id = give_get_payment_meta($donation_id, '_give_payment_form_id', true); |
|
22 | +$meta = give_get_payment_meta($donation_id); |
|
23 | +$donation = give_get_payment_form_title($meta); |
|
24 | +$user = give_get_payment_meta_user_info($donation_id); |
|
25 | +$email = give_get_payment_user_email($donation_id); |
|
26 | 26 | $status = $payment->post_status; |
27 | -$status_label = give_get_payment_status( $payment, true ); |
|
27 | +$status_label = give_get_payment_status($payment, true); |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Generate Donation Receipt Arguments. |
@@ -34,56 +34,56 @@ discard block |
||
34 | 34 | * @since 1.8.8 |
35 | 35 | */ |
36 | 36 | $give_receipt_args['donation_receipt']['donor'] = array( |
37 | - 'name' => __( 'Donor', 'give' ), |
|
38 | - 'value' => $user['first_name'] . ' ' . $user['last_name'], |
|
37 | + 'name' => __('Donor', 'give'), |
|
38 | + 'value' => $user['first_name'].' '.$user['last_name'], |
|
39 | 39 | 'display' => $give_receipt_args['donor'], |
40 | 40 | ); |
41 | 41 | |
42 | 42 | $give_receipt_args['donation_receipt']['date'] = array( |
43 | - 'name' => __( 'Date', 'give' ), |
|
44 | - 'value' => date_i18n( give_date_format(), strtotime( $meta['date'] ) ), |
|
43 | + 'name' => __('Date', 'give'), |
|
44 | + 'value' => date_i18n(give_date_format(), strtotime($meta['date'])), |
|
45 | 45 | 'display' => $give_receipt_args['date'], |
46 | 46 | ); |
47 | 47 | |
48 | 48 | $give_receipt_args['donation_receipt']['total_donation'] = array( |
49 | - 'name' => __( 'Total Donation', 'give' ), |
|
50 | - 'value' => give_payment_amount( $donation_id ), |
|
49 | + 'name' => __('Total Donation', 'give'), |
|
50 | + 'value' => give_payment_amount($donation_id), |
|
51 | 51 | 'display' => true, |
52 | 52 | ); |
53 | 53 | |
54 | 54 | $give_receipt_args['donation_receipt']['donation'] = array( |
55 | - 'name' => __( 'Donation', 'give' ), |
|
55 | + 'name' => __('Donation', 'give'), |
|
56 | 56 | 'value' => $donation, |
57 | 57 | 'display' => true, |
58 | 58 | ); |
59 | 59 | |
60 | 60 | $give_receipt_args['donation_receipt']['donation_status'] = array( |
61 | - 'name' => __( 'Donation Status', 'give' ), |
|
62 | - 'value' => esc_attr( $status ), |
|
61 | + 'name' => __('Donation Status', 'give'), |
|
62 | + 'value' => esc_attr($status), |
|
63 | 63 | 'display' => $give_receipt_args['payment_status'], |
64 | 64 | ); |
65 | 65 | |
66 | 66 | $give_receipt_args['donation_receipt']['donation_id'] = array( |
67 | - 'name' => __( 'Donation ID', 'give' ), |
|
67 | + 'name' => __('Donation ID', 'give'), |
|
68 | 68 | 'value' => $donation_id, |
69 | - 'display' => ($give_receipt_args['payment_id'])?true:false, |
|
69 | + 'display' => ($give_receipt_args['payment_id']) ?true:false, |
|
70 | 70 | ); |
71 | 71 | |
72 | 72 | $give_receipt_args['donation_receipt']['payment_details'] = array( |
73 | - 'name' => __( 'Payment:', 'give' ), |
|
74 | - 'value' => __( 'Details:', 'give' ), |
|
75 | - 'display' => ($give_receipt_args['payment_id'])?false:true, |
|
73 | + 'name' => __('Payment:', 'give'), |
|
74 | + 'value' => __('Details:', 'give'), |
|
75 | + 'display' => ($give_receipt_args['payment_id']) ?false:true, |
|
76 | 76 | ); |
77 | 77 | |
78 | 78 | $give_receipt_args['donation_receipt']['payment_key'] = array( |
79 | - 'name' => __( 'Payment Key', 'give' ), |
|
80 | - 'value' => get_post_meta( $donation_id, '_give_payment_purchase_key', true ), |
|
79 | + 'name' => __('Payment Key', 'give'), |
|
80 | + 'value' => get_post_meta($donation_id, '_give_payment_purchase_key', true), |
|
81 | 81 | 'display' => $give_receipt_args['payment_key'], |
82 | 82 | ); |
83 | 83 | |
84 | 84 | $give_receipt_args['donation_receipt']['payment_method'] = array( |
85 | - 'name' => __( 'Payment Method', 'give' ), |
|
86 | - 'value' => give_get_gateway_checkout_label( give_get_payment_gateway( $donation_id ) ), |
|
85 | + 'name' => __('Payment Method', 'give'), |
|
86 | + 'value' => give_get_gateway_checkout_label(give_get_payment_gateway($donation_id)), |
|
87 | 87 | 'display' => true, |
88 | 88 | ); |
89 | 89 | |
@@ -98,49 +98,49 @@ discard block |
||
98 | 98 | * |
99 | 99 | * @since 1.8.8 |
100 | 100 | */ |
101 | -$give_receipt_args['donation_receipt'] = apply_filters( 'give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id ); |
|
101 | +$give_receipt_args['donation_receipt'] = apply_filters('give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id); |
|
102 | 102 | |
103 | 103 | // Show payment status notice based on shortcode attribute. |
104 | -if ( filter_var( $give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN ) ) { |
|
104 | +if (filter_var($give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN)) { |
|
105 | 105 | $notice_message = ''; |
106 | 106 | $notice_type = 'warning'; |
107 | 107 | |
108 | - switch ( $status ) { |
|
108 | + switch ($status) { |
|
109 | 109 | case 'publish': |
110 | - $notice_message = __( 'Payment Complete: Thank you for your donation.', 'give' ); |
|
110 | + $notice_message = __('Payment Complete: Thank you for your donation.', 'give'); |
|
111 | 111 | $notice_type = 'success'; |
112 | 112 | break; |
113 | 113 | case 'pending': |
114 | - $notice_message = __( 'Payment Pending: Your donation is currently processing.', 'give' ); |
|
114 | + $notice_message = __('Payment Pending: Your donation is currently processing.', 'give'); |
|
115 | 115 | $notice_type = 'warning'; |
116 | 116 | break; |
117 | 117 | case 'refunded': |
118 | - $notice_message = __( 'Payment Refunded: Your donation has been refunded.', 'give' ); |
|
118 | + $notice_message = __('Payment Refunded: Your donation has been refunded.', 'give'); |
|
119 | 119 | $notice_type = 'warning'; |
120 | 120 | break; |
121 | 121 | case 'preapproval': |
122 | - $notice_message = __( 'Payment Preapproved: Thank you for your donation.', 'give' ); |
|
122 | + $notice_message = __('Payment Preapproved: Thank you for your donation.', 'give'); |
|
123 | 123 | $notice_type = 'warning'; |
124 | 124 | break; |
125 | 125 | case 'failed': |
126 | - $notice_message = __( 'Payment Failed: Please contact the site owner for assistance.', 'give' ); |
|
126 | + $notice_message = __('Payment Failed: Please contact the site owner for assistance.', 'give'); |
|
127 | 127 | $notice_type = 'error'; |
128 | 128 | break; |
129 | 129 | case 'cancelled': |
130 | - $notice_message = __( 'Payment Cancelled: Your donation has been cancelled.', 'give' ); |
|
130 | + $notice_message = __('Payment Cancelled: Your donation has been cancelled.', 'give'); |
|
131 | 131 | $notice_type = 'error'; |
132 | 132 | break; |
133 | 133 | case 'abandoned': |
134 | - $notice_message = __( 'Payment Abandoned: This donation has not been completed.', 'give' ); |
|
134 | + $notice_message = __('Payment Abandoned: This donation has not been completed.', 'give'); |
|
135 | 135 | $notice_type = 'error'; |
136 | 136 | break; |
137 | 137 | case 'revoked': |
138 | - $notice_message = __( 'Payment Revoked: Please contact the site owner for assistance.', 'give' ); |
|
138 | + $notice_message = __('Payment Revoked: Please contact the site owner for assistance.', 'give'); |
|
139 | 139 | $notice_type = 'error'; |
140 | 140 | break; |
141 | 141 | } |
142 | 142 | |
143 | - if ( ! empty( $notice_message ) ) { |
|
143 | + if ( ! empty($notice_message)) { |
|
144 | 144 | /** |
145 | 145 | * Filters payment status notice for receipts. |
146 | 146 | * |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * @param string $status Payment status. |
156 | 156 | * @param array $meta Array of meta data related to the payment. |
157 | 157 | */ |
158 | - echo apply_filters( 'give_receipt_status_notice', Give()->notices->print_frontend_notice( $notice_message, false, $notice_type ), $id, $status, $meta ); |
|
158 | + echo apply_filters('give_receipt_status_notice', Give()->notices->print_frontend_notice($notice_message, false, $notice_type), $id, $status, $meta); |
|
159 | 159 | } |
160 | 160 | }// End if(). |
161 | 161 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * @param object $payment The payment object. |
170 | 170 | * @param array $give_receipt_args Receipt_argument. |
171 | 171 | */ |
172 | -do_action( 'give_payment_receipt_before_table', $payment, $give_receipt_args ); |
|
172 | +do_action('give_payment_receipt_before_table', $payment, $give_receipt_args); |
|
173 | 173 | ?> |
174 | 174 | |
175 | 175 | <table id="give_donation_receipt" class="give-table"> |
@@ -185,11 +185,11 @@ discard block |
||
185 | 185 | * @param object $payment The payment object. |
186 | 186 | * @param array $give_receipt_args Receipt_argument. |
187 | 187 | */ |
188 | - do_action( 'give_payment_receipt_header_before', $payment, $give_receipt_args ); |
|
188 | + do_action('give_payment_receipt_header_before', $payment, $give_receipt_args); |
|
189 | 189 | ?> |
190 | 190 | <tr> |
191 | 191 | <th scope="colgroup" colspan="2"> |
192 | - <span class="give-receipt-thead-text"><?php esc_html_e( 'Donation Receipt', 'give' ) ?></span> |
|
192 | + <span class="give-receipt-thead-text"><?php esc_html_e('Donation Receipt', 'give') ?></span> |
|
193 | 193 | </th> |
194 | 194 | </tr> |
195 | 195 | <?php |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * @param object $payment The payment object. |
204 | 204 | * @param array $give_receipt_args Receipt_argument. |
205 | 205 | */ |
206 | - do_action( 'give_payment_receipt_header_after', $payment, $give_receipt_args ); |
|
206 | + do_action('give_payment_receipt_header_after', $payment, $give_receipt_args); |
|
207 | 207 | ?> |
208 | 208 | </thead> |
209 | 209 | |
@@ -219,11 +219,11 @@ discard block |
||
219 | 219 | * @param object $payment The payment object. |
220 | 220 | * @param array $give_receipt_args Receipt_argument. |
221 | 221 | */ |
222 | - do_action( 'give_payment_receipt_before', $payment, $give_receipt_args ); |
|
222 | + do_action('give_payment_receipt_before', $payment, $give_receipt_args); |
|
223 | 223 | ?> |
224 | 224 | |
225 | - <?php foreach ( $give_receipt_args['donation_receipt'] as $receipt_item ) { ?> |
|
226 | - <?php if ( filter_var( $receipt_item['display'], FILTER_VALIDATE_BOOLEAN ) ) : ?> |
|
225 | + <?php foreach ($give_receipt_args['donation_receipt'] as $receipt_item) { ?> |
|
226 | + <?php if (filter_var($receipt_item['display'], FILTER_VALIDATE_BOOLEAN)) : ?> |
|
227 | 227 | <tr> |
228 | 228 | <td scope="row"><strong><?php echo $receipt_item['name']; ?></strong></td> |
229 | 229 | <td><?php echo $receipt_item['value']; ?></td> |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * @param object $payment The payment object. |
243 | 243 | * @param array $give_receipt_args Receipt_argument. |
244 | 244 | */ |
245 | - do_action( 'give_payment_receipt_after', $payment, $give_receipt_args ); |
|
245 | + do_action('give_payment_receipt_after', $payment, $give_receipt_args); |
|
246 | 246 | ?> |
247 | 247 | </tbody> |
248 | 248 | </table> |
@@ -258,5 +258,5 @@ discard block |
||
258 | 258 | * @param object $payment The payment object. |
259 | 259 | * @param array $give_receipt_args Receipt_argument. |
260 | 260 | */ |
261 | -do_action( 'give_payment_receipt_after_table', $payment, $give_receipt_args ); |
|
261 | +do_action('give_payment_receipt_after_table', $payment, $give_receipt_args); |
|
262 | 262 | ?> |
@@ -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: https://givewp.com/documenation/ */ |
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( 'https://givewp.com/documenation/' ) |
|
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('https://givewp.com/documenation/') |
|
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/images/give-logo-photo-mashup.png' ?>" |
|
179 | - alt="<?php esc_attr_e( 'Give', 'give' ); ?>"> |
|
178 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/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/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/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/images/give-badge.png'; |
|
520 | + $badge_url = GIVE_PLUGIN_URL.'assets/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 ) ) { |
|
647 | + if ( ! Give_Cache::get('_give_activation_redirect', true)) { |
|
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 | } |
@@ -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 | |
@@ -93,19 +93,19 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function get_predefined_dates() { |
95 | 95 | $predefined = array( |
96 | - 'today' => esc_html__( 'Today', 'give' ), |
|
97 | - 'yesterday' => esc_html__( 'Yesterday', 'give' ), |
|
98 | - 'this_week' => esc_html__( 'This Week', 'give' ), |
|
99 | - 'last_week' => esc_html__( 'Last Week', 'give' ), |
|
100 | - 'this_month' => esc_html__( 'This Month', 'give' ), |
|
101 | - 'last_month' => esc_html__( 'Last Month', 'give' ), |
|
102 | - 'this_quarter' => esc_html__( 'This Quarter', 'give' ), |
|
103 | - 'last_quarter' => esc_html__( 'Last Quarter', 'give' ), |
|
104 | - 'this_year' => esc_html__( 'This Year', 'give' ), |
|
105 | - 'last_year' => esc_html__( 'Last Year', 'give' ), |
|
96 | + 'today' => esc_html__('Today', 'give'), |
|
97 | + 'yesterday' => esc_html__('Yesterday', 'give'), |
|
98 | + 'this_week' => esc_html__('This Week', 'give'), |
|
99 | + 'last_week' => esc_html__('Last Week', 'give'), |
|
100 | + 'this_month' => esc_html__('This Month', 'give'), |
|
101 | + 'last_month' => esc_html__('Last Month', 'give'), |
|
102 | + 'this_quarter' => esc_html__('This Quarter', 'give'), |
|
103 | + 'last_quarter' => esc_html__('Last Quarter', 'give'), |
|
104 | + 'this_year' => esc_html__('This Year', 'give'), |
|
105 | + 'last_year' => esc_html__('Last Year', 'give'), |
|
106 | 106 | ); |
107 | 107 | |
108 | - return apply_filters( 'give_stats_predefined_dates', $predefined ); |
|
108 | + return apply_filters('give_stats_predefined_dates', $predefined); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -121,18 +121,18 @@ discard block |
||
121 | 121 | * |
122 | 122 | * @return void |
123 | 123 | */ |
124 | - public function setup_dates( $_start_date = 'this_month', $_end_date = false ) { |
|
124 | + public function setup_dates($_start_date = 'this_month', $_end_date = false) { |
|
125 | 125 | |
126 | - if ( empty( $_start_date ) ) { |
|
126 | + if (empty($_start_date)) { |
|
127 | 127 | $_start_date = 'this_month'; |
128 | 128 | } |
129 | 129 | |
130 | - if ( empty( $_end_date ) ) { |
|
130 | + if (empty($_end_date)) { |
|
131 | 131 | $_end_date = $_start_date; |
132 | 132 | } |
133 | 133 | |
134 | - $this->start_date = $this->convert_date( $_start_date ); |
|
135 | - $this->end_date = $this->convert_date( $_end_date, true ); |
|
134 | + $this->start_date = $this->convert_date($_start_date); |
|
135 | + $this->end_date = $this->convert_date($_end_date, true); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
@@ -148,26 +148,26 @@ discard block |
||
148 | 148 | * |
149 | 149 | * @return array|WP_Error If the date is invalid, a WP_Error object will be returned. |
150 | 150 | */ |
151 | - public function convert_date( $date, $end_date = false ) { |
|
151 | + public function convert_date($date, $end_date = false) { |
|
152 | 152 | |
153 | 153 | $this->timestamp = false; |
154 | 154 | $second = $end_date ? 59 : 0; |
155 | 155 | $minute = $end_date ? 59 : 0; |
156 | 156 | $hour = $end_date ? 23 : 0; |
157 | 157 | $day = 1; |
158 | - $month = date( 'n', current_time( 'timestamp' ) ); |
|
159 | - $year = date( 'Y', current_time( 'timestamp' ) ); |
|
158 | + $month = date('n', current_time('timestamp')); |
|
159 | + $year = date('Y', current_time('timestamp')); |
|
160 | 160 | |
161 | - if ( array_key_exists( (string) $date, $this->get_predefined_dates() ) ) { |
|
161 | + if (array_key_exists((string) $date, $this->get_predefined_dates())) { |
|
162 | 162 | |
163 | 163 | // This is a predefined date rate, such as last_week |
164 | - switch ( $date ) { |
|
164 | + switch ($date) { |
|
165 | 165 | |
166 | 166 | case 'this_month' : |
167 | 167 | |
168 | - if ( $end_date ) { |
|
168 | + if ($end_date) { |
|
169 | 169 | |
170 | - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); |
|
170 | + $day = cal_days_in_month(CAL_GREGORIAN, $month, $year); |
|
171 | 171 | $hour = 23; |
172 | 172 | $minute = 59; |
173 | 173 | $second = 59; |
@@ -177,28 +177,28 @@ discard block |
||
177 | 177 | |
178 | 178 | case 'last_month' : |
179 | 179 | |
180 | - if ( $month == 1 ) { |
|
180 | + if ($month == 1) { |
|
181 | 181 | |
182 | 182 | $month = 12; |
183 | - $year --; |
|
183 | + $year--; |
|
184 | 184 | |
185 | 185 | } else { |
186 | 186 | |
187 | - $month --; |
|
187 | + $month--; |
|
188 | 188 | |
189 | 189 | } |
190 | 190 | |
191 | - if ( $end_date ) { |
|
192 | - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); |
|
191 | + if ($end_date) { |
|
192 | + $day = cal_days_in_month(CAL_GREGORIAN, $month, $year); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | break; |
196 | 196 | |
197 | 197 | case 'today' : |
198 | 198 | |
199 | - $day = date( 'd', current_time( 'timestamp' ) ); |
|
199 | + $day = date('d', current_time('timestamp')); |
|
200 | 200 | |
201 | - if ( $end_date ) { |
|
201 | + if ($end_date) { |
|
202 | 202 | $hour = 23; |
203 | 203 | $minute = 59; |
204 | 204 | $second = 59; |
@@ -208,23 +208,23 @@ discard block |
||
208 | 208 | |
209 | 209 | case 'yesterday' : |
210 | 210 | |
211 | - $day = date( 'd', current_time( 'timestamp' ) ) - 1; |
|
211 | + $day = date('d', current_time('timestamp')) - 1; |
|
212 | 212 | |
213 | 213 | // Check if Today is the first day of the month (meaning subtracting one will get us 0) |
214 | - if ( $day < 1 ) { |
|
214 | + if ($day < 1) { |
|
215 | 215 | |
216 | 216 | // If current month is 1 |
217 | - if ( 1 == $month ) { |
|
217 | + if (1 == $month) { |
|
218 | 218 | |
219 | 219 | $year -= 1; // Today is January 1, so skip back to last day of December |
220 | 220 | $month = 12; |
221 | - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); |
|
221 | + $day = cal_days_in_month(CAL_GREGORIAN, $month, $year); |
|
222 | 222 | |
223 | 223 | } else { |
224 | 224 | |
225 | 225 | // Go back one month and get the last day of the month |
226 | 226 | $month -= 1; |
227 | - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); |
|
227 | + $day = cal_days_in_month(CAL_GREGORIAN, $month, $year); |
|
228 | 228 | |
229 | 229 | } |
230 | 230 | } |
@@ -233,12 +233,12 @@ discard block |
||
233 | 233 | |
234 | 234 | case 'this_week' : |
235 | 235 | |
236 | - $days_to_week_start = ( date( 'w', current_time( 'timestamp' ) ) - 1 ) * 60 * 60 * 24; |
|
237 | - $today = date( 'd', current_time( 'timestamp' ) ) * 60 * 60 * 24; |
|
236 | + $days_to_week_start = (date('w', current_time('timestamp')) - 1) * 60 * 60 * 24; |
|
237 | + $today = date('d', current_time('timestamp')) * 60 * 60 * 24; |
|
238 | 238 | |
239 | - if ( $today < $days_to_week_start ) { |
|
239 | + if ($today < $days_to_week_start) { |
|
240 | 240 | |
241 | - if ( $month > 1 ) { |
|
241 | + if ($month > 1) { |
|
242 | 242 | $month -= 1; |
243 | 243 | } else { |
244 | 244 | $month = 12; |
@@ -246,19 +246,19 @@ discard block |
||
246 | 246 | |
247 | 247 | } |
248 | 248 | |
249 | - if ( ! $end_date ) { |
|
249 | + if ( ! $end_date) { |
|
250 | 250 | |
251 | 251 | // Getting the start day |
252 | 252 | |
253 | - $day = date( 'd', current_time( 'timestamp' ) - $days_to_week_start ) - 1; |
|
254 | - $day += get_option( 'start_of_week' ); |
|
253 | + $day = date('d', current_time('timestamp') - $days_to_week_start) - 1; |
|
254 | + $day += get_option('start_of_week'); |
|
255 | 255 | |
256 | 256 | } else { |
257 | 257 | |
258 | 258 | // Getting the end day |
259 | 259 | |
260 | - $day = date( 'd', current_time( 'timestamp' ) - $days_to_week_start ) - 1; |
|
261 | - $day += get_option( 'start_of_week' ) + 6; |
|
260 | + $day = date('d', current_time('timestamp') - $days_to_week_start) - 1; |
|
261 | + $day += get_option('start_of_week') + 6; |
|
262 | 262 | |
263 | 263 | } |
264 | 264 | |
@@ -266,12 +266,12 @@ discard block |
||
266 | 266 | |
267 | 267 | case 'last_week' : |
268 | 268 | |
269 | - $days_to_week_start = ( date( 'w', current_time( 'timestamp' ) ) - 1 ) * 60 * 60 * 24; |
|
270 | - $today = date( 'd', current_time( 'timestamp' ) ) * 60 * 60 * 24; |
|
269 | + $days_to_week_start = (date('w', current_time('timestamp')) - 1) * 60 * 60 * 24; |
|
270 | + $today = date('d', current_time('timestamp')) * 60 * 60 * 24; |
|
271 | 271 | |
272 | - if ( $today < $days_to_week_start ) { |
|
272 | + if ($today < $days_to_week_start) { |
|
273 | 273 | |
274 | - if ( $month > 1 ) { |
|
274 | + if ($month > 1) { |
|
275 | 275 | $month -= 1; |
276 | 276 | } else { |
277 | 277 | $month = 12; |
@@ -279,19 +279,19 @@ discard block |
||
279 | 279 | |
280 | 280 | } |
281 | 281 | |
282 | - if ( ! $end_date ) { |
|
282 | + if ( ! $end_date) { |
|
283 | 283 | |
284 | 284 | // Getting the start day |
285 | 285 | |
286 | - $day = date( 'd', current_time( 'timestamp' ) - $days_to_week_start ) - 8; |
|
287 | - $day += get_option( 'start_of_week' ); |
|
286 | + $day = date('d', current_time('timestamp') - $days_to_week_start) - 8; |
|
287 | + $day += get_option('start_of_week'); |
|
288 | 288 | |
289 | 289 | } else { |
290 | 290 | |
291 | 291 | // Getting the end day |
292 | 292 | |
293 | - $day = date( 'd', current_time( 'timestamp' ) - $days_to_week_start ) - 8; |
|
294 | - $day += get_option( 'start_of_week' ) + 6; |
|
293 | + $day = date('d', current_time('timestamp') - $days_to_week_start) - 8; |
|
294 | + $day += get_option('start_of_week') + 6; |
|
295 | 295 | |
296 | 296 | } |
297 | 297 | |
@@ -299,39 +299,39 @@ discard block |
||
299 | 299 | |
300 | 300 | case 'this_quarter' : |
301 | 301 | |
302 | - $month_now = date( 'n', current_time( 'timestamp' ) ); |
|
302 | + $month_now = date('n', current_time('timestamp')); |
|
303 | 303 | |
304 | - if ( $month_now <= 3 ) { |
|
304 | + if ($month_now <= 3) { |
|
305 | 305 | |
306 | - if ( ! $end_date ) { |
|
306 | + if ( ! $end_date) { |
|
307 | 307 | $month = 1; |
308 | 308 | } else { |
309 | 309 | $month = 3; |
310 | - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); |
|
310 | + $day = cal_days_in_month(CAL_GREGORIAN, $month, $year); |
|
311 | 311 | $hour = 23; |
312 | 312 | $minute = 59; |
313 | 313 | $second = 59; |
314 | 314 | } |
315 | 315 | |
316 | - } else if ( $month_now <= 6 ) { |
|
316 | + } else if ($month_now <= 6) { |
|
317 | 317 | |
318 | - if ( ! $end_date ) { |
|
318 | + if ( ! $end_date) { |
|
319 | 319 | $month = 4; |
320 | 320 | } else { |
321 | 321 | $month = 6; |
322 | - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); |
|
322 | + $day = cal_days_in_month(CAL_GREGORIAN, $month, $year); |
|
323 | 323 | $hour = 23; |
324 | 324 | $minute = 59; |
325 | 325 | $second = 59; |
326 | 326 | } |
327 | 327 | |
328 | - } else if ( $month_now <= 9 ) { |
|
328 | + } else if ($month_now <= 9) { |
|
329 | 329 | |
330 | - if ( ! $end_date ) { |
|
330 | + if ( ! $end_date) { |
|
331 | 331 | $month = 7; |
332 | 332 | } else { |
333 | 333 | $month = 9; |
334 | - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); |
|
334 | + $day = cal_days_in_month(CAL_GREGORIAN, $month, $year); |
|
335 | 335 | $hour = 23; |
336 | 336 | $minute = 59; |
337 | 337 | $second = 59; |
@@ -339,11 +339,11 @@ discard block |
||
339 | 339 | |
340 | 340 | } else { |
341 | 341 | |
342 | - if ( ! $end_date ) { |
|
342 | + if ( ! $end_date) { |
|
343 | 343 | $month = 10; |
344 | 344 | } else { |
345 | 345 | $month = 12; |
346 | - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); |
|
346 | + $day = cal_days_in_month(CAL_GREGORIAN, $month, $year); |
|
347 | 347 | $hour = 23; |
348 | 348 | $minute = 59; |
349 | 349 | $second = 59; |
@@ -355,40 +355,40 @@ discard block |
||
355 | 355 | |
356 | 356 | case 'last_quarter' : |
357 | 357 | |
358 | - $month_now = date( 'n', current_time( 'timestamp' ) ); |
|
358 | + $month_now = date('n', current_time('timestamp')); |
|
359 | 359 | |
360 | - if ( $month_now <= 3 ) { |
|
360 | + if ($month_now <= 3) { |
|
361 | 361 | |
362 | - if ( ! $end_date ) { |
|
362 | + if ( ! $end_date) { |
|
363 | 363 | $month = 10; |
364 | 364 | } else { |
365 | 365 | $year -= 1; |
366 | 366 | $month = 12; |
367 | - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); |
|
367 | + $day = cal_days_in_month(CAL_GREGORIAN, $month, $year); |
|
368 | 368 | $hour = 23; |
369 | 369 | $minute = 59; |
370 | 370 | $second = 59; |
371 | 371 | } |
372 | 372 | |
373 | - } else if ( $month_now <= 6 ) { |
|
373 | + } else if ($month_now <= 6) { |
|
374 | 374 | |
375 | - if ( ! $end_date ) { |
|
375 | + if ( ! $end_date) { |
|
376 | 376 | $month = 1; |
377 | 377 | } else { |
378 | 378 | $month = 3; |
379 | - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); |
|
379 | + $day = cal_days_in_month(CAL_GREGORIAN, $month, $year); |
|
380 | 380 | $hour = 23; |
381 | 381 | $minute = 59; |
382 | 382 | $second = 59; |
383 | 383 | } |
384 | 384 | |
385 | - } else if ( $month_now <= 9 ) { |
|
385 | + } else if ($month_now <= 9) { |
|
386 | 386 | |
387 | - if ( ! $end_date ) { |
|
387 | + if ( ! $end_date) { |
|
388 | 388 | $month = 4; |
389 | 389 | } else { |
390 | 390 | $month = 6; |
391 | - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); |
|
391 | + $day = cal_days_in_month(CAL_GREGORIAN, $month, $year); |
|
392 | 392 | $hour = 23; |
393 | 393 | $minute = 59; |
394 | 394 | $second = 59; |
@@ -396,11 +396,11 @@ discard block |
||
396 | 396 | |
397 | 397 | } else { |
398 | 398 | |
399 | - if ( ! $end_date ) { |
|
399 | + if ( ! $end_date) { |
|
400 | 400 | $month = 7; |
401 | 401 | } else { |
402 | 402 | $month = 9; |
403 | - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); |
|
403 | + $day = cal_days_in_month(CAL_GREGORIAN, $month, $year); |
|
404 | 404 | $hour = 23; |
405 | 405 | $minute = 59; |
406 | 406 | $second = 59; |
@@ -412,11 +412,11 @@ discard block |
||
412 | 412 | |
413 | 413 | case 'this_year' : |
414 | 414 | |
415 | - if ( ! $end_date ) { |
|
415 | + if ( ! $end_date) { |
|
416 | 416 | $month = 1; |
417 | 417 | } else { |
418 | 418 | $month = 12; |
419 | - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); |
|
419 | + $day = cal_days_in_month(CAL_GREGORIAN, $month, $year); |
|
420 | 420 | $hour = 23; |
421 | 421 | $minute = 59; |
422 | 422 | $second = 59; |
@@ -427,11 +427,11 @@ discard block |
||
427 | 427 | case 'last_year' : |
428 | 428 | |
429 | 429 | $year -= 1; |
430 | - if ( ! $end_date ) { |
|
430 | + if ( ! $end_date) { |
|
431 | 431 | $month = 1; |
432 | 432 | } else { |
433 | 433 | $month = 12; |
434 | - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); |
|
434 | + $day = cal_days_in_month(CAL_GREGORIAN, $month, $year); |
|
435 | 435 | $hour = 23; |
436 | 436 | $minute = 59; |
437 | 437 | $second = 59; |
@@ -442,30 +442,30 @@ discard block |
||
442 | 442 | } |
443 | 443 | |
444 | 444 | |
445 | - } else if ( is_numeric( $date ) ) { |
|
445 | + } else if (is_numeric($date)) { |
|
446 | 446 | |
447 | 447 | // return $date unchanged since it is a timestamp |
448 | 448 | $this->timestamp = true; |
449 | 449 | |
450 | - } else if ( false !== strtotime( $date ) ) { |
|
450 | + } else if (false !== strtotime($date)) { |
|
451 | 451 | |
452 | - $date = strtotime( $date, current_time( 'timestamp' ) ); |
|
453 | - $year = date( 'Y', $date ); |
|
454 | - $month = date( 'm', $date ); |
|
455 | - $day = date( 'd', $date ); |
|
452 | + $date = strtotime($date, current_time('timestamp')); |
|
453 | + $year = date('Y', $date); |
|
454 | + $month = date('m', $date); |
|
455 | + $day = date('d', $date); |
|
456 | 456 | |
457 | 457 | } else { |
458 | 458 | |
459 | - return new WP_Error( 'invalid_date', esc_html__( 'Improper date provided.', 'give' ) ); |
|
459 | + return new WP_Error('invalid_date', esc_html__('Improper date provided.', 'give')); |
|
460 | 460 | |
461 | 461 | } |
462 | 462 | |
463 | - if ( false === $this->timestamp ) { |
|
463 | + if (false === $this->timestamp) { |
|
464 | 464 | // Create an exact timestamp |
465 | - $date = mktime( $hour, $minute, $second, $month, $day, $year ); |
|
465 | + $date = mktime($hour, $minute, $second, $month, $day, $year); |
|
466 | 466 | } |
467 | 467 | |
468 | - return apply_filters( 'give_stats_date', $date, $end_date, $this ); |
|
468 | + return apply_filters('give_stats_date', $date, $end_date, $this); |
|
469 | 469 | |
470 | 470 | } |
471 | 471 | |
@@ -481,33 +481,33 @@ discard block |
||
481 | 481 | * |
482 | 482 | * @return string |
483 | 483 | */ |
484 | - public function count_where( $where = '' ) { |
|
484 | + public function count_where($where = '') { |
|
485 | 485 | // Only get payments in our date range |
486 | 486 | |
487 | 487 | $start_where = ''; |
488 | 488 | $end_where = ''; |
489 | 489 | |
490 | - if ( $this->start_date ) { |
|
490 | + if ($this->start_date) { |
|
491 | 491 | |
492 | - if ( $this->timestamp ) { |
|
492 | + if ($this->timestamp) { |
|
493 | 493 | $format = 'Y-m-d H:i:s'; |
494 | 494 | } else { |
495 | 495 | $format = 'Y-m-d 00:00:00'; |
496 | 496 | } |
497 | 497 | |
498 | - $start_date = date( $format, $this->start_date ); |
|
498 | + $start_date = date($format, $this->start_date); |
|
499 | 499 | $start_where = " AND p.post_date >= '{$start_date}'"; |
500 | 500 | } |
501 | 501 | |
502 | - if ( $this->end_date ) { |
|
502 | + if ($this->end_date) { |
|
503 | 503 | |
504 | - if ( $this->timestamp ) { |
|
504 | + if ($this->timestamp) { |
|
505 | 505 | $format = 'Y-m-d H:i:s'; |
506 | 506 | } else { |
507 | 507 | $format = 'Y-m-d 23:59:59'; |
508 | 508 | } |
509 | 509 | |
510 | - $end_date = date( $format, $this->end_date ); |
|
510 | + $end_date = date($format, $this->end_date); |
|
511 | 511 | |
512 | 512 | $end_where = " AND p.post_date <= '{$end_date}'"; |
513 | 513 | } |
@@ -529,34 +529,34 @@ discard block |
||
529 | 529 | * |
530 | 530 | * @return string |
531 | 531 | */ |
532 | - public function payments_where( $where = '' ) { |
|
532 | + public function payments_where($where = '') { |
|
533 | 533 | |
534 | 534 | global $wpdb; |
535 | 535 | |
536 | 536 | $start_where = ''; |
537 | 537 | $end_where = ''; |
538 | 538 | |
539 | - if ( ! is_wp_error( $this->start_date ) ) { |
|
539 | + if ( ! is_wp_error($this->start_date)) { |
|
540 | 540 | |
541 | - if ( $this->timestamp ) { |
|
541 | + if ($this->timestamp) { |
|
542 | 542 | $format = 'Y-m-d H:i:s'; |
543 | 543 | } else { |
544 | 544 | $format = 'Y-m-d 00:00:00'; |
545 | 545 | } |
546 | 546 | |
547 | - $start_date = date( $format, $this->start_date ); |
|
547 | + $start_date = date($format, $this->start_date); |
|
548 | 548 | $start_where = " AND $wpdb->posts.post_date >= '{$start_date}'"; |
549 | 549 | } |
550 | 550 | |
551 | - if ( ! is_wp_error( $this->end_date ) ) { |
|
551 | + if ( ! is_wp_error($this->end_date)) { |
|
552 | 552 | |
553 | - if ( $this->timestamp ) { |
|
553 | + if ($this->timestamp) { |
|
554 | 554 | $format = 'Y-m-d H:i:s'; |
555 | 555 | } else { |
556 | 556 | $format = 'Y-m-d 23:59:59'; |
557 | 557 | } |
558 | 558 | |
559 | - $end_date = date( $format, $this->end_date ); |
|
559 | + $end_date = date($format, $this->end_date); |
|
560 | 560 | |
561 | 561 | $end_where = " AND $wpdb->posts.post_date <= '{$end_date}'"; |
562 | 562 | } |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | * |
370 | 370 | * @param int|bool $payment_id A given payment |
371 | 371 | * |
372 | - * @return mixed void|false |
|
372 | + * @return false|null void|false |
|
373 | 373 | */ |
374 | 374 | public function __construct( $payment_id = false ) { |
375 | 375 | |
@@ -1088,7 +1088,7 @@ discard block |
||
1088 | 1088 | * |
1089 | 1089 | * @param string $note The note to add |
1090 | 1090 | * |
1091 | - * @return bool If the note was specified or not |
|
1091 | + * @return false|null If the note was specified or not |
|
1092 | 1092 | */ |
1093 | 1093 | public function add_note( $note = false ) { |
1094 | 1094 | // Bail if no note specified. |
@@ -1012,7 +1012,7 @@ |
||
1012 | 1012 | // Find a match between price_id and level_id. |
1013 | 1013 | // First verify array keys exists THEN make the match. |
1014 | 1014 | if ( ( isset( $args['price_id'] ) && isset( $price['_give_id']['level_id'] ) ) |
1015 | - && $args['price_id'] == $price['_give_id']['level_id'] |
|
1015 | + && $args['price_id'] == $price['_give_id']['level_id'] |
|
1016 | 1016 | ) { |
1017 | 1017 | $donation_amount = $price['_give_amount']; |
1018 | 1018 | } |
@@ -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 | |
@@ -392,13 +392,13 @@ discard block |
||
392 | 392 | * |
393 | 393 | * @return mixed void|false |
394 | 394 | */ |
395 | - public function __construct( $payment_id = false ) { |
|
395 | + public function __construct($payment_id = false) { |
|
396 | 396 | |
397 | - if ( empty( $payment_id ) ) { |
|
397 | + if (empty($payment_id)) { |
|
398 | 398 | return false; |
399 | 399 | } |
400 | 400 | |
401 | - $this->setup_payment( $payment_id ); |
|
401 | + $this->setup_payment($payment_id); |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | /** |
@@ -411,11 +411,11 @@ discard block |
||
411 | 411 | * |
412 | 412 | * @return mixed The value. |
413 | 413 | */ |
414 | - public function __get( $key ) { |
|
414 | + public function __get($key) { |
|
415 | 415 | |
416 | - if ( method_exists( $this, 'get_' . $key ) ) { |
|
416 | + if (method_exists($this, 'get_'.$key)) { |
|
417 | 417 | |
418 | - $value = call_user_func( array( $this, 'get_' . $key ) ); |
|
418 | + $value = call_user_func(array($this, 'get_'.$key)); |
|
419 | 419 | |
420 | 420 | } else { |
421 | 421 | |
@@ -437,18 +437,18 @@ discard block |
||
437 | 437 | * @param string $key The property name |
438 | 438 | * @param mixed $value The value of the property |
439 | 439 | */ |
440 | - public function __set( $key, $value ) { |
|
441 | - $ignore = array( '_ID' ); |
|
440 | + public function __set($key, $value) { |
|
441 | + $ignore = array('_ID'); |
|
442 | 442 | |
443 | - if ( 'status' === $key ) { |
|
443 | + if ('status' === $key) { |
|
444 | 444 | $this->old_status = $this->status; |
445 | 445 | } |
446 | 446 | |
447 | - if ( ! in_array( $key, $ignore ) ) { |
|
448 | - $this->pending[ $key ] = $value; |
|
447 | + if ( ! in_array($key, $ignore)) { |
|
448 | + $this->pending[$key] = $value; |
|
449 | 449 | } |
450 | 450 | |
451 | - if ( '_ID' !== $key ) { |
|
451 | + if ('_ID' !== $key) { |
|
452 | 452 | $this->$key = $value; |
453 | 453 | } |
454 | 454 | } |
@@ -463,9 +463,9 @@ discard block |
||
463 | 463 | * |
464 | 464 | * @return boolean|null If the item is set or not |
465 | 465 | */ |
466 | - public function __isset( $name ) { |
|
467 | - if ( property_exists( $this, $name ) ) { |
|
468 | - return false === empty( $this->$name ); |
|
466 | + public function __isset($name) { |
|
467 | + if (property_exists($this, $name)) { |
|
468 | + return false === empty($this->$name); |
|
469 | 469 | } else { |
470 | 470 | return null; |
471 | 471 | } |
@@ -481,20 +481,20 @@ discard block |
||
481 | 481 | * |
482 | 482 | * @return bool If the setup was successful or not |
483 | 483 | */ |
484 | - private function setup_payment( $payment_id ) { |
|
484 | + private function setup_payment($payment_id) { |
|
485 | 485 | $this->pending = array(); |
486 | 486 | |
487 | - if ( empty( $payment_id ) ) { |
|
487 | + if (empty($payment_id)) { |
|
488 | 488 | return false; |
489 | 489 | } |
490 | 490 | |
491 | - $payment = get_post( $payment_id ); |
|
491 | + $payment = get_post($payment_id); |
|
492 | 492 | |
493 | - if ( ! $payment || is_wp_error( $payment ) ) { |
|
493 | + if ( ! $payment || is_wp_error($payment)) { |
|
494 | 494 | return false; |
495 | 495 | } |
496 | 496 | |
497 | - if ( 'give_payment' !== $payment->post_type ) { |
|
497 | + if ('give_payment' !== $payment->post_type) { |
|
498 | 498 | return false; |
499 | 499 | } |
500 | 500 | |
@@ -508,13 +508,13 @@ discard block |
||
508 | 508 | * @param Give_Payment $this Payment object. |
509 | 509 | * @param int $payment_id The ID of the payment. |
510 | 510 | */ |
511 | - do_action( 'give_pre_setup_payment', $this, $payment_id ); |
|
511 | + do_action('give_pre_setup_payment', $this, $payment_id); |
|
512 | 512 | |
513 | 513 | // Primary Identifier. |
514 | - $this->ID = absint( $payment_id ); |
|
514 | + $this->ID = absint($payment_id); |
|
515 | 515 | |
516 | 516 | // Protected ID that can never be changed. |
517 | - $this->_ID = absint( $payment_id ); |
|
517 | + $this->_ID = absint($payment_id); |
|
518 | 518 | |
519 | 519 | // We have a payment, get the generic payment_meta item to reduce calls to it. |
520 | 520 | $this->payment_meta = $this->get_meta(); |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | $this->parent_payment = $payment->post_parent; |
531 | 531 | |
532 | 532 | $all_payment_statuses = give_get_payment_statuses(); |
533 | - $this->status_nicename = array_key_exists( $this->status, $all_payment_statuses ) ? $all_payment_statuses[ $this->status ] : ucfirst( $this->status ); |
|
533 | + $this->status_nicename = array_key_exists($this->status, $all_payment_statuses) ? $all_payment_statuses[$this->status] : ucfirst($this->status); |
|
534 | 534 | |
535 | 535 | // Currency Based. |
536 | 536 | $this->total = $this->setup_total(); |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | * @param Give_Payment $this Payment object. |
569 | 569 | * @param int $payment_id The ID of the payment. |
570 | 570 | */ |
571 | - do_action( 'give_setup_payment', $this, $payment_id ); |
|
571 | + do_action('give_setup_payment', $this, $payment_id); |
|
572 | 572 | |
573 | 573 | return true; |
574 | 574 | } |
@@ -586,8 +586,8 @@ discard block |
||
586 | 586 | * |
587 | 587 | * @return void |
588 | 588 | */ |
589 | - public function update_payment_setup( $payment_id ) { |
|
590 | - $this->setup_payment( $payment_id ); |
|
589 | + public function update_payment_setup($payment_id) { |
|
590 | + $this->setup_payment($payment_id); |
|
591 | 591 | } |
592 | 592 | |
593 | 593 | /** |
@@ -602,24 +602,24 @@ discard block |
||
602 | 602 | |
603 | 603 | // Construct the payment title. |
604 | 604 | $payment_title = ''; |
605 | - if ( ! empty( $this->first_name ) && ! empty( $this->last_name ) ) { |
|
606 | - $payment_title = $this->first_name . ' ' . $this->last_name; |
|
607 | - } elseif ( ! empty( $this->first_name ) && empty( $this->last_name ) ) { |
|
605 | + if ( ! empty($this->first_name) && ! empty($this->last_name)) { |
|
606 | + $payment_title = $this->first_name.' '.$this->last_name; |
|
607 | + } elseif ( ! empty($this->first_name) && empty($this->last_name)) { |
|
608 | 608 | $payment_title = $this->first_name; |
609 | - } elseif ( ! empty( $this->email ) && is_email( $this->email ) ) { |
|
609 | + } elseif ( ! empty($this->email) && is_email($this->email)) { |
|
610 | 610 | $payment_title = $this->email; |
611 | 611 | } |
612 | 612 | |
613 | 613 | // Set Key. |
614 | - if ( empty( $this->key ) ) { |
|
614 | + if (empty($this->key)) { |
|
615 | 615 | |
616 | - $auth_key = defined( 'AUTH_KEY' ) ? AUTH_KEY : ''; |
|
617 | - $this->key = strtolower( md5( $this->email . date( 'Y-m-d H:i:s' ) . $auth_key . uniqid( 'give', true ) ) ); // Unique key |
|
616 | + $auth_key = defined('AUTH_KEY') ? AUTH_KEY : ''; |
|
617 | + $this->key = strtolower(md5($this->email.date('Y-m-d H:i:s').$auth_key.uniqid('give', true))); // Unique key |
|
618 | 618 | $this->pending['key'] = $this->key; |
619 | 619 | } |
620 | 620 | |
621 | 621 | // Set IP. |
622 | - if ( empty( $this->ip ) ) { |
|
622 | + if (empty($this->ip)) { |
|
623 | 623 | |
624 | 624 | $this->ip = give_get_ip(); |
625 | 625 | $this->pending['ip'] = $this->ip; |
@@ -646,19 +646,19 @@ discard block |
||
646 | 646 | 'status' => $this->status, |
647 | 647 | ); |
648 | 648 | |
649 | - $args = apply_filters( 'give_insert_payment_args', array( |
|
649 | + $args = apply_filters('give_insert_payment_args', array( |
|
650 | 650 | 'post_title' => $payment_title, |
651 | 651 | 'post_status' => $this->status, |
652 | 652 | 'post_type' => 'give_payment', |
653 | - 'post_date' => ! empty( $this->date ) ? $this->date : null, |
|
654 | - 'post_date_gmt' => ! empty( $this->date ) ? get_gmt_from_date( $this->date ) : null, |
|
653 | + 'post_date' => ! empty($this->date) ? $this->date : null, |
|
654 | + 'post_date_gmt' => ! empty($this->date) ? get_gmt_from_date($this->date) : null, |
|
655 | 655 | 'post_parent' => $this->parent_payment, |
656 | - ), $payment_data ); |
|
656 | + ), $payment_data); |
|
657 | 657 | |
658 | 658 | // Create a blank payment |
659 | - $payment_id = wp_insert_post( $args ); |
|
659 | + $payment_id = wp_insert_post($args); |
|
660 | 660 | |
661 | - if ( ! empty( $payment_id ) ) { |
|
661 | + if ( ! empty($payment_id)) { |
|
662 | 662 | |
663 | 663 | $this->ID = $payment_id; |
664 | 664 | $this->_ID = $payment_id; |
@@ -670,40 +670,40 @@ discard block |
||
670 | 670 | * |
671 | 671 | * @since 1.8.13 |
672 | 672 | */ |
673 | - $donor = apply_filters( 'give_update_donor_information', $donor, $payment_id, $payment_data, $args ); |
|
673 | + $donor = apply_filters('give_update_donor_information', $donor, $payment_id, $payment_data, $args); |
|
674 | 674 | |
675 | - if ( did_action( 'give_pre_process_donation' ) && is_user_logged_in() ) { |
|
676 | - $donor = new Give_Donor( get_current_user_id(), true ); |
|
675 | + if (did_action('give_pre_process_donation') && is_user_logged_in()) { |
|
676 | + $donor = new Give_Donor(get_current_user_id(), true); |
|
677 | 677 | |
678 | 678 | // Donor is logged in but used a different email to purchase with so assign to their donor record. |
679 | - if ( ! empty( $donor->id ) && $this->email !== $donor->email ) { |
|
680 | - $donor->add_email( $this->email ); |
|
679 | + if ( ! empty($donor->id) && $this->email !== $donor->email) { |
|
680 | + $donor->add_email($this->email); |
|
681 | 681 | } |
682 | 682 | } |
683 | 683 | |
684 | - if ( empty( $donor->id ) ) { |
|
685 | - $donor = new Give_Donor( $this->email ); |
|
684 | + if (empty($donor->id)) { |
|
685 | + $donor = new Give_Donor($this->email); |
|
686 | 686 | } |
687 | 687 | |
688 | - if ( empty( $donor->id ) ) { |
|
688 | + if (empty($donor->id)) { |
|
689 | 689 | |
690 | 690 | $donor_data = array( |
691 | - 'name' => ! is_email( $payment_title ) ? $this->first_name . ' ' . $this->last_name : '', |
|
691 | + 'name' => ! is_email($payment_title) ? $this->first_name.' '.$this->last_name : '', |
|
692 | 692 | 'email' => $this->email, |
693 | 693 | 'user_id' => $this->user_id, |
694 | 694 | ); |
695 | 695 | |
696 | - $donor->create( $donor_data ); |
|
696 | + $donor->create($donor_data); |
|
697 | 697 | |
698 | 698 | } |
699 | 699 | |
700 | 700 | $this->customer_id = $donor->id; |
701 | 701 | $this->pending['customer_id'] = $this->customer_id; |
702 | - $donor->attach_payment( $this->ID, false ); |
|
702 | + $donor->attach_payment($this->ID, false); |
|
703 | 703 | |
704 | - $this->payment_meta = apply_filters( 'give_payment_meta', $this->payment_meta, $payment_data ); |
|
704 | + $this->payment_meta = apply_filters('give_payment_meta', $this->payment_meta, $payment_data); |
|
705 | 705 | |
706 | - $this->update_meta( '_give_payment_meta', $this->payment_meta ); |
|
706 | + $this->update_meta('_give_payment_meta', $this->payment_meta); |
|
707 | 707 | $this->new = true; |
708 | 708 | }// End if(). |
709 | 709 | |
@@ -725,11 +725,11 @@ discard block |
||
725 | 725 | $saved = false; |
726 | 726 | |
727 | 727 | // Must have an ID. |
728 | - if ( empty( $this->ID ) ) { |
|
728 | + if (empty($this->ID)) { |
|
729 | 729 | |
730 | 730 | $payment_id = $this->insert_payment(); |
731 | 731 | |
732 | - if ( false === $payment_id ) { |
|
732 | + if (false === $payment_id) { |
|
733 | 733 | $saved = false; |
734 | 734 | } else { |
735 | 735 | $this->ID = $payment_id; |
@@ -737,42 +737,42 @@ discard block |
||
737 | 737 | } |
738 | 738 | |
739 | 739 | // Set ID if not matching. |
740 | - if ( $this->ID !== $this->_ID ) { |
|
740 | + if ($this->ID !== $this->_ID) { |
|
741 | 741 | $this->ID = $this->_ID; |
742 | 742 | } |
743 | 743 | |
744 | 744 | // If we have something pending, let's save it. |
745 | - if ( ! empty( $this->pending ) ) { |
|
745 | + if ( ! empty($this->pending)) { |
|
746 | 746 | |
747 | 747 | $total_increase = 0; |
748 | 748 | $total_decrease = 0; |
749 | 749 | |
750 | - foreach ( $this->pending as $key => $value ) { |
|
750 | + foreach ($this->pending as $key => $value) { |
|
751 | 751 | |
752 | - switch ( $key ) { |
|
752 | + switch ($key) { |
|
753 | 753 | |
754 | 754 | case 'donations': |
755 | 755 | // Update totals for pending donations. |
756 | - foreach ( $this->pending[ $key ] as $item ) { |
|
756 | + foreach ($this->pending[$key] as $item) { |
|
757 | 757 | |
758 | - $quantity = isset( $item['quantity'] ) ? $item['quantity'] : 1; |
|
759 | - $price_id = isset( $item['price_id'] ) ? $item['price_id'] : 0; |
|
758 | + $quantity = isset($item['quantity']) ? $item['quantity'] : 1; |
|
759 | + $price_id = isset($item['price_id']) ? $item['price_id'] : 0; |
|
760 | 760 | |
761 | - switch ( $item['action'] ) { |
|
761 | + switch ($item['action']) { |
|
762 | 762 | |
763 | 763 | case 'add': |
764 | 764 | |
765 | 765 | $price = $item['price']; |
766 | 766 | |
767 | - if ( 'publish' === $this->status || 'complete' === $this->status ) { |
|
767 | + if ('publish' === $this->status || 'complete' === $this->status) { |
|
768 | 768 | |
769 | 769 | // Add donation to logs. |
770 | - $log_date = date_i18n( 'Y-m-d G:i:s', current_time( 'timestamp' ) ); |
|
771 | - give_record_donation_in_log( $item['id'], $this->ID, $price_id, $log_date ); |
|
770 | + $log_date = date_i18n('Y-m-d G:i:s', current_time('timestamp')); |
|
771 | + give_record_donation_in_log($item['id'], $this->ID, $price_id, $log_date); |
|
772 | 772 | |
773 | - $form = new Give_Donate_Form( $item['id'] ); |
|
774 | - $form->increase_sales( $quantity ); |
|
775 | - $form->increase_earnings( $price ); |
|
773 | + $form = new Give_Donate_Form($item['id']); |
|
774 | + $form->increase_sales($quantity); |
|
775 | + $form->increase_earnings($price); |
|
776 | 776 | |
777 | 777 | $total_increase += $price; |
778 | 778 | } |
@@ -797,15 +797,15 @@ discard block |
||
797 | 797 | ), |
798 | 798 | ); |
799 | 799 | |
800 | - $found_logs = get_posts( $log_args ); |
|
801 | - foreach ( $found_logs as $log ) { |
|
802 | - wp_delete_post( $log->ID, true ); |
|
800 | + $found_logs = get_posts($log_args); |
|
801 | + foreach ($found_logs as $log) { |
|
802 | + wp_delete_post($log->ID, true); |
|
803 | 803 | } |
804 | 804 | |
805 | - if ( 'publish' === $this->status || 'complete' === $this->status ) { |
|
806 | - $form = new Give_Donate_Form( $item['id'] ); |
|
807 | - $form->decrease_sales( $quantity ); |
|
808 | - $form->decrease_earnings( $item['amount'] ); |
|
805 | + if ('publish' === $this->status || 'complete' === $this->status) { |
|
806 | + $form = new Give_Donate_Form($item['id']); |
|
807 | + $form->decrease_sales($quantity); |
|
808 | + $form->decrease_earnings($item['amount']); |
|
809 | 809 | |
810 | 810 | $total_decrease += $item['amount']; |
811 | 811 | } |
@@ -816,44 +816,44 @@ discard block |
||
816 | 816 | break; |
817 | 817 | |
818 | 818 | case 'status': |
819 | - $this->update_status( $this->status ); |
|
819 | + $this->update_status($this->status); |
|
820 | 820 | break; |
821 | 821 | |
822 | 822 | case 'gateway': |
823 | - $this->update_meta( '_give_payment_gateway', $this->gateway ); |
|
823 | + $this->update_meta('_give_payment_gateway', $this->gateway); |
|
824 | 824 | break; |
825 | 825 | |
826 | 826 | case 'mode': |
827 | - $this->update_meta( '_give_payment_mode', $this->mode ); |
|
827 | + $this->update_meta('_give_payment_mode', $this->mode); |
|
828 | 828 | break; |
829 | 829 | |
830 | 830 | case 'transaction_id': |
831 | - $this->update_meta( '_give_payment_transaction_id', $this->transaction_id ); |
|
831 | + $this->update_meta('_give_payment_transaction_id', $this->transaction_id); |
|
832 | 832 | break; |
833 | 833 | |
834 | 834 | case 'ip': |
835 | - $this->update_meta( '_give_payment_user_ip', $this->ip ); |
|
835 | + $this->update_meta('_give_payment_user_ip', $this->ip); |
|
836 | 836 | break; |
837 | 837 | |
838 | 838 | case 'customer_id': |
839 | - $this->update_meta( '_give_payment_customer_id', $this->customer_id ); |
|
839 | + $this->update_meta('_give_payment_customer_id', $this->customer_id); |
|
840 | 840 | break; |
841 | 841 | |
842 | 842 | case 'user_id': |
843 | - $this->update_meta( '_give_payment_user_id', $this->user_id ); |
|
843 | + $this->update_meta('_give_payment_user_id', $this->user_id); |
|
844 | 844 | $this->user_info['id'] = $this->user_id; |
845 | 845 | break; |
846 | 846 | |
847 | 847 | case 'form_title': |
848 | - $this->update_meta( '_give_payment_form_title', $this->form_title ); |
|
848 | + $this->update_meta('_give_payment_form_title', $this->form_title); |
|
849 | 849 | break; |
850 | 850 | |
851 | 851 | case 'form_id': |
852 | - $this->update_meta( '_give_payment_form_id', $this->form_id ); |
|
852 | + $this->update_meta('_give_payment_form_id', $this->form_id); |
|
853 | 853 | break; |
854 | 854 | |
855 | 855 | case 'price_id': |
856 | - $this->update_meta( '_give_payment_price_id', $this->price_id ); |
|
856 | + $this->update_meta('_give_payment_price_id', $this->price_id); |
|
857 | 857 | break; |
858 | 858 | |
859 | 859 | case 'first_name': |
@@ -869,15 +869,15 @@ discard block |
||
869 | 869 | break; |
870 | 870 | |
871 | 871 | case 'email': |
872 | - $this->update_meta( '_give_payment_user_email', $this->email ); |
|
872 | + $this->update_meta('_give_payment_user_email', $this->email); |
|
873 | 873 | break; |
874 | 874 | |
875 | 875 | case 'key': |
876 | - $this->update_meta( '_give_payment_purchase_key', $this->key ); |
|
876 | + $this->update_meta('_give_payment_purchase_key', $this->key); |
|
877 | 877 | break; |
878 | 878 | |
879 | 879 | case 'number': |
880 | - $this->update_meta( '_give_payment_number', $this->number ); |
|
880 | + $this->update_meta('_give_payment_number', $this->number); |
|
881 | 881 | break; |
882 | 882 | |
883 | 883 | case 'date': |
@@ -887,11 +887,11 @@ discard block |
||
887 | 887 | 'edit_date' => true, |
888 | 888 | ); |
889 | 889 | |
890 | - wp_update_post( $args ); |
|
890 | + wp_update_post($args); |
|
891 | 891 | break; |
892 | 892 | |
893 | 893 | case 'completed_date': |
894 | - $this->update_meta( '_give_completed_date', $this->completed_date ); |
|
894 | + $this->update_meta('_give_completed_date', $this->completed_date); |
|
895 | 895 | break; |
896 | 896 | |
897 | 897 | case 'parent_payment': |
@@ -900,7 +900,7 @@ discard block |
||
900 | 900 | 'post_parent' => $this->parent_payment, |
901 | 901 | ); |
902 | 902 | |
903 | - wp_update_post( $args ); |
|
903 | + wp_update_post($args); |
|
904 | 904 | break; |
905 | 905 | |
906 | 906 | default: |
@@ -911,33 +911,33 @@ discard block |
||
911 | 911 | * |
912 | 912 | * @param Give_Payment $this Payment object. |
913 | 913 | */ |
914 | - do_action( 'give_payment_save', $this, $key ); |
|
914 | + do_action('give_payment_save', $this, $key); |
|
915 | 915 | break; |
916 | 916 | }// End switch(). |
917 | 917 | }// End foreach(). |
918 | 918 | |
919 | - if ( 'pending' !== $this->status ) { |
|
919 | + if ('pending' !== $this->status) { |
|
920 | 920 | |
921 | - $donor = new Give_Donor( $this->customer_id ); |
|
921 | + $donor = new Give_Donor($this->customer_id); |
|
922 | 922 | |
923 | 923 | $total_change = $total_increase - $total_decrease; |
924 | - if ( $total_change < 0 ) { |
|
924 | + if ($total_change < 0) { |
|
925 | 925 | |
926 | - $total_change = - ( $total_change ); |
|
926 | + $total_change = - ($total_change); |
|
927 | 927 | // Decrease the donor's donation stats. |
928 | - $donor->decrease_value( $total_change ); |
|
929 | - give_decrease_total_earnings( $total_change ); |
|
928 | + $donor->decrease_value($total_change); |
|
929 | + give_decrease_total_earnings($total_change); |
|
930 | 930 | |
931 | - } elseif ( $total_change > 0 ) { |
|
931 | + } elseif ($total_change > 0) { |
|
932 | 932 | |
933 | 933 | // Increase the donor's donation stats. |
934 | - $donor->increase_value( $total_change ); |
|
935 | - give_increase_total_earnings( $total_change ); |
|
934 | + $donor->increase_value($total_change); |
|
935 | + give_increase_total_earnings($total_change); |
|
936 | 936 | |
937 | 937 | } |
938 | 938 | } |
939 | 939 | |
940 | - $this->update_meta( '_give_payment_total', give_sanitize_amount_for_db( $this->total ) ); |
|
940 | + $this->update_meta('_give_payment_total', give_sanitize_amount_for_db($this->total)); |
|
941 | 941 | |
942 | 942 | $new_meta = array( |
943 | 943 | 'form_title' => $this->form_title, |
@@ -948,12 +948,12 @@ discard block |
||
948 | 948 | ); |
949 | 949 | |
950 | 950 | $meta = $this->get_meta(); |
951 | - $merged_meta = array_merge( $meta, $new_meta ); |
|
951 | + $merged_meta = array_merge($meta, $new_meta); |
|
952 | 952 | |
953 | 953 | // Only save the payment meta if it's changed. |
954 | - if ( md5( serialize( $meta ) ) !== md5( serialize( $merged_meta ) ) ) { |
|
955 | - $updated = $this->update_meta( '_give_payment_meta', $merged_meta ); |
|
956 | - if ( false !== $updated ) { |
|
954 | + if (md5(serialize($meta)) !== md5(serialize($merged_meta))) { |
|
955 | + $updated = $this->update_meta('_give_payment_meta', $merged_meta); |
|
956 | + if (false !== $updated) { |
|
957 | 957 | $saved = true; |
958 | 958 | } |
959 | 959 | } |
@@ -962,8 +962,8 @@ discard block |
||
962 | 962 | $saved = true; |
963 | 963 | }// End if(). |
964 | 964 | |
965 | - if ( true === $saved ) { |
|
966 | - $this->setup_payment( $this->ID ); |
|
965 | + if (true === $saved) { |
|
966 | + $this->setup_payment($this->ID); |
|
967 | 967 | } |
968 | 968 | |
969 | 969 | return $saved; |
@@ -981,12 +981,12 @@ discard block |
||
981 | 981 | * |
982 | 982 | * @return bool True when successful, false otherwise |
983 | 983 | */ |
984 | - public function add_donation( $form_id = 0, $args = array(), $options = array() ) { |
|
984 | + public function add_donation($form_id = 0, $args = array(), $options = array()) { |
|
985 | 985 | |
986 | - $donation = new Give_Donate_Form( $form_id ); |
|
986 | + $donation = new Give_Donate_Form($form_id); |
|
987 | 987 | |
988 | 988 | // Bail if this post isn't a give donation form. |
989 | - if ( ! $donation || $donation->post_type !== 'give_forms' ) { |
|
989 | + if ( ! $donation || $donation->post_type !== 'give_forms') { |
|
990 | 990 | return false; |
991 | 991 | } |
992 | 992 | |
@@ -996,59 +996,59 @@ discard block |
||
996 | 996 | 'price_id' => false, |
997 | 997 | ); |
998 | 998 | |
999 | - $args = wp_parse_args( apply_filters( 'give_payment_add_donation_args', $args, $donation->ID ), $defaults ); |
|
999 | + $args = wp_parse_args(apply_filters('give_payment_add_donation_args', $args, $donation->ID), $defaults); |
|
1000 | 1000 | |
1001 | 1001 | // Allow overriding the price. |
1002 | - if ( false !== $args['price'] ) { |
|
1002 | + if (false !== $args['price']) { |
|
1003 | 1003 | $donation_amount = $args['price']; |
1004 | 1004 | } else { |
1005 | 1005 | |
1006 | 1006 | // Deal with variable pricing. |
1007 | - if ( give_has_variable_prices( $donation->ID ) ) { |
|
1008 | - $prices = give_get_meta( $form_id, '_give_donation_levels', true ); |
|
1007 | + if (give_has_variable_prices($donation->ID)) { |
|
1008 | + $prices = give_get_meta($form_id, '_give_donation_levels', true); |
|
1009 | 1009 | $donation_amount = ''; |
1010 | 1010 | // Loop through prices. |
1011 | - foreach ( $prices as $price ) { |
|
1011 | + foreach ($prices as $price) { |
|
1012 | 1012 | // Find a match between price_id and level_id. |
1013 | 1013 | // First verify array keys exists THEN make the match. |
1014 | - if ( ( isset( $args['price_id'] ) && isset( $price['_give_id']['level_id'] ) ) |
|
1014 | + if ((isset($args['price_id']) && isset($price['_give_id']['level_id'])) |
|
1015 | 1015 | && $args['price_id'] == $price['_give_id']['level_id'] |
1016 | 1016 | ) { |
1017 | 1017 | $donation_amount = $price['_give_amount']; |
1018 | 1018 | } |
1019 | 1019 | } |
1020 | 1020 | // Fallback to the lowest price point. |
1021 | - if ( $donation_amount == '' ) { |
|
1022 | - $donation_amount = give_get_lowest_price_option( $donation->ID ); |
|
1023 | - $args['price_id'] = give_get_lowest_price_id( $donation->ID ); |
|
1021 | + if ($donation_amount == '') { |
|
1022 | + $donation_amount = give_get_lowest_price_option($donation->ID); |
|
1023 | + $args['price_id'] = give_get_lowest_price_id($donation->ID); |
|
1024 | 1024 | } |
1025 | 1025 | } else { |
1026 | 1026 | // Simple form price. |
1027 | - $donation_amount = give_get_form_price( $donation->ID ); |
|
1027 | + $donation_amount = give_get_form_price($donation->ID); |
|
1028 | 1028 | } |
1029 | 1029 | } |
1030 | 1030 | |
1031 | 1031 | // Sanitizing the price here so we don't have a dozen calls later. |
1032 | - $donation_amount = give_maybe_sanitize_amount( $donation_amount ); |
|
1033 | - $total = round( $donation_amount, give_currency_decimal_filter() ); |
|
1032 | + $donation_amount = give_maybe_sanitize_amount($donation_amount); |
|
1033 | + $total = round($donation_amount, give_currency_decimal_filter()); |
|
1034 | 1034 | |
1035 | 1035 | // Add Options. |
1036 | 1036 | $default_options = array(); |
1037 | - if ( false !== $args['price_id'] ) { |
|
1037 | + if (false !== $args['price_id']) { |
|
1038 | 1038 | $default_options['price_id'] = (int) $args['price_id']; |
1039 | 1039 | } |
1040 | - $options = wp_parse_args( $options, $default_options ); |
|
1040 | + $options = wp_parse_args($options, $default_options); |
|
1041 | 1041 | |
1042 | 1042 | // Do not allow totals to go negative. |
1043 | - if ( $total < 0 ) { |
|
1043 | + if ($total < 0) { |
|
1044 | 1044 | $total = 0; |
1045 | 1045 | } |
1046 | 1046 | |
1047 | 1047 | $donation = array( |
1048 | 1048 | 'name' => $donation->post_title, |
1049 | 1049 | 'id' => $donation->ID, |
1050 | - 'price' => round( $total, give_currency_decimal_filter() ), |
|
1051 | - 'subtotal' => round( $total, give_currency_decimal_filter() ), |
|
1050 | + 'price' => round($total, give_currency_decimal_filter()), |
|
1051 | + 'subtotal' => round($total, give_currency_decimal_filter()), |
|
1052 | 1052 | 'price_id' => $args['price_id'], |
1053 | 1053 | 'action' => 'add', |
1054 | 1054 | 'options' => $options, |
@@ -1056,7 +1056,7 @@ discard block |
||
1056 | 1056 | |
1057 | 1057 | $this->pending['donations'][] = $donation; |
1058 | 1058 | |
1059 | - $this->increase_subtotal( $total ); |
|
1059 | + $this->increase_subtotal($total); |
|
1060 | 1060 | |
1061 | 1061 | return true; |
1062 | 1062 | |
@@ -1073,7 +1073,7 @@ discard block |
||
1073 | 1073 | * |
1074 | 1074 | * @return bool If the item was removed or not |
1075 | 1075 | */ |
1076 | - public function remove_donation( $form_id, $args = array() ) { |
|
1076 | + public function remove_donation($form_id, $args = array()) { |
|
1077 | 1077 | |
1078 | 1078 | // Set some defaults. |
1079 | 1079 | $defaults = array( |
@@ -1081,12 +1081,12 @@ discard block |
||
1081 | 1081 | 'price' => false, |
1082 | 1082 | 'price_id' => false, |
1083 | 1083 | ); |
1084 | - $args = wp_parse_args( $args, $defaults ); |
|
1084 | + $args = wp_parse_args($args, $defaults); |
|
1085 | 1085 | |
1086 | - $form = new Give_Donate_Form( $form_id ); |
|
1086 | + $form = new Give_Donate_Form($form_id); |
|
1087 | 1087 | |
1088 | 1088 | // Bail if this post isn't a valid give donation form. |
1089 | - if ( ! $form || $form->post_type !== 'give_forms' ) { |
|
1089 | + if ( ! $form || $form->post_type !== 'give_forms') { |
|
1090 | 1090 | return false; |
1091 | 1091 | } |
1092 | 1092 | |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | |
1100 | 1100 | $this->pending['donations'][] = $pending_args; |
1101 | 1101 | |
1102 | - $this->decrease_subtotal( $this->total ); |
|
1102 | + $this->decrease_subtotal($this->total); |
|
1103 | 1103 | |
1104 | 1104 | return true; |
1105 | 1105 | } |
@@ -1115,13 +1115,13 @@ discard block |
||
1115 | 1115 | * |
1116 | 1116 | * @return bool If the note was specified or not |
1117 | 1117 | */ |
1118 | - public function add_note( $note = false ) { |
|
1118 | + public function add_note($note = false) { |
|
1119 | 1119 | // Bail if no note specified. |
1120 | - if ( ! $note ) { |
|
1120 | + if ( ! $note) { |
|
1121 | 1121 | return false; |
1122 | 1122 | } |
1123 | 1123 | |
1124 | - give_insert_payment_note( $this->ID, $note ); |
|
1124 | + give_insert_payment_note($this->ID, $note); |
|
1125 | 1125 | } |
1126 | 1126 | |
1127 | 1127 | /** |
@@ -1134,8 +1134,8 @@ discard block |
||
1134 | 1134 | * |
1135 | 1135 | * @return void |
1136 | 1136 | */ |
1137 | - private function increase_subtotal( $amount = 0.00 ) { |
|
1138 | - $amount = (float) $amount; |
|
1137 | + private function increase_subtotal($amount = 0.00) { |
|
1138 | + $amount = (float) $amount; |
|
1139 | 1139 | $this->subtotal += $amount; |
1140 | 1140 | |
1141 | 1141 | $this->recalculate_total(); |
@@ -1151,11 +1151,11 @@ discard block |
||
1151 | 1151 | * |
1152 | 1152 | * @return void |
1153 | 1153 | */ |
1154 | - private function decrease_subtotal( $amount = 0.00 ) { |
|
1155 | - $amount = (float) $amount; |
|
1154 | + private function decrease_subtotal($amount = 0.00) { |
|
1155 | + $amount = (float) $amount; |
|
1156 | 1156 | $this->subtotal -= $amount; |
1157 | 1157 | |
1158 | - if ( $this->subtotal < 0 ) { |
|
1158 | + if ($this->subtotal < 0) { |
|
1159 | 1159 | $this->subtotal = 0; |
1160 | 1160 | } |
1161 | 1161 | |
@@ -1184,24 +1184,24 @@ discard block |
||
1184 | 1184 | * |
1185 | 1185 | * @return bool $updated Returns if the status was successfully updated. |
1186 | 1186 | */ |
1187 | - public function update_status( $status = false ) { |
|
1187 | + public function update_status($status = false) { |
|
1188 | 1188 | |
1189 | 1189 | // standardize the 'complete(d)' status. |
1190 | - if ( $status == 'completed' || $status == 'complete' ) { |
|
1190 | + if ($status == 'completed' || $status == 'complete') { |
|
1191 | 1191 | $status = 'publish'; |
1192 | 1192 | } |
1193 | 1193 | |
1194 | - $old_status = ! empty( $this->old_status ) ? $this->old_status : false; |
|
1194 | + $old_status = ! empty($this->old_status) ? $this->old_status : false; |
|
1195 | 1195 | |
1196 | - if ( $old_status === $status ) { |
|
1196 | + if ($old_status === $status) { |
|
1197 | 1197 | return false; // Don't permit status changes that aren't changes. |
1198 | 1198 | } |
1199 | 1199 | |
1200 | - $do_change = apply_filters( 'give_should_update_payment_status', true, $this->ID, $status, $old_status ); |
|
1200 | + $do_change = apply_filters('give_should_update_payment_status', true, $this->ID, $status, $old_status); |
|
1201 | 1201 | |
1202 | 1202 | $updated = false; |
1203 | 1203 | |
1204 | - if ( $do_change ) { |
|
1204 | + if ($do_change) { |
|
1205 | 1205 | |
1206 | 1206 | /** |
1207 | 1207 | * Fires before changing payment status. |
@@ -1212,21 +1212,21 @@ discard block |
||
1212 | 1212 | * @param string $status The new status. |
1213 | 1213 | * @param string $old_status The old status. |
1214 | 1214 | */ |
1215 | - do_action( 'give_before_payment_status_change', $this->ID, $status, $old_status ); |
|
1215 | + do_action('give_before_payment_status_change', $this->ID, $status, $old_status); |
|
1216 | 1216 | |
1217 | 1217 | $update_fields = array( |
1218 | 1218 | 'ID' => $this->ID, |
1219 | 1219 | 'post_status' => $status, |
1220 | - 'edit_date' => current_time( 'mysql' ), |
|
1220 | + 'edit_date' => current_time('mysql'), |
|
1221 | 1221 | ); |
1222 | 1222 | |
1223 | - $updated = wp_update_post( apply_filters( 'give_update_payment_status_fields', $update_fields ) ); |
|
1223 | + $updated = wp_update_post(apply_filters('give_update_payment_status_fields', $update_fields)); |
|
1224 | 1224 | |
1225 | 1225 | $all_payment_statuses = give_get_payment_statuses(); |
1226 | - $this->status_nicename = array_key_exists( $status, $all_payment_statuses ) ? $all_payment_statuses[ $status ] : ucfirst( $status ); |
|
1226 | + $this->status_nicename = array_key_exists($status, $all_payment_statuses) ? $all_payment_statuses[$status] : ucfirst($status); |
|
1227 | 1227 | |
1228 | 1228 | // Process any specific status functions. |
1229 | - switch ( $status ) { |
|
1229 | + switch ($status) { |
|
1230 | 1230 | case 'refunded': |
1231 | 1231 | $this->process_refund(); |
1232 | 1232 | break; |
@@ -1253,7 +1253,7 @@ discard block |
||
1253 | 1253 | * @param string $status The new status. |
1254 | 1254 | * @param string $old_status The old status. |
1255 | 1255 | */ |
1256 | - do_action( 'give_update_payment_status', $this->ID, $status, $old_status ); |
|
1256 | + do_action('give_update_payment_status', $this->ID, $status, $old_status); |
|
1257 | 1257 | |
1258 | 1258 | }// End if(). |
1259 | 1259 | |
@@ -1288,41 +1288,41 @@ discard block |
||
1288 | 1288 | * |
1289 | 1289 | * @return mixed The value from the post meta |
1290 | 1290 | */ |
1291 | - public function get_meta( $meta_key = '_give_payment_meta', $single = true ) { |
|
1291 | + public function get_meta($meta_key = '_give_payment_meta', $single = true) { |
|
1292 | 1292 | |
1293 | - $meta = give_get_meta( $this->ID, $meta_key, $single ); |
|
1293 | + $meta = give_get_meta($this->ID, $meta_key, $single); |
|
1294 | 1294 | |
1295 | - if ( $meta_key === '_give_payment_meta' ) { |
|
1295 | + if ($meta_key === '_give_payment_meta') { |
|
1296 | 1296 | $meta = (array) $meta; |
1297 | 1297 | |
1298 | - if ( empty( $meta['key'] ) ) { |
|
1298 | + if (empty($meta['key'])) { |
|
1299 | 1299 | $meta['key'] = $this->setup_payment_key(); |
1300 | 1300 | } |
1301 | 1301 | |
1302 | - if ( empty( $meta['form_title'] ) ) { |
|
1302 | + if (empty($meta['form_title'])) { |
|
1303 | 1303 | $meta['form_title'] = $this->setup_form_title(); |
1304 | 1304 | } |
1305 | 1305 | |
1306 | - if ( empty( $meta['email'] ) ) { |
|
1306 | + if (empty($meta['email'])) { |
|
1307 | 1307 | $meta['email'] = $this->setup_email(); |
1308 | 1308 | } |
1309 | 1309 | |
1310 | - if ( empty( $meta['date'] ) ) { |
|
1311 | - $meta['date'] = get_post_field( 'post_date', $this->ID ); |
|
1310 | + if (empty($meta['date'])) { |
|
1311 | + $meta['date'] = get_post_field('post_date', $this->ID); |
|
1312 | 1312 | } |
1313 | 1313 | } |
1314 | 1314 | |
1315 | - $meta = apply_filters( "give_get_payment_meta_{$meta_key}", $meta, $this->ID ); |
|
1315 | + $meta = apply_filters("give_get_payment_meta_{$meta_key}", $meta, $this->ID); |
|
1316 | 1316 | |
1317 | 1317 | // Security check. |
1318 | - if ( is_serialized( $meta ) ) { |
|
1319 | - preg_match( '/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $meta, $matches ); |
|
1320 | - if ( ! empty( $matches ) ) { |
|
1318 | + if (is_serialized($meta)) { |
|
1319 | + preg_match('/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $meta, $matches); |
|
1320 | + if ( ! empty($matches)) { |
|
1321 | 1321 | $meta = array(); |
1322 | 1322 | } |
1323 | 1323 | } |
1324 | 1324 | |
1325 | - return apply_filters( 'give_get_payment_meta', $meta, $this->ID, $meta_key ); |
|
1325 | + return apply_filters('give_get_payment_meta', $meta, $this->ID, $meta_key); |
|
1326 | 1326 | } |
1327 | 1327 | |
1328 | 1328 | /** |
@@ -1337,23 +1337,23 @@ discard block |
||
1337 | 1337 | * |
1338 | 1338 | * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure |
1339 | 1339 | */ |
1340 | - public function update_meta( $meta_key = '', $meta_value = '', $prev_value = '' ) { |
|
1341 | - if ( empty( $meta_key ) ) { |
|
1340 | + public function update_meta($meta_key = '', $meta_value = '', $prev_value = '') { |
|
1341 | + if (empty($meta_key)) { |
|
1342 | 1342 | return false; |
1343 | 1343 | } |
1344 | 1344 | |
1345 | - if ( $meta_key == 'key' || $meta_key == 'date' ) { |
|
1345 | + if ($meta_key == 'key' || $meta_key == 'date') { |
|
1346 | 1346 | |
1347 | 1347 | $current_meta = $this->get_meta(); |
1348 | - $current_meta[ $meta_key ] = $meta_value; |
|
1348 | + $current_meta[$meta_key] = $meta_value; |
|
1349 | 1349 | |
1350 | 1350 | $meta_key = '_give_payment_meta'; |
1351 | 1351 | $meta_value = $current_meta; |
1352 | 1352 | |
1353 | - } elseif ( $meta_key == 'email' || $meta_key == '_give_payment_user_email' ) { |
|
1353 | + } elseif ($meta_key == 'email' || $meta_key == '_give_payment_user_email') { |
|
1354 | 1354 | |
1355 | - $meta_value = apply_filters( "give_update_payment_meta_{$meta_key}", $meta_value, $this->ID ); |
|
1356 | - give_update_meta( $this->ID, '_give_payment_user_email', $meta_value ); |
|
1355 | + $meta_value = apply_filters("give_update_payment_meta_{$meta_key}", $meta_value, $this->ID); |
|
1356 | + give_update_meta($this->ID, '_give_payment_user_email', $meta_value); |
|
1357 | 1357 | |
1358 | 1358 | $current_meta = $this->get_meta(); |
1359 | 1359 | $current_meta['user_info']['email'] = $meta_value; |
@@ -1363,9 +1363,9 @@ discard block |
||
1363 | 1363 | |
1364 | 1364 | } |
1365 | 1365 | |
1366 | - $meta_value = apply_filters( "give_update_payment_meta_{$meta_key}", $meta_value, $this->ID ); |
|
1366 | + $meta_value = apply_filters("give_update_payment_meta_{$meta_key}", $meta_value, $this->ID); |
|
1367 | 1367 | |
1368 | - return give_update_meta( $this->ID, $meta_key, $meta_value, $prev_value ); |
|
1368 | + return give_update_meta($this->ID, $meta_key, $meta_value, $prev_value); |
|
1369 | 1369 | } |
1370 | 1370 | |
1371 | 1371 | /** |
@@ -1380,14 +1380,14 @@ discard block |
||
1380 | 1380 | $process_refund = true; |
1381 | 1381 | |
1382 | 1382 | // If the payment was not in publish or revoked status, don't decrement stats as they were never incremented. |
1383 | - if ( 'publish' != $this->old_status || 'refunded' != $this->status ) { |
|
1383 | + if ('publish' != $this->old_status || 'refunded' != $this->status) { |
|
1384 | 1384 | $process_refund = false; |
1385 | 1385 | } |
1386 | 1386 | |
1387 | 1387 | // Allow extensions to filter for their own payment types, Example: Recurring Payments. |
1388 | - $process_refund = apply_filters( 'give_should_process_refund', $process_refund, $this ); |
|
1388 | + $process_refund = apply_filters('give_should_process_refund', $process_refund, $this); |
|
1389 | 1389 | |
1390 | - if ( false === $process_refund ) { |
|
1390 | + if (false === $process_refund) { |
|
1391 | 1391 | return; |
1392 | 1392 | } |
1393 | 1393 | |
@@ -1398,13 +1398,13 @@ discard block |
||
1398 | 1398 | * |
1399 | 1399 | * @param Give_Payment $this Payment object. |
1400 | 1400 | */ |
1401 | - do_action( 'give_pre_refund_payment', $this ); |
|
1401 | + do_action('give_pre_refund_payment', $this); |
|
1402 | 1402 | |
1403 | - $decrease_earnings = apply_filters( 'give_decrease_store_earnings_on_refund', true, $this ); |
|
1404 | - $decrease_customer_value = apply_filters( 'give_decrease_customer_value_on_refund', true, $this ); |
|
1405 | - $decrease_purchase_count = apply_filters( 'give_decrease_customer_purchase_count_on_refund', true, $this ); |
|
1403 | + $decrease_earnings = apply_filters('give_decrease_store_earnings_on_refund', true, $this); |
|
1404 | + $decrease_customer_value = apply_filters('give_decrease_customer_value_on_refund', true, $this); |
|
1405 | + $decrease_purchase_count = apply_filters('give_decrease_customer_purchase_count_on_refund', true, $this); |
|
1406 | 1406 | |
1407 | - $this->maybe_alter_stats( $decrease_earnings, $decrease_customer_value, $decrease_purchase_count ); |
|
1407 | + $this->maybe_alter_stats($decrease_earnings, $decrease_customer_value, $decrease_purchase_count); |
|
1408 | 1408 | $this->delete_sales_logs(); |
1409 | 1409 | |
1410 | 1410 | // @todo: Refresh only range related stat cache |
@@ -1417,7 +1417,7 @@ discard block |
||
1417 | 1417 | * |
1418 | 1418 | * @param Give_Payment $this Payment object. |
1419 | 1419 | */ |
1420 | - do_action( 'give_post_refund_payment', $this ); |
|
1420 | + do_action('give_post_refund_payment', $this); |
|
1421 | 1421 | } |
1422 | 1422 | |
1423 | 1423 | /** |
@@ -1444,26 +1444,26 @@ discard block |
||
1444 | 1444 | $process_pending = true; |
1445 | 1445 | |
1446 | 1446 | // If the payment was not in publish or revoked status, don't decrement stats as they were never incremented. |
1447 | - if ( 'publish' != $this->old_status || 'pending' != $this->status ) { |
|
1447 | + if ('publish' != $this->old_status || 'pending' != $this->status) { |
|
1448 | 1448 | $process_pending = false; |
1449 | 1449 | } |
1450 | 1450 | |
1451 | 1451 | // Allow extensions to filter for their own payment types, Example: Recurring Payments. |
1452 | - $process_pending = apply_filters( 'give_should_process_pending', $process_pending, $this ); |
|
1452 | + $process_pending = apply_filters('give_should_process_pending', $process_pending, $this); |
|
1453 | 1453 | |
1454 | - if ( false === $process_pending ) { |
|
1454 | + if (false === $process_pending) { |
|
1455 | 1455 | return; |
1456 | 1456 | } |
1457 | 1457 | |
1458 | - $decrease_earnings = apply_filters( 'give_decrease_earnings_on_pending', true, $this ); |
|
1459 | - $decrease_donor_value = apply_filters( 'give_decrease_donor_value_on_pending', true, $this ); |
|
1460 | - $decrease_donation_count = apply_filters( 'give_decrease_donors_donation_count_on_pending', true, $this ); |
|
1458 | + $decrease_earnings = apply_filters('give_decrease_earnings_on_pending', true, $this); |
|
1459 | + $decrease_donor_value = apply_filters('give_decrease_donor_value_on_pending', true, $this); |
|
1460 | + $decrease_donation_count = apply_filters('give_decrease_donors_donation_count_on_pending', true, $this); |
|
1461 | 1461 | |
1462 | - $this->maybe_alter_stats( $decrease_earnings, $decrease_donor_value, $decrease_donation_count ); |
|
1462 | + $this->maybe_alter_stats($decrease_earnings, $decrease_donor_value, $decrease_donation_count); |
|
1463 | 1463 | $this->delete_sales_logs(); |
1464 | 1464 | |
1465 | 1465 | $this->completed_date = false; |
1466 | - $this->update_meta( '_give_completed_date', '' ); |
|
1466 | + $this->update_meta('_give_completed_date', ''); |
|
1467 | 1467 | |
1468 | 1468 | // @todo: Refresh only range related stat cache |
1469 | 1469 | give_delete_donation_stats(); |
@@ -1481,26 +1481,26 @@ discard block |
||
1481 | 1481 | $process_cancelled = true; |
1482 | 1482 | |
1483 | 1483 | // If the payment was not in publish or revoked status, don't decrement stats as they were never incremented. |
1484 | - if ( 'publish' != $this->old_status || 'cancelled' != $this->status ) { |
|
1484 | + if ('publish' != $this->old_status || 'cancelled' != $this->status) { |
|
1485 | 1485 | $process_cancelled = false; |
1486 | 1486 | } |
1487 | 1487 | |
1488 | 1488 | // Allow extensions to filter for their own payment types, Example: Recurring Payments. |
1489 | - $process_cancelled = apply_filters( 'give_should_process_cancelled', $process_cancelled, $this ); |
|
1489 | + $process_cancelled = apply_filters('give_should_process_cancelled', $process_cancelled, $this); |
|
1490 | 1490 | |
1491 | - if ( false === $process_cancelled ) { |
|
1491 | + if (false === $process_cancelled) { |
|
1492 | 1492 | return; |
1493 | 1493 | } |
1494 | 1494 | |
1495 | - $decrease_earnings = apply_filters( 'give_decrease_earnings_on_cancelled', true, $this ); |
|
1496 | - $decrease_donor_value = apply_filters( 'give_decrease_donor_value_on_cancelled', true, $this ); |
|
1497 | - $decrease_donation_count = apply_filters( 'give_decrease_donors_donation_count_on_cancelled', true, $this ); |
|
1495 | + $decrease_earnings = apply_filters('give_decrease_earnings_on_cancelled', true, $this); |
|
1496 | + $decrease_donor_value = apply_filters('give_decrease_donor_value_on_cancelled', true, $this); |
|
1497 | + $decrease_donation_count = apply_filters('give_decrease_donors_donation_count_on_cancelled', true, $this); |
|
1498 | 1498 | |
1499 | - $this->maybe_alter_stats( $decrease_earnings, $decrease_donor_value, $decrease_donation_count ); |
|
1499 | + $this->maybe_alter_stats($decrease_earnings, $decrease_donor_value, $decrease_donation_count); |
|
1500 | 1500 | $this->delete_sales_logs(); |
1501 | 1501 | |
1502 | 1502 | $this->completed_date = false; |
1503 | - $this->update_meta( '_give_completed_date', '' ); |
|
1503 | + $this->update_meta('_give_completed_date', ''); |
|
1504 | 1504 | |
1505 | 1505 | // @todo: Refresh only range related stat cache |
1506 | 1506 | give_delete_donation_stats(); |
@@ -1516,26 +1516,26 @@ discard block |
||
1516 | 1516 | $process_revoked = true; |
1517 | 1517 | |
1518 | 1518 | // If the payment was not in publish, don't decrement stats as they were never incremented. |
1519 | - if ( 'publish' != $this->old_status || 'revoked' != $this->status ) { |
|
1519 | + if ('publish' != $this->old_status || 'revoked' != $this->status) { |
|
1520 | 1520 | $process_revoked = false; |
1521 | 1521 | } |
1522 | 1522 | |
1523 | 1523 | // Allow extensions to filter for their own payment types, Example: Recurring Payments. |
1524 | - $process_revoked = apply_filters( 'give_should_process_revoked', $process_revoked, $this ); |
|
1524 | + $process_revoked = apply_filters('give_should_process_revoked', $process_revoked, $this); |
|
1525 | 1525 | |
1526 | - if ( false === $process_revoked ) { |
|
1526 | + if (false === $process_revoked) { |
|
1527 | 1527 | return; |
1528 | 1528 | } |
1529 | 1529 | |
1530 | - $decrease_earnings = apply_filters( 'give_decrease_earnings_on_revoked', true, $this ); |
|
1531 | - $decrease_donor_value = apply_filters( 'give_decrease_donor_value_on_revoked', true, $this ); |
|
1532 | - $decrease_donation_count = apply_filters( 'give_decrease_donors_donation_count_on_revoked', true, $this ); |
|
1530 | + $decrease_earnings = apply_filters('give_decrease_earnings_on_revoked', true, $this); |
|
1531 | + $decrease_donor_value = apply_filters('give_decrease_donor_value_on_revoked', true, $this); |
|
1532 | + $decrease_donation_count = apply_filters('give_decrease_donors_donation_count_on_revoked', true, $this); |
|
1533 | 1533 | |
1534 | - $this->maybe_alter_stats( $decrease_earnings, $decrease_donor_value, $decrease_donation_count ); |
|
1534 | + $this->maybe_alter_stats($decrease_earnings, $decrease_donor_value, $decrease_donation_count); |
|
1535 | 1535 | $this->delete_sales_logs(); |
1536 | 1536 | |
1537 | 1537 | $this->completed_date = false; |
1538 | - $this->update_meta( '_give_completed_date', '' ); |
|
1538 | + $this->update_meta('_give_completed_date', ''); |
|
1539 | 1539 | |
1540 | 1540 | // @todo: Refresh only range related stat cache |
1541 | 1541 | give_delete_donation_stats(); |
@@ -1553,25 +1553,25 @@ discard block |
||
1553 | 1553 | * |
1554 | 1554 | * @return void |
1555 | 1555 | */ |
1556 | - private function maybe_alter_stats( $alter_store_earnings, $alter_customer_value, $alter_customer_purchase_count ) { |
|
1556 | + private function maybe_alter_stats($alter_store_earnings, $alter_customer_value, $alter_customer_purchase_count) { |
|
1557 | 1557 | |
1558 | - give_undo_donation( $this->ID ); |
|
1558 | + give_undo_donation($this->ID); |
|
1559 | 1559 | |
1560 | 1560 | // Decrease store earnings. |
1561 | - if ( true === $alter_store_earnings ) { |
|
1562 | - give_decrease_total_earnings( $this->total ); |
|
1561 | + if (true === $alter_store_earnings) { |
|
1562 | + give_decrease_total_earnings($this->total); |
|
1563 | 1563 | } |
1564 | 1564 | |
1565 | 1565 | // Decrement the stats for the donor. |
1566 | - if ( ! empty( $this->customer_id ) ) { |
|
1566 | + if ( ! empty($this->customer_id)) { |
|
1567 | 1567 | |
1568 | - $donor = new Give_Donor( $this->customer_id ); |
|
1568 | + $donor = new Give_Donor($this->customer_id); |
|
1569 | 1569 | |
1570 | - if ( true === $alter_customer_value ) { |
|
1571 | - $donor->decrease_value( $this->total ); |
|
1570 | + if (true === $alter_customer_value) { |
|
1571 | + $donor->decrease_value($this->total); |
|
1572 | 1572 | } |
1573 | 1573 | |
1574 | - if ( true === $alter_customer_purchase_count ) { |
|
1574 | + if (true === $alter_customer_purchase_count) { |
|
1575 | 1575 | $donor->decrease_donation_count(); |
1576 | 1576 | } |
1577 | 1577 | } |
@@ -1620,13 +1620,13 @@ discard block |
||
1620 | 1620 | * @return string The date the payment was completed |
1621 | 1621 | */ |
1622 | 1622 | private function setup_completed_date() { |
1623 | - $payment = get_post( $this->ID ); |
|
1623 | + $payment = get_post($this->ID); |
|
1624 | 1624 | |
1625 | - if ( 'pending' == $payment->post_status || 'preapproved' == $payment->post_status ) { |
|
1625 | + if ('pending' == $payment->post_status || 'preapproved' == $payment->post_status) { |
|
1626 | 1626 | return false; // This payment was never completed. |
1627 | 1627 | } |
1628 | 1628 | |
1629 | - $date = ( $date = $this->get_meta( '_give_completed_date', true ) ) ? $date : $payment->modified_date; |
|
1629 | + $date = ($date = $this->get_meta('_give_completed_date', true)) ? $date : $payment->modified_date; |
|
1630 | 1630 | |
1631 | 1631 | return $date; |
1632 | 1632 | } |
@@ -1640,7 +1640,7 @@ discard block |
||
1640 | 1640 | * @return string The payment mode |
1641 | 1641 | */ |
1642 | 1642 | private function setup_mode() { |
1643 | - return $this->get_meta( '_give_payment_mode' ); |
|
1643 | + return $this->get_meta('_give_payment_mode'); |
|
1644 | 1644 | } |
1645 | 1645 | |
1646 | 1646 | /** |
@@ -1652,7 +1652,7 @@ discard block |
||
1652 | 1652 | * @return bool The payment import |
1653 | 1653 | */ |
1654 | 1654 | private function setup_import() { |
1655 | - return (bool) $this->get_meta( '_give_payment_import' ); |
|
1655 | + return (bool) $this->get_meta('_give_payment_import'); |
|
1656 | 1656 | } |
1657 | 1657 | |
1658 | 1658 | /** |
@@ -1664,18 +1664,18 @@ discard block |
||
1664 | 1664 | * @return float The payment total |
1665 | 1665 | */ |
1666 | 1666 | private function setup_total() { |
1667 | - $amount = $this->get_meta( '_give_payment_total', true ); |
|
1667 | + $amount = $this->get_meta('_give_payment_total', true); |
|
1668 | 1668 | |
1669 | - if ( empty( $amount ) && '0.00' != $amount ) { |
|
1670 | - $meta = $this->get_meta( '_give_payment_meta', true ); |
|
1671 | - $meta = maybe_unserialize( $meta ); |
|
1669 | + if (empty($amount) && '0.00' != $amount) { |
|
1670 | + $meta = $this->get_meta('_give_payment_meta', true); |
|
1671 | + $meta = maybe_unserialize($meta); |
|
1672 | 1672 | |
1673 | - if ( isset( $meta['amount'] ) ) { |
|
1673 | + if (isset($meta['amount'])) { |
|
1674 | 1674 | $amount = $meta['amount']; |
1675 | 1675 | } |
1676 | 1676 | } |
1677 | 1677 | |
1678 | - return round( floatval( $amount ), give_currency_decimal_filter() ); |
|
1678 | + return round(floatval($amount), give_currency_decimal_filter()); |
|
1679 | 1679 | } |
1680 | 1680 | |
1681 | 1681 | /** |
@@ -1701,7 +1701,7 @@ discard block |
||
1701 | 1701 | * @return string The currency for the payment |
1702 | 1702 | */ |
1703 | 1703 | private function setup_currency() { |
1704 | - $currency = isset( $this->payment_meta['currency'] ) ? $this->payment_meta['currency'] : apply_filters( 'give_payment_currency_default', give_get_currency(), $this ); |
|
1704 | + $currency = isset($this->payment_meta['currency']) ? $this->payment_meta['currency'] : apply_filters('give_payment_currency_default', give_get_currency(), $this); |
|
1705 | 1705 | |
1706 | 1706 | return $currency; |
1707 | 1707 | } |
@@ -1715,7 +1715,7 @@ discard block |
||
1715 | 1715 | * @return string The gateway |
1716 | 1716 | */ |
1717 | 1717 | private function setup_gateway() { |
1718 | - $gateway = $this->get_meta( '_give_payment_gateway', true ); |
|
1718 | + $gateway = $this->get_meta('_give_payment_gateway', true); |
|
1719 | 1719 | |
1720 | 1720 | return $gateway; |
1721 | 1721 | } |
@@ -1729,11 +1729,11 @@ discard block |
||
1729 | 1729 | * @return string The donation ID |
1730 | 1730 | */ |
1731 | 1731 | private function setup_transaction_id() { |
1732 | - $transaction_id = $this->get_meta( '_give_payment_transaction_id', true ); |
|
1732 | + $transaction_id = $this->get_meta('_give_payment_transaction_id', true); |
|
1733 | 1733 | |
1734 | - if ( empty( $transaction_id ) ) { |
|
1734 | + if (empty($transaction_id)) { |
|
1735 | 1735 | $gateway = $this->gateway; |
1736 | - $transaction_id = apply_filters( "give_get_payment_transaction_id-{$gateway}", $this->ID ); |
|
1736 | + $transaction_id = apply_filters("give_get_payment_transaction_id-{$gateway}", $this->ID); |
|
1737 | 1737 | } |
1738 | 1738 | |
1739 | 1739 | return $transaction_id; |
@@ -1748,7 +1748,7 @@ discard block |
||
1748 | 1748 | * @return string The IP address for the payment |
1749 | 1749 | */ |
1750 | 1750 | private function setup_ip() { |
1751 | - $ip = $this->get_meta( '_give_payment_user_ip', true ); |
|
1751 | + $ip = $this->get_meta('_give_payment_user_ip', true); |
|
1752 | 1752 | |
1753 | 1753 | return $ip; |
1754 | 1754 | } |
@@ -1762,7 +1762,7 @@ discard block |
||
1762 | 1762 | * @return int The Donor ID. |
1763 | 1763 | */ |
1764 | 1764 | private function setup_donor_id() { |
1765 | - $customer_id = $this->get_meta( '_give_payment_customer_id', true ); |
|
1765 | + $customer_id = $this->get_meta('_give_payment_customer_id', true); |
|
1766 | 1766 | |
1767 | 1767 | return $customer_id; |
1768 | 1768 | } |
@@ -1776,7 +1776,7 @@ discard block |
||
1776 | 1776 | * @return int The User ID |
1777 | 1777 | */ |
1778 | 1778 | private function setup_user_id() { |
1779 | - $user_id = $this->get_meta( '_give_payment_user_id', true ); |
|
1779 | + $user_id = $this->get_meta('_give_payment_user_id', true); |
|
1780 | 1780 | |
1781 | 1781 | return $user_id; |
1782 | 1782 | } |
@@ -1790,10 +1790,10 @@ discard block |
||
1790 | 1790 | * @return string The email address for the payment. |
1791 | 1791 | */ |
1792 | 1792 | private function setup_email() { |
1793 | - $email = $this->get_meta( '_give_payment_user_email', true ); |
|
1793 | + $email = $this->get_meta('_give_payment_user_email', true); |
|
1794 | 1794 | |
1795 | - if ( empty( $email ) && $this->customer_id ) { |
|
1796 | - $email = Give()->donors->get_column( 'email', $this->customer_id ); |
|
1795 | + if (empty($email) && $this->customer_id) { |
|
1796 | + $email = Give()->donors->get_column('email', $this->customer_id); |
|
1797 | 1797 | } |
1798 | 1798 | |
1799 | 1799 | return $email; |
@@ -1813,23 +1813,23 @@ discard block |
||
1813 | 1813 | 'last_name' => $this->last_name, |
1814 | 1814 | ); |
1815 | 1815 | |
1816 | - $user_info = isset( $this->payment_meta['user_info'] ) ? $this->payment_meta['user_info'] : array(); |
|
1816 | + $user_info = isset($this->payment_meta['user_info']) ? $this->payment_meta['user_info'] : array(); |
|
1817 | 1817 | |
1818 | - if ( is_serialized( $user_info ) ) { |
|
1819 | - preg_match( '/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $user_info, $matches ); |
|
1820 | - if ( ! empty( $matches ) ) { |
|
1818 | + if (is_serialized($user_info)) { |
|
1819 | + preg_match('/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $user_info, $matches); |
|
1820 | + if ( ! empty($matches)) { |
|
1821 | 1821 | $user_info = array(); |
1822 | 1822 | } |
1823 | 1823 | } |
1824 | 1824 | |
1825 | - $user_info = wp_parse_args( $user_info, $defaults ); |
|
1825 | + $user_info = wp_parse_args($user_info, $defaults); |
|
1826 | 1826 | |
1827 | - if ( empty( $user_info ) ) { |
|
1827 | + if (empty($user_info)) { |
|
1828 | 1828 | // Get the donor, but only if it's been created. |
1829 | - $donor = new Give_Donor( $this->customer_id ); |
|
1829 | + $donor = new Give_Donor($this->customer_id); |
|
1830 | 1830 | |
1831 | - if ( $donor->id > 0 ) { |
|
1832 | - $name = explode( ' ', $donor->name, 2 ); |
|
1831 | + if ($donor->id > 0) { |
|
1832 | + $name = explode(' ', $donor->name, 2); |
|
1833 | 1833 | $user_info = array( |
1834 | 1834 | 'first_name' => $name[0], |
1835 | 1835 | 'last_name' => $name[1], |
@@ -1839,29 +1839,29 @@ discard block |
||
1839 | 1839 | } |
1840 | 1840 | } else { |
1841 | 1841 | // Get the donor, but only if it's been created. |
1842 | - $donor = new Give_Donor( $this->customer_id ); |
|
1843 | - if ( $donor->id > 0 ) { |
|
1844 | - foreach ( $user_info as $key => $value ) { |
|
1845 | - if ( ! empty( $value ) ) { |
|
1842 | + $donor = new Give_Donor($this->customer_id); |
|
1843 | + if ($donor->id > 0) { |
|
1844 | + foreach ($user_info as $key => $value) { |
|
1845 | + if ( ! empty($value)) { |
|
1846 | 1846 | continue; |
1847 | 1847 | } |
1848 | 1848 | |
1849 | - switch ( $key ) { |
|
1849 | + switch ($key) { |
|
1850 | 1850 | case 'first_name': |
1851 | - $name = explode( ' ', $donor->name, 2 ); |
|
1851 | + $name = explode(' ', $donor->name, 2); |
|
1852 | 1852 | |
1853 | - $user_info[ $key ] = $name[0]; |
|
1853 | + $user_info[$key] = $name[0]; |
|
1854 | 1854 | break; |
1855 | 1855 | |
1856 | 1856 | case 'last_name': |
1857 | - $name = explode( ' ', $donor->name, 2 ); |
|
1858 | - $last_name = ! empty( $name[1] ) ? $name[1] : ''; |
|
1857 | + $name = explode(' ', $donor->name, 2); |
|
1858 | + $last_name = ! empty($name[1]) ? $name[1] : ''; |
|
1859 | 1859 | |
1860 | - $user_info[ $key ] = $last_name; |
|
1860 | + $user_info[$key] = $last_name; |
|
1861 | 1861 | break; |
1862 | 1862 | |
1863 | 1863 | case 'email': |
1864 | - $user_info[ $key ] = $donor->email; |
|
1864 | + $user_info[$key] = $donor->email; |
|
1865 | 1865 | break; |
1866 | 1866 | } |
1867 | 1867 | } |
@@ -1882,7 +1882,7 @@ discard block |
||
1882 | 1882 | */ |
1883 | 1883 | private function setup_address() { |
1884 | 1884 | |
1885 | - $address = ! empty( $this->payment_meta['user_info']['address'] ) ? $this->payment_meta['user_info']['address'] : array( |
|
1885 | + $address = ! empty($this->payment_meta['user_info']['address']) ? $this->payment_meta['user_info']['address'] : array( |
|
1886 | 1886 | 'line1' => '', |
1887 | 1887 | 'line2' => '', |
1888 | 1888 | 'city' => '', |
@@ -1904,7 +1904,7 @@ discard block |
||
1904 | 1904 | */ |
1905 | 1905 | private function setup_form_title() { |
1906 | 1906 | |
1907 | - $form_id = $this->get_meta( '_give_payment_form_title', true ); |
|
1907 | + $form_id = $this->get_meta('_give_payment_form_title', true); |
|
1908 | 1908 | |
1909 | 1909 | return $form_id; |
1910 | 1910 | } |
@@ -1919,7 +1919,7 @@ discard block |
||
1919 | 1919 | */ |
1920 | 1920 | private function setup_form_id() { |
1921 | 1921 | |
1922 | - $form_id = $this->get_meta( '_give_payment_form_id', true ); |
|
1922 | + $form_id = $this->get_meta('_give_payment_form_id', true); |
|
1923 | 1923 | |
1924 | 1924 | return $form_id; |
1925 | 1925 | } |
@@ -1933,7 +1933,7 @@ discard block |
||
1933 | 1933 | * @return int The Form Price ID. |
1934 | 1934 | */ |
1935 | 1935 | private function setup_price_id() { |
1936 | - $price_id = $this->get_meta( '_give_payment_price_id', true ); |
|
1936 | + $price_id = $this->get_meta('_give_payment_price_id', true); |
|
1937 | 1937 | |
1938 | 1938 | return $price_id; |
1939 | 1939 | } |
@@ -1947,7 +1947,7 @@ discard block |
||
1947 | 1947 | * @return string The Payment Key. |
1948 | 1948 | */ |
1949 | 1949 | private function setup_payment_key() { |
1950 | - $key = $this->get_meta( '_give_payment_purchase_key', true ); |
|
1950 | + $key = $this->get_meta('_give_payment_purchase_key', true); |
|
1951 | 1951 | |
1952 | 1952 | return $key; |
1953 | 1953 | } |
@@ -1963,11 +1963,11 @@ discard block |
||
1963 | 1963 | private function setup_payment_number() { |
1964 | 1964 | $number = $this->ID; |
1965 | 1965 | |
1966 | - if ( give_get_option( 'enable_sequential' ) ) { |
|
1966 | + if (give_get_option('enable_sequential')) { |
|
1967 | 1967 | |
1968 | - $number = $this->get_meta( '_give_payment_number', true ); |
|
1968 | + $number = $this->get_meta('_give_payment_number', true); |
|
1969 | 1969 | |
1970 | - if ( ! $number ) { |
|
1970 | + if ( ! $number) { |
|
1971 | 1971 | |
1972 | 1972 | $number = $this->ID; |
1973 | 1973 | |
@@ -1985,7 +1985,7 @@ discard block |
||
1985 | 1985 | * @return array The payment object as an array. |
1986 | 1986 | */ |
1987 | 1987 | public function array_convert() { |
1988 | - return get_object_vars( $this ); |
|
1988 | + return get_object_vars($this); |
|
1989 | 1989 | } |
1990 | 1990 | |
1991 | 1991 | |
@@ -1998,7 +1998,7 @@ discard block |
||
1998 | 1998 | * @return bool |
1999 | 1999 | */ |
2000 | 2000 | public function is_completed() { |
2001 | - return ( 'publish' === $this->status && $this->completed_date ); |
|
2001 | + return ('publish' === $this->status && $this->completed_date); |
|
2002 | 2002 | } |
2003 | 2003 | |
2004 | 2004 | /** |
@@ -2010,7 +2010,7 @@ discard block |
||
2010 | 2010 | * @return string Date payment was completed. |
2011 | 2011 | */ |
2012 | 2012 | private function get_completed_date() { |
2013 | - return apply_filters( 'give_payment_completed_date', $this->completed_date, $this->ID, $this ); |
|
2013 | + return apply_filters('give_payment_completed_date', $this->completed_date, $this->ID, $this); |
|
2014 | 2014 | } |
2015 | 2015 | |
2016 | 2016 | /** |
@@ -2022,7 +2022,7 @@ discard block |
||
2022 | 2022 | * @return float Payment subtotal. |
2023 | 2023 | */ |
2024 | 2024 | private function get_subtotal() { |
2025 | - return apply_filters( 'give_get_payment_subtotal', $this->subtotal, $this->ID, $this ); |
|
2025 | + return apply_filters('give_get_payment_subtotal', $this->subtotal, $this->ID, $this); |
|
2026 | 2026 | } |
2027 | 2027 | |
2028 | 2028 | /** |
@@ -2034,7 +2034,7 @@ discard block |
||
2034 | 2034 | * @return string Payment currency code. |
2035 | 2035 | */ |
2036 | 2036 | private function get_currency() { |
2037 | - return apply_filters( 'give_payment_currency_code', $this->currency, $this->ID, $this ); |
|
2037 | + return apply_filters('give_payment_currency_code', $this->currency, $this->ID, $this); |
|
2038 | 2038 | } |
2039 | 2039 | |
2040 | 2040 | /** |
@@ -2046,7 +2046,7 @@ discard block |
||
2046 | 2046 | * @return string Gateway used. |
2047 | 2047 | */ |
2048 | 2048 | private function get_gateway() { |
2049 | - return apply_filters( 'give_payment_gateway', $this->gateway, $this->ID, $this ); |
|
2049 | + return apply_filters('give_payment_gateway', $this->gateway, $this->ID, $this); |
|
2050 | 2050 | } |
2051 | 2051 | |
2052 | 2052 | /** |
@@ -2058,7 +2058,7 @@ discard block |
||
2058 | 2058 | * @return string Donation ID from merchant processor. |
2059 | 2059 | */ |
2060 | 2060 | private function get_transaction_id() { |
2061 | - return apply_filters( 'give_get_payment_transaction_id', $this->transaction_id, $this->ID, $this ); |
|
2061 | + return apply_filters('give_get_payment_transaction_id', $this->transaction_id, $this->ID, $this); |
|
2062 | 2062 | } |
2063 | 2063 | |
2064 | 2064 | /** |
@@ -2070,7 +2070,7 @@ discard block |
||
2070 | 2070 | * @return string Payment IP address |
2071 | 2071 | */ |
2072 | 2072 | private function get_ip() { |
2073 | - return apply_filters( 'give_payment_user_ip', $this->ip, $this->ID, $this ); |
|
2073 | + return apply_filters('give_payment_user_ip', $this->ip, $this->ID, $this); |
|
2074 | 2074 | } |
2075 | 2075 | |
2076 | 2076 | /** |
@@ -2082,7 +2082,7 @@ discard block |
||
2082 | 2082 | * @return int Payment donor ID. |
2083 | 2083 | */ |
2084 | 2084 | private function get_donor_id() { |
2085 | - return apply_filters( 'give_payment_customer_id', $this->customer_id, $this->ID, $this ); |
|
2085 | + return apply_filters('give_payment_customer_id', $this->customer_id, $this->ID, $this); |
|
2086 | 2086 | } |
2087 | 2087 | |
2088 | 2088 | /** |
@@ -2094,7 +2094,7 @@ discard block |
||
2094 | 2094 | * @return int Payment user ID. |
2095 | 2095 | */ |
2096 | 2096 | private function get_user_id() { |
2097 | - return apply_filters( 'give_payment_user_id', $this->user_id, $this->ID, $this ); |
|
2097 | + return apply_filters('give_payment_user_id', $this->user_id, $this->ID, $this); |
|
2098 | 2098 | } |
2099 | 2099 | |
2100 | 2100 | /** |
@@ -2106,7 +2106,7 @@ discard block |
||
2106 | 2106 | * @return string Payment donor email. |
2107 | 2107 | */ |
2108 | 2108 | private function get_email() { |
2109 | - return apply_filters( 'give_payment_user_email', $this->email, $this->ID, $this ); |
|
2109 | + return apply_filters('give_payment_user_email', $this->email, $this->ID, $this); |
|
2110 | 2110 | } |
2111 | 2111 | |
2112 | 2112 | /** |
@@ -2118,7 +2118,7 @@ discard block |
||
2118 | 2118 | * @return array Payment user info. |
2119 | 2119 | */ |
2120 | 2120 | private function get_user_info() { |
2121 | - return apply_filters( 'give_payment_meta_user_info', $this->user_info, $this->ID, $this ); |
|
2121 | + return apply_filters('give_payment_meta_user_info', $this->user_info, $this->ID, $this); |
|
2122 | 2122 | } |
2123 | 2123 | |
2124 | 2124 | /** |
@@ -2130,7 +2130,7 @@ discard block |
||
2130 | 2130 | * @return array Payment billing address. |
2131 | 2131 | */ |
2132 | 2132 | private function get_address() { |
2133 | - return apply_filters( 'give_payment_address', $this->address, $this->ID, $this ); |
|
2133 | + return apply_filters('give_payment_address', $this->address, $this->ID, $this); |
|
2134 | 2134 | } |
2135 | 2135 | |
2136 | 2136 | /** |
@@ -2142,7 +2142,7 @@ discard block |
||
2142 | 2142 | * @return string Payment key. |
2143 | 2143 | */ |
2144 | 2144 | private function get_key() { |
2145 | - return apply_filters( 'give_payment_key', $this->key, $this->ID, $this ); |
|
2145 | + return apply_filters('give_payment_key', $this->key, $this->ID, $this); |
|
2146 | 2146 | } |
2147 | 2147 | |
2148 | 2148 | /** |
@@ -2154,7 +2154,7 @@ discard block |
||
2154 | 2154 | * @return string Payment form id |
2155 | 2155 | */ |
2156 | 2156 | private function get_form_id() { |
2157 | - return apply_filters( 'give_payment_form_id', $this->form_id, $this->ID, $this ); |
|
2157 | + return apply_filters('give_payment_form_id', $this->form_id, $this->ID, $this); |
|
2158 | 2158 | } |
2159 | 2159 | |
2160 | 2160 | /** |
@@ -2166,7 +2166,7 @@ discard block |
||
2166 | 2166 | * @return int|string Payment number |
2167 | 2167 | */ |
2168 | 2168 | private function get_number() { |
2169 | - return apply_filters( 'give_payment_number', $this->number, $this->ID, $this ); |
|
2169 | + return apply_filters('give_payment_number', $this->number, $this->ID, $this); |
|
2170 | 2170 | } |
2171 | 2171 | |
2172 | 2172 | } |