@@ -43,14 +43,14 @@ discard block |
||
43 | 43 | public function __construct() { |
44 | 44 | |
45 | 45 | // Custom settings fields. |
46 | - add_action( 'give_render_give_title', 'give_title_callback', 10, 5 ); |
|
47 | - add_action( 'give_render_give_description', 'give_description_callback', 10, 5 ); |
|
48 | - add_action( 'give_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 ); |
|
49 | - add_action( 'give_render_default_gateway', 'give_default_gateway_callback', 10, 5 ); |
|
50 | - add_action( 'give_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 ); |
|
51 | - add_action( 'give_render_system_info', 'give_system_info_callback', 10, 5 ); |
|
52 | - add_action( 'give_render_api', 'give_api_callback', 10, 5 ); |
|
53 | - add_action( 'give_render_license_key', 'give_license_key_callback', 10, 5 ); |
|
46 | + add_action('give_render_give_title', 'give_title_callback', 10, 5); |
|
47 | + add_action('give_render_give_description', 'give_description_callback', 10, 5); |
|
48 | + add_action('give_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5); |
|
49 | + add_action('give_render_default_gateway', 'give_default_gateway_callback', 10, 5); |
|
50 | + add_action('give_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5); |
|
51 | + add_action('give_render_system_info', 'give_system_info_callback', 10, 5); |
|
52 | + add_action('give_render_api', 'give_api_callback', 10, 5); |
|
53 | + add_action('give_render_license_key', 'give_license_key_callback', 10, 5); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @since 1.0 |
61 | 61 | */ |
62 | 62 | public function init() { |
63 | - register_setting( $this->key, $this->key ); |
|
63 | + register_setting($this->key, $this->key); |
|
64 | 64 | |
65 | 65 | } |
66 | 66 | |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | * |
75 | 75 | * @return mixed |
76 | 76 | */ |
77 | - public function give_update_cmb_meta_box_url( $url ) { |
|
77 | + public function give_update_cmb_meta_box_url($url) { |
|
78 | 78 | // Path to Give's CMB |
79 | - return GIVE_PLUGIN_URL . '/includes/libraries/cmb2'; |
|
79 | + return GIVE_PLUGIN_URL.'/includes/libraries/cmb2'; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -88,27 +88,27 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function give_get_settings_tabs() { |
90 | 90 | |
91 | - $settings = $this->give_settings( null ); |
|
91 | + $settings = $this->give_settings(null); |
|
92 | 92 | |
93 | 93 | $tabs = array(); |
94 | - $tabs['general'] = __( 'General', 'give' ); |
|
95 | - $tabs['gateways'] = __( 'Payment Gateways', 'give' ); |
|
96 | - $tabs['display'] = __( 'Display Options', 'give' ); |
|
97 | - $tabs['emails'] = __( 'Emails', 'give' ); |
|
94 | + $tabs['general'] = __('General', 'give'); |
|
95 | + $tabs['gateways'] = __('Payment Gateways', 'give'); |
|
96 | + $tabs['display'] = __('Display Options', 'give'); |
|
97 | + $tabs['emails'] = __('Emails', 'give'); |
|
98 | 98 | |
99 | - if ( ! empty( $settings['addons']['fields'] ) ) { |
|
100 | - $tabs['addons'] = __( 'Add-ons', 'give' ); |
|
99 | + if ( ! empty($settings['addons']['fields'])) { |
|
100 | + $tabs['addons'] = __('Add-ons', 'give'); |
|
101 | 101 | } |
102 | 102 | |
103 | - if ( ! empty( $settings['licenses']['fields'] ) ) { |
|
104 | - $tabs['licenses'] = __( 'Licenses', 'give' ); |
|
103 | + if ( ! empty($settings['licenses']['fields'])) { |
|
104 | + $tabs['licenses'] = __('Licenses', 'give'); |
|
105 | 105 | } |
106 | 106 | |
107 | - $tabs['advanced'] = __( 'Advanced', 'give' ); |
|
108 | - $tabs['api'] = __( 'API', 'give' ); |
|
109 | - $tabs['system_info'] = __( 'System Info', 'give' ); |
|
107 | + $tabs['advanced'] = __('Advanced', 'give'); |
|
108 | + $tabs['api'] = __('API', 'give'); |
|
109 | + $tabs['system_info'] = __('System Info', 'give'); |
|
110 | 110 | |
111 | - return apply_filters( 'give_settings_tabs', $tabs ); |
|
111 | + return apply_filters('give_settings_tabs', $tabs); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function admin_page_display() { |
121 | 121 | |
122 | - $active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general'; |
|
122 | + $active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general'; |
|
123 | 123 | |
124 | 124 | ?> |
125 | 125 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | <h2 class="nav-tab-wrapper"> |
131 | 131 | <?php |
132 | - foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) { |
|
132 | + foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) { |
|
133 | 133 | |
134 | 134 | $tab_url = esc_url( |
135 | 135 | add_query_arg( |
@@ -142,13 +142,13 @@ discard block |
||
142 | 142 | |
143 | 143 | $active = $active_tab == $tab_id ? ' nav-tab-active' : ''; |
144 | 144 | |
145 | - echo '<a href="' . esc_url( $tab_url ) . '" class="nav-tab' . $active . '" id="tab-' . $tab_id . '">' . esc_html( $tab_name ) . '</a>'; |
|
145 | + echo '<a href="'.esc_url($tab_url).'" class="nav-tab'.$active.'" id="tab-'.$tab_id.'">'.esc_html($tab_name).'</a>'; |
|
146 | 146 | |
147 | 147 | } |
148 | 148 | ?> |
149 | 149 | </h2> |
150 | 150 | |
151 | - <?php cmb2_metabox_form( $this->give_settings( $active_tab ), $this->key ); ?> |
|
151 | + <?php cmb2_metabox_form($this->give_settings($active_tab), $this->key); ?> |
|
152 | 152 | |
153 | 153 | </div><!-- .wrap --> |
154 | 154 | |
@@ -170,12 +170,12 @@ discard block |
||
170 | 170 | * |
171 | 171 | * @return string |
172 | 172 | */ |
173 | - function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) { |
|
173 | + function give_modify_cmb2_form_output($form_format, $object_id, $cmb) { |
|
174 | 174 | |
175 | 175 | // only modify the give settings form |
176 | - if ( 'give_settings' == $object_id ) { |
|
176 | + if ('give_settings' == $object_id) { |
|
177 | 177 | |
178 | - return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . esc_attr__( 'Save Settings', 'give' ) . '" class="button-primary"></div></form>'; |
|
178 | + return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.esc_attr__('Save Settings', 'give').'" class="button-primary"></div></form>'; |
|
179 | 179 | |
180 | 180 | } |
181 | 181 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * |
193 | 193 | * @return array |
194 | 194 | */ |
195 | - public function give_settings( $active_tab ) { |
|
195 | + public function give_settings($active_tab) { |
|
196 | 196 | |
197 | 197 | $give_settings = array( |
198 | 198 | /** |
@@ -200,23 +200,23 @@ discard block |
||
200 | 200 | */ |
201 | 201 | 'general' => array( |
202 | 202 | 'id' => 'general_settings', |
203 | - 'give_title' => __( 'General Settings', 'give' ), |
|
203 | + 'give_title' => __('General Settings', 'give'), |
|
204 | 204 | 'show_on' => array( |
205 | 205 | 'key' => 'options-page', |
206 | - 'value' => array( $this->key ), |
|
206 | + 'value' => array($this->key), |
|
207 | 207 | ), |
208 | 208 | 'fields' => apply_filters( |
209 | 209 | 'give_settings_general', array( |
210 | 210 | array( |
211 | - 'name' => __( 'General Settings', 'give' ), |
|
211 | + 'name' => __('General Settings', 'give'), |
|
212 | 212 | 'desc' => '', |
213 | 213 | 'type' => 'give_title', |
214 | 214 | 'id' => 'give_title_general_settings_1', |
215 | 215 | ), |
216 | 216 | array( |
217 | - 'name' => __( 'Success Page', 'give' ), |
|
217 | + 'name' => __('Success Page', 'give'), |
|
218 | 218 | /* translators: %s: [give_receipt] */ |
219 | - '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>' ), |
|
219 | + '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>'), |
|
220 | 220 | 'id' => 'success_page', |
221 | 221 | 'type' => 'select', |
222 | 222 | 'options' => give_cmb2_get_post_options( |
@@ -227,8 +227,8 @@ discard block |
||
227 | 227 | ), |
228 | 228 | ), |
229 | 229 | array( |
230 | - 'name' => __( 'Failed Donation Page', 'give' ), |
|
231 | - 'desc' => __( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ), |
|
230 | + 'name' => __('Failed Donation Page', 'give'), |
|
231 | + 'desc' => __('The page donors are sent to if their donation is cancelled or fails.', 'give'), |
|
232 | 232 | 'id' => 'failure_page', |
233 | 233 | 'type' => 'select', |
234 | 234 | 'options' => give_cmb2_get_post_options( |
@@ -239,9 +239,9 @@ discard block |
||
239 | 239 | ), |
240 | 240 | ), |
241 | 241 | array( |
242 | - 'name' => __( 'Donation History Page', 'give' ), |
|
242 | + 'name' => __('Donation History Page', 'give'), |
|
243 | 243 | /* translators: %s: [donation_history] */ |
244 | - '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>' ), |
|
244 | + '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>'), |
|
245 | 245 | 'id' => 'history_page', |
246 | 246 | 'type' => 'select', |
247 | 247 | 'options' => give_cmb2_get_post_options( |
@@ -252,57 +252,57 @@ discard block |
||
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(), |
260 | 260 | ), |
261 | 261 | array( |
262 | - 'name' => __( 'Currency Settings', 'give' ), |
|
262 | + 'name' => __('Currency Settings', 'give'), |
|
263 | 263 | 'desc' => '', |
264 | 264 | 'type' => 'give_title', |
265 | 265 | 'id' => 'give_title_general_settings_2', |
266 | 266 | ), |
267 | 267 | array( |
268 | - 'name' => __( 'Currency', 'give' ), |
|
269 | - 'desc' => __( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ), |
|
268 | + 'name' => __('Currency', 'give'), |
|
269 | + 'desc' => __('The donation currency. Note that some payment gateways have currency restrictions.', 'give'), |
|
270 | 270 | 'id' => 'currency', |
271 | 271 | 'type' => 'select', |
272 | 272 | 'options' => give_get_currencies(), |
273 | 273 | 'default' => 'USD', |
274 | 274 | ), |
275 | 275 | array( |
276 | - 'name' => __( 'Currency Position', 'give' ), |
|
277 | - 'desc' => __( 'The position of the currency symbol.', 'give' ), |
|
276 | + 'name' => __('Currency Position', 'give'), |
|
277 | + 'desc' => __('The position of the currency symbol.', 'give'), |
|
278 | 278 | 'id' => 'currency_position', |
279 | 279 | 'type' => 'select', |
280 | 280 | 'options' => array( |
281 | 281 | /* translators: %s: currency symbol */ |
282 | - 'before' => sprintf( __( 'Before - %s‎10', 'give' ), give_currency_symbol( give_get_currency() ) ), |
|
282 | + 'before' => sprintf(__('Before - %s‎10', 'give'), give_currency_symbol(give_get_currency())), |
|
283 | 283 | /* translators: %s: currency symbol */ |
284 | - 'after' => sprintf( __( 'After - 10%s‏', 'give' ), give_currency_symbol( give_get_currency() ) ), |
|
284 | + 'after' => sprintf(__('After - 10%s‏', 'give'), give_currency_symbol(give_get_currency())), |
|
285 | 285 | ), |
286 | 286 | 'default' => 'before', |
287 | 287 | ), |
288 | 288 | array( |
289 | - 'name' => __( 'Thousands Separator', 'give' ), |
|
290 | - 'desc' => __( 'The symbol (usually , or .) to separate thousands.', 'give' ), |
|
289 | + 'name' => __('Thousands Separator', 'give'), |
|
290 | + 'desc' => __('The symbol (usually , or .) to separate thousands.', 'give'), |
|
291 | 291 | 'id' => 'thousands_separator', |
292 | 292 | 'type' => 'text_small', |
293 | 293 | 'sanitization_cb' => 'give_sanitize_thousand_separator', |
294 | 294 | 'default' => ',', |
295 | 295 | ), |
296 | 296 | array( |
297 | - 'name' => __( 'Decimal Separator', 'give' ), |
|
298 | - 'desc' => __( 'The symbol (usually , or .) to separate decimal points.', 'give' ), |
|
297 | + 'name' => __('Decimal Separator', 'give'), |
|
298 | + 'desc' => __('The symbol (usually , or .) to separate decimal points.', 'give'), |
|
299 | 299 | 'id' => 'decimal_separator', |
300 | 300 | 'type' => 'text_small', |
301 | 301 | 'default' => '.', |
302 | 302 | ), |
303 | 303 | array( |
304 | - 'name' => __( 'Number of Decimals', 'give' ), |
|
305 | - 'desc' => __( 'The number of decimal points displayed in amounts.', 'give' ), |
|
304 | + 'name' => __('Number of Decimals', 'give'), |
|
305 | + 'desc' => __('The number of decimal points displayed in amounts.', 'give'), |
|
306 | 306 | 'id' => 'number_decimals', |
307 | 307 | 'type' => 'text_small', |
308 | 308 | 'default' => 2, |
@@ -316,87 +316,87 @@ discard block |
||
316 | 316 | */ |
317 | 317 | 'gateways' => array( |
318 | 318 | 'id' => 'payment_gateways', |
319 | - 'give_title' => __( 'Payment Gateways', 'give' ), |
|
319 | + 'give_title' => __('Payment Gateways', 'give'), |
|
320 | 320 | 'show_on' => array( |
321 | 321 | 'key' => 'options-page', |
322 | - 'value' => array( $this->key ), |
|
322 | + 'value' => array($this->key), |
|
323 | 323 | ), |
324 | 324 | 'fields' => apply_filters( |
325 | 325 | 'give_settings_gateways', array( |
326 | 326 | array( |
327 | - 'name' => __( 'Gateways Settings', 'give' ), |
|
327 | + 'name' => __('Gateways Settings', 'give'), |
|
328 | 328 | 'desc' => '', |
329 | 329 | 'id' => 'give_title_gateway_settings_1', |
330 | 330 | 'type' => 'give_title', |
331 | 331 | ), |
332 | 332 | array( |
333 | - 'name' => __( 'Test Mode', 'give' ), |
|
334 | - 'desc' => __( 'While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ), |
|
333 | + 'name' => __('Test Mode', 'give'), |
|
334 | + 'desc' => __('While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'), |
|
335 | 335 | 'id' => 'test_mode', |
336 | 336 | 'type' => 'checkbox', |
337 | 337 | ), |
338 | 338 | array( |
339 | - 'name' => __( 'Enabled Gateways', 'give' ), |
|
340 | - 'desc' => __( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ), |
|
339 | + 'name' => __('Enabled Gateways', 'give'), |
|
340 | + 'desc' => __('Enable your payment gateway. Can be ordered by dragging.', 'give'), |
|
341 | 341 | 'id' => 'gateways', |
342 | 342 | 'type' => 'enabled_gateways', |
343 | 343 | ), |
344 | 344 | array( |
345 | - 'name' => __( 'Default Gateway', 'give' ), |
|
346 | - 'desc' => __( 'The gateway that will be selected by default.', 'give' ), |
|
345 | + 'name' => __('Default Gateway', 'give'), |
|
346 | + 'desc' => __('The gateway that will be selected by default.', 'give'), |
|
347 | 347 | 'id' => 'default_gateway', |
348 | 348 | 'type' => 'default_gateway', |
349 | 349 | ), |
350 | 350 | array( |
351 | - 'name' => __( 'PayPal Standard', 'give' ), |
|
351 | + 'name' => __('PayPal Standard', 'give'), |
|
352 | 352 | 'desc' => '', |
353 | 353 | 'type' => 'give_title', |
354 | 354 | 'id' => 'give_title_gateway_settings_2', |
355 | 355 | ), |
356 | 356 | array( |
357 | - 'name' => __( 'PayPal Email', 'give' ), |
|
358 | - 'desc' => __( 'Enter your PayPal account\'s email.', 'give' ), |
|
357 | + 'name' => __('PayPal Email', 'give'), |
|
358 | + 'desc' => __('Enter your PayPal account\'s email.', 'give'), |
|
359 | 359 | 'id' => 'paypal_email', |
360 | 360 | 'type' => 'text_email', |
361 | 361 | ), |
362 | 362 | array( |
363 | - 'name' => __( 'PayPal Page Style', 'give' ), |
|
364 | - 'desc' => __( 'Enter the name of the page style to use, or leave blank to use the default.', 'give' ), |
|
363 | + 'name' => __('PayPal Page Style', 'give'), |
|
364 | + 'desc' => __('Enter the name of the page style to use, or leave blank to use the default.', 'give'), |
|
365 | 365 | 'id' => 'paypal_page_style', |
366 | 366 | 'type' => 'text', |
367 | 367 | ), |
368 | 368 | array( |
369 | - 'name' => __( 'PayPal Transaction Type', 'give' ), |
|
370 | - 'desc' => __( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ), |
|
369 | + 'name' => __('PayPal Transaction Type', 'give'), |
|
370 | + 'desc' => __('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'), |
|
371 | 371 | 'id' => 'paypal_button_type', |
372 | 372 | 'type' => 'radio_inline', |
373 | 373 | 'options' => array( |
374 | - 'donation' => __( 'Donation', 'give' ), |
|
375 | - 'standard' => __( 'Standard Transaction', 'give' ), |
|
374 | + 'donation' => __('Donation', 'give'), |
|
375 | + 'standard' => __('Standard Transaction', 'give'), |
|
376 | 376 | ), |
377 | 377 | 'default' => 'donation', |
378 | 378 | ), |
379 | 379 | array( |
380 | - 'name' => __( 'Disable PayPal IPN Verification', 'give' ), |
|
381 | - 'desc' => __( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ), |
|
380 | + 'name' => __('Disable PayPal IPN Verification', 'give'), |
|
381 | + 'desc' => __('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'), |
|
382 | 382 | 'id' => 'disable_paypal_verification', |
383 | 383 | 'type' => 'checkbox', |
384 | 384 | ), |
385 | 385 | array( |
386 | - 'name' => __( 'Offline Donations', 'give' ), |
|
386 | + 'name' => __('Offline Donations', 'give'), |
|
387 | 387 | 'desc' => '', |
388 | 388 | 'type' => 'give_title', |
389 | 389 | 'id' => 'give_title_gateway_settings_3', |
390 | 390 | ), |
391 | 391 | array( |
392 | - 'name' => __( 'Collect Billing Details', 'give' ), |
|
393 | - 'desc' => __( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ), |
|
392 | + 'name' => __('Collect Billing Details', 'give'), |
|
393 | + 'desc' => __('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'), |
|
394 | 394 | 'id' => 'give_offline_donation_enable_billing_fields', |
395 | 395 | 'type' => 'checkbox', |
396 | 396 | ), |
397 | 397 | array( |
398 | - 'name' => __( 'Offline Donation Instructions', 'give' ), |
|
399 | - 'desc' => __( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ), |
|
398 | + 'name' => __('Offline Donation Instructions', 'give'), |
|
399 | + 'desc' => __('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'), |
|
400 | 400 | 'id' => 'global_offline_donation_content', |
401 | 401 | 'default' => give_get_default_offline_donation_content(), |
402 | 402 | 'type' => 'wysiwyg', |
@@ -405,15 +405,15 @@ discard block |
||
405 | 405 | ), |
406 | 406 | ), |
407 | 407 | array( |
408 | - 'name' => __( 'Offline Donation Email Instructions Subject', 'give' ), |
|
409 | - 'desc' => __( 'Enter the subject line for the donation receipt email.', 'give' ), |
|
408 | + 'name' => __('Offline Donation Email Instructions Subject', 'give'), |
|
409 | + 'desc' => __('Enter the subject line for the donation receipt email.', 'give'), |
|
410 | 410 | 'id' => 'offline_donation_subject', |
411 | - 'default' => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ), |
|
411 | + 'default' => esc_attr__('{donation} - Offline Donation Instructions', 'give'), |
|
412 | 412 | 'type' => 'text', |
413 | 413 | ), |
414 | 414 | array( |
415 | - 'name' => __( 'Offline Donation Email Instructions', 'give' ), |
|
416 | - 'desc' => __( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ), |
|
415 | + 'name' => __('Offline Donation Email Instructions', 'give'), |
|
416 | + 'desc' => __('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give'), |
|
417 | 417 | 'id' => 'global_offline_donation_email', |
418 | 418 | 'default' => give_get_default_offline_donation_email_content(), |
419 | 419 | 'type' => 'wysiwyg', |
@@ -427,116 +427,116 @@ discard block |
||
427 | 427 | /** Display Settings */ |
428 | 428 | 'display' => array( |
429 | 429 | 'id' => 'display_settings', |
430 | - 'give_title' => __( 'Display Settings', 'give' ), |
|
430 | + 'give_title' => __('Display Settings', 'give'), |
|
431 | 431 | 'show_on' => array( |
432 | 432 | 'key' => 'options-page', |
433 | - 'value' => array( $this->key ), |
|
433 | + 'value' => array($this->key), |
|
434 | 434 | ), |
435 | 435 | 'fields' => apply_filters( |
436 | 436 | 'give_settings_display', array( |
437 | 437 | array( |
438 | - 'name' => __( 'Display Settings', 'give' ), |
|
438 | + 'name' => __('Display Settings', 'give'), |
|
439 | 439 | 'desc' => '', |
440 | 440 | 'id' => 'give_title_display_settings_1', |
441 | 441 | 'type' => 'give_title', |
442 | 442 | ), |
443 | 443 | array( |
444 | - 'name' => __( 'Disable CSS', 'give' ), |
|
445 | - 'desc' => __( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ), |
|
444 | + 'name' => __('Disable CSS', 'give'), |
|
445 | + 'desc' => __('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'), |
|
446 | 446 | 'id' => 'disable_css', |
447 | 447 | 'type' => 'checkbox', |
448 | 448 | ), |
449 | 449 | array( |
450 | - 'name' => __( 'Enable Floating Labels', 'give' ), |
|
450 | + 'name' => __('Enable Floating Labels', 'give'), |
|
451 | 451 | /* translators: %s: http://docs.givewp.com/form-floating-labels */ |
452 | 452 | 'desc' => sprintf( |
453 | 453 | wp_kses( |
454 | - __( 'Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array( |
|
454 | + __('Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array( |
|
455 | 455 | 'a' => array( |
456 | 456 | 'href' => array(), |
457 | 457 | 'target' => array(), |
458 | 458 | ), |
459 | 459 | ) |
460 | - ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) |
|
460 | + ), esc_url('http://docs.givewp.com/form-floating-labels') |
|
461 | 461 | ), |
462 | 462 | 'id' => 'floatlabels', |
463 | 463 | 'type' => 'checkbox', |
464 | 464 | ), |
465 | 465 | array( |
466 | - 'name' => __( 'Disable Welcome Screen', 'give' ), |
|
466 | + 'name' => __('Disable Welcome Screen', 'give'), |
|
467 | 467 | /* translators: %s: about page URL */ |
468 | 468 | 'desc' => sprintf( |
469 | 469 | wp_kses( |
470 | - __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give' ), array( |
|
470 | + __('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give'), array( |
|
471 | 471 | 'a' => array( |
472 | 472 | 'href' => array(), |
473 | 473 | 'target' => array(), |
474 | 474 | ), |
475 | 475 | ) |
476 | - ), esc_url( admin_url( 'index.php?page=give-about' ) ) |
|
476 | + ), esc_url(admin_url('index.php?page=give-about')) |
|
477 | 477 | ), |
478 | 478 | 'id' => 'disable_welcome', |
479 | 479 | 'type' => 'checkbox', |
480 | 480 | ), |
481 | 481 | array( |
482 | - 'name' => __( 'Post Types', 'give' ), |
|
482 | + 'name' => __('Post Types', 'give'), |
|
483 | 483 | 'desc' => '', |
484 | 484 | 'id' => 'give_title_display_settings_2', |
485 | 485 | 'type' => 'give_title', |
486 | 486 | ), |
487 | 487 | array( |
488 | - 'name' => __( 'Disable Form Single Views', 'give' ), |
|
489 | - 'desc' => __( 'By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ), |
|
488 | + 'name' => __('Disable Form Single Views', 'give'), |
|
489 | + 'desc' => __('By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'), |
|
490 | 490 | 'id' => 'disable_forms_singular', |
491 | 491 | 'type' => 'checkbox', |
492 | 492 | ), |
493 | 493 | array( |
494 | - 'name' => __( 'Disable Form Archives', 'give' ), |
|
495 | - 'desc' => __( 'Archives pages list all the 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 refresh your permalinks after this option has been enabled.', 'give' ), |
|
494 | + 'name' => __('Disable Form Archives', 'give'), |
|
495 | + 'desc' => __('Archives pages list all the 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 refresh your permalinks after this option has been enabled.', 'give'), |
|
496 | 496 | 'id' => 'disable_forms_archives', |
497 | 497 | 'type' => 'checkbox', |
498 | 498 | ), |
499 | 499 | array( |
500 | - 'name' => __( 'Disable Form Excerpts', 'give' ), |
|
501 | - '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' ), |
|
500 | + 'name' => __('Disable Form Excerpts', 'give'), |
|
501 | + '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'), |
|
502 | 502 | 'id' => 'disable_forms_excerpt', |
503 | 503 | 'type' => 'checkbox', |
504 | 504 | ), |
505 | 505 | array( |
506 | - 'name' => __( 'Featured Image Size', 'give' ), |
|
507 | - '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' ), |
|
506 | + 'name' => __('Featured Image Size', 'give'), |
|
507 | + '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'), |
|
508 | 508 | 'id' => 'featured_image_size', |
509 | 509 | 'type' => 'select', |
510 | 510 | 'default' => 'large', |
511 | 511 | 'options' => give_get_featured_image_sizes(), |
512 | 512 | ), |
513 | 513 | array( |
514 | - 'name' => __( 'Disable Form Featured Image', 'give' ), |
|
515 | - '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' ), |
|
514 | + 'name' => __('Disable Form Featured Image', 'give'), |
|
515 | + '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'), |
|
516 | 516 | 'id' => 'disable_form_featured_img', |
517 | 517 | 'type' => 'checkbox', |
518 | 518 | ), |
519 | 519 | array( |
520 | - 'name' => __( 'Disable Single Form Sidebar', 'give' ), |
|
521 | - 'desc' => __( 'The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ), |
|
520 | + 'name' => __('Disable Single Form Sidebar', 'give'), |
|
521 | + 'desc' => __('The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'), |
|
522 | 522 | 'id' => 'disable_form_sidebar', |
523 | 523 | 'type' => 'checkbox', |
524 | 524 | ), |
525 | 525 | array( |
526 | - 'name' => __( 'Taxonomies', 'give' ), |
|
526 | + 'name' => __('Taxonomies', 'give'), |
|
527 | 527 | 'desc' => '', |
528 | 528 | 'id' => 'give_title_display_settings_3', |
529 | 529 | 'type' => 'give_title', |
530 | 530 | ), |
531 | 531 | array( |
532 | - 'name' => __( 'Enable Form Categories', 'give' ), |
|
533 | - 'desc' => __( 'Enables the "Category" taxonomy for all Give forms.', 'give' ), |
|
532 | + 'name' => __('Enable Form Categories', 'give'), |
|
533 | + 'desc' => __('Enables the "Category" taxonomy for all Give forms.', 'give'), |
|
534 | 534 | 'id' => 'categories', |
535 | 535 | 'type' => 'checkbox', |
536 | 536 | ), |
537 | 537 | array( |
538 | - 'name' => __( 'Enable Form Tags', 'give' ), |
|
539 | - 'desc' => __( 'Enables the "Tag" taxonomy for all Give forms.', 'give' ), |
|
538 | + 'name' => __('Enable Form Tags', 'give'), |
|
539 | + 'desc' => __('Enables the "Tag" taxonomy for all Give forms.', 'give'), |
|
540 | 540 | 'id' => 'tags', |
541 | 541 | 'type' => 'checkbox', |
542 | 542 | ), |
@@ -549,105 +549,105 @@ discard block |
||
549 | 549 | */ |
550 | 550 | 'emails' => array( |
551 | 551 | 'id' => 'email_settings', |
552 | - 'give_title' => __( 'Email Settings', 'give' ), |
|
552 | + 'give_title' => __('Email Settings', 'give'), |
|
553 | 553 | 'show_on' => array( |
554 | 554 | 'key' => 'options-page', |
555 | - 'value' => array( $this->key ), |
|
555 | + 'value' => array($this->key), |
|
556 | 556 | ), |
557 | 557 | 'fields' => apply_filters( |
558 | 558 | 'give_settings_emails', array( |
559 | 559 | array( |
560 | - 'name' => __( 'Email Settings', 'give' ), |
|
560 | + 'name' => __('Email Settings', 'give'), |
|
561 | 561 | 'desc' => '', |
562 | 562 | 'id' => 'give_title_email_settings_1', |
563 | 563 | 'type' => 'give_title', |
564 | 564 | ), |
565 | 565 | array( |
566 | 566 | 'id' => 'email_template', |
567 | - 'name' => __( 'Email Template', 'give' ), |
|
568 | - 'desc' => __( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ), |
|
567 | + 'name' => __('Email Template', 'give'), |
|
568 | + 'desc' => __('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'), |
|
569 | 569 | 'type' => 'select', |
570 | 570 | 'options' => give_get_email_templates(), |
571 | 571 | ), |
572 | 572 | array( |
573 | 573 | 'id' => 'email_logo', |
574 | - 'name' => __( 'Logo', 'give' ), |
|
575 | - 'desc' => __( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ), |
|
574 | + 'name' => __('Logo', 'give'), |
|
575 | + 'desc' => __('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'), |
|
576 | 576 | 'type' => 'file', |
577 | 577 | ), |
578 | 578 | array( |
579 | 579 | 'id' => 'from_name', |
580 | - 'name' => __( 'From Name', 'give' ), |
|
581 | - 'desc' => __( 'The name that appears in the "From" field in donation receipt emails.', 'give' ), |
|
582 | - 'default' => get_bloginfo( 'name' ), |
|
580 | + 'name' => __('From Name', 'give'), |
|
581 | + 'desc' => __('The name that appears in the "From" field in donation receipt emails.', 'give'), |
|
582 | + 'default' => get_bloginfo('name'), |
|
583 | 583 | 'type' => 'text', |
584 | 584 | ), |
585 | 585 | array( |
586 | 586 | 'id' => 'from_email', |
587 | - 'name' => __( 'From Email', 'give' ), |
|
588 | - 'desc' => __( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ), |
|
589 | - 'default' => get_bloginfo( 'admin_email' ), |
|
587 | + 'name' => __('From Email', 'give'), |
|
588 | + 'desc' => __('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'), |
|
589 | + 'default' => get_bloginfo('admin_email'), |
|
590 | 590 | 'type' => 'text', |
591 | 591 | ), |
592 | 592 | array( |
593 | - 'name' => __( 'Donation Receipt', 'give' ), |
|
593 | + 'name' => __('Donation Receipt', 'give'), |
|
594 | 594 | 'desc' => '', |
595 | 595 | 'id' => 'give_title_email_settings_2', |
596 | 596 | 'type' => 'give_title', |
597 | 597 | ), |
598 | 598 | array( |
599 | 599 | 'id' => 'donation_subject', |
600 | - 'name' => __( 'Donation Email Subject', 'give' ), |
|
601 | - 'desc' => __( 'Enter the subject line for the donation receipt email.', 'give' ), |
|
602 | - 'default' => esc_attr__( 'Donation Receipt', 'give' ), |
|
600 | + 'name' => __('Donation Email Subject', 'give'), |
|
601 | + 'desc' => __('Enter the subject line for the donation receipt email.', 'give'), |
|
602 | + 'default' => esc_attr__('Donation Receipt', 'give'), |
|
603 | 603 | 'type' => 'text', |
604 | 604 | ), |
605 | 605 | array( |
606 | 606 | 'id' => 'donation_receipt', |
607 | - 'name' => __( 'Donation Receipt', 'give' ), |
|
607 | + 'name' => __('Donation Receipt', 'give'), |
|
608 | 608 | 'desc' => sprintf( |
609 | 609 | /* translators: %s: emails tags list */ |
610 | - __( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give' ), |
|
611 | - '<br/>' . give_get_emails_tags_list() |
|
610 | + __('Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give'), |
|
611 | + '<br/>'.give_get_emails_tags_list() |
|
612 | 612 | ), |
613 | 613 | 'type' => 'wysiwyg', |
614 | 614 | 'default' => give_get_default_donation_receipt_email(), |
615 | 615 | ), |
616 | 616 | array( |
617 | - 'name' => __( 'New Donation Notification', 'give' ), |
|
617 | + 'name' => __('New Donation Notification', 'give'), |
|
618 | 618 | 'desc' => '', |
619 | 619 | 'id' => 'give_title_email_settings_3', |
620 | 620 | 'type' => 'give_title', |
621 | 621 | ), |
622 | 622 | array( |
623 | 623 | 'id' => 'donation_notification_subject', |
624 | - 'name' => __( 'Donation Notification Subject', 'give' ), |
|
625 | - 'desc' => __( 'Enter the subject line for the donation notification email.', 'give' ), |
|
624 | + 'name' => __('Donation Notification Subject', 'give'), |
|
625 | + 'desc' => __('Enter the subject line for the donation notification email.', 'give'), |
|
626 | 626 | 'type' => 'text', |
627 | - 'default' => esc_attr__( 'New Donation - #{payment_id}', 'give' ), |
|
627 | + 'default' => esc_attr__('New Donation - #{payment_id}', 'give'), |
|
628 | 628 | ), |
629 | 629 | array( |
630 | 630 | 'id' => 'donation_notification', |
631 | - 'name' => __( 'Donation Notification', 'give' ), |
|
631 | + 'name' => __('Donation Notification', 'give'), |
|
632 | 632 | 'desc' => sprintf( |
633 | 633 | /* translators: %s: emails tags list */ |
634 | - __( 'Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give' ), |
|
635 | - '<br/>' . give_get_emails_tags_list() |
|
634 | + __('Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give'), |
|
635 | + '<br/>'.give_get_emails_tags_list() |
|
636 | 636 | ), |
637 | 637 | 'type' => 'wysiwyg', |
638 | 638 | 'default' => give_get_default_donation_notification_email(), |
639 | 639 | ), |
640 | 640 | array( |
641 | 641 | 'id' => 'admin_notice_emails', |
642 | - 'name' => __( 'Donation Notification Emails', 'give' ), |
|
643 | - 'desc' => __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give' ), |
|
642 | + 'name' => __('Donation Notification Emails', 'give'), |
|
643 | + 'desc' => __('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give'), |
|
644 | 644 | 'type' => 'textarea', |
645 | - 'default' => get_bloginfo( 'admin_email' ), |
|
645 | + 'default' => get_bloginfo('admin_email'), |
|
646 | 646 | ), |
647 | 647 | array( |
648 | 648 | 'id' => 'disable_admin_notices', |
649 | - 'name' => __( 'Disable Admin Notifications', 'give' ), |
|
650 | - 'desc' => __( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ), |
|
649 | + 'name' => __('Disable Admin Notifications', 'give'), |
|
650 | + 'desc' => __('Check this box if you do not want to receive emails when new donations are made.', 'give'), |
|
651 | 651 | 'type' => 'checkbox', |
652 | 652 | ), |
653 | 653 | ) |
@@ -656,10 +656,10 @@ discard block |
||
656 | 656 | /** Extension Settings */ |
657 | 657 | 'addons' => array( |
658 | 658 | 'id' => 'addons', |
659 | - 'give_title' => __( 'Give Add-ons Settings', 'give' ), |
|
659 | + 'give_title' => __('Give Add-ons Settings', 'give'), |
|
660 | 660 | 'show_on' => array( |
661 | 661 | 'key' => 'options-page', |
662 | - 'value' => array( $this->key ), |
|
662 | + 'value' => array($this->key), |
|
663 | 663 | ), |
664 | 664 | 'fields' => apply_filters( |
665 | 665 | 'give_settings_addons', array() |
@@ -668,10 +668,10 @@ discard block |
||
668 | 668 | /** Licenses Settings */ |
669 | 669 | 'licenses' => array( |
670 | 670 | 'id' => 'licenses', |
671 | - 'give_title' => __( 'Give Licenses', 'give' ), |
|
671 | + 'give_title' => __('Give Licenses', 'give'), |
|
672 | 672 | 'show_on' => array( |
673 | 673 | 'key' => 'options-page', |
674 | - 'value' => array( $this->key ), |
|
674 | + 'value' => array($this->key), |
|
675 | 675 | ), |
676 | 676 | 'fields' => apply_filters( |
677 | 677 | 'give_settings_licenses', array() |
@@ -680,87 +680,87 @@ discard block |
||
680 | 680 | /** Advanced Options */ |
681 | 681 | 'advanced' => array( |
682 | 682 | 'id' => 'advanced_options', |
683 | - 'give_title' => __( 'Advanced Options', 'give' ), |
|
683 | + 'give_title' => __('Advanced Options', 'give'), |
|
684 | 684 | 'show_on' => array( |
685 | 685 | 'key' => 'options-page', |
686 | - 'value' => array( $this->key ), |
|
686 | + 'value' => array($this->key), |
|
687 | 687 | ), |
688 | 688 | 'fields' => apply_filters( |
689 | 689 | 'give_settings_advanced', array( |
690 | 690 | array( |
691 | - 'name' => __( 'Access Control', 'give' ), |
|
691 | + 'name' => __('Access Control', 'give'), |
|
692 | 692 | 'desc' => '', |
693 | 693 | 'id' => 'give_title_session_control_1', |
694 | 694 | 'type' => 'give_title', |
695 | 695 | ), |
696 | 696 | array( |
697 | 697 | 'id' => 'session_lifetime', |
698 | - 'name' => __( 'Session Lifetime', 'give' ), |
|
699 | - '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' ), |
|
698 | + 'name' => __('Session Lifetime', 'give'), |
|
699 | + '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'), |
|
700 | 700 | 'type' => 'select', |
701 | 701 | 'options' => array( |
702 | - '86400' => __( '24 Hours', 'give' ), |
|
703 | - '172800' => __( '48 Hours', 'give' ), |
|
704 | - '259200' => __( '72 Hours', 'give' ), |
|
705 | - '604800' => __( '1 Week', 'give' ), |
|
702 | + '86400' => __('24 Hours', 'give'), |
|
703 | + '172800' => __('48 Hours', 'give'), |
|
704 | + '259200' => __('72 Hours', 'give'), |
|
705 | + '604800' => __('1 Week', 'give'), |
|
706 | 706 | ), |
707 | 707 | ), |
708 | 708 | array( |
709 | - 'name' => __( 'Email Access', 'give' ), |
|
710 | - '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' ), |
|
709 | + 'name' => __('Email Access', 'give'), |
|
710 | + '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'), |
|
711 | 711 | 'id' => 'email_access', |
712 | 712 | 'type' => 'checkbox', |
713 | 713 | ), |
714 | 714 | array( |
715 | 715 | 'id' => 'recaptcha_key', |
716 | - 'name' => __( 'reCAPTCHA Site Key', 'give' ), |
|
716 | + 'name' => __('reCAPTCHA Site Key', 'give'), |
|
717 | 717 | /* translators: %s: https://www.google.com/recaptcha/ */ |
718 | - '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. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'https://www.google.com/recaptcha/' ) ), |
|
718 | + '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. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('https://www.google.com/recaptcha/')), |
|
719 | 719 | 'default' => '', |
720 | 720 | 'type' => 'text', |
721 | 721 | ), |
722 | 722 | array( |
723 | 723 | 'id' => 'recaptcha_secret', |
724 | - 'name' => __( 'reCAPTCHA Secret Key', 'give' ), |
|
725 | - 'desc' => __( 'Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give' ), |
|
724 | + 'name' => __('reCAPTCHA Secret Key', 'give'), |
|
725 | + 'desc' => __('Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give'), |
|
726 | 726 | 'default' => '', |
727 | 727 | 'type' => 'text', |
728 | 728 | ), |
729 | 729 | array( |
730 | - 'name' => __( 'Data Control', 'give' ), |
|
730 | + 'name' => __('Data Control', 'give'), |
|
731 | 731 | 'desc' => '', |
732 | 732 | 'id' => 'give_title_data_control_2', |
733 | 733 | 'type' => 'give_title', |
734 | 734 | ), |
735 | 735 | array( |
736 | - 'name' => __( 'Remove All Data on Uninstall?', 'give' ), |
|
737 | - 'desc' => __( 'When the plugin is deleted, completely remove all Give data.', 'give' ), |
|
736 | + 'name' => __('Remove All Data on Uninstall?', 'give'), |
|
737 | + 'desc' => __('When the plugin is deleted, completely remove all Give data.', 'give'), |
|
738 | 738 | 'id' => 'uninstall_on_delete', |
739 | 739 | 'type' => 'checkbox', |
740 | 740 | ), |
741 | 741 | array( |
742 | - 'name' => __( 'Filter Control', 'give' ), |
|
742 | + 'name' => __('Filter Control', 'give'), |
|
743 | 743 | 'desc' => '', |
744 | 744 | 'id' => 'give_title_filter_control', |
745 | 745 | 'type' => 'give_title', |
746 | 746 | ), |
747 | 747 | array( |
748 | 748 | /* translators: %s: the_content */ |
749 | - 'name' => sprintf( __( 'Disable %s filter', 'give' ), '<code>the_content</code>' ), |
|
749 | + 'name' => sprintf(__('Disable %s filter', 'give'), '<code>the_content</code>'), |
|
750 | 750 | /* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */ |
751 | - '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>' ), |
|
751 | + '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>'), |
|
752 | 752 | 'id' => 'disable_the_content_filter', |
753 | 753 | 'type' => 'checkbox', |
754 | 754 | ), |
755 | 755 | array( |
756 | - 'name' => __( 'Script Loading', 'give' ), |
|
756 | + 'name' => __('Script Loading', 'give'), |
|
757 | 757 | 'desc' => '', |
758 | 758 | 'id' => 'give_title_script_control', |
759 | 759 | 'type' => 'give_title', |
760 | 760 | ), |
761 | 761 | array( |
762 | - 'name' => __( 'Load Scripts in Footer?', 'give' ), |
|
763 | - 'desc' => __( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ), |
|
762 | + 'name' => __('Load Scripts in Footer?', 'give'), |
|
763 | + 'desc' => __('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'), |
|
764 | 764 | 'id' => 'scripts_footer', |
765 | 765 | 'type' => 'checkbox', |
766 | 766 | ), |
@@ -770,17 +770,17 @@ discard block |
||
770 | 770 | /** API Settings */ |
771 | 771 | 'api' => array( |
772 | 772 | 'id' => 'api', |
773 | - 'give_title' => __( 'API', 'give' ), |
|
773 | + 'give_title' => __('API', 'give'), |
|
774 | 774 | 'show_on' => array( |
775 | 775 | 'key' => 'options-page', |
776 | - 'value' => array( $this->key ), |
|
776 | + 'value' => array($this->key), |
|
777 | 777 | ), |
778 | 778 | 'show_names' => false, // Hide field names on the left |
779 | 779 | 'fields' => apply_filters( |
780 | 780 | 'give_settings_system', array( |
781 | 781 | array( |
782 | 782 | 'id' => 'api', |
783 | - 'name' => __( 'API', 'give' ), |
|
783 | + 'name' => __('API', 'give'), |
|
784 | 784 | 'type' => 'api', |
785 | 785 | ), |
786 | 786 | ) |
@@ -789,17 +789,17 @@ discard block |
||
789 | 789 | /** Licenses Settings */ |
790 | 790 | 'system_info' => array( |
791 | 791 | 'id' => 'system_info', |
792 | - 'give_title' => __( 'System Info', 'give' ), |
|
792 | + 'give_title' => __('System Info', 'give'), |
|
793 | 793 | 'show_on' => array( |
794 | 794 | 'key' => 'options-page', |
795 | - 'value' => array( $this->key ), |
|
795 | + 'value' => array($this->key), |
|
796 | 796 | ), |
797 | 797 | 'fields' => apply_filters( |
798 | 798 | 'give_settings_system', array( |
799 | 799 | array( |
800 | 800 | 'id' => 'system-info-textarea', |
801 | - 'name' => __( 'System Info', 'give' ), |
|
802 | - 'desc' => __( 'Please copy and paste this information in your ticket when contacting support.', 'give' ), |
|
801 | + 'name' => __('System Info', 'give'), |
|
802 | + 'desc' => __('Please copy and paste this information in your ticket when contacting support.', 'give'), |
|
803 | 803 | 'type' => 'system_info', |
804 | 804 | ), |
805 | 805 | ) |
@@ -807,15 +807,15 @@ discard block |
||
807 | 807 | ), |
808 | 808 | ); |
809 | 809 | |
810 | - $give_settings = apply_filters( 'give_registered_settings', $give_settings ); |
|
810 | + $give_settings = apply_filters('give_registered_settings', $give_settings); |
|
811 | 811 | |
812 | 812 | // Return all settings array if no active tab |
813 | - if ( empty( $active_tab ) || ! isset( $give_settings[ $active_tab ] ) ) { |
|
813 | + if (empty($active_tab) || ! isset($give_settings[$active_tab])) { |
|
814 | 814 | return $give_settings; |
815 | 815 | } |
816 | 816 | |
817 | 817 | // Add other tabs and settings fields as needed |
818 | - return $give_settings[ $active_tab ]; |
|
818 | + return $give_settings[$active_tab]; |
|
819 | 819 | |
820 | 820 | } |
821 | 821 | |
@@ -824,11 +824,11 @@ discard block |
||
824 | 824 | */ |
825 | 825 | public function settings_notices() { |
826 | 826 | |
827 | - if ( ! isset( $_POST['give_settings_saved'] ) ) { |
|
827 | + if ( ! isset($_POST['give_settings_saved'])) { |
|
828 | 828 | return; |
829 | 829 | } |
830 | 830 | |
831 | - add_settings_error( 'give-notices', 'global-settings-updated', __( 'Settings updated.', 'give' ), 'updated' ); |
|
831 | + add_settings_error('give-notices', 'global-settings-updated', __('Settings updated.', 'give'), 'updated'); |
|
832 | 832 | |
833 | 833 | } |
834 | 834 | |
@@ -843,14 +843,14 @@ discard block |
||
843 | 843 | * @return mixed Field value or exception is thrown. |
844 | 844 | * @throws Exception Throws an exception if the field is invalid. |
845 | 845 | */ |
846 | - public function __get( $field ) { |
|
846 | + public function __get($field) { |
|
847 | 847 | |
848 | 848 | // Allowed fields to retrieve |
849 | - if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) { |
|
849 | + if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) { |
|
850 | 850 | return $this->{$field}; |
851 | 851 | } |
852 | 852 | |
853 | - throw new Exception( sprintf( __( 'Invalid property: %s', 'give' ), $field ) ); |
|
853 | + throw new Exception(sprintf(__('Invalid property: %s', 'give'), $field)); |
|
854 | 854 | } |
855 | 855 | |
856 | 856 | |
@@ -869,12 +869,12 @@ discard block |
||
869 | 869 | * |
870 | 870 | * @return mixed Option value |
871 | 871 | */ |
872 | -function give_get_option( $key = '', $default = false ) { |
|
872 | +function give_get_option($key = '', $default = false) { |
|
873 | 873 | $give_options = give_get_settings(); |
874 | - $value = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default; |
|
875 | - $value = apply_filters( 'give_get_option', $value, $key, $default ); |
|
874 | + $value = ! empty($give_options[$key]) ? $give_options[$key] : $default; |
|
875 | + $value = apply_filters('give_get_option', $value, $key, $default); |
|
876 | 876 | |
877 | - return apply_filters( "give_get_option_{$key}", $value, $key, $default ); |
|
877 | + return apply_filters("give_get_option_{$key}", $value, $key, $default); |
|
878 | 878 | } |
879 | 879 | |
880 | 880 | |
@@ -892,33 +892,33 @@ discard block |
||
892 | 892 | * |
893 | 893 | * @return boolean True if updated, false if not. |
894 | 894 | */ |
895 | -function give_update_option( $key = '', $value = false ) { |
|
895 | +function give_update_option($key = '', $value = false) { |
|
896 | 896 | |
897 | 897 | // If no key, exit |
898 | - if ( empty( $key ) ) { |
|
898 | + if (empty($key)) { |
|
899 | 899 | return false; |
900 | 900 | } |
901 | 901 | |
902 | - if ( empty( $value ) ) { |
|
903 | - $remove_option = give_delete_option( $key ); |
|
902 | + if (empty($value)) { |
|
903 | + $remove_option = give_delete_option($key); |
|
904 | 904 | |
905 | 905 | return $remove_option; |
906 | 906 | } |
907 | 907 | |
908 | 908 | // First let's grab the current settings |
909 | - $options = get_option( 'give_settings' ); |
|
909 | + $options = get_option('give_settings'); |
|
910 | 910 | |
911 | 911 | // Let's let devs alter that value coming in |
912 | - $value = apply_filters( 'give_update_option', $value, $key ); |
|
912 | + $value = apply_filters('give_update_option', $value, $key); |
|
913 | 913 | |
914 | 914 | // Next let's try to update the value |
915 | - $options[ $key ] = $value; |
|
916 | - $did_update = update_option( 'give_settings', $options, false ); |
|
915 | + $options[$key] = $value; |
|
916 | + $did_update = update_option('give_settings', $options, false); |
|
917 | 917 | |
918 | 918 | // If it updated, let's update the global variable |
919 | - if ( $did_update ) { |
|
919 | + if ($did_update) { |
|
920 | 920 | global $give_options; |
921 | - $give_options[ $key ] = $value; |
|
921 | + $give_options[$key] = $value; |
|
922 | 922 | } |
923 | 923 | |
924 | 924 | return $did_update; |
@@ -937,25 +937,25 @@ discard block |
||
937 | 937 | * |
938 | 938 | * @return boolean True if updated, false if not. |
939 | 939 | */ |
940 | -function give_delete_option( $key = '' ) { |
|
940 | +function give_delete_option($key = '') { |
|
941 | 941 | |
942 | 942 | // If no key, exit |
943 | - if ( empty( $key ) ) { |
|
943 | + if (empty($key)) { |
|
944 | 944 | return false; |
945 | 945 | } |
946 | 946 | |
947 | 947 | // First let's grab the current settings |
948 | - $options = get_option( 'give_settings' ); |
|
948 | + $options = get_option('give_settings'); |
|
949 | 949 | |
950 | 950 | // Next let's try to update the value |
951 | - if ( isset( $options[ $key ] ) ) { |
|
952 | - unset( $options[ $key ] ); |
|
951 | + if (isset($options[$key])) { |
|
952 | + unset($options[$key]); |
|
953 | 953 | } |
954 | 954 | |
955 | - $did_update = update_option( 'give_settings', $options, false ); |
|
955 | + $did_update = update_option('give_settings', $options, false); |
|
956 | 956 | |
957 | 957 | // If it updated, let's update the global variable |
958 | - if ( $did_update ) { |
|
958 | + if ($did_update) { |
|
959 | 959 | global $give_options; |
960 | 960 | $give_options = $options; |
961 | 961 | } |
@@ -974,9 +974,9 @@ discard block |
||
974 | 974 | */ |
975 | 975 | function give_get_settings() { |
976 | 976 | |
977 | - $settings = get_option( 'give_settings' ); |
|
977 | + $settings = get_option('give_settings'); |
|
978 | 978 | |
979 | - return (array) apply_filters( 'give_get_settings', $settings ); |
|
979 | + return (array) apply_filters('give_get_settings', $settings); |
|
980 | 980 | |
981 | 981 | } |
982 | 982 | |
@@ -994,25 +994,25 @@ discard block |
||
994 | 994 | * |
995 | 995 | * @return array |
996 | 996 | */ |
997 | -function give_settings_array_insert( $array, $position, $insert ) { |
|
998 | - if ( is_int( $position ) ) { |
|
999 | - array_splice( $array, $position, 0, $insert ); |
|
997 | +function give_settings_array_insert($array, $position, $insert) { |
|
998 | + if (is_int($position)) { |
|
999 | + array_splice($array, $position, 0, $insert); |
|
1000 | 1000 | } else { |
1001 | 1001 | |
1002 | - foreach ( $array as $index => $subarray ) { |
|
1003 | - if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) { |
|
1002 | + foreach ($array as $index => $subarray) { |
|
1003 | + if (isset($subarray['id']) && $subarray['id'] == $position) { |
|
1004 | 1004 | $pos = $index; |
1005 | 1005 | } |
1006 | 1006 | } |
1007 | 1007 | |
1008 | - if ( ! isset( $pos ) ) { |
|
1008 | + if ( ! isset($pos)) { |
|
1009 | 1009 | return $array; |
1010 | 1010 | } |
1011 | 1011 | |
1012 | 1012 | $array = array_merge( |
1013 | - array_slice( $array, 0, $pos ), |
|
1013 | + array_slice($array, 0, $pos), |
|
1014 | 1014 | $insert, |
1015 | - array_slice( $array, $pos ) |
|
1015 | + array_slice($array, $pos) |
|
1016 | 1016 | ); |
1017 | 1017 | } |
1018 | 1018 | |
@@ -1032,23 +1032,23 @@ discard block |
||
1032 | 1032 | * |
1033 | 1033 | * @return void |
1034 | 1034 | */ |
1035 | -function give_enabled_gateways_callback( $field_arr, $saved_values = array() ) { |
|
1036 | - $saved_values = __give_validate_active_gateways( $saved_values ); |
|
1035 | +function give_enabled_gateways_callback($field_arr, $saved_values = array()) { |
|
1036 | + $saved_values = __give_validate_active_gateways($saved_values); |
|
1037 | 1037 | $id = $field_arr['id']; |
1038 | - $gateways = give_get_ordered_payment_gateways( give_get_payment_gateways() ); |
|
1038 | + $gateways = give_get_ordered_payment_gateways(give_get_payment_gateways()); |
|
1039 | 1039 | |
1040 | 1040 | echo '<ul class="give-checklist-fields give-payment-gatways-list">'; |
1041 | 1041 | |
1042 | - foreach ( $gateways as $key => $option ) : |
|
1042 | + foreach ($gateways as $key => $option) : |
|
1043 | 1043 | |
1044 | - if ( is_array( $saved_values ) && array_key_exists( $key, $saved_values ) ) { |
|
1044 | + if (is_array($saved_values) && array_key_exists($key, $saved_values)) { |
|
1045 | 1045 | $enabled = '1'; |
1046 | 1046 | } else { |
1047 | 1047 | $enabled = null; |
1048 | 1048 | } |
1049 | 1049 | |
1050 | - echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="' . $id . '[' . $key . ']" id="' . $id . '[' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/> '; |
|
1051 | - echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>'; |
|
1050 | + echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="'.$id.'['.$key.']" id="'.$id.'['.$key.']" type="checkbox" value="1" '.checked('1', $enabled, false).'/> '; |
|
1051 | + echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>'; |
|
1052 | 1052 | |
1053 | 1053 | endforeach; |
1054 | 1054 | |
@@ -1067,16 +1067,16 @@ discard block |
||
1067 | 1067 | * |
1068 | 1068 | * @return void |
1069 | 1069 | */ |
1070 | -function give_default_gateway_callback( $field_arr, $saved_value ) { |
|
1070 | +function give_default_gateway_callback($field_arr, $saved_value) { |
|
1071 | 1071 | $id = $field_arr['id']; |
1072 | 1072 | $gateways = give_get_enabled_payment_gateways(); |
1073 | - $saved_value = give_get_default_gateway( null ); |
|
1073 | + $saved_value = give_get_default_gateway(null); |
|
1074 | 1074 | |
1075 | - echo '<select class="give-select" name="' . $id . '" id="' . $id . '">'; |
|
1075 | + echo '<select class="give-select" name="'.$id.'" id="'.$id.'">'; |
|
1076 | 1076 | |
1077 | - foreach ( $gateways as $key => $option ) : |
|
1078 | - $selected = isset( $saved_value ) ? selected( $key, $saved_value, false ) : ''; |
|
1079 | - echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>'; |
|
1077 | + foreach ($gateways as $key => $option) : |
|
1078 | + $selected = isset($saved_value) ? selected($key, $saved_value, false) : ''; |
|
1079 | + echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>'; |
|
1080 | 1080 | endforeach; |
1081 | 1081 | |
1082 | 1082 | echo '</select>'; |
@@ -1094,13 +1094,13 @@ discard block |
||
1094 | 1094 | * |
1095 | 1095 | * @return void |
1096 | 1096 | */ |
1097 | -function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
1097 | +function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) { |
|
1098 | 1098 | |
1099 | 1099 | $id = $field_type_object->field->args['id']; |
1100 | 1100 | $title = $field_type_object->field->args['name']; |
1101 | 1101 | $field_description = $field_type_object->field->args['desc']; |
1102 | 1102 | |
1103 | - echo '<hr>' . $field_description; |
|
1103 | + echo '<hr>'.$field_description; |
|
1104 | 1104 | |
1105 | 1105 | } |
1106 | 1106 | |
@@ -1115,7 +1115,7 @@ discard block |
||
1115 | 1115 | * |
1116 | 1116 | * @return void |
1117 | 1117 | */ |
1118 | -function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
1118 | +function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) { |
|
1119 | 1119 | |
1120 | 1120 | $id = $field_type_object->field->args['id']; |
1121 | 1121 | $title = $field_type_object->field->args['name']; |
@@ -1134,11 +1134,11 @@ discard block |
||
1134 | 1134 | * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types |
1135 | 1135 | * @return array An array of options that matches the CMB2 options array |
1136 | 1136 | */ |
1137 | -function give_cmb2_get_post_options( $query_args, $force = false ) { |
|
1137 | +function give_cmb2_get_post_options($query_args, $force = false) { |
|
1138 | 1138 | |
1139 | - $post_options = array( '' => '' ); // Blank option |
|
1139 | + $post_options = array('' => ''); // Blank option |
|
1140 | 1140 | |
1141 | - if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) { |
|
1141 | + if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) { |
|
1142 | 1142 | return $post_options; |
1143 | 1143 | } |
1144 | 1144 | |
@@ -1149,12 +1149,12 @@ discard block |
||
1149 | 1149 | ) |
1150 | 1150 | ); |
1151 | 1151 | |
1152 | - $posts = get_posts( $args ); |
|
1152 | + $posts = get_posts($args); |
|
1153 | 1153 | |
1154 | - if ( $posts ) { |
|
1155 | - foreach ( $posts as $post ) { |
|
1154 | + if ($posts) { |
|
1155 | + foreach ($posts as $post) { |
|
1156 | 1156 | |
1157 | - $post_options[ $post->ID ] = $post->post_title; |
|
1157 | + $post_options[$post->ID] = $post->post_title; |
|
1158 | 1158 | |
1159 | 1159 | } |
1160 | 1160 | } |
@@ -1179,32 +1179,32 @@ discard block |
||
1179 | 1179 | |
1180 | 1180 | $sizes = array(); |
1181 | 1181 | $get_sizes = get_intermediate_image_sizes(); |
1182 | - $core_image_sizes = array( 'thumbnail', 'medium', 'medium_large', 'large' ); |
|
1182 | + $core_image_sizes = array('thumbnail', 'medium', 'medium_large', 'large'); |
|
1183 | 1183 | |
1184 | 1184 | // This will help us to filter special characters from a string |
1185 | - $filter_slug_items = array( '_', '-' ); |
|
1185 | + $filter_slug_items = array('_', '-'); |
|
1186 | 1186 | |
1187 | - foreach ( $get_sizes as $_size ) { |
|
1187 | + foreach ($get_sizes as $_size) { |
|
1188 | 1188 | |
1189 | 1189 | // Converting image size slug to title case |
1190 | - $sizes[ $_size ] = give_slug_to_title( $_size, $filter_slug_items ); |
|
1190 | + $sizes[$_size] = give_slug_to_title($_size, $filter_slug_items); |
|
1191 | 1191 | |
1192 | - if ( in_array( $_size, $core_image_sizes ) ) { |
|
1193 | - $sizes[ $_size ] .= ' (' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" ); |
|
1194 | - } elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) { |
|
1195 | - $sizes[ $_size ] .= " ({$_wp_additional_image_sizes[ $_size ]['width']} x {$_wp_additional_image_sizes[ $_size ]['height']}"; |
|
1192 | + if (in_array($_size, $core_image_sizes)) { |
|
1193 | + $sizes[$_size] .= ' ('.get_option("{$_size}_size_w").'x'.get_option("{$_size}_size_h"); |
|
1194 | + } elseif (isset($_wp_additional_image_sizes[$_size])) { |
|
1195 | + $sizes[$_size] .= " ({$_wp_additional_image_sizes[$_size]['width']} x {$_wp_additional_image_sizes[$_size]['height']}"; |
|
1196 | 1196 | } |
1197 | 1197 | |
1198 | 1198 | // Based on the above image height check, label the respective resolution as responsive |
1199 | - if ( ( array_key_exists( $_size, $_wp_additional_image_sizes ) && ! $_wp_additional_image_sizes[ $_size ]['crop'] ) || ( in_array( $_size, $core_image_sizes ) && ! get_option( "{$_size}_crop" ) ) ) { |
|
1200 | - $sizes[ $_size ] .= ' - responsive'; |
|
1199 | + if ((array_key_exists($_size, $_wp_additional_image_sizes) && ! $_wp_additional_image_sizes[$_size]['crop']) || (in_array($_size, $core_image_sizes) && ! get_option("{$_size}_crop"))) { |
|
1200 | + $sizes[$_size] .= ' - responsive'; |
|
1201 | 1201 | } |
1202 | 1202 | |
1203 | - $sizes[ $_size ] .= ')'; |
|
1203 | + $sizes[$_size] .= ')'; |
|
1204 | 1204 | |
1205 | 1205 | } |
1206 | 1206 | |
1207 | - return apply_filters( 'give_get_featured_image_sizes', $sizes ); |
|
1207 | + return apply_filters('give_get_featured_image_sizes', $sizes); |
|
1208 | 1208 | } |
1209 | 1209 | |
1210 | 1210 | |
@@ -1220,14 +1220,14 @@ discard block |
||
1220 | 1220 | * |
1221 | 1221 | * @return text $string |
1222 | 1222 | */ |
1223 | -function give_slug_to_title( $string, $filters = array() ) { |
|
1223 | +function give_slug_to_title($string, $filters = array()) { |
|
1224 | 1224 | |
1225 | - foreach ( $filters as $filter_item ) { |
|
1226 | - $string = str_replace( $filter_item, ' ', $string ); |
|
1225 | + foreach ($filters as $filter_item) { |
|
1226 | + $string = str_replace($filter_item, ' ', $string); |
|
1227 | 1227 | } |
1228 | 1228 | |
1229 | 1229 | // Return updated string after converting it to title case |
1230 | - return ucwords( $string ); |
|
1230 | + return ucwords($string); |
|
1231 | 1231 | |
1232 | 1232 | } |
1233 | 1233 | |
@@ -1243,18 +1243,18 @@ discard block |
||
1243 | 1243 | * |
1244 | 1244 | * @return void |
1245 | 1245 | */ |
1246 | -function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
1246 | +function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) { |
|
1247 | 1247 | /* @var CMB2_Types $field_type_object */ |
1248 | 1248 | |
1249 | 1249 | $id = $field_type_object->field->args['id']; |
1250 | 1250 | $field_description = $field_type_object->field->args['desc']; |
1251 | 1251 | $license = $field_type_object->field->args['options']['license']; |
1252 | 1252 | $license_key = $escaped_value; |
1253 | - $is_license_key = apply_filters( 'give_is_license_key', ( is_object( $license ) && ! empty( $license ) ) ); |
|
1254 | - $is_valid_license = apply_filters( 'give_is_valid_license', ( $is_license_key && property_exists( $license, 'license' ) && 'valid' === $license->license ) ); |
|
1253 | + $is_license_key = apply_filters('give_is_license_key', (is_object($license) && ! empty($license))); |
|
1254 | + $is_valid_license = apply_filters('give_is_valid_license', ($is_license_key && property_exists($license, 'license') && 'valid' === $license->license)); |
|
1255 | 1255 | $shortname = $field_type_object->field->args['options']['shortname']; |
1256 | 1256 | $field_classes = 'regular-text give-license-field'; |
1257 | - $type = empty( $escaped_value ) || ! $is_valid_license ? 'text' : 'password'; |
|
1257 | + $type = empty($escaped_value) || ! $is_valid_license ? 'text' : 'password'; |
|
1258 | 1258 | $custom_html = ''; |
1259 | 1259 | $messages = array(); |
1260 | 1260 | $class = ''; |
@@ -1266,83 +1266,83 @@ discard block |
||
1266 | 1266 | |
1267 | 1267 | // By default query on edd api url will return license object which contain status and message property, this can break below functionality. |
1268 | 1268 | // To combat that check if status is set to error or not, if yes then set $is_license_key to false. |
1269 | - if ( $is_license_key && property_exists( $license, 'status' ) && 'error' === $license->status ) { |
|
1269 | + if ($is_license_key && property_exists($license, 'status') && 'error' === $license->status) { |
|
1270 | 1270 | $is_license_key = false; |
1271 | 1271 | } |
1272 | 1272 | |
1273 | 1273 | // Check if current license is part of subscription or not. |
1274 | - $subscriptions = get_option( 'give_subscriptions' ); |
|
1274 | + $subscriptions = get_option('give_subscriptions'); |
|
1275 | 1275 | |
1276 | - if ( $is_license_key && $subscriptions ) { |
|
1277 | - foreach ( $subscriptions as $subscription ) { |
|
1278 | - if ( in_array( $license_key, $subscription['licenses'] ) ) { |
|
1276 | + if ($is_license_key && $subscriptions) { |
|
1277 | + foreach ($subscriptions as $subscription) { |
|
1278 | + if (in_array($license_key, $subscription['licenses'])) { |
|
1279 | 1279 | $is_in_subscription = $subscription['id']; |
1280 | 1280 | break; |
1281 | 1281 | } |
1282 | 1282 | } |
1283 | 1283 | } |
1284 | 1284 | |
1285 | - if ( $is_license_key ) { |
|
1285 | + if ($is_license_key) { |
|
1286 | 1286 | |
1287 | - if ( empty( $license->success ) && property_exists( $license, 'error' ) ) { |
|
1287 | + if (empty($license->success) && property_exists($license, 'error')) { |
|
1288 | 1288 | |
1289 | 1289 | // activate_license 'invalid' on anything other than valid, so if there was an error capture it |
1290 | - switch ( $license->error ) { |
|
1290 | + switch ($license->error) { |
|
1291 | 1291 | case 'expired': |
1292 | 1292 | $class = $license->error; |
1293 | 1293 | $messages[] = sprintf( |
1294 | - __( 'Your license key expired on %1$s. Please <a href="%2$s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give' ), |
|
1295 | - date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ), |
|
1296 | - $checkout_page_link . '?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired' |
|
1294 | + __('Your license key expired on %1$s. Please <a href="%2$s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give'), |
|
1295 | + date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))), |
|
1296 | + $checkout_page_link.'?edd_license_key='.$license_key.'&utm_campaign=admin&utm_source=licenses&utm_medium=expired' |
|
1297 | 1297 | ); |
1298 | - $license_status = 'license-' . $class; |
|
1298 | + $license_status = 'license-'.$class; |
|
1299 | 1299 | break; |
1300 | 1300 | |
1301 | 1301 | case 'missing': |
1302 | 1302 | $class = $license->error; |
1303 | 1303 | $messages[] = sprintf( |
1304 | - __( 'Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give' ), |
|
1305 | - $account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=missing' |
|
1304 | + __('Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give'), |
|
1305 | + $account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=missing' |
|
1306 | 1306 | ); |
1307 | - $license_status = 'license-' . $class; |
|
1307 | + $license_status = 'license-'.$class; |
|
1308 | 1308 | break; |
1309 | 1309 | |
1310 | 1310 | case 'invalid': |
1311 | 1311 | $class = $license->error; |
1312 | 1312 | $messages[] = sprintf( |
1313 | - __( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ), |
|
1313 | + __('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'), |
|
1314 | 1314 | $addon_name, |
1315 | - $account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid' |
|
1315 | + $account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid' |
|
1316 | 1316 | ); |
1317 | - $license_status = 'license-' . $class; |
|
1317 | + $license_status = 'license-'.$class; |
|
1318 | 1318 | break; |
1319 | 1319 | |
1320 | 1320 | case 'site_inactive': |
1321 | 1321 | $class = $license->error; |
1322 | 1322 | $messages[] = sprintf( |
1323 | - __( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ), |
|
1323 | + __('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'), |
|
1324 | 1324 | $addon_name, |
1325 | - $account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid' |
|
1325 | + $account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid' |
|
1326 | 1326 | ); |
1327 | - $license_status = 'license-' . $class; |
|
1327 | + $license_status = 'license-'.$class; |
|
1328 | 1328 | break; |
1329 | 1329 | |
1330 | 1330 | case 'item_name_mismatch': |
1331 | 1331 | $class = $license->error; |
1332 | - $messages[] = sprintf( __( 'This license %1$s does not belong to %2$s.', 'give' ), $license_key, $addon_name ); |
|
1333 | - $license_status = 'license-' . $class; |
|
1332 | + $messages[] = sprintf(__('This license %1$s does not belong to %2$s.', 'give'), $license_key, $addon_name); |
|
1333 | + $license_status = 'license-'.$class; |
|
1334 | 1334 | break; |
1335 | 1335 | |
1336 | 1336 | case 'no_activations_left': |
1337 | 1337 | $class = $license->error; |
1338 | - $messages[] = sprintf( __( 'Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give' ), $account_page_link ); |
|
1339 | - $license_status = 'license-' . $class; |
|
1338 | + $messages[] = sprintf(__('Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give'), $account_page_link); |
|
1339 | + $license_status = 'license-'.$class; |
|
1340 | 1340 | break; |
1341 | 1341 | |
1342 | 1342 | default: |
1343 | 1343 | $class = $license->error; |
1344 | 1344 | $messages[] = sprintf( |
1345 | - __( 'Your license is not activated. Please <a href="%3$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs. %2$sError Code: %1$s.', 'give' ), |
|
1345 | + __('Your license is not activated. Please <a href="%3$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs. %2$sError Code: %1$s.', 'give'), |
|
1346 | 1346 | $license->error, |
1347 | 1347 | '<br/>', |
1348 | 1348 | "{$account_page_link}?utm_campaign=admin&utm_source=licenses&utm_medium={$license->error}" |
@@ -1350,73 +1350,73 @@ discard block |
||
1350 | 1350 | $license_status = 'license-error'; |
1351 | 1351 | break; |
1352 | 1352 | } |
1353 | - } elseif ( $is_in_subscription ) { |
|
1353 | + } elseif ($is_in_subscription) { |
|
1354 | 1354 | |
1355 | - $subscription_expires = strtotime( $subscriptions[ $is_in_subscription ]['expires'] ); |
|
1356 | - $subscription_status = __( 'renew', 'give' ); |
|
1355 | + $subscription_expires = strtotime($subscriptions[$is_in_subscription]['expires']); |
|
1356 | + $subscription_status = __('renew', 'give'); |
|
1357 | 1357 | |
1358 | - if ( ( 'active' !== $subscriptions[ $is_in_subscription ]['status'] ) ) { |
|
1359 | - $subscription_status = __( 'expire', 'give' ); |
|
1358 | + if (('active' !== $subscriptions[$is_in_subscription]['status'])) { |
|
1359 | + $subscription_status = __('expire', 'give'); |
|
1360 | 1360 | } |
1361 | 1361 | |
1362 | - if ( $subscription_expires < current_time( 'timestamp', 1 ) ) { |
|
1363 | - $messages[] = sprintf( |
|
1364 | - __( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%3$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give' ), |
|
1365 | - urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ), |
|
1366 | - $subscriptions[ $is_in_subscription ]['payment_id'], |
|
1367 | - $checkout_page_link . '?edd_license_key=' . $subscriptions[ $is_in_subscription ]['license_key'] . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired' |
|
1362 | + if ($subscription_expires < current_time('timestamp', 1)) { |
|
1363 | + $messages[] = sprintf( |
|
1364 | + __('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%3$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give'), |
|
1365 | + urldecode($subscriptions[$is_in_subscription]['invoice_url']), |
|
1366 | + $subscriptions[$is_in_subscription]['payment_id'], |
|
1367 | + $checkout_page_link.'?edd_license_key='.$subscriptions[$is_in_subscription]['license_key'].'&utm_campaign=admin&utm_source=licenses&utm_medium=expired' |
|
1368 | 1368 | ); |
1369 | 1369 | $license_status = 'license-expired'; |
1370 | - } elseif ( strtotime( '- 7 days', $subscription_expires ) < current_time( 'timestamp', 1 ) ) { |
|
1370 | + } elseif (strtotime('- 7 days', $subscription_expires) < current_time('timestamp', 1)) { |
|
1371 | 1371 | $messages[] = sprintf( |
1372 | - __( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s in %4$s.', 'give' ), |
|
1373 | - urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ), |
|
1374 | - $subscriptions[ $is_in_subscription ]['payment_id'], |
|
1372 | + __('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s in %4$s.', 'give'), |
|
1373 | + urldecode($subscriptions[$is_in_subscription]['invoice_url']), |
|
1374 | + $subscriptions[$is_in_subscription]['payment_id'], |
|
1375 | 1375 | $subscription_status, |
1376 | - human_time_diff( current_time( 'timestamp', 1 ), strtotime( $subscriptions[ $is_in_subscription ]['expires'] ) ) |
|
1376 | + human_time_diff(current_time('timestamp', 1), strtotime($subscriptions[$is_in_subscription]['expires'])) |
|
1377 | 1377 | ); |
1378 | 1378 | $license_status = 'license-expires-soon'; |
1379 | 1379 | } else { |
1380 | 1380 | $messages[] = sprintf( |
1381 | - __( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s on %4$s.', 'give' ), |
|
1382 | - urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ), |
|
1383 | - $subscriptions[ $is_in_subscription ]['payment_id'], |
|
1381 | + __('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s on %4$s.', 'give'), |
|
1382 | + urldecode($subscriptions[$is_in_subscription]['invoice_url']), |
|
1383 | + $subscriptions[$is_in_subscription]['payment_id'], |
|
1384 | 1384 | $subscription_status, |
1385 | - date_i18n( get_option( 'date_format' ), strtotime( $subscriptions[ $is_in_subscription ]['expires'], current_time( 'timestamp' ) ) ) |
|
1385 | + date_i18n(get_option('date_format'), strtotime($subscriptions[$is_in_subscription]['expires'], current_time('timestamp'))) |
|
1386 | 1386 | ); |
1387 | 1387 | $license_status = 'license-expiration-date'; |
1388 | 1388 | } |
1389 | - } elseif ( empty( $license->success ) ) { |
|
1389 | + } elseif (empty($license->success)) { |
|
1390 | 1390 | $class = 'invalid'; |
1391 | 1391 | $messages[] = sprintf( |
1392 | - __( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ), |
|
1392 | + __('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'), |
|
1393 | 1393 | $addon_name, |
1394 | - $account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid' |
|
1394 | + $account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid' |
|
1395 | 1395 | ); |
1396 | - $license_status = 'license-' . $class; |
|
1396 | + $license_status = 'license-'.$class; |
|
1397 | 1397 | |
1398 | 1398 | } else { |
1399 | - switch ( $license->license ) { |
|
1399 | + switch ($license->license) { |
|
1400 | 1400 | case 'valid': |
1401 | 1401 | default: |
1402 | 1402 | $class = 'valid'; |
1403 | - $now = current_time( 'timestamp' ); |
|
1404 | - $expiration = strtotime( $license->expires, current_time( 'timestamp' ) ); |
|
1403 | + $now = current_time('timestamp'); |
|
1404 | + $expiration = strtotime($license->expires, current_time('timestamp')); |
|
1405 | 1405 | |
1406 | - if ( 'lifetime' === $license->expires ) { |
|
1407 | - $messages[] = __( 'License key never expires.', 'give' ); |
|
1406 | + if ('lifetime' === $license->expires) { |
|
1407 | + $messages[] = __('License key never expires.', 'give'); |
|
1408 | 1408 | $license_status = 'license-lifetime-notice'; |
1409 | - } elseif ( $expiration > $now && $expiration - $now < ( DAY_IN_SECONDS * 30 ) ) { |
|
1409 | + } elseif ($expiration > $now && $expiration - $now < (DAY_IN_SECONDS * 30)) { |
|
1410 | 1410 | $messages[] = sprintf( |
1411 | - __( 'Your license key expires soon! It expires on %1$s. <a href="%2$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give' ), |
|
1412 | - date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ), |
|
1413 | - $checkout_page_link . '?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=renew' |
|
1411 | + __('Your license key expires soon! It expires on %1$s. <a href="%2$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give'), |
|
1412 | + date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))), |
|
1413 | + $checkout_page_link.'?edd_license_key='.$license_key.'&utm_campaign=admin&utm_source=licenses&utm_medium=renew' |
|
1414 | 1414 | ); |
1415 | 1415 | $license_status = 'license-expires-soon'; |
1416 | 1416 | } else { |
1417 | 1417 | $messages[] = sprintf( |
1418 | - __( 'Your license key expires on %s.', 'give' ), |
|
1419 | - date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ) |
|
1418 | + __('Your license key expires on %s.', 'give'), |
|
1419 | + date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))) |
|
1420 | 1420 | ); |
1421 | 1421 | $license_status = 'license-expiration-date'; |
1422 | 1422 | } |
@@ -1424,15 +1424,15 @@ discard block |
||
1424 | 1424 | } |
1425 | 1425 | } |
1426 | 1426 | } else { |
1427 | - $messages[] = sprintf( |
|
1428 | - __( 'To receive updates, please enter your valid %s license key.', 'give' ), |
|
1427 | + $messages[] = sprintf( |
|
1428 | + __('To receive updates, please enter your valid %s license key.', 'give'), |
|
1429 | 1429 | $addon_name |
1430 | 1430 | ); |
1431 | 1431 | $license_status = 'inactive'; |
1432 | 1432 | } |
1433 | 1433 | |
1434 | 1434 | // Add class for input field if license is active. |
1435 | - if ( $is_valid_license ) { |
|
1435 | + if ($is_valid_license) { |
|
1436 | 1436 | $field_classes .= ' give-license-active'; |
1437 | 1437 | } |
1438 | 1438 | |
@@ -1440,33 +1440,33 @@ discard block |
||
1440 | 1440 | $input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\">"; |
1441 | 1441 | |
1442 | 1442 | // If license is active so show deactivate button. |
1443 | - if ( $is_valid_license ) { |
|
1443 | + if ($is_valid_license) { |
|
1444 | 1444 | // Get input field html. |
1445 | 1445 | $input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\" readonly=\"readonly\">"; |
1446 | 1446 | |
1447 | - $custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="' . $id . '_deactivate" value="' . esc_attr__( 'Deactivate License', 'give' ) . '"/>'; |
|
1447 | + $custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="'.$id.'_deactivate" value="'.esc_attr__('Deactivate License', 'give').'"/>'; |
|
1448 | 1448 | |
1449 | 1449 | } |
1450 | 1450 | |
1451 | 1451 | // Field description. |
1452 | - $custom_html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>'; |
|
1452 | + $custom_html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>'; |
|
1453 | 1453 | |
1454 | 1454 | // If no messages found then inform user that to get updated in future register yourself. |
1455 | - if ( empty( $messages ) ) { |
|
1456 | - $messages[] = apply_filters( "{$shortname}_default_addon_notice", __( 'To receive updates, please enter your valid license key.', 'give' ) ); |
|
1455 | + if (empty($messages)) { |
|
1456 | + $messages[] = apply_filters("{$shortname}_default_addon_notice", __('To receive updates, please enter your valid license key.', 'give')); |
|
1457 | 1457 | } |
1458 | 1458 | |
1459 | - foreach ( $messages as $message ) { |
|
1460 | - $custom_html .= '<div class="give-license-status-notice give-' . $license_status . '">'; |
|
1461 | - $custom_html .= '<p>' . $message . '</p>'; |
|
1459 | + foreach ($messages as $message) { |
|
1460 | + $custom_html .= '<div class="give-license-status-notice give-'.$license_status.'">'; |
|
1461 | + $custom_html .= '<p>'.$message.'</p>'; |
|
1462 | 1462 | $custom_html .= '</div>'; |
1463 | 1463 | } |
1464 | 1464 | |
1465 | 1465 | // Field html. |
1466 | - $custom_html = apply_filters( 'give_license_key_field_html', $input_field_html . $custom_html, $field_type_object ); |
|
1466 | + $custom_html = apply_filters('give_license_key_field_html', $input_field_html.$custom_html, $field_type_object); |
|
1467 | 1467 | |
1468 | 1468 | // Nonce. |
1469 | - wp_nonce_field( $id . '-nonce', $id . '-nonce' ); |
|
1469 | + wp_nonce_field($id.'-nonce', $id.'-nonce'); |
|
1470 | 1470 | |
1471 | 1471 | // Print field html. |
1472 | 1472 | echo "<div class=\"give-license-key\"><label for=\"{$id}\">{$addon_name }</label></div><div class=\"give-license-block\">{$custom_html}</div>"; |
@@ -1481,7 +1481,7 @@ discard block |
||
1481 | 1481 | */ |
1482 | 1482 | function give_api_callback() { |
1483 | 1483 | |
1484 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
1484 | + if ( ! current_user_can('manage_give_settings')) { |
|
1485 | 1485 | return; |
1486 | 1486 | } |
1487 | 1487 | |
@@ -1490,9 +1490,9 @@ discard block |
||
1490 | 1490 | * |
1491 | 1491 | * @since 1.0 |
1492 | 1492 | */ |
1493 | - do_action( 'give_tools_api_keys_before' ); |
|
1493 | + do_action('give_tools_api_keys_before'); |
|
1494 | 1494 | |
1495 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php'; |
|
1495 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php'; |
|
1496 | 1496 | |
1497 | 1497 | $api_keys_table = new Give_API_Keys_Table(); |
1498 | 1498 | $api_keys_table->prepare_items(); |
@@ -1502,9 +1502,9 @@ discard block |
||
1502 | 1502 | <?php |
1503 | 1503 | echo sprintf( |
1504 | 1504 | /* translators: 1: http://docs.givewp.com/api 2: http://docs.givewp.com/addon-zapier */ |
1505 | - __( 'You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give' ), |
|
1506 | - esc_url( 'http://docs.givewp.com/api' ), |
|
1507 | - esc_url( 'http://docs.givewp.com/addon-zapier' ) |
|
1505 | + __('You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give'), |
|
1506 | + esc_url('http://docs.givewp.com/api'), |
|
1507 | + esc_url('http://docs.givewp.com/addon-zapier') |
|
1508 | 1508 | ); |
1509 | 1509 | ?> |
1510 | 1510 | </span> |
@@ -1515,10 +1515,10 @@ discard block |
||
1515 | 1515 | * |
1516 | 1516 | * @since 1.0 |
1517 | 1517 | */ |
1518 | - do_action( 'give_tools_api_keys_after' ); |
|
1518 | + do_action('give_tools_api_keys_after'); |
|
1519 | 1519 | } |
1520 | 1520 | |
1521 | -add_action( 'give_settings_tab_api_keys', 'give_api_callback' ); |
|
1521 | +add_action('give_settings_tab_api_keys', 'give_api_callback'); |
|
1522 | 1522 | |
1523 | 1523 | /** |
1524 | 1524 | * Hook Callback |
@@ -1531,7 +1531,7 @@ discard block |
||
1531 | 1531 | * |
1532 | 1532 | * @return void |
1533 | 1533 | */ |
1534 | -function give_hook_callback( $args ) { |
|
1534 | +function give_hook_callback($args) { |
|
1535 | 1535 | |
1536 | 1536 | $id = $args['id']; |
1537 | 1537 | |
@@ -1540,7 +1540,7 @@ discard block |
||
1540 | 1540 | * |
1541 | 1541 | * @since 1.0 |
1542 | 1542 | */ |
1543 | - do_action( "give_{$id}" ); |
|
1543 | + do_action("give_{$id}"); |
|
1544 | 1544 | |
1545 | 1545 | } |
1546 | 1546 | |
@@ -1555,19 +1555,19 @@ discard block |
||
1555 | 1555 | * |
1556 | 1556 | * @return bool |
1557 | 1557 | */ |
1558 | -function give_is_setting_enabled( $value, $compare_with = null ) { |
|
1559 | - if ( ! is_null( $compare_with ) ) { |
|
1558 | +function give_is_setting_enabled($value, $compare_with = null) { |
|
1559 | + if ( ! is_null($compare_with)) { |
|
1560 | 1560 | |
1561 | - if ( is_array( $compare_with ) ) { |
|
1561 | + if (is_array($compare_with)) { |
|
1562 | 1562 | // Output. |
1563 | - return in_array( $value, $compare_with ); |
|
1563 | + return in_array($value, $compare_with); |
|
1564 | 1564 | } |
1565 | 1565 | |
1566 | 1566 | // Output. |
1567 | - return ( $value === $compare_with ); |
|
1567 | + return ($value === $compare_with); |
|
1568 | 1568 | } |
1569 | 1569 | |
1570 | 1570 | // Backward compatibility: From version 1.8 most of setting is modified to enabled/disabled |
1571 | 1571 | // Output. |
1572 | - return ( in_array( $value, array( 'enabled', 'on', 'yes' ) ) ? true : false ); |
|
1572 | + return (in_array($value, array('enabled', 'on', 'yes')) ? true : false); |
|
1573 | 1573 | } |