@@ -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( |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | break; |
118 | 118 | |
119 | 119 | case 'currency-settings' : |
120 | - $currency_position_before = __( 'Before - %s‎10', 'give' ); |
|
121 | - $currency_position_after = __( 'After - 10%s‏', 'give' ); |
|
120 | + $currency_position_before = __('Before - %s‎10', 'give'); |
|
121 | + $currency_position_after = __('After - 10%s‏', 'give'); |
|
122 | 122 | |
123 | 123 | $settings = array( |
124 | 124 | // Section 2: Currency |
@@ -127,14 +127,14 @@ discard block |
||
127 | 127 | 'id' => 'give_title_general_settings_2', |
128 | 128 | ), |
129 | 129 | array( |
130 | - 'name' => __( 'Currency Settings', 'give' ), |
|
130 | + 'name' => __('Currency Settings', 'give'), |
|
131 | 131 | 'desc' => '', |
132 | 132 | 'type' => 'give_title', |
133 | 133 | 'id' => 'give_title_general_settings_2', |
134 | 134 | ), |
135 | 135 | array( |
136 | - 'name' => __( 'Currency', 'give' ), |
|
137 | - 'desc' => __( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ), |
|
136 | + 'name' => __('Currency', 'give'), |
|
137 | + 'desc' => __('The donation currency. Note that some payment gateways have currency restrictions.', 'give'), |
|
138 | 138 | 'id' => 'currency', |
139 | 139 | 'class' => 'give-select-chosen', |
140 | 140 | 'type' => 'select', |
@@ -142,51 +142,51 @@ discard block |
||
142 | 142 | 'default' => 'USD', |
143 | 143 | ), |
144 | 144 | array( |
145 | - 'name' => __( 'Currency Position', 'give' ), |
|
146 | - 'desc' => __( 'The position of the currency symbol.', 'give' ), |
|
145 | + 'name' => __('Currency Position', 'give'), |
|
146 | + 'desc' => __('The position of the currency symbol.', 'give'), |
|
147 | 147 | 'id' => 'currency_position', |
148 | 148 | 'type' => 'select', |
149 | 149 | 'options' => array( |
150 | 150 | /* translators: %s: currency symbol */ |
151 | - 'before' => sprintf( $currency_position_before, give_currency_symbol( give_get_currency() ) ), |
|
151 | + 'before' => sprintf($currency_position_before, give_currency_symbol(give_get_currency())), |
|
152 | 152 | /* translators: %s: currency symbol */ |
153 | - 'after' => sprintf( $currency_position_after, give_currency_symbol( give_get_currency() ) ), |
|
153 | + 'after' => sprintf($currency_position_after, give_currency_symbol(give_get_currency())), |
|
154 | 154 | ), |
155 | 155 | 'default' => 'before', |
156 | 156 | 'attributes' => array( |
157 | - 'data-before-template' => sprintf( $currency_position_before, '{currency_pos}' ), |
|
158 | - 'data-after-template' => sprintf( $currency_position_after, '{currency_pos}' ), |
|
157 | + 'data-before-template' => sprintf($currency_position_before, '{currency_pos}'), |
|
158 | + 'data-after-template' => sprintf($currency_position_after, '{currency_pos}'), |
|
159 | 159 | ), |
160 | 160 | ), |
161 | 161 | array( |
162 | - 'name' => __( 'Thousands Separator', 'give' ), |
|
163 | - 'desc' => __( 'The symbol (typically , or .) to separate thousands.', 'give' ), |
|
162 | + 'name' => __('Thousands Separator', 'give'), |
|
163 | + 'desc' => __('The symbol (typically , or .) to separate thousands.', 'give'), |
|
164 | 164 | 'id' => 'thousands_separator', |
165 | 165 | 'type' => 'text', |
166 | 166 | 'default' => ',', |
167 | 167 | 'css' => 'width:12em;', |
168 | 168 | ), |
169 | 169 | array( |
170 | - 'name' => __( 'Decimal Separator', 'give' ), |
|
171 | - 'desc' => __( 'The symbol (usually , or .) to separate decimal points.', 'give' ), |
|
170 | + 'name' => __('Decimal Separator', 'give'), |
|
171 | + 'desc' => __('The symbol (usually , or .) to separate decimal points.', 'give'), |
|
172 | 172 | 'id' => 'decimal_separator', |
173 | 173 | 'type' => 'text', |
174 | 174 | 'default' => '.', |
175 | 175 | 'css' => 'width:12em;', |
176 | 176 | ), |
177 | 177 | array( |
178 | - 'name' => __( 'Number of Decimals', 'give' ), |
|
179 | - 'desc' => __( 'The number of decimal points displayed in amounts.', 'give' ), |
|
178 | + 'name' => __('Number of Decimals', 'give'), |
|
179 | + 'desc' => __('The number of decimal points displayed in amounts.', 'give'), |
|
180 | 180 | 'id' => 'number_decimals', |
181 | 181 | 'type' => 'text', |
182 | 182 | 'default' => 2, |
183 | 183 | 'css' => 'width:12em;', |
184 | 184 | ), |
185 | 185 | array( |
186 | - 'name' => __( 'Currency Options Docs Link', 'give' ), |
|
186 | + 'name' => __('Currency Options Docs Link', 'give'), |
|
187 | 187 | 'id' => 'currency_settings_docs_link', |
188 | - 'url' => esc_url( 'http://docs.givewp.com/settings-currency' ), |
|
189 | - 'title' => __( 'Currency Settings', 'give' ), |
|
188 | + 'url' => esc_url('http://docs.givewp.com/settings-currency'), |
|
189 | + 'title' => __('Currency Settings', 'give'), |
|
190 | 190 | 'type' => 'give_docs_link', |
191 | 191 | ), |
192 | 192 | array( |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $country = give_get_country(); |
203 | 203 | |
204 | 204 | // get the list of the states of which default country is selected. |
205 | - $states = give_get_states( $country ); |
|
205 | + $states = give_get_states($country); |
|
206 | 206 | |
207 | 207 | // Get the country list that does not have any states init. |
208 | 208 | $no_states_country = give_no_states_country_list(); |
@@ -214,46 +214,46 @@ discard block |
||
214 | 214 | 'id' => 'give_title_general_settings_1', |
215 | 215 | ), |
216 | 216 | array( |
217 | - 'name' => __( 'General Settings', 'give' ), |
|
217 | + 'name' => __('General Settings', 'give'), |
|
218 | 218 | 'desc' => '', |
219 | 219 | 'type' => 'give_title', |
220 | 220 | 'id' => 'give_title_general_settings_1', |
221 | 221 | ), |
222 | 222 | array( |
223 | - 'name' => __( 'Success Page', 'give' ), |
|
223 | + 'name' => __('Success Page', 'give'), |
|
224 | 224 | /* translators: %s: [give_receipt] */ |
225 | - '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>' ), |
|
225 | + '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>'), |
|
226 | 226 | 'id' => 'success_page', |
227 | 227 | 'type' => 'select', |
228 | - 'options' => give_cmb2_get_post_options( array( |
|
228 | + 'options' => give_cmb2_get_post_options(array( |
|
229 | 229 | 'post_type' => 'page', |
230 | 230 | 'numberposts' => 999, |
231 | - ) ), |
|
231 | + )), |
|
232 | 232 | ), |
233 | 233 | array( |
234 | - 'name' => __( 'Failed Donation Page', 'give' ), |
|
235 | - 'desc' => __( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ), |
|
234 | + 'name' => __('Failed Donation Page', 'give'), |
|
235 | + 'desc' => __('The page donors are sent to if their donation is cancelled or fails.', 'give'), |
|
236 | 236 | 'id' => 'failure_page', |
237 | 237 | 'type' => 'select', |
238 | - 'options' => give_cmb2_get_post_options( array( |
|
238 | + 'options' => give_cmb2_get_post_options(array( |
|
239 | 239 | 'post_type' => 'page', |
240 | 240 | 'numberposts' => 999, |
241 | - ) ), |
|
241 | + )), |
|
242 | 242 | ), |
243 | 243 | array( |
244 | - 'name' => __( 'Donation History Page', 'give' ), |
|
244 | + 'name' => __('Donation History Page', 'give'), |
|
245 | 245 | /* translators: %s: [donation_history] */ |
246 | - '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>' ), |
|
246 | + '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>'), |
|
247 | 247 | 'id' => 'history_page', |
248 | 248 | 'type' => 'select', |
249 | - 'options' => give_cmb2_get_post_options( array( |
|
249 | + 'options' => give_cmb2_get_post_options(array( |
|
250 | 250 | 'post_type' => 'page', |
251 | 251 | 'numberposts' => 999, |
252 | - ) ), |
|
252 | + )), |
|
253 | 253 | ), |
254 | 254 | array( |
255 | - 'name' => __( 'Base Country', 'give' ), |
|
256 | - 'desc' => __( 'The country your site operates from.', 'give' ), |
|
255 | + 'name' => __('Base Country', 'give'), |
|
256 | + 'desc' => __('The country your site operates from.', 'give'), |
|
257 | 257 | 'id' => 'base_country', |
258 | 258 | 'type' => 'select', |
259 | 259 | 'options' => give_get_country_list(), |
@@ -264,18 +264,18 @@ discard block |
||
264 | 264 | * @since 1.8.14 |
265 | 265 | */ |
266 | 266 | array( |
267 | - 'wrapper_class' => ( array_key_exists( $country, $no_states_country ) ? 'give-hidden' : '' ), |
|
268 | - 'name' => __( 'Base State/Province', 'give' ), |
|
269 | - 'desc' => __( 'The state/province your site operates from.', 'give' ), |
|
267 | + 'wrapper_class' => (array_key_exists($country, $no_states_country) ? 'give-hidden' : ''), |
|
268 | + 'name' => __('Base State/Province', 'give'), |
|
269 | + 'desc' => __('The state/province your site operates from.', 'give'), |
|
270 | 270 | 'id' => 'base_state', |
271 | - 'type' => ( empty( $states ) ? 'text' : 'select' ), |
|
271 | + 'type' => (empty($states) ? 'text' : 'select'), |
|
272 | 272 | 'options' => $states, |
273 | 273 | ), |
274 | 274 | array( |
275 | - 'name' => __( 'General Options Docs Link', 'give' ), |
|
275 | + 'name' => __('General Options Docs Link', 'give'), |
|
276 | 276 | 'id' => 'general_options_docs_link', |
277 | - 'url' => esc_url( 'http://docs.givewp.com/settings-general' ), |
|
278 | - 'title' => __( 'General Options', 'give' ), |
|
277 | + 'url' => esc_url('http://docs.givewp.com/settings-general'), |
|
278 | + 'title' => __('General Options', 'give'), |
|
279 | 279 | 'type' => 'give_docs_link', |
280 | 280 | ), |
281 | 281 | array( |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | * Filter the general settings. |
291 | 291 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
292 | 292 | */ |
293 | - $settings = apply_filters( 'give_settings_general', $settings ); |
|
293 | + $settings = apply_filters('give_settings_general', $settings); |
|
294 | 294 | |
295 | 295 | /** |
296 | 296 | * Filter the settings. |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | * |
300 | 300 | * @param array $settings |
301 | 301 | */ |
302 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
302 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
303 | 303 | |
304 | 304 | // Output. |
305 | 305 | return $settings; |
@@ -313,12 +313,12 @@ discard block |
||
313 | 313 | */ |
314 | 314 | public function get_sections() { |
315 | 315 | $sections = array( |
316 | - 'general-settings' => __( 'General', 'give' ), |
|
317 | - 'currency-settings' => __( 'Currency', 'give' ), |
|
318 | - 'access-control' => __( 'Access Control', 'give' ), |
|
316 | + 'general-settings' => __('General', 'give'), |
|
317 | + 'currency-settings' => __('Currency', 'give'), |
|
318 | + 'access-control' => __('Access Control', 'give'), |
|
319 | 319 | ); |
320 | 320 | |
321 | - return apply_filters( 'give_get_sections_' . $this->id, $sections ); |
|
321 | + return apply_filters('give_get_sections_'.$this->id, $sections); |
|
322 | 322 | } |
323 | 323 | } |
324 | 324 |