@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_Advanced' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Advanced')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Advanced. |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | 29 | $this->id = 'advanced'; |
30 | - $this->label = __( 'Advanced', 'give' ); |
|
30 | + $this->label = __('Advanced', 'give'); |
|
31 | 31 | |
32 | 32 | $this->default_tab = 'advanced-options'; |
33 | 33 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | $current_section = give_get_current_setting_section(); |
47 | 47 | |
48 | - switch ( $current_section ) { |
|
48 | + switch ($current_section) { |
|
49 | 49 | case 'advanced-options': |
50 | 50 | $settings = array( |
51 | 51 | array( |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | 'type' => 'title', |
54 | 54 | ), |
55 | 55 | array( |
56 | - 'name' => __( 'Default User Role', 'give' ), |
|
57 | - 'desc' => __( 'Assign default user roles for donors when donors opt to register as a WP User.', 'give' ), |
|
56 | + 'name' => __('Default User Role', 'give'), |
|
57 | + 'desc' => __('Assign default user roles for donors when donors opt to register as a WP User.', 'give'), |
|
58 | 58 | 'id' => 'donor_default_user_role', |
59 | 59 | 'type' => 'select', |
60 | 60 | 'default' => 'give_donor', |
@@ -62,55 +62,55 @@ discard block |
||
62 | 62 | ), |
63 | 63 | array( |
64 | 64 | /* translators: %s: the_content */ |
65 | - 'name' => sprintf( __( '%s filter', 'give' ), '<code>the_content</code>' ), |
|
65 | + 'name' => sprintf(__('%s filter', 'give'), '<code>the_content</code>'), |
|
66 | 66 | /* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */ |
67 | - 'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ), |
|
67 | + 'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'), |
|
68 | 68 | 'id' => 'the_content_filter', |
69 | 69 | 'default' => 'enabled', |
70 | 70 | 'type' => 'radio_inline', |
71 | 71 | 'options' => array( |
72 | - 'enabled' => __( 'Enabled', 'give' ), |
|
73 | - 'disabled' => __( 'Disabled', 'give' ), |
|
72 | + 'enabled' => __('Enabled', 'give'), |
|
73 | + 'disabled' => __('Disabled', 'give'), |
|
74 | 74 | ), |
75 | 75 | ), |
76 | 76 | array( |
77 | - 'name' => __( 'Script Loading Location', 'give' ), |
|
78 | - 'desc' => __( 'This allows you to load your Give scripts either in the <code><head></code> or footer of your website.', 'give' ), |
|
77 | + 'name' => __('Script Loading Location', 'give'), |
|
78 | + 'desc' => __('This allows you to load your Give scripts either in the <code><head></code> or footer of your website.', 'give'), |
|
79 | 79 | 'id' => 'scripts_footer', |
80 | 80 | 'type' => 'radio_inline', |
81 | 81 | 'default' => 'disabled', |
82 | 82 | 'options' => array( |
83 | - 'disabled' => __( 'Head', 'give' ), |
|
84 | - 'enabled' => __( 'Footer', 'give' ), |
|
83 | + 'disabled' => __('Head', 'give'), |
|
84 | + 'enabled' => __('Footer', 'give'), |
|
85 | 85 | ), |
86 | 86 | ), |
87 | 87 | array( |
88 | - 'name' => __( 'Akismet SPAM Protection', 'give' ), |
|
89 | - 'desc' => __( 'Add a layer of SPAM protection to your donation submissions with Akismet. When enabled, donation submissions will be first sent to Akismet\'s API if you have the plugin activated and configured.', 'give' ), |
|
88 | + 'name' => __('Akismet SPAM Protection', 'give'), |
|
89 | + 'desc' => __('Add a layer of SPAM protection to your donation submissions with Akismet. When enabled, donation submissions will be first sent to Akismet\'s API if you have the plugin activated and configured.', 'give'), |
|
90 | 90 | 'id' => 'akismet_spam_protection', |
91 | 91 | 'type' => 'radio_inline', |
92 | - 'default' => ( give_check_akismet_key() ) ? 'enabled' : 'disabled', |
|
92 | + 'default' => (give_check_akismet_key()) ? 'enabled' : 'disabled', |
|
93 | 93 | 'options' => array( |
94 | - 'enabled' => __( 'Enabled', 'give' ), |
|
95 | - 'disabled' => __( 'Disabled', 'give' ), |
|
94 | + 'enabled' => __('Enabled', 'give'), |
|
95 | + 'disabled' => __('Disabled', 'give'), |
|
96 | 96 | ), |
97 | 97 | ), |
98 | 98 | array( |
99 | - 'name' => __( 'Remove Data on Uninstall', 'give' ), |
|
100 | - 'desc' => __( 'When the plugin is deleted, completely remove all Give data. This includes all Give settings, forms, form meta, donor, donor data, donations. Everything.', 'give' ), |
|
99 | + 'name' => __('Remove Data on Uninstall', 'give'), |
|
100 | + 'desc' => __('When the plugin is deleted, completely remove all Give data. This includes all Give settings, forms, form meta, donor, donor data, donations. Everything.', 'give'), |
|
101 | 101 | 'id' => 'uninstall_on_delete', |
102 | 102 | 'type' => 'radio_inline', |
103 | 103 | 'default' => 'disabled', |
104 | 104 | 'options' => array( |
105 | - 'enabled' => __( 'Yes, Remove all data', 'give' ), |
|
106 | - 'disabled' => __( 'No, keep my Give settings and donation data', 'give' ), |
|
105 | + 'enabled' => __('Yes, Remove all data', 'give'), |
|
106 | + 'disabled' => __('No, keep my Give settings and donation data', 'give'), |
|
107 | 107 | ), |
108 | 108 | ), |
109 | 109 | array( |
110 | - 'name' => __( 'Advanced Settings Docs Link', 'give' ), |
|
110 | + 'name' => __('Advanced Settings Docs Link', 'give'), |
|
111 | 111 | 'id' => 'advanced_settings_docs_link', |
112 | - 'url' => esc_url( 'http://docs.givewp.com/settings-advanced' ), |
|
113 | - 'title' => __( 'Advanced Settings', 'give' ), |
|
112 | + 'url' => esc_url('http://docs.givewp.com/settings-advanced'), |
|
113 | + 'title' => __('Advanced Settings', 'give'), |
|
114 | 114 | 'type' => 'give_docs_link', |
115 | 115 | ), |
116 | 116 | array( |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * Filter the advanced settings. |
127 | 127 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
128 | 128 | */ |
129 | - $settings = apply_filters( 'give_settings_advanced', $settings ); |
|
129 | + $settings = apply_filters('give_settings_advanced', $settings); |
|
130 | 130 | |
131 | 131 | /** |
132 | 132 | * Filter the settings. |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * |
136 | 136 | * @param array $settings |
137 | 137 | */ |
138 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
138 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
139 | 139 | |
140 | 140 | // Output. |
141 | 141 | return $settings; |
@@ -149,10 +149,10 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function get_sections() { |
151 | 151 | $sections = array( |
152 | - 'advanced-options' => __( 'Advanced Options', 'give' ), |
|
152 | + 'advanced-options' => __('Advanced Options', 'give'), |
|
153 | 153 | ); |
154 | 154 | |
155 | - return apply_filters( 'give_get_sections_' . $this->id, $sections ); |
|
155 | + return apply_filters('give_get_sections_'.$this->id, $sections); |
|
156 | 156 | } |
157 | 157 | } |
158 | 158 |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_Display' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Display')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Display. |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | 29 | $this->id = 'display'; |
30 | - $this->label = __( 'Display Options', 'give' ); |
|
30 | + $this->label = __('Display Options', 'give'); |
|
31 | 31 | |
32 | 32 | $this->default_tab = 'display-settings'; |
33 | 33 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $settings = array(); |
45 | 45 | $current_section = give_get_current_setting_section(); |
46 | 46 | |
47 | - switch ( $current_section ) { |
|
47 | + switch ($current_section) { |
|
48 | 48 | case 'display-settings' : |
49 | 49 | $settings = array( |
50 | 50 | // Section 1: Display |
@@ -53,55 +53,55 @@ discard block |
||
53 | 53 | 'type' => 'title', |
54 | 54 | ), |
55 | 55 | array( |
56 | - 'name' => __( 'Default Give Styles', 'give' ), |
|
57 | - 'desc' => __( 'You can disable Give\'s default styles for donation forms and other frontend elements.', 'give' ), |
|
56 | + 'name' => __('Default Give Styles', 'give'), |
|
57 | + 'desc' => __('You can disable Give\'s default styles for donation forms and other frontend elements.', 'give'), |
|
58 | 58 | 'id' => 'css', |
59 | 59 | 'type' => 'radio_inline', |
60 | 60 | 'default' => 'enabled', |
61 | 61 | 'options' => array( |
62 | - 'enabled' => __( 'Enabled', 'give' ), |
|
63 | - 'disabled' => __( 'Disabled', 'give' ), |
|
62 | + 'enabled' => __('Enabled', 'give'), |
|
63 | + 'disabled' => __('Disabled', 'give'), |
|
64 | 64 | ), |
65 | 65 | ), |
66 | 66 | array( |
67 | - 'name' => __( 'Floating Labels', 'give' ), |
|
67 | + 'name' => __('Floating Labels', 'give'), |
|
68 | 68 | /* translators: %s: http://docs.givewp.com/form-floating-labels */ |
69 | - 'desc' => sprintf( wp_kses( __( '<a href="%s" target="_blank">Floating labels</a> allows your labels to be inset within the form fields to provide a cleaner form appearance. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array( |
|
69 | + 'desc' => sprintf(wp_kses(__('<a href="%s" target="_blank">Floating labels</a> allows your labels to be inset within the form fields to provide a cleaner form appearance. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array( |
|
70 | 70 | 'a' => array( |
71 | 71 | 'href' => array(), |
72 | 72 | 'target' => array(), |
73 | 73 | ), |
74 | - ) ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ), |
|
74 | + )), esc_url('http://docs.givewp.com/form-floating-labels')), |
|
75 | 75 | 'id' => 'floatlabels', |
76 | 76 | 'type' => 'radio_inline', |
77 | 77 | 'default' => 'disabled', |
78 | 78 | 'options' => array( |
79 | - 'enabled' => __( 'Enabled', 'give' ), |
|
80 | - 'disabled' => __( 'Disabled', 'give' ), |
|
79 | + 'enabled' => __('Enabled', 'give'), |
|
80 | + 'disabled' => __('Disabled', 'give'), |
|
81 | 81 | ), |
82 | 82 | ), |
83 | 83 | array( |
84 | - 'name' => __( 'Welcome Screen', 'give' ), |
|
84 | + 'name' => __('Welcome Screen', 'give'), |
|
85 | 85 | /* translators: %s: about page URL */ |
86 | - 'desc' => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> that displays each time Give is activated or updated.', 'give' ), array( |
|
86 | + 'desc' => sprintf(wp_kses(__('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> that displays each time Give is activated or updated.', 'give'), array( |
|
87 | 87 | 'a' => array( |
88 | 88 | 'href' => array(), |
89 | 89 | 'target' => array(), |
90 | 90 | ), |
91 | - ) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ), |
|
91 | + )), esc_url(admin_url('index.php?page=give-about'))), |
|
92 | 92 | 'id' => 'welcome', |
93 | 93 | 'type' => 'radio_inline', |
94 | 94 | 'default' => 'enabled', |
95 | 95 | 'options' => array( |
96 | - 'enabled' => __( 'Enabled', 'give' ), |
|
97 | - 'disabled' => __( 'Disabled', 'give' ), |
|
96 | + 'enabled' => __('Enabled', 'give'), |
|
97 | + 'disabled' => __('Disabled', 'give'), |
|
98 | 98 | ), |
99 | 99 | ), |
100 | 100 | array( |
101 | - 'name' => __( 'Display Settings Docs Link', 'give' ), |
|
101 | + 'name' => __('Display Settings Docs Link', 'give'), |
|
102 | 102 | 'id' => 'display_settings_docs_link', |
103 | - 'url' => esc_url( 'http://docs.givewp.com/form-display-options' ), |
|
104 | - 'title' => __( 'Display Options Settings', 'give' ), |
|
103 | + 'url' => esc_url('http://docs.givewp.com/form-display-options'), |
|
104 | + 'title' => __('Display Options Settings', 'give'), |
|
105 | 105 | 'type' => 'give_docs_link', |
106 | 106 | ), |
107 | 107 | array( |
@@ -118,78 +118,78 @@ discard block |
||
118 | 118 | 'type' => 'title', |
119 | 119 | ), |
120 | 120 | array( |
121 | - 'name' => __( 'Form Single Views', 'give' ), |
|
122 | - 'desc' => __( 'By default, all donation form have single views enabled which creates a specific URL on your website for that form. This option disables the singular posts from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ), |
|
121 | + 'name' => __('Form Single Views', 'give'), |
|
122 | + 'desc' => __('By default, all donation form have single views enabled which creates a specific URL on your website for that form. This option disables the singular posts from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'), |
|
123 | 123 | 'id' => 'forms_singular', |
124 | 124 | 'type' => 'radio_inline', |
125 | 125 | 'default' => 'enabled', |
126 | 126 | 'options' => array( |
127 | - 'enabled' => __( 'Enabled', 'give' ), |
|
128 | - 'disabled' => __( 'Disabled', 'give' ), |
|
127 | + 'enabled' => __('Enabled', 'give'), |
|
128 | + 'disabled' => __('Disabled', 'give'), |
|
129 | 129 | ), |
130 | 130 | ), |
131 | 131 | array( |
132 | - 'name' => __( 'Form Archives', 'give' ), |
|
133 | - 'desc' => sprintf( wp_kses( __( 'Archives pages list all the donation forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to <a href="%s">refresh your permalinks</a> after this option has been enabled.', 'give' ), array( |
|
132 | + 'name' => __('Form Archives', 'give'), |
|
133 | + 'desc' => sprintf(wp_kses(__('Archives pages list all the donation forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to <a href="%s">refresh your permalinks</a> after this option has been enabled.', 'give'), array( |
|
134 | 134 | 'a' => array( |
135 | 135 | 'href' => array(), |
136 | 136 | 'target' => array(), |
137 | 137 | ), |
138 | - ) ), esc_url( admin_url( 'options-permalink.php' ) ) ), |
|
138 | + )), esc_url(admin_url('options-permalink.php'))), |
|
139 | 139 | 'id' => 'forms_archives', |
140 | 140 | 'type' => 'radio_inline', |
141 | 141 | 'default' => 'enabled', |
142 | 142 | 'options' => array( |
143 | - 'enabled' => __( 'Enabled', 'give' ), |
|
144 | - 'disabled' => __( 'Disabled', 'give' ), |
|
143 | + 'enabled' => __('Enabled', 'give'), |
|
144 | + 'disabled' => __('Disabled', 'give'), |
|
145 | 145 | ), |
146 | 146 | ), |
147 | 147 | array( |
148 | - 'name' => __( 'Form Excerpts', 'give' ), |
|
149 | - 'desc' => __( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ), |
|
148 | + 'name' => __('Form Excerpts', 'give'), |
|
149 | + 'desc' => __('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'), |
|
150 | 150 | 'id' => 'forms_excerpt', |
151 | 151 | 'type' => 'radio_inline', |
152 | 152 | 'default' => 'enabled', |
153 | 153 | 'options' => array( |
154 | - 'enabled' => __( 'Enabled', 'give' ), |
|
155 | - 'disabled' => __( 'Disabled', 'give' ), |
|
154 | + 'enabled' => __('Enabled', 'give'), |
|
155 | + 'disabled' => __('Disabled', 'give'), |
|
156 | 156 | ), |
157 | 157 | ), |
158 | 158 | array( |
159 | - 'name' => __( 'Form Featured Image', 'give' ), |
|
160 | - 'desc' => __( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ), |
|
159 | + 'name' => __('Form Featured Image', 'give'), |
|
160 | + 'desc' => __('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'), |
|
161 | 161 | 'id' => 'form_featured_img', |
162 | 162 | 'type' => 'radio_inline', |
163 | 163 | 'default' => 'enabled', |
164 | 164 | 'options' => array( |
165 | - 'enabled' => __( 'Enabled', 'give' ), |
|
166 | - 'disabled' => __( 'Disabled', 'give' ), |
|
165 | + 'enabled' => __('Enabled', 'give'), |
|
166 | + 'disabled' => __('Disabled', 'give'), |
|
167 | 167 | ), |
168 | 168 | ), |
169 | 169 | array( |
170 | - 'name' => __( 'Featured Image Size', 'give' ), |
|
171 | - 'desc' => __( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give' ), |
|
170 | + 'name' => __('Featured Image Size', 'give'), |
|
171 | + 'desc' => __('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give'), |
|
172 | 172 | 'id' => 'featured_image_size', |
173 | 173 | 'type' => 'select', |
174 | 174 | 'default' => 'large', |
175 | 175 | 'options' => give_get_featured_image_sizes(), |
176 | 176 | ), |
177 | 177 | array( |
178 | - 'name' => __( 'Single Form Sidebar', 'give' ), |
|
179 | - 'desc' => __( 'The sidebar allows you to add additional widgets to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ), |
|
178 | + 'name' => __('Single Form Sidebar', 'give'), |
|
179 | + 'desc' => __('The sidebar allows you to add additional widgets to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'), |
|
180 | 180 | 'id' => 'form_sidebar', |
181 | 181 | 'type' => 'radio_inline', |
182 | 182 | 'default' => 'enabled', |
183 | 183 | 'options' => array( |
184 | - 'enabled' => __( 'Enabled', 'give' ), |
|
185 | - 'disabled' => __( 'Disabled', 'give' ), |
|
184 | + 'enabled' => __('Enabled', 'give'), |
|
185 | + 'disabled' => __('Disabled', 'give'), |
|
186 | 186 | ), |
187 | 187 | ), |
188 | 188 | array( |
189 | - 'name' => __( 'Post Types Docs Link', 'give' ), |
|
189 | + 'name' => __('Post Types Docs Link', 'give'), |
|
190 | 190 | 'id' => 'post_types_settings_docs_link', |
191 | - 'url' => esc_url( 'http://docs.givewp.com/settings-post-types' ), |
|
192 | - 'title' => __( 'Post Types Settings', 'give' ), |
|
191 | + 'url' => esc_url('http://docs.givewp.com/settings-post-types'), |
|
192 | + 'title' => __('Post Types Settings', 'give'), |
|
193 | 193 | 'type' => 'give_docs_link', |
194 | 194 | ), |
195 | 195 | array( |
@@ -206,32 +206,32 @@ discard block |
||
206 | 206 | 'type' => 'title', |
207 | 207 | ), |
208 | 208 | array( |
209 | - 'name' => __( 'Form Categories', 'give' ), |
|
210 | - 'desc' => __( 'Enable Categories for all Give forms.', 'give' ), |
|
209 | + 'name' => __('Form Categories', 'give'), |
|
210 | + 'desc' => __('Enable Categories for all Give forms.', 'give'), |
|
211 | 211 | 'id' => 'categories', |
212 | 212 | 'type' => 'radio_inline', |
213 | 213 | 'default' => 'disabled', |
214 | 214 | 'options' => array( |
215 | - 'enabled' => __( 'Enabled', 'give' ), |
|
216 | - 'disabled' => __( 'Disabled', 'give' ), |
|
215 | + 'enabled' => __('Enabled', 'give'), |
|
216 | + 'disabled' => __('Disabled', 'give'), |
|
217 | 217 | ), |
218 | 218 | ), |
219 | 219 | array( |
220 | - 'name' => __( 'Form Tags', 'give' ), |
|
221 | - 'desc' => __( 'Enable Tags for all Give forms.', 'give' ), |
|
220 | + 'name' => __('Form Tags', 'give'), |
|
221 | + 'desc' => __('Enable Tags for all Give forms.', 'give'), |
|
222 | 222 | 'id' => 'tags', |
223 | 223 | 'type' => 'radio_inline', |
224 | 224 | 'default' => 'disabled', |
225 | 225 | 'options' => array( |
226 | - 'enabled' => __( 'Enabled', 'give' ), |
|
227 | - 'disabled' => __( 'Disabled', 'give' ), |
|
226 | + 'enabled' => __('Enabled', 'give'), |
|
227 | + 'disabled' => __('Disabled', 'give'), |
|
228 | 228 | ), |
229 | 229 | ), |
230 | 230 | array( |
231 | - 'name' => __( 'Taxonomies Docs Link', 'give' ), |
|
231 | + 'name' => __('Taxonomies Docs Link', 'give'), |
|
232 | 232 | 'id' => 'taxonomies_settings_docs_link', |
233 | - 'url' => esc_url( 'http://docs.givewp.com/settings-taxonomies' ), |
|
234 | - 'title' => __( 'Taxonomies Settings', 'give' ), |
|
233 | + 'url' => esc_url('http://docs.givewp.com/settings-taxonomies'), |
|
234 | + 'title' => __('Taxonomies Settings', 'give'), |
|
235 | 235 | 'type' => 'give_docs_link', |
236 | 236 | ), |
237 | 237 | array( |
@@ -248,36 +248,36 @@ discard block |
||
248 | 248 | 'type' => 'title', |
249 | 249 | ), |
250 | 250 | array( |
251 | - 'name' => __( 'Terms and Conditions', 'give' ), |
|
252 | - 'desc' => __( 'Would you like donors to require that donors agree to your terms when donating? Note: You can enable/disable this option and customize the terms per form as well.', 'give' ), |
|
251 | + 'name' => __('Terms and Conditions', 'give'), |
|
252 | + 'desc' => __('Would you like donors to require that donors agree to your terms when donating? Note: You can enable/disable this option and customize the terms per form as well.', 'give'), |
|
253 | 253 | 'id' => 'terms', |
254 | 254 | 'type' => 'radio_inline', |
255 | 255 | 'default' => 'disabled', |
256 | 256 | 'options' => array( |
257 | - 'enabled' => __( 'Enabled', 'give' ), |
|
258 | - 'disabled' => __( 'Disabled', 'give' ), |
|
257 | + 'enabled' => __('Enabled', 'give'), |
|
258 | + 'disabled' => __('Disabled', 'give'), |
|
259 | 259 | ), |
260 | 260 | ), |
261 | 261 | array( |
262 | - 'name' => __( 'Agree to Terms Label', 'give' ), |
|
263 | - 'desc' => __( 'The label shown next to the agree to terms check box. Customize it here or leave blank to use the default placeholder text. Note: You can customize the label per form.', 'give' ), |
|
262 | + 'name' => __('Agree to Terms Label', 'give'), |
|
263 | + 'desc' => __('The label shown next to the agree to terms check box. Customize it here or leave blank to use the default placeholder text. Note: You can customize the label per form.', 'give'), |
|
264 | 264 | 'id' => 'agree_to_terms_label', |
265 | 265 | 'attributes' => array( |
266 | - 'placeholder' => esc_attr__( 'Agree to Terms?', 'give' ), |
|
266 | + 'placeholder' => esc_attr__('Agree to Terms?', 'give'), |
|
267 | 267 | ), |
268 | 268 | 'type' => 'text', |
269 | 269 | ), |
270 | 270 | array( |
271 | - 'name' => __( 'Agreement Text', 'give' ), |
|
272 | - 'desc' => __( 'This is the actual text which the user will be asked to agree to in order to donate. Note: You can customize the content per form as needed.', 'give' ), |
|
271 | + 'name' => __('Agreement Text', 'give'), |
|
272 | + 'desc' => __('This is the actual text which the user will be asked to agree to in order to donate. Note: You can customize the content per form as needed.', 'give'), |
|
273 | 273 | 'id' => 'agreement_text', |
274 | 274 | 'type' => 'wysiwyg', |
275 | 275 | ), |
276 | 276 | array( |
277 | - 'name' => __( 'Terms and Conditions Docs Link', 'give' ), |
|
277 | + 'name' => __('Terms and Conditions Docs Link', 'give'), |
|
278 | 278 | 'id' => 'terms_settings_docs_link', |
279 | - 'url' => esc_url( 'http://docs.givewp.com/settings-terms' ), |
|
280 | - 'title' => __( 'Terms and Conditions Settings', 'give' ), |
|
279 | + 'url' => esc_url('http://docs.givewp.com/settings-terms'), |
|
280 | + 'title' => __('Terms and Conditions Settings', 'give'), |
|
281 | 281 | 'type' => 'give_docs_link', |
282 | 282 | ), |
283 | 283 | array( |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | * Filter the display options settings. |
293 | 293 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
294 | 294 | */ |
295 | - $settings = apply_filters( 'give_settings_display', $settings ); |
|
295 | + $settings = apply_filters('give_settings_display', $settings); |
|
296 | 296 | |
297 | 297 | /** |
298 | 298 | * Filter the settings. |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | * |
302 | 302 | * @param array $settings |
303 | 303 | */ |
304 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
304 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
305 | 305 | |
306 | 306 | // Output. |
307 | 307 | return $settings; |
@@ -315,13 +315,13 @@ discard block |
||
315 | 315 | */ |
316 | 316 | public function get_sections() { |
317 | 317 | $sections = array( |
318 | - 'display-settings' => __( 'Display', 'give' ), |
|
319 | - 'post-types' => __( 'Post Types', 'give' ), |
|
320 | - 'taxonomies' => __( 'Taxonomies', 'give' ), |
|
321 | - 'term-and-conditions' => __( 'Terms and Conditions', 'give' ), |
|
318 | + 'display-settings' => __('Display', 'give'), |
|
319 | + 'post-types' => __('Post Types', 'give'), |
|
320 | + 'taxonomies' => __('Taxonomies', 'give'), |
|
321 | + 'term-and-conditions' => __('Terms and Conditions', 'give'), |
|
322 | 322 | ); |
323 | 323 | |
324 | - return apply_filters( 'give_get_sections_' . $this->id, $sections ); |
|
324 | + return apply_filters('give_get_sections_'.$this->id, $sections); |
|
325 | 325 | } |
326 | 326 | } |
327 | 327 |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly. |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_General' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_General')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_General. |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | 29 | $this->id = 'general'; |
30 | - $this->label = __( 'General', 'give' ); |
|
30 | + $this->label = __('General', 'give'); |
|
31 | 31 | |
32 | 32 | $this->default_tab = 'general-settings'; |
33 | 33 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $settings = array(); |
45 | 45 | $current_section = give_get_current_setting_section(); |
46 | 46 | |
47 | - switch ( $current_section ) { |
|
47 | + switch ($current_section) { |
|
48 | 48 | case 'access-control': |
49 | 49 | $settings = array( |
50 | 50 | // Section 3: Access control. |
@@ -54,20 +54,20 @@ discard block |
||
54 | 54 | ), |
55 | 55 | array( |
56 | 56 | 'id' => 'session_lifetime', |
57 | - 'name' => __( 'Session Lifetime', 'give' ), |
|
58 | - 'desc' => __( 'The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give' ), |
|
57 | + 'name' => __('Session Lifetime', 'give'), |
|
58 | + 'desc' => __('The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give'), |
|
59 | 59 | 'type' => 'select', |
60 | 60 | 'options' => array( |
61 | - '86400' => __( '24 Hours', 'give' ), |
|
62 | - '172800' => __( '48 Hours', 'give' ), |
|
63 | - '259200' => __( '72 Hours', 'give' ), |
|
64 | - '604800' => __( '1 Week', 'give' ), |
|
61 | + '86400' => __('24 Hours', 'give'), |
|
62 | + '172800' => __('48 Hours', 'give'), |
|
63 | + '259200' => __('72 Hours', 'give'), |
|
64 | + '604800' => __('1 Week', 'give'), |
|
65 | 65 | ), |
66 | 66 | ), |
67 | 67 | array( |
68 | 68 | 'id' => 'limit_display_donations', |
69 | - 'name' => __( 'Limit Donations Displayed', 'give' ), |
|
70 | - 'desc' => __( 'Adjusts the number of donations displayed to a non logged-in user when they attempt to access the Donation History page without an active session. For security reasons, it\'s best to leave this at 1-3 donations.', 'give' ), |
|
69 | + 'name' => __('Limit Donations Displayed', 'give'), |
|
70 | + 'desc' => __('Adjusts the number of donations displayed to a non logged-in user when they attempt to access the Donation History page without an active session. For security reasons, it\'s best to leave this at 1-3 donations.', 'give'), |
|
71 | 71 | 'default' => '1', |
72 | 72 | 'type' => 'number', |
73 | 73 | 'css' => 'width:50px;', |
@@ -77,36 +77,36 @@ discard block |
||
77 | 77 | ), |
78 | 78 | ), |
79 | 79 | array( |
80 | - 'name' => __( 'Email Access', 'give' ), |
|
81 | - 'desc' => __( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ), |
|
80 | + 'name' => __('Email Access', 'give'), |
|
81 | + 'desc' => __('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'), |
|
82 | 82 | 'id' => 'email_access', |
83 | 83 | 'type' => 'radio_inline', |
84 | 84 | 'default' => 'disabled', |
85 | 85 | 'options' => array( |
86 | - 'enabled' => __( 'Enabled', 'give' ), |
|
87 | - 'disabled' => __( 'Disabled', 'give' ), |
|
86 | + 'enabled' => __('Enabled', 'give'), |
|
87 | + 'disabled' => __('Disabled', 'give'), |
|
88 | 88 | ), |
89 | 89 | ), |
90 | 90 | array( |
91 | 91 | 'id' => 'recaptcha_key', |
92 | - 'name' => __( 'reCAPTCHA Site Key', 'give' ), |
|
92 | + 'name' => __('reCAPTCHA Site Key', 'give'), |
|
93 | 93 | /* translators: %s: https://www.google.com/recaptcha/ */ |
94 | - 'desc' => sprintf( __( 'If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key and paste your reCAPTCHA site key here. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'http://docs.givewp.com/recaptcha' ) ), |
|
94 | + 'desc' => sprintf(__('If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key and paste your reCAPTCHA site key here. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('http://docs.givewp.com/recaptcha')), |
|
95 | 95 | 'default' => '', |
96 | 96 | 'type' => 'text', |
97 | 97 | ), |
98 | 98 | array( |
99 | 99 | 'id' => 'recaptcha_secret', |
100 | - 'name' => __( 'reCAPTCHA Secret Key', 'give' ), |
|
101 | - 'desc' => __( 'Please paste the reCAPTCHA secret key here from your reCAPTCHA API Keys panel.', 'give' ), |
|
100 | + 'name' => __('reCAPTCHA Secret Key', 'give'), |
|
101 | + 'desc' => __('Please paste the reCAPTCHA secret key here from your reCAPTCHA API Keys panel.', 'give'), |
|
102 | 102 | 'default' => '', |
103 | 103 | 'type' => 'text', |
104 | 104 | ), |
105 | 105 | array( |
106 | - 'name' => __( 'Access Control Docs Link', 'give' ), |
|
106 | + 'name' => __('Access Control Docs Link', 'give'), |
|
107 | 107 | 'id' => 'access_control_docs_link', |
108 | - 'url' => esc_url( 'http://docs.givewp.com/settings-access-control' ), |
|
109 | - 'title' => __( 'Access Control', 'give' ), |
|
108 | + 'url' => esc_url('http://docs.givewp.com/settings-access-control'), |
|
109 | + 'title' => __('Access Control', 'give'), |
|
110 | 110 | 'type' => 'give_docs_link', |
111 | 111 | ), |
112 | 112 | array( |
@@ -124,14 +124,14 @@ discard block |
||
124 | 124 | 'id' => 'give_title_general_settings_2', |
125 | 125 | ), |
126 | 126 | array( |
127 | - 'name' => __( 'Currency Settings', 'give' ), |
|
127 | + 'name' => __('Currency Settings', 'give'), |
|
128 | 128 | 'desc' => '', |
129 | 129 | 'type' => 'give_title', |
130 | 130 | 'id' => 'give_title_general_settings_2', |
131 | 131 | ), |
132 | 132 | array( |
133 | - 'name' => __( 'Currency', 'give' ), |
|
134 | - 'desc' => __( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ), |
|
133 | + 'name' => __('Currency', 'give'), |
|
134 | + 'desc' => __('The donation currency. Note that some payment gateways have currency restrictions.', 'give'), |
|
135 | 135 | 'id' => 'currency', |
136 | 136 | 'class' => 'give-select-chosen', |
137 | 137 | 'type' => 'select', |
@@ -139,47 +139,47 @@ discard block |
||
139 | 139 | 'default' => 'USD', |
140 | 140 | ), |
141 | 141 | array( |
142 | - 'name' => __( 'Currency Position', 'give' ), |
|
143 | - 'desc' => __( 'The position of the currency symbol.', 'give' ), |
|
142 | + 'name' => __('Currency Position', 'give'), |
|
143 | + 'desc' => __('The position of the currency symbol.', 'give'), |
|
144 | 144 | 'id' => 'currency_position', |
145 | 145 | 'type' => 'select', |
146 | 146 | 'options' => array( |
147 | 147 | /* translators: %s: currency symbol */ |
148 | - 'before' => sprintf( __( 'Before - %s‎10', 'give' ), give_currency_symbol( give_get_currency() ) ), |
|
148 | + 'before' => sprintf(__('Before - %s‎10', 'give'), give_currency_symbol(give_get_currency())), |
|
149 | 149 | /* translators: %s: currency symbol */ |
150 | - 'after' => sprintf( __( 'After - 10%s‏', 'give' ), give_currency_symbol( give_get_currency() ) ), |
|
150 | + 'after' => sprintf(__('After - 10%s‏', 'give'), give_currency_symbol(give_get_currency())), |
|
151 | 151 | ), |
152 | 152 | 'default' => 'before', |
153 | 153 | ), |
154 | 154 | array( |
155 | - 'name' => __( 'Thousands Separator', 'give' ), |
|
156 | - 'desc' => __( 'The symbol (typically , or .) to separate thousands.', 'give' ), |
|
155 | + 'name' => __('Thousands Separator', 'give'), |
|
156 | + 'desc' => __('The symbol (typically , or .) to separate thousands.', 'give'), |
|
157 | 157 | 'id' => 'thousands_separator', |
158 | 158 | 'type' => 'text', |
159 | 159 | 'default' => ',', |
160 | 160 | 'css' => 'width:12em;', |
161 | 161 | ), |
162 | 162 | array( |
163 | - 'name' => __( 'Decimal Separator', 'give' ), |
|
164 | - 'desc' => __( 'The symbol (usually , or .) to separate decimal points.', 'give' ), |
|
163 | + 'name' => __('Decimal Separator', 'give'), |
|
164 | + 'desc' => __('The symbol (usually , or .) to separate decimal points.', 'give'), |
|
165 | 165 | 'id' => 'decimal_separator', |
166 | 166 | 'type' => 'text', |
167 | 167 | 'default' => '.', |
168 | 168 | 'css' => 'width:12em;', |
169 | 169 | ), |
170 | 170 | array( |
171 | - 'name' => __( 'Number of Decimals', 'give' ), |
|
172 | - 'desc' => __( 'The number of decimal points displayed in amounts.', 'give' ), |
|
171 | + 'name' => __('Number of Decimals', 'give'), |
|
172 | + 'desc' => __('The number of decimal points displayed in amounts.', 'give'), |
|
173 | 173 | 'id' => 'number_decimals', |
174 | 174 | 'type' => 'text', |
175 | 175 | 'default' => 2, |
176 | 176 | 'css' => 'width:12em;', |
177 | 177 | ), |
178 | 178 | array( |
179 | - 'name' => __( 'Currency Options Docs Link', 'give' ), |
|
179 | + 'name' => __('Currency Options Docs Link', 'give'), |
|
180 | 180 | 'id' => 'currency_settings_docs_link', |
181 | - 'url' => esc_url( 'http://docs.givewp.com/settings-currency' ), |
|
182 | - 'title' => __( 'Currency Settings', 'give' ), |
|
181 | + 'url' => esc_url('http://docs.givewp.com/settings-currency'), |
|
182 | + 'title' => __('Currency Settings', 'give'), |
|
183 | 183 | 'type' => 'give_docs_link', |
184 | 184 | ), |
185 | 185 | array( |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $country = give_get_country(); |
195 | 195 | |
196 | 196 | // get the list of the states of which default country is selected. |
197 | - $states = give_get_states( $country ); |
|
197 | + $states = give_get_states($country); |
|
198 | 198 | |
199 | 199 | // Get the country list that does not have any states init. |
200 | 200 | $no_states_country = give_no_states_country_list(); |
@@ -206,46 +206,46 @@ discard block |
||
206 | 206 | 'id' => 'give_title_general_settings_1', |
207 | 207 | ), |
208 | 208 | array( |
209 | - 'name' => __( 'General Settings', 'give' ), |
|
209 | + 'name' => __('General Settings', 'give'), |
|
210 | 210 | 'desc' => '', |
211 | 211 | 'type' => 'give_title', |
212 | 212 | 'id' => 'give_title_general_settings_1', |
213 | 213 | ), |
214 | 214 | array( |
215 | - 'name' => __( 'Success Page', 'give' ), |
|
215 | + 'name' => __('Success Page', 'give'), |
|
216 | 216 | /* translators: %s: [give_receipt] */ |
217 | - 'desc' => sprintf( __( 'The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give' ), '<code>[give_receipt]</code>' ), |
|
217 | + 'desc' => sprintf(__('The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give'), '<code>[give_receipt]</code>'), |
|
218 | 218 | 'id' => 'success_page', |
219 | 219 | 'type' => 'select', |
220 | - 'options' => give_cmb2_get_post_options( array( |
|
220 | + 'options' => give_cmb2_get_post_options(array( |
|
221 | 221 | 'post_type' => 'page', |
222 | 222 | 'numberposts' => 999, |
223 | - ) ), |
|
223 | + )), |
|
224 | 224 | ), |
225 | 225 | array( |
226 | - 'name' => __( 'Failed Donation Page', 'give' ), |
|
227 | - 'desc' => __( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ), |
|
226 | + 'name' => __('Failed Donation Page', 'give'), |
|
227 | + 'desc' => __('The page donors are sent to if their donation is cancelled or fails.', 'give'), |
|
228 | 228 | 'id' => 'failure_page', |
229 | 229 | 'type' => 'select', |
230 | - 'options' => give_cmb2_get_post_options( array( |
|
230 | + 'options' => give_cmb2_get_post_options(array( |
|
231 | 231 | 'post_type' => 'page', |
232 | 232 | 'numberposts' => 999, |
233 | - ) ), |
|
233 | + )), |
|
234 | 234 | ), |
235 | 235 | array( |
236 | - 'name' => __( 'Donation History Page', 'give' ), |
|
236 | + 'name' => __('Donation History Page', 'give'), |
|
237 | 237 | /* translators: %s: [donation_history] */ |
238 | - 'desc' => sprintf( __( 'The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give' ), '<code>[donation_history]</code>' ), |
|
238 | + 'desc' => sprintf(__('The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give'), '<code>[donation_history]</code>'), |
|
239 | 239 | 'id' => 'history_page', |
240 | 240 | 'type' => 'select', |
241 | - 'options' => give_cmb2_get_post_options( array( |
|
241 | + 'options' => give_cmb2_get_post_options(array( |
|
242 | 242 | 'post_type' => 'page', |
243 | 243 | 'numberposts' => 999, |
244 | - ) ), |
|
244 | + )), |
|
245 | 245 | ), |
246 | 246 | array( |
247 | - 'name' => __( 'Base Country', 'give' ), |
|
248 | - 'desc' => __( 'The country your site operates from.', 'give' ), |
|
247 | + 'name' => __('Base Country', 'give'), |
|
248 | + 'desc' => __('The country your site operates from.', 'give'), |
|
249 | 249 | 'id' => 'base_country', |
250 | 250 | 'type' => 'select', |
251 | 251 | 'options' => give_get_country_list(), |
@@ -256,18 +256,18 @@ discard block |
||
256 | 256 | * @since 1.8.14 |
257 | 257 | */ |
258 | 258 | array( |
259 | - 'wrapper_class' => ( array_key_exists( $country, $no_states_country ) ? 'give-hidden' : '' ), |
|
260 | - 'name' => __( 'Base State/Province', 'give' ), |
|
261 | - 'desc' => __( 'The state/province your site operates from.', 'give' ), |
|
259 | + 'wrapper_class' => (array_key_exists($country, $no_states_country) ? 'give-hidden' : ''), |
|
260 | + 'name' => __('Base State/Province', 'give'), |
|
261 | + 'desc' => __('The state/province your site operates from.', 'give'), |
|
262 | 262 | 'id' => 'base_state', |
263 | - 'type' => ( empty( $states ) ? 'text' : 'select' ), |
|
263 | + 'type' => (empty($states) ? 'text' : 'select'), |
|
264 | 264 | 'options' => $states, |
265 | 265 | ), |
266 | 266 | array( |
267 | - 'name' => __( 'General Options Docs Link', 'give' ), |
|
267 | + 'name' => __('General Options Docs Link', 'give'), |
|
268 | 268 | 'id' => 'general_options_docs_link', |
269 | - 'url' => esc_url( 'http://docs.givewp.com/settings-general' ), |
|
270 | - 'title' => __( 'General Options', 'give' ), |
|
269 | + 'url' => esc_url('http://docs.givewp.com/settings-general'), |
|
270 | + 'title' => __('General Options', 'give'), |
|
271 | 271 | 'type' => 'give_docs_link', |
272 | 272 | ), |
273 | 273 | array( |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | * Filter the general settings. |
283 | 283 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
284 | 284 | */ |
285 | - $settings = apply_filters( 'give_settings_general', $settings ); |
|
285 | + $settings = apply_filters('give_settings_general', $settings); |
|
286 | 286 | |
287 | 287 | /** |
288 | 288 | * Filter the settings. |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | * |
292 | 292 | * @param array $settings |
293 | 293 | */ |
294 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
294 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
295 | 295 | |
296 | 296 | // Output. |
297 | 297 | return $settings; |
@@ -305,12 +305,12 @@ discard block |
||
305 | 305 | */ |
306 | 306 | public function get_sections() { |
307 | 307 | $sections = array( |
308 | - 'general-settings' => __( 'General', 'give' ), |
|
309 | - 'currency-settings' => __( 'Currency', 'give' ), |
|
310 | - 'access-control' => __( 'Access Control', 'give' ), |
|
308 | + 'general-settings' => __('General', 'give'), |
|
309 | + 'currency-settings' => __('Currency', 'give'), |
|
310 | + 'access-control' => __('Access Control', 'give'), |
|
311 | 311 | ); |
312 | 312 | |
313 | - return apply_filters( 'give_get_sections_' . $this->id, $sections ); |
|
313 | + return apply_filters('give_get_sections_'.$this->id, $sections); |
|
314 | 314 | } |
315 | 315 | } |
316 | 316 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly. |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -26,34 +26,34 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @return void |
28 | 28 | */ |
29 | -function give_set_settings_with_disable_prefix( $old_settings, $settings ) { |
|
29 | +function give_set_settings_with_disable_prefix($old_settings, $settings) { |
|
30 | 30 | // Bailout. |
31 | - if ( ! function_exists( 'give_v18_renamed_core_settings' ) ) { |
|
31 | + if ( ! function_exists('give_v18_renamed_core_settings')) { |
|
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
35 | 35 | // Get old setting names. |
36 | - $old_settings = array_flip( give_v18_renamed_core_settings() ); |
|
36 | + $old_settings = array_flip(give_v18_renamed_core_settings()); |
|
37 | 37 | $update_setting = false; |
38 | 38 | |
39 | - foreach ( $settings as $key => $value ) { |
|
39 | + foreach ($settings as $key => $value) { |
|
40 | 40 | |
41 | 41 | // Check 1. Check if new option is really updated or not. |
42 | 42 | // Check 2. Continue if key is not renamed. |
43 | - if ( ! isset( $old_settings[ $key ] ) ) { |
|
43 | + if ( ! isset($old_settings[$key])) { |
|
44 | 44 | continue; |
45 | 45 | } |
46 | 46 | |
47 | 47 | // Set old setting. |
48 | - $settings[ $old_settings[ $key ] ] = 'on'; |
|
48 | + $settings[$old_settings[$key]] = 'on'; |
|
49 | 49 | |
50 | 50 | // Do not need to set old setting if new setting is not set. |
51 | 51 | if ( |
52 | - ( give_is_setting_enabled( $value ) && ( false !== strpos( $old_settings[ $key ], 'disable_' ) ) ) |
|
53 | - || ( ! give_is_setting_enabled( $value ) && ( false !== strpos( $old_settings[ $key ], 'enable_' ) ) ) |
|
52 | + (give_is_setting_enabled($value) && (false !== strpos($old_settings[$key], 'disable_'))) |
|
53 | + || ( ! give_is_setting_enabled($value) && (false !== strpos($old_settings[$key], 'enable_'))) |
|
54 | 54 | |
55 | 55 | ) { |
56 | - unset( $settings[ $old_settings[ $key ] ] ); |
|
56 | + unset($settings[$old_settings[$key]]); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // Tell bot to update setting. |
@@ -61,12 +61,12 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | // Update setting if any old setting set. |
64 | - if ( $update_setting ) { |
|
65 | - update_option( 'give_settings', $settings ); |
|
64 | + if ($update_setting) { |
|
65 | + update_option('give_settings', $settings); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | -add_action( 'update_option_give_settings', 'give_set_settings_with_disable_prefix', 10, 2 ); |
|
69 | +add_action('update_option_give_settings', 'give_set_settings_with_disable_prefix', 10, 2); |
|
70 | 70 | |
71 | 71 | /** |
72 | 72 | * Check spam through Akismet. |
@@ -80,45 +80,45 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @return bool|mixed |
82 | 82 | */ |
83 | -function give_akismet( $spam ) { |
|
83 | +function give_akismet($spam) { |
|
84 | 84 | |
85 | 85 | // Bail out, If spam. |
86 | - if ( $spam ) { |
|
86 | + if ($spam) { |
|
87 | 87 | return $spam; |
88 | 88 | } |
89 | 89 | |
90 | 90 | // Bail out, if Akismet key not exist. |
91 | - if ( ! give_check_akismet_key() ) { |
|
91 | + if ( ! give_check_akismet_key()) { |
|
92 | 92 | return false; |
93 | 93 | } |
94 | 94 | |
95 | 95 | // Build args array. |
96 | 96 | $args = array(); |
97 | 97 | |
98 | - $args['comment_author'] = isset( $_POST['give_first'] ) ? strip_tags( trim( $_POST['give_first'] ) ) : ''; |
|
99 | - $args['comment_author_email'] = isset( $_POST['give_email'] ) ? $_POST['give_email'] : false; |
|
100 | - $args['blog'] = get_option( 'home' ); |
|
98 | + $args['comment_author'] = isset($_POST['give_first']) ? strip_tags(trim($_POST['give_first'])) : ''; |
|
99 | + $args['comment_author_email'] = isset($_POST['give_email']) ? $_POST['give_email'] : false; |
|
100 | + $args['blog'] = get_option('home'); |
|
101 | 101 | $args['blog_lang'] = get_locale(); |
102 | - $args['blog_charset'] = get_option( 'blog_charset' ); |
|
102 | + $args['blog_charset'] = get_option('blog_charset'); |
|
103 | 103 | $args['user_ip'] = $_SERVER['REMOTE_ADDR']; |
104 | 104 | $args['user_agent'] = $_SERVER['HTTP_USER_AGENT']; |
105 | 105 | $args['referrer'] = $_SERVER['HTTP_REFERER']; |
106 | 106 | $args['comment_type'] = 'contact-form'; |
107 | 107 | |
108 | - $ignore = array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' ); |
|
108 | + $ignore = array('HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW'); |
|
109 | 109 | |
110 | - foreach ( $_SERVER as $key => $value ) { |
|
111 | - if ( ! in_array( $key, (array) $ignore ) ) { |
|
110 | + foreach ($_SERVER as $key => $value) { |
|
111 | + if ( ! in_array($key, (array) $ignore)) { |
|
112 | 112 | $args["$key"] = $value; |
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
116 | 116 | // It will return Akismet spam detect API response. |
117 | - return give_akismet_spam_check( $args ); |
|
117 | + return give_akismet_spam_check($args); |
|
118 | 118 | |
119 | 119 | } |
120 | 120 | |
121 | -add_filter( 'give_spam', 'give_akismet' ); |
|
121 | +add_filter('give_spam', 'give_akismet'); |
|
122 | 122 | |
123 | 123 | /** |
124 | 124 | * Check Akismet API Key. |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | * @return bool |
129 | 129 | */ |
130 | 130 | function give_check_akismet_key() { |
131 | - if ( is_callable( array( 'Akismet', 'get_api_key' ) ) ) { // Akismet v3.0+ |
|
131 | + if (is_callable(array('Akismet', 'get_api_key'))) { // Akismet v3.0+ |
|
132 | 132 | return (bool) Akismet::get_api_key(); |
133 | 133 | } |
134 | 134 | |
135 | - if ( function_exists( 'akismet_get_key' ) ) { |
|
135 | + if (function_exists('akismet_get_key')) { |
|
136 | 136 | return (bool) akismet_get_key(); |
137 | 137 | } |
138 | 138 | |
@@ -148,26 +148,26 @@ discard block |
||
148 | 148 | * |
149 | 149 | * @return bool|mixed |
150 | 150 | */ |
151 | -function give_akismet_spam_check( $args ) { |
|
151 | +function give_akismet_spam_check($args) { |
|
152 | 152 | global $akismet_api_host, $akismet_api_port; |
153 | 153 | |
154 | 154 | $spam = false; |
155 | - $query_string = http_build_query( $args ); |
|
155 | + $query_string = http_build_query($args); |
|
156 | 156 | |
157 | - if ( is_callable( array( 'Akismet', 'http_post' ) ) ) { // Akismet v3.0+ |
|
158 | - $response = Akismet::http_post( $query_string, 'comment-check' ); |
|
157 | + if (is_callable(array('Akismet', 'http_post'))) { // Akismet v3.0+ |
|
158 | + $response = Akismet::http_post($query_string, 'comment-check'); |
|
159 | 159 | } else { |
160 | - $response = akismet_http_post( $query_string, $akismet_api_host, |
|
161 | - '/1.1/comment-check', $akismet_api_port ); |
|
160 | + $response = akismet_http_post($query_string, $akismet_api_host, |
|
161 | + '/1.1/comment-check', $akismet_api_port); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | // It's spam if response status is true. |
165 | - if ( 'true' === $response[1] ) { |
|
165 | + if ('true' === $response[1]) { |
|
166 | 166 | $spam = true; |
167 | 167 | } |
168 | 168 | |
169 | 169 | // Allow developer to modified Akismet spam detection response. |
170 | - return apply_filters( 'give_akismet_spam_check', $spam, $args ); |
|
170 | + return apply_filters('give_akismet_spam_check', $spam, $args); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -180,15 +180,15 @@ discard block |
||
180 | 180 | * |
181 | 181 | * @return array |
182 | 182 | */ |
183 | -function give_bc_v1817_iranian_currency_code( $currencies ) { |
|
184 | - if ( ! give_has_upgrade_completed( 'v1817_update_donation_iranian_currency_code' ) ) { |
|
183 | +function give_bc_v1817_iranian_currency_code($currencies) { |
|
184 | + if ( ! give_has_upgrade_completed('v1817_update_donation_iranian_currency_code')) { |
|
185 | 185 | $currencies['RIAL'] = $currencies['IRR']; |
186 | 186 | } |
187 | 187 | |
188 | 188 | return $currencies; |
189 | 189 | } |
190 | 190 | |
191 | -add_filter( 'give_currencies', 'give_bc_v1817_iranian_currency_code', 0 ); |
|
191 | +add_filter('give_currencies', 'give_bc_v1817_iranian_currency_code', 0); |
|
192 | 192 | |
193 | 193 | |
194 | 194 | /** |
@@ -202,22 +202,20 @@ discard block |
||
202 | 202 | * |
203 | 203 | * @return string |
204 | 204 | */ |
205 | -function give_format_price_for_right_to_left_supported_currency( $formatted_amount, $currency_args, $price ) { |
|
206 | - if ( ! give_is_right_to_left_supported_currency( $currency_args['currency_code'] ) ) { |
|
205 | +function give_format_price_for_right_to_left_supported_currency($formatted_amount, $currency_args, $price) { |
|
206 | + if ( ! give_is_right_to_left_supported_currency($currency_args['currency_code'])) { |
|
207 | 207 | return $formatted_amount; |
208 | 208 | } |
209 | 209 | |
210 | 210 | $formatted_amount = ( |
211 | 211 | 'before' === (string) $currency_args['position'] ? |
212 | - '‫' . $price . $currency_args['symbol'] . '‬' : |
|
213 | - '‪' . $price . $currency_args['symbol'] . '‬' |
|
212 | + '‫'.$price.$currency_args['symbol'].'‬' : '‪'.$price.$currency_args['symbol'].'‬' |
|
214 | 213 | ); |
215 | 214 | |
216 | 215 | $formatted_amount = $currency_args['decode_currency'] ? |
217 | - html_entity_decode( $formatted_amount, ENT_COMPAT, 'UTF-8' ) : |
|
218 | - $formatted_amount; |
|
216 | + html_entity_decode($formatted_amount, ENT_COMPAT, 'UTF-8') : $formatted_amount; |
|
219 | 217 | |
220 | 218 | return $formatted_amount; |
221 | 219 | } |
222 | 220 | |
223 | -add_filter( 'give_currency_filter', 'give_format_price_for_right_to_left_supported_currency', 10, 3 ); |
|
224 | 221 | \ No newline at end of file |
222 | +add_filter('give_currency_filter', 'give_format_price_for_right_to_left_supported_currency', 10, 3); |
|
225 | 223 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly. |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @param $args array The array of arguments that can be passed in and used for setting up this payment query. |
87 | 87 | */ |
88 | - public function __construct( $args = array() ) { |
|
88 | + public function __construct($args = array()) { |
|
89 | 89 | $defaults = array( |
90 | 90 | 'number' => 20, |
91 | 91 | 'offset' => 0, |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | // 'form' => array(), |
104 | 104 | ); |
105 | 105 | |
106 | - $this->args = wp_parse_args( $args, $defaults ); |
|
106 | + $this->args = wp_parse_args($args, $defaults); |
|
107 | 107 | |
108 | 108 | $this->table_name = Give()->donors->table_name; |
109 | 109 | $this->meta_table_name = Give()->donor_meta->table_name; |
@@ -146,12 +146,12 @@ discard block |
||
146 | 146 | * |
147 | 147 | * @param Give_Donors_Query $this Donors query object. |
148 | 148 | */ |
149 | - do_action( 'give_pre_get_donors', $this ); |
|
149 | + do_action('give_pre_get_donors', $this); |
|
150 | 150 | |
151 | - if ( empty( $this->args['count'] ) ) { |
|
152 | - $this->donors = $wpdb->get_results( $this->get_sql() ); |
|
151 | + if (empty($this->args['count'])) { |
|
152 | + $this->donors = $wpdb->get_results($this->get_sql()); |
|
153 | 153 | } else { |
154 | - $this->donors = $wpdb->get_var( $this->get_sql() ); |
|
154 | + $this->donors = $wpdb->get_var($this->get_sql()); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | * |
162 | 162 | * @param Give_Donors_Query $this Donors query object. |
163 | 163 | */ |
164 | - do_action( 'give_post_get_donors', $this ); |
|
164 | + do_action('give_post_get_donors', $this); |
|
165 | 165 | |
166 | 166 | return $this->donors; |
167 | 167 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | public function get_sql() { |
179 | 179 | global $wpdb; |
180 | 180 | |
181 | - if ( $this->args['number'] < 1 ) { |
|
181 | + if ($this->args['number'] < 1) { |
|
182 | 182 | $this->args['number'] = 999999999999; |
183 | 183 | } |
184 | 184 | |
@@ -186,22 +186,22 @@ discard block |
||
186 | 186 | |
187 | 187 | |
188 | 188 | // Set offset. |
189 | - if ( empty( $this->args['offset'] ) && ( 0 < $this->args['paged'] ) ) { |
|
190 | - $this->args['offset'] = $this->args['number'] * ( $this->args['paged'] - 1 ); |
|
189 | + if (empty($this->args['offset']) && (0 < $this->args['paged'])) { |
|
190 | + $this->args['offset'] = $this->args['number'] * ($this->args['paged'] - 1); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | // Set fields. |
194 | 194 | $fields = "{$this->table_name}.*"; |
195 | - if ( ! empty( $this->args['fields'] ) && 'all' !== $this->args['fields'] ) { |
|
196 | - if ( is_string( $this->args['fields'] ) ) { |
|
195 | + if ( ! empty($this->args['fields']) && 'all' !== $this->args['fields']) { |
|
196 | + if (is_string($this->args['fields'])) { |
|
197 | 197 | $fields = "{$this->table_name}.{$this->args['fields']}"; |
198 | - } else if ( is_array( $this->args['fields'] ) ) { |
|
199 | - $fields = "{$this->table_name}." . implode( " , {$this->table_name}.", $this->args['fields'] ); |
|
198 | + } else if (is_array($this->args['fields'])) { |
|
199 | + $fields = "{$this->table_name}.".implode(" , {$this->table_name}.", $this->args['fields']); |
|
200 | 200 | } |
201 | 201 | } |
202 | 202 | |
203 | 203 | // Set count. |
204 | - if ( ! empty( $this->args['count'] ) ) { |
|
204 | + if ( ! empty($this->args['count'])) { |
|
205 | 205 | $fields = "COUNT({$this->table_name}.id)"; |
206 | 206 | } |
207 | 207 | |
@@ -209,13 +209,13 @@ discard block |
||
209 | 209 | |
210 | 210 | $sql = $wpdb->prepare( |
211 | 211 | "SELECT {$fields} FROM {$this->table_name} LIMIT %d,%d;", |
212 | - absint( $this->args['offset'] ), |
|
213 | - absint( $this->args['number'] ) |
|
212 | + absint($this->args['offset']), |
|
213 | + absint($this->args['number']) |
|
214 | 214 | ); |
215 | 215 | |
216 | 216 | // $where, $orderby and order already prepared query they can generate notice if you re prepare them in above. |
217 | 217 | // WordPress consider LIKE condition as placeholder if start with s,f, or d. |
218 | - $sql = str_replace( 'LIMIT', "{$where} {$orderby} {$this->args['order']} LIMIT", $sql ); |
|
218 | + $sql = str_replace('LIMIT', "{$where} {$orderby} {$this->args['order']} LIMIT", $sql); |
|
219 | 219 | |
220 | 220 | return $sql; |
221 | 221 | } |
@@ -233,15 +233,15 @@ discard block |
||
233 | 233 | $where = ''; |
234 | 234 | |
235 | 235 | // Get sql query for meta. |
236 | - if ( ! empty( $this->args['meta_query'] ) ) { |
|
237 | - $meta_query_object = new WP_Meta_Query( $this->args['meta_query'] ); |
|
236 | + if ( ! empty($this->args['meta_query'])) { |
|
237 | + $meta_query_object = new WP_Meta_Query($this->args['meta_query']); |
|
238 | 238 | $meta_query = $meta_query_object->get_sql( |
239 | 239 | $this->meta_type, |
240 | 240 | $this->table_name, |
241 | 241 | 'id' |
242 | 242 | ); |
243 | 243 | |
244 | - $where = implode( '', $meta_query ); |
|
244 | + $where = implode('', $meta_query); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | $where .= 'WHERE 1=1 '; |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $where .= $this->get_where_user(); |
252 | 252 | $where .= $this->get_where_date(); |
253 | 253 | |
254 | - return trim( $where ); |
|
254 | + return trim($where); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | /** |
@@ -268,17 +268,17 @@ discard block |
||
268 | 268 | |
269 | 269 | $where = ''; |
270 | 270 | |
271 | - if ( ! empty( $this->args['email'] ) ) { |
|
271 | + if ( ! empty($this->args['email'])) { |
|
272 | 272 | |
273 | - if ( is_array( $this->args['email'] ) ) { |
|
273 | + if (is_array($this->args['email'])) { |
|
274 | 274 | |
275 | - $emails_count = count( $this->args['email'] ); |
|
276 | - $emails_placeholder = array_fill( 0, $emails_count, '%s' ); |
|
277 | - $emails = implode( ', ', $emails_placeholder ); |
|
275 | + $emails_count = count($this->args['email']); |
|
276 | + $emails_placeholder = array_fill(0, $emails_count, '%s'); |
|
277 | + $emails = implode(', ', $emails_placeholder); |
|
278 | 278 | |
279 | - $where .= $wpdb->prepare( "AND {$this->table_name}.email IN( $emails )", $this->args['email'] ); |
|
279 | + $where .= $wpdb->prepare("AND {$this->table_name}.email IN( $emails )", $this->args['email']); |
|
280 | 280 | } else { |
281 | - $where .= $wpdb->prepare( "AND {$this->table_name}.email = %s", $this->args['email'] ); |
|
281 | + $where .= $wpdb->prepare("AND {$this->table_name}.email = %s", $this->args['email']); |
|
282 | 282 | } |
283 | 283 | } |
284 | 284 | |
@@ -298,11 +298,11 @@ discard block |
||
298 | 298 | $where = ''; |
299 | 299 | |
300 | 300 | // Specific donors. |
301 | - if ( ! empty( $this->args['donor'] ) ) { |
|
302 | - if ( ! is_array( $this->args['donor'] ) ) { |
|
303 | - $this->args['donor'] = explode( ',', $this->args['donor'] ); |
|
301 | + if ( ! empty($this->args['donor'])) { |
|
302 | + if ( ! is_array($this->args['donor'])) { |
|
303 | + $this->args['donor'] = explode(',', $this->args['donor']); |
|
304 | 304 | } |
305 | - $donor_ids = implode( ',', array_map( 'intval', $this->args['donor'] ) ); |
|
305 | + $donor_ids = implode(',', array_map('intval', $this->args['donor'])); |
|
306 | 306 | |
307 | 307 | $where .= "AND {$this->table_name}.id IN( {$donor_ids} )"; |
308 | 308 | } |
@@ -323,9 +323,9 @@ discard block |
||
323 | 323 | $where = ''; |
324 | 324 | |
325 | 325 | // Donors created for a specific date or in a date range |
326 | - if ( ! empty( $this->args['date_query'] ) ) { |
|
326 | + if ( ! empty($this->args['date_query'])) { |
|
327 | 327 | $date_query_object = new WP_Date_Query( |
328 | - is_array( $this->args['date_query'] ) ? $this->args['date_query'] : wp_parse_args( $this->args['date_query'] ), |
|
328 | + is_array($this->args['date_query']) ? $this->args['date_query'] : wp_parse_args($this->args['date_query']), |
|
329 | 329 | "{$this->table_name}.date_created" |
330 | 330 | ); |
331 | 331 | |
@@ -360,11 +360,11 @@ discard block |
||
360 | 360 | $where = ''; |
361 | 361 | |
362 | 362 | // Donors created for a specific date or in a date range |
363 | - if ( ! empty( $this->args['s'] ) && false !== strpos( $this->args['s'], ':' ) ) { |
|
364 | - $search_parts = explode( ':', $this->args['s'] ); |
|
363 | + if ( ! empty($this->args['s']) && false !== strpos($this->args['s'], ':')) { |
|
364 | + $search_parts = explode(':', $this->args['s']); |
|
365 | 365 | |
366 | - if ( ! empty( $search_parts[0] ) ) { |
|
367 | - switch ( $search_parts[0] ) { |
|
366 | + if ( ! empty($search_parts[0])) { |
|
367 | + switch ($search_parts[0]) { |
|
368 | 368 | case 'name': |
369 | 369 | $where = "AND {$this->table_name}.name LIKE '%{$search_parts[1]}%'"; |
370 | 370 | break; |
@@ -392,11 +392,11 @@ discard block |
||
392 | 392 | $where = ''; |
393 | 393 | |
394 | 394 | // Donors create for specific wp user. |
395 | - if ( ! empty( $this->args['user'] ) ) { |
|
396 | - if ( ! is_array( $this->args['user'] ) ) { |
|
397 | - $this->args['user'] = explode( ',', $this->args['user'] ); |
|
395 | + if ( ! empty($this->args['user'])) { |
|
396 | + if ( ! is_array($this->args['user'])) { |
|
397 | + $this->args['user'] = explode(',', $this->args['user']); |
|
398 | 398 | } |
399 | - $user_ids = implode( ',', array_map( 'intval', $this->args['user'] ) ); |
|
399 | + $user_ids = implode(',', array_map('intval', $this->args['user'])); |
|
400 | 400 | |
401 | 401 | $where .= "AND {$this->table_name}.user_id IN( {$user_ids} )"; |
402 | 402 | } |
@@ -415,14 +415,13 @@ discard block |
||
415 | 415 | private function get_order_query() { |
416 | 416 | $table_columns = Give()->donors->get_columns(); |
417 | 417 | |
418 | - $this->args['orderby'] = ! array_key_exists( $this->args['orderby'], $table_columns ) ? |
|
419 | - 'id' : |
|
420 | - $this->args['orderby']; |
|
418 | + $this->args['orderby'] = ! array_key_exists($this->args['orderby'], $table_columns) ? |
|
419 | + 'id' : $this->args['orderby']; |
|
421 | 420 | |
422 | - $this->args['orderby'] = esc_sql( $this->args['orderby'] ); |
|
423 | - $this->args['order'] = esc_sql( $this->args['order'] ); |
|
421 | + $this->args['orderby'] = esc_sql($this->args['orderby']); |
|
422 | + $this->args['order'] = esc_sql($this->args['order']); |
|
424 | 423 | |
425 | - switch ( $table_columns[ $this->args['orderby'] ] ) { |
|
424 | + switch ($table_columns[$this->args['orderby']]) { |
|
426 | 425 | case '%d': |
427 | 426 | case '%f': |
428 | 427 | $query = "ORDER BY {$this->table_name}.{$this->args['orderby']}+0"; |
@@ -5,18 +5,18 @@ discard block |
||
5 | 5 | |
6 | 6 | global $give_logout_redirect; |
7 | 7 | |
8 | -if ( ! is_user_logged_in() ) { |
|
8 | +if ( ! is_user_logged_in()) { |
|
9 | 9 | |
10 | 10 | $give_login_redirect = give_get_history_page_uri(); |
11 | - if ( ! empty( $_GET['payment_key'] ) ) { |
|
12 | - $give_login_redirect = add_query_arg( 'payment_key', give_clean( $_GET['payment_key'] ) , give_get_history_page_uri() ); |
|
11 | + if ( ! empty($_GET['payment_key'])) { |
|
12 | + $give_login_redirect = add_query_arg('payment_key', give_clean($_GET['payment_key']), give_get_history_page_uri()); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | // Show any error messages after form submission |
16 | - Give()->notices->render_frontend_notices( 0 ); ?> |
|
16 | + Give()->notices->render_frontend_notices(0); ?> |
|
17 | 17 | <form id="give-login-form" class="give-form" action="" method="post"> |
18 | 18 | <fieldset> |
19 | - <legend><?php _e( 'Log into Your Account', 'give' ); ?></legend> |
|
19 | + <legend><?php _e('Log into Your Account', 'give'); ?></legend> |
|
20 | 20 | <?php |
21 | 21 | /** |
22 | 22 | * Fires in the login shortcode, before the login fields. |
@@ -25,27 +25,27 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @since 1.0 |
27 | 27 | */ |
28 | - do_action( 'give_login_fields_before' ); |
|
28 | + do_action('give_login_fields_before'); |
|
29 | 29 | ?> |
30 | 30 | <div class="give-login-username give-login"> |
31 | - <label for="give_user_login"><?php _e( 'Username', 'give' ); ?></label> |
|
31 | + <label for="give_user_login"><?php _e('Username', 'give'); ?></label> |
|
32 | 32 | <input name="give_user_login" id="give_user_login" class="give-required give-input" type="text" required aria-required="true" /> |
33 | 33 | </div> |
34 | 34 | |
35 | 35 | <div class="give-login-password give-login"> |
36 | - <label for="give_user_pass"><?php _e( 'Password', 'give' ); ?></label> |
|
36 | + <label for="give_user_pass"><?php _e('Password', 'give'); ?></label> |
|
37 | 37 | <input name="give_user_pass" id="give_user_pass" class="give-password give-required give-input" type="password" required aria-required="true" /> |
38 | 38 | </div> |
39 | 39 | |
40 | 40 | <div class="give-login-submit give-login"> |
41 | - <input type="hidden" name="give_login_redirect" value="<?php echo esc_url( $give_login_redirect ); ?>" /> |
|
42 | - <input type="hidden" name="give_login_nonce" value="<?php echo wp_create_nonce( 'give-login-nonce' ); ?>" /> |
|
41 | + <input type="hidden" name="give_login_redirect" value="<?php echo esc_url($give_login_redirect); ?>" /> |
|
42 | + <input type="hidden" name="give_login_nonce" value="<?php echo wp_create_nonce('give-login-nonce'); ?>" /> |
|
43 | 43 | <input type="hidden" name="give_action" value="user_login" /> |
44 | - <input id="give_login_submit" type="submit" class="give_submit" value="<?php _e( 'Log In', 'give' ); ?>" /> |
|
44 | + <input id="give_login_submit" type="submit" class="give_submit" value="<?php _e('Log In', 'give'); ?>" /> |
|
45 | 45 | </div> |
46 | 46 | |
47 | 47 | <div class="give-lost-password give-login"> |
48 | - <a href="<?php echo wp_lostpassword_url(); ?>"><?php _e( 'Reset Password', 'give' ); ?></a> |
|
48 | + <a href="<?php echo wp_lostpassword_url(); ?>"><?php _e('Reset Password', 'give'); ?></a> |
|
49 | 49 | </div> |
50 | 50 | <?php |
51 | 51 | /** |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @since 1.0 |
57 | 57 | */ |
58 | - do_action( 'give_login_fields_after' ); |
|
58 | + do_action('give_login_fields_after'); |
|
59 | 59 | ?> |
60 | 60 | </fieldset> |
61 | 61 | </form> |
62 | -<?php } elseif( isset( $_GET['give-login-success'] ) && true === (bool) $_GET['give-login-success'] ) { ?> |
|
63 | - <?php Give()->notices->print_frontend_notice( apply_filters('give_successful_login_message', __( 'Login successful. Welcome!', 'give' )), true, 'success' ); ?> |
|
62 | +<?php } elseif (isset($_GET['give-login-success']) && true === (bool) $_GET['give-login-success']) { ?> |
|
63 | + <?php Give()->notices->print_frontend_notice(apply_filters('give_successful_login_message', __('Login successful. Welcome!', 'give')), true, 'success'); ?> |
|
64 | 64 | <?php } else { ?> |
65 | - <?php Give()->notices->print_frontend_notice( apply_filters('give_already_logged_in_message', sprintf( __( 'You are already logged in to the site. <a href="%s">Click here</a> to logout.', 'give' ), esc_url( $give_logout_redirect ) ) ), true, 'warning' ); ?> |
|
65 | + <?php Give()->notices->print_frontend_notice(apply_filters('give_already_logged_in_message', sprintf(__('You are already logged in to the site. <a href="%s">Click here</a> to logout.', 'give'), esc_url($give_logout_redirect))), true, 'warning'); ?> |
|
66 | 66 | <?php } ?> |
67 | 67 | \ No newline at end of file |
@@ -3,24 +3,24 @@ discard block |
||
3 | 3 | * This template is used to display the goal with [give_goal] |
4 | 4 | */ |
5 | 5 | |
6 | -$form = new Give_Donate_Form( $form_id ); |
|
7 | -$goal_option = give_get_meta( $form->ID, '_give_goal_option', true ); |
|
6 | +$form = new Give_Donate_Form($form_id); |
|
7 | +$goal_option = give_get_meta($form->ID, '_give_goal_option', true); |
|
8 | 8 | |
9 | 9 | //Sanity check - ensure form has pass all condition to show goal. |
10 | 10 | if ( |
11 | - ( isset( $args['show_goal'] ) && ! filter_var( $args['show_goal'], FILTER_VALIDATE_BOOLEAN ) ) |
|
12 | - || empty( $form->ID ) |
|
13 | - || ( is_singular( 'give_forms' ) && ! give_is_setting_enabled( $goal_option ) ) |
|
14 | - || ! give_is_setting_enabled( $goal_option ) |
|
11 | + (isset($args['show_goal']) && ! filter_var($args['show_goal'], FILTER_VALIDATE_BOOLEAN)) |
|
12 | + || empty($form->ID) |
|
13 | + || (is_singular('give_forms') && ! give_is_setting_enabled($goal_option)) |
|
14 | + || ! give_is_setting_enabled($goal_option) |
|
15 | 15 | || 0 === $form->goal |
16 | 16 | ) { |
17 | 17 | return false; |
18 | 18 | } |
19 | 19 | |
20 | -$goal_format = give_get_meta( $form_id, '_give_goal_format', true ); |
|
21 | -$color = give_get_meta( $form_id, '_give_goal_color', true ); |
|
22 | -$show_text = isset( $args['show_text'] ) ? filter_var( $args['show_text'], FILTER_VALIDATE_BOOLEAN ) : true; |
|
23 | -$show_bar = isset( $args['show_bar'] ) ? filter_var( $args['show_bar'], FILTER_VALIDATE_BOOLEAN ) : true; |
|
20 | +$goal_format = give_get_meta($form_id, '_give_goal_format', true); |
|
21 | +$color = give_get_meta($form_id, '_give_goal_color', true); |
|
22 | +$show_text = isset($args['show_text']) ? filter_var($args['show_text'], FILTER_VALIDATE_BOOLEAN) : true; |
|
23 | +$show_bar = isset($args['show_bar']) ? filter_var($args['show_bar'], FILTER_VALIDATE_BOOLEAN) : true; |
|
24 | 24 | |
25 | 25 | |
26 | 26 | /** |
@@ -28,14 +28,14 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @since 1.8.8 |
30 | 30 | */ |
31 | -$income = apply_filters( 'give_goal_amount_raised_output', $form->get_earnings(), $form_id, $form ); |
|
31 | +$income = apply_filters('give_goal_amount_raised_output', $form->get_earnings(), $form_id, $form); |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Filter the form |
35 | 35 | * |
36 | 36 | * @since 1.8.8 |
37 | 37 | */ |
38 | -$goal = apply_filters( 'give_goal_amount_target_output', $form->goal, $form_id, $form ); |
|
38 | +$goal = apply_filters('give_goal_amount_target_output', $form->goal, $form_id, $form); |
|
39 | 39 | |
40 | 40 | |
41 | 41 | /** |
@@ -43,59 +43,59 @@ discard block |
||
43 | 43 | * |
44 | 44 | * @since 1.8.8 |
45 | 45 | */ |
46 | -$progress = apply_filters( 'give_goal_amount_funded_percentage_output', round( ( $income / $goal ) * 100, 2 ), $form_id, $form ); |
|
46 | +$progress = apply_filters('give_goal_amount_funded_percentage_output', round(($income / $goal) * 100, 2), $form_id, $form); |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * Filter the give currency. |
50 | 50 | * |
51 | 51 | * @since 1.8.17 |
52 | 52 | */ |
53 | -$form_currency = apply_filters( 'give_goal_form_currency', give_get_currency( $form_id ), $form_id ); |
|
53 | +$form_currency = apply_filters('give_goal_form_currency', give_get_currency($form_id), $form_id); |
|
54 | 54 | |
55 | 55 | // Set progress to 100 percentage if income > goal. |
56 | -if ( $income >= $goal ) { |
|
56 | +if ($income >= $goal) { |
|
57 | 57 | $progress = 100; |
58 | 58 | } |
59 | 59 | |
60 | 60 | ?> |
61 | 61 | <div class="give-goal-progress"> |
62 | - <?php if ( ! empty( $show_text ) ) : ?> |
|
62 | + <?php if ( ! empty($show_text)) : ?> |
|
63 | 63 | <div class="raised"> |
64 | 64 | <?php |
65 | - if ( $goal_format !== 'percentage' ) : |
|
65 | + if ($goal_format !== 'percentage') : |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * Filter the income formatting arguments. |
69 | 69 | * |
70 | 70 | * @since 1.8.17 |
71 | 71 | */ |
72 | - $income_format_args = apply_filters( 'give_goal_income_format_args', array( 'sanitize' => false, 'currency' => $form_currency, 'decimal' => false ), $form_id ); |
|
72 | + $income_format_args = apply_filters('give_goal_income_format_args', array('sanitize' => false, 'currency' => $form_currency, 'decimal' => false), $form_id); |
|
73 | 73 | |
74 | 74 | /** |
75 | 75 | * Filter the goal formatting arguments. |
76 | 76 | * |
77 | 77 | * @since 1.8.17 |
78 | 78 | */ |
79 | - $goal_format_args = apply_filters( 'give_goal_amount_format_args', array( 'sanitize' => false, 'currency' => $form_currency, 'decimal' => false ), $form_id ); |
|
79 | + $goal_format_args = apply_filters('give_goal_amount_format_args', array('sanitize' => false, 'currency' => $form_currency, 'decimal' => false), $form_id); |
|
80 | 80 | |
81 | 81 | // Get formatted amount. |
82 | - $income = give_human_format_large_amount( give_format_amount( $income, $income_format_args ), array( 'currency' => $form_currency ) ); |
|
83 | - $goal = give_human_format_large_amount( give_format_amount( $goal, $goal_format_args ), array( 'currency' => $form_currency ) ); |
|
82 | + $income = give_human_format_large_amount(give_format_amount($income, $income_format_args), array('currency' => $form_currency)); |
|
83 | + $goal = give_human_format_large_amount(give_format_amount($goal, $goal_format_args), array('currency' => $form_currency)); |
|
84 | 84 | |
85 | 85 | echo sprintf( |
86 | 86 | /* translators: 1: amount of income raised 2: goal target amount. */ |
87 | - __( '%1$s of %2$s raised', 'give' ), |
|
88 | - '<span class="income">' . give_currency_filter( $income, array( 'form_id' => $form_id ) ) . '</span>', |
|
89 | - '<span class="goal-text">' . give_currency_filter( $goal, array( 'form_id' => $form_id ) ) . '</span>' |
|
87 | + __('%1$s of %2$s raised', 'give'), |
|
88 | + '<span class="income">'.give_currency_filter($income, array('form_id' => $form_id)).'</span>', |
|
89 | + '<span class="goal-text">'.give_currency_filter($goal, array('form_id' => $form_id)).'</span>' |
|
90 | 90 | ); |
91 | 91 | |
92 | 92 | |
93 | - elseif ( $goal_format == 'percentage' ) : |
|
93 | + elseif ($goal_format == 'percentage') : |
|
94 | 94 | |
95 | 95 | echo sprintf( |
96 | 96 | /* translators: %s: percentage of the amount raised compared to the goal target */ |
97 | - __( '%s%% funded', 'give' ), |
|
98 | - '<span class="give-percentage">' . round( $progress ) . '</span>' |
|
97 | + __('%s%% funded', 'give'), |
|
98 | + '<span class="give-percentage">'.round($progress).'</span>' |
|
99 | 99 | ); |
100 | 100 | |
101 | 101 | endif; |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | <?php endif; ?> |
105 | 105 | |
106 | 106 | |
107 | - <?php if ( ! empty( $show_bar ) ) : ?> |
|
108 | - <div class="give-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="<?php echo esc_attr( $progress ); ?>"> |
|
109 | - <span style="width: <?php echo esc_attr( $progress ); ?>%;<?php if ( ! empty( $color ) ) { |
|
110 | - echo 'background-color:' . $color; |
|
107 | + <?php if ( ! empty($show_bar)) : ?> |
|
108 | + <div class="give-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="<?php echo esc_attr($progress); ?>"> |
|
109 | + <span style="width: <?php echo esc_attr($progress); ?>%;<?php if ( ! empty($color)) { |
|
110 | + echo 'background-color:'.$color; |
|
111 | 111 | } ?>"></span> |
112 | 112 | </div><!-- /.give-progress-bar --> |
113 | 113 | <?php endif; ?> |
@@ -4,56 +4,56 @@ discard block |
||
4 | 4 | */ |
5 | 5 | |
6 | 6 | $donations = array(); |
7 | -$donation_history_args = Give()->session->get( 'give_donation_history_args' ); |
|
7 | +$donation_history_args = Give()->session->get('give_donation_history_args'); |
|
8 | 8 | |
9 | 9 | // User's Donations. |
10 | -if ( is_user_logged_in() ) { |
|
11 | - $donations = give_get_users_donations( get_current_user_id(), 20, true, 'any' ); |
|
12 | -} elseif ( Give()->email_access->token_exists ) { |
|
10 | +if (is_user_logged_in()) { |
|
11 | + $donations = give_get_users_donations(get_current_user_id(), 20, true, 'any'); |
|
12 | +} elseif (Give()->email_access->token_exists) { |
|
13 | 13 | // Email Access Token? |
14 | - $donations = give_get_users_donations( 0, 20, true, 'any' ); |
|
14 | + $donations = give_get_users_donations(0, 20, true, 'any'); |
|
15 | 15 | } elseif ( |
16 | 16 | false !== Give()->session->get_session_expiration() || |
17 | 17 | true === give_get_history_session() |
18 | 18 | ) { |
19 | 19 | // Session active? |
20 | - $email = Give()->session->get( 'give_email' ); |
|
21 | - $donor = Give()->donors->get_donor_by( 'email', $email ); |
|
22 | - $donations_count = count( explode( ',', $donor->payment_ids ) ); |
|
20 | + $email = Give()->session->get('give_email'); |
|
21 | + $donor = Give()->donors->get_donor_by('email', $email); |
|
22 | + $donations_count = count(explode(',', $donor->payment_ids)); |
|
23 | 23 | |
24 | - if( $donations_count > give_get_limit_display_donations() ) { |
|
24 | + if ($donations_count > give_get_limit_display_donations()) { |
|
25 | 25 | |
26 | 26 | // Restrict Security Email Access option, if donation count of a donor is less than or equal to limit. |
27 | - if( true !== Give_Cache::get( "give_cache_email_throttle_limit_exhausted_{$donor->id}" ) ) { |
|
28 | - add_action( 'give_donation_history_table_end', 'give_donation_history_table_end' ); |
|
27 | + if (true !== Give_Cache::get("give_cache_email_throttle_limit_exhausted_{$donor->id}")) { |
|
28 | + add_action('give_donation_history_table_end', 'give_donation_history_table_end'); |
|
29 | 29 | } else { |
30 | 30 | $value = Give()->email_access->verify_throttle / 60; |
31 | 31 | |
32 | - give_set_error( 'give-limited-throttle', sprintf( |
|
33 | - __( 'Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give' ), |
|
34 | - sprintf( _n( '%s minute', '%s minutes', Give()->email_access->verify_throttle / 60, 'give' ), Give()->email_access->verify_throttle / 60 ) |
|
35 | - ) ); |
|
32 | + give_set_error('give-limited-throttle', sprintf( |
|
33 | + __('Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give'), |
|
34 | + sprintf(_n('%s minute', '%s minutes', Give()->email_access->verify_throttle / 60, 'give'), Give()->email_access->verify_throttle / 60) |
|
35 | + )); |
|
36 | 36 | |
37 | 37 | } |
38 | 38 | |
39 | - $donations = give_get_users_donations( $email, give_get_limit_display_donations(), true, 'any' ); |
|
39 | + $donations = give_get_users_donations($email, give_get_limit_display_donations(), true, 'any'); |
|
40 | 40 | } else { |
41 | - $donations = give_get_users_donations( $email, 20, true, 'any' ); |
|
41 | + $donations = give_get_users_donations($email, 20, true, 'any'); |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | -Give()->notices->render_frontend_notices( 0 ); |
|
45 | +Give()->notices->render_frontend_notices(0); |
|
46 | 46 | |
47 | -if ( $donations ) : ?> |
|
47 | +if ($donations) : ?> |
|
48 | 48 | <?php |
49 | 49 | $table_headings = array( |
50 | - 'id' => __( 'ID', 'give' ), |
|
51 | - 'date' => __( 'Date', 'give' ), |
|
52 | - 'donor' => __( 'Donor', 'give' ), |
|
53 | - 'amount' => __( 'Amount', 'give' ), |
|
54 | - 'status' => __( 'Status', 'give' ), |
|
55 | - 'payment_method' => __( 'Payment Method', 'give' ), |
|
56 | - 'details' => __( 'Details', 'give' ), |
|
50 | + 'id' => __('ID', 'give'), |
|
51 | + 'date' => __('Date', 'give'), |
|
52 | + 'donor' => __('Donor', 'give'), |
|
53 | + 'amount' => __('Amount', 'give'), |
|
54 | + 'status' => __('Status', 'give'), |
|
55 | + 'payment_method' => __('Payment Method', 'give'), |
|
56 | + 'details' => __('Details', 'give'), |
|
57 | 57 | ); |
58 | 58 | ?> |
59 | 59 | <div class="give_user_history_main" > |
@@ -69,14 +69,14 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @since 1.7 |
71 | 71 | */ |
72 | - do_action( 'give_donation_history_header_before' ); |
|
72 | + do_action('give_donation_history_header_before'); |
|
73 | 73 | |
74 | - foreach ( $donation_history_args as $index => $value ) { |
|
75 | - if ( filter_var( $donation_history_args[ $index ], FILTER_VALIDATE_BOOLEAN ) ) : |
|
74 | + foreach ($donation_history_args as $index => $value) { |
|
75 | + if (filter_var($donation_history_args[$index], FILTER_VALIDATE_BOOLEAN)) : |
|
76 | 76 | echo sprintf( |
77 | 77 | '<th scope="col" class="give-donation-%1$s>">%2$s</th>', |
78 | 78 | $index, |
79 | - $table_headings[ $index ] |
|
79 | + $table_headings[$index] |
|
80 | 80 | ); |
81 | 81 | endif; |
82 | 82 | } |
@@ -88,13 +88,13 @@ discard block |
||
88 | 88 | * |
89 | 89 | * @since 1.7 |
90 | 90 | */ |
91 | - do_action( 'give_donation_history_header_after' ); |
|
91 | + do_action('give_donation_history_header_after'); |
|
92 | 92 | ?> |
93 | 93 | </tr> |
94 | 94 | </thead> |
95 | - <?php foreach ( $donations as $post ) : |
|
96 | - setup_postdata( $post ); |
|
97 | - $donation_data = give_get_payment_meta( $post->ID ); ?> |
|
95 | + <?php foreach ($donations as $post) : |
|
96 | + setup_postdata($post); |
|
97 | + $donation_data = give_get_payment_meta($post->ID); ?> |
|
98 | 98 | <tr class="give-donation-row"> |
99 | 99 | <?php |
100 | 100 | /** |
@@ -107,36 +107,36 @@ discard block |
||
107 | 107 | * @param int $post_id The ID of the post. |
108 | 108 | * @param mixed $donation_data Payment meta data. |
109 | 109 | */ |
110 | - do_action( 'give_donation_history_row_start', $post->ID, $donation_data ); |
|
110 | + do_action('give_donation_history_row_start', $post->ID, $donation_data); |
|
111 | 111 | |
112 | - if ( filter_var( $donation_history_args['id'], FILTER_VALIDATE_BOOLEAN ) ) : |
|
112 | + if (filter_var($donation_history_args['id'], FILTER_VALIDATE_BOOLEAN)) : |
|
113 | 113 | echo sprintf( |
114 | 114 | '<td class="give-donation-id">#%1$s</td>', |
115 | - give_get_payment_number( $post->ID ) |
|
115 | + give_get_payment_number($post->ID) |
|
116 | 116 | ); |
117 | 117 | endif; |
118 | 118 | |
119 | - if ( filter_var( $donation_history_args['date'], FILTER_VALIDATE_BOOLEAN ) ) : |
|
119 | + if (filter_var($donation_history_args['date'], FILTER_VALIDATE_BOOLEAN)) : |
|
120 | 120 | echo sprintf( |
121 | 121 | '<td class="give-donation-date">%1$s</td>', |
122 | - date_i18n( give_date_format(), strtotime( get_post_field( 'post_date', $post->ID ) ) ) |
|
122 | + date_i18n(give_date_format(), strtotime(get_post_field('post_date', $post->ID))) |
|
123 | 123 | ); |
124 | 124 | endif; |
125 | 125 | |
126 | - if ( filter_var( $donation_history_args['donor'], FILTER_VALIDATE_BOOLEAN ) ) : |
|
126 | + if (filter_var($donation_history_args['donor'], FILTER_VALIDATE_BOOLEAN)) : |
|
127 | 127 | echo sprintf( |
128 | 128 | '<td class="give-donation-donor">%1$s</td>', |
129 | - give_get_donor_name_by( $post->ID ) |
|
129 | + give_get_donor_name_by($post->ID) |
|
130 | 130 | ); |
131 | 131 | endif; |
132 | 132 | ?> |
133 | 133 | |
134 | - <?php if ( filter_var( $donation_history_args['amount'], FILTER_VALIDATE_BOOLEAN ) ) : ?> |
|
134 | + <?php if (filter_var($donation_history_args['amount'], FILTER_VALIDATE_BOOLEAN)) : ?> |
|
135 | 135 | <td class="give-donation-amount"> |
136 | 136 | <span class="give-donation-amount"> |
137 | 137 | <?php |
138 | - $currency_code = give_get_payment_currency_code( $post->ID ); |
|
139 | - $donation_amount = give_donation_amount( $post->ID, true ); |
|
138 | + $currency_code = give_get_payment_currency_code($post->ID); |
|
139 | + $donation_amount = give_donation_amount($post->ID, true); |
|
140 | 140 | |
141 | 141 | /** |
142 | 142 | * Filters the donation amount on Donation History Page. |
@@ -148,42 +148,42 @@ discard block |
||
148 | 148 | * |
149 | 149 | * @return int |
150 | 150 | */ |
151 | - echo apply_filters( 'give_donation_history_row_amount', $donation_amount, $post->ID ); |
|
151 | + echo apply_filters('give_donation_history_row_amount', $donation_amount, $post->ID); |
|
152 | 152 | ?> |
153 | 153 | </span> |
154 | 154 | </td> |
155 | 155 | <?php endif; ?> |
156 | 156 | |
157 | 157 | <?php |
158 | - if ( filter_var( $donation_history_args['status'], FILTER_VALIDATE_BOOLEAN ) ) : |
|
158 | + if (filter_var($donation_history_args['status'], FILTER_VALIDATE_BOOLEAN)) : |
|
159 | 159 | echo sprintf( |
160 | 160 | '<td class="give-donation-status">%1$s</td>', |
161 | - give_get_payment_status( $post, true ) |
|
161 | + give_get_payment_status($post, true) |
|
162 | 162 | ); |
163 | 163 | endif; |
164 | 164 | |
165 | - if ( filter_var( $donation_history_args['payment_method'], FILTER_VALIDATE_BOOLEAN ) ) : |
|
165 | + if (filter_var($donation_history_args['payment_method'], FILTER_VALIDATE_BOOLEAN)) : |
|
166 | 166 | echo sprintf( |
167 | 167 | '<td class="give-donation-payment-method">%1$s</td>', |
168 | - give_get_gateway_checkout_label( give_get_payment_gateway( $post->ID ) ) |
|
168 | + give_get_gateway_checkout_label(give_get_payment_gateway($post->ID)) |
|
169 | 169 | ); |
170 | 170 | endif; |
171 | 171 | ?> |
172 | 172 | <td class="give-donation-details"> |
173 | 173 | <?php |
174 | 174 | // Display View Receipt or. |
175 | - if ( 'publish' !== $post->post_status && 'subscription' !== $post->post_status ) : |
|
175 | + if ('publish' !== $post->post_status && 'subscription' !== $post->post_status) : |
|
176 | 176 | echo sprintf( |
177 | 177 | '<a href="%1$s"><span class="give-donation-status %2$s">%3$s</span></a>', |
178 | 178 | esc_url( |
179 | 179 | add_query_arg( |
180 | 180 | 'payment_key', |
181 | - give_get_payment_key( $post->ID ), |
|
181 | + give_get_payment_key($post->ID), |
|
182 | 182 | give_get_history_page_uri() |
183 | 183 | ) |
184 | 184 | ), |
185 | 185 | $post->post_status, |
186 | - __( 'View', 'give' ) . ' ' . give_get_payment_status( $post, true ) . ' »' |
|
186 | + __('View', 'give').' '.give_get_payment_status($post, true).' »' |
|
187 | 187 | ); |
188 | 188 | |
189 | 189 | else : |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | esc_url( |
193 | 193 | add_query_arg( |
194 | 194 | 'payment_key', |
195 | - give_get_payment_key( $post->ID ), |
|
195 | + give_get_payment_key($post->ID), |
|
196 | 196 | give_get_history_page_uri() |
197 | 197 | ) |
198 | 198 | ), |
199 | - __( 'View Receipt »', 'give' ) |
|
199 | + __('View Receipt »', 'give') |
|
200 | 200 | ); |
201 | 201 | |
202 | 202 | endif; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | * @param int $post_id The ID of the post. |
214 | 214 | * @param mixed $donation_data Payment meta data. |
215 | 215 | */ |
216 | - do_action( 'give_donation_history_row_end', $post->ID, $donation_data ); |
|
216 | + do_action('give_donation_history_row_end', $post->ID, $donation_data); |
|
217 | 217 | ?> |
218 | 218 | </tr> |
219 | 219 | <?php endforeach; ?> |
@@ -226,22 +226,22 @@ discard block |
||
226 | 226 | * |
227 | 227 | * @since 1.8.17 |
228 | 228 | */ |
229 | - do_action( 'give_donation_history_table_end' ); |
|
229 | + do_action('give_donation_history_table_end'); |
|
230 | 230 | ?> |
231 | 231 | </table> |
232 | 232 | <div id="give-donation-history-pagination" class="give_pagination navigation"> |
233 | 233 | <?php |
234 | 234 | $big = 999999; |
235 | - echo paginate_links( array( |
|
236 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
235 | + echo paginate_links(array( |
|
236 | + 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
|
237 | 237 | 'format' => '?paged=%#%', |
238 | - 'current' => max( 1, get_query_var( 'paged' ) ), |
|
239 | - 'total' => ceil( give_count_donations_of_donor() / 20 ) // 20 items per page |
|
240 | - ) ); |
|
238 | + 'current' => max(1, get_query_var('paged')), |
|
239 | + 'total' => ceil(give_count_donations_of_donor() / 20) // 20 items per page |
|
240 | + )); |
|
241 | 241 | ?> |
242 | 242 | </div> |
243 | 243 | </div> |
244 | 244 | <?php wp_reset_postdata(); ?> |
245 | 245 | <?php else : ?> |
246 | - <?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?> |
|
246 | + <?php Give()->notices->print_frontend_notice(__('It looks like you haven\'t made any donations.', 'give'), true, 'success'); ?> |
|
247 | 247 | <?php endif; |
248 | 248 | \ No newline at end of file |
@@ -186,7 +186,8 @@ discard block |
||
186 | 186 | __( 'View', 'give' ) . ' ' . give_get_payment_status( $post, true ) . ' »' |
187 | 187 | ); |
188 | 188 | |
189 | - else : |
|
189 | + else { |
|
190 | + : |
|
190 | 191 | echo sprintf( |
191 | 192 | '<a href="%1$s">%2$s</a>', |
192 | 193 | esc_url( |
@@ -198,6 +199,7 @@ discard block |
||
198 | 199 | ), |
199 | 200 | __( 'View Receipt »', 'give' ) |
200 | 201 | ); |
202 | + } |
|
201 | 203 | |
202 | 204 | endif; |
203 | 205 | ?> |
@@ -242,6 +244,9 @@ discard block |
||
242 | 244 | </div> |
243 | 245 | </div> |
244 | 246 | <?php wp_reset_postdata(); ?> |
245 | -<?php else : ?> |
|
246 | - <?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?> |
|
247 | +<?php else { |
|
248 | + : ?> |
|
249 | + <?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); |
|
250 | +} |
|
251 | +?> |
|
247 | 252 | <?php endif; |
248 | 253 | \ No newline at end of file |
@@ -8,26 +8,26 @@ discard block |
||
8 | 8 | global $give_access_form_outputted; |
9 | 9 | |
10 | 10 | // Only output the form once. |
11 | -if ( $give_access_form_outputted ) { |
|
11 | +if ($give_access_form_outputted) { |
|
12 | 12 | return; |
13 | 13 | } |
14 | 14 | |
15 | -$recaptcha_key = give_get_option( 'recaptcha_key' ); |
|
16 | -$recaptcha_secret = give_get_option( 'recaptcha_secret' ); |
|
17 | -$enable_recaptcha = ! empty( $recaptcha_key ) && ! empty( $recaptcha_secret ) ? true : false; |
|
15 | +$recaptcha_key = give_get_option('recaptcha_key'); |
|
16 | +$recaptcha_secret = give_get_option('recaptcha_secret'); |
|
17 | +$enable_recaptcha = ! empty($recaptcha_key) && ! empty($recaptcha_secret) ? true : false; |
|
18 | 18 | |
19 | 19 | // Email already sent? |
20 | -if ( isset( $_POST['email-access-sent'] ) ) { |
|
21 | - Give()->notices->print_frontend_notice( __( 'Please check your email and click on the link to access your complete donation history.', 'give' ), true, 'success' ); |
|
20 | +if (isset($_POST['email-access-sent'])) { |
|
21 | + Give()->notices->print_frontend_notice(__('Please check your email and click on the link to access your complete donation history.', 'give'), true, 'success'); |
|
22 | 22 | |
23 | 23 | return; |
24 | -} elseif ( isset( $_POST['email-access-exhausted'] ) ) { |
|
24 | +} elseif (isset($_POST['email-access-exhausted'])) { |
|
25 | 25 | |
26 | 26 | // Too many emails sent? |
27 | 27 | Give()->notices->print_frontend_notice( |
28 | 28 | sprintf( |
29 | - __( 'Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give' ), |
|
30 | - sprintf( _n( '%s minute', '%s minutes', Give()->email_access->verify_throttle / 60, 'give' ), Give()->email_access->verify_throttle / 60 ) |
|
29 | + __('Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give'), |
|
30 | + sprintf(_n('%s minute', '%s minutes', Give()->email_access->verify_throttle / 60, 'give'), Give()->email_access->verify_throttle / 60) |
|
31 | 31 | ), |
32 | 32 | true, |
33 | 33 | 'error' |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @since 1.8.17 |
44 | 44 | */ |
45 | -do_action( 'give_email_access_form_login' ); |
|
45 | +do_action('give_email_access_form_login'); |
|
46 | 46 | |
47 | 47 | // Print any other messages & errors. |
48 | 48 | Give()->notices->render_frontend_notices(); |
@@ -51,17 +51,17 @@ discard block |
||
51 | 51 | <div class="give-form"> |
52 | 52 | <form method="post" id="give-email-access-form"> |
53 | 53 | |
54 | - <p><?php echo apply_filters( 'give_email_access_welcome_message', __( 'Please verify your email to access your donation history.', 'give' ) ); ?></p> |
|
54 | + <p><?php echo apply_filters('give_email_access_welcome_message', __('Please verify your email to access your donation history.', 'give')); ?></p> |
|
55 | 55 | |
56 | - <label for="give-email"><?php _e( 'Donation Email:', 'give' ); ?></label> |
|
56 | + <label for="give-email"><?php _e('Donation Email:', 'give'); ?></label> |
|
57 | 57 | <input id="give-email" type="email" name="give_email" value="" |
58 | - placeholder="<?php _e( 'Email Address', 'give' ); ?>" /> |
|
59 | - <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'give' ); ?>" /> |
|
58 | + placeholder="<?php _e('Email Address', 'give'); ?>" /> |
|
59 | + <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('give'); ?>" /> |
|
60 | 60 | <input type="hidden" name="give_action" value="email_access_form_login" /> |
61 | 61 | |
62 | 62 | <?php |
63 | 63 | // Enable reCAPTCHA? |
64 | - if ( $enable_recaptcha ) : |
|
64 | + if ($enable_recaptcha) : |
|
65 | 65 | ?> |
66 | 66 | <script> |
67 | 67 | // IP verify for reCAPTCHA. |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | <input type="hidden" name="give_ip" class="give_ip" value="" /> |
80 | 80 | <?php endif; ?> |
81 | 81 | |
82 | - <input type="submit" class="give-submit" value="<?php _e( 'Verify Email', 'give' ); ?>" /> |
|
82 | + <input type="submit" class="give-submit" value="<?php _e('Verify Email', 'give'); ?>" /> |
|
83 | 83 | </form> |
84 | 84 | </div> |
85 | 85 | <?php |