forked from impress-org/givewp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
give.php
699 lines (604 loc) · 20.6 KB
/
give.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
<?php
/**
* Plugin Name: Give - Donation Plugin
* Plugin URI: https://givewp.com
* Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
* Author: GiveWP
* Author URI: https://givewp.com/
* Version: 2.4.3
* Text Domain: give
* Domain Path: /languages
*
* Give is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* Give is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Give. If not, see <https://www.gnu.org/licenses/>.
*
* A Tribute to Open Source:
*
* "Open source software is software that can be freely used, changed, and shared (in modified or unmodified form) by anyone. Open
* source software is made by many people, and distributed under licenses that comply with the Open Source Definition."
*
* -- The Open Source Initiative
*
* Give is a tribute to the spirit and philosophy of Open Source. We at GiveWP gladly embrace the Open Source philosophy both
* in how Give itself was developed, and how we hope to see others build more from our code base.
*
* Give would not have been possible without the tireless efforts of WordPress and the surrounding Open Source projects and their talented developers. Thank you all for your contribution to WordPress.
*
* - The GiveWP Team
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Give' ) ) :
/**
* Main Give Class
*
* @since 1.0
*/
final class Give {
/** Singleton *************************************************************/
/**
* Give Instance
*
* @since 1.0
* @access private
*
* @var Give() The one true Give
*/
protected static $_instance;
/**
* Give Roles Object
*
* @since 1.0
* @access public
*
* @var Give_Roles object
*/
public $roles;
/**
* Give Settings Object
*
* @since 1.0
* @access public
*
* @var Give_Admin_Settings object
*/
public $give_settings;
/**
* Give Session Object
*
* This holds donation data for user's session.
*
* @since 1.0
* @access public
*
* @var Give_Session object
*/
public $session;
/**
* Give Session DB Object
*
* This holds donation data for user's session.
*
* @since 1.0
* @access public
*
* @var Give_DB_Sessions object
*/
public $session_db;
/**
* Give HTML Element Helper Object
*
* @since 1.0
* @access public
*
* @var Give_HTML_Elements object
*/
public $html;
/**
* Give Emails Object
*
* @since 1.0
* @access public
*
* @var Give_Emails object
*/
public $emails;
/**
* Give Email Template Tags Object
*
* @since 1.0
* @access public
*
* @var Give_Email_Template_Tags object
*/
public $email_tags;
/**
* Give Donors DB Object
*
* @since 1.0
* @access public
*
* @var Give_DB_Donors object
*/
public $donors;
/**
* Give Donor meta DB Object
*
* @since 1.6
* @access public
*
* @var Give_DB_Donor_Meta object
*/
public $donor_meta;
/**
* Give Sequential Donation DB Object
*
* @since 2.1.0
* @access public
*
* @var Give_DB_Sequential_Ordering object
*/
public $sequential_donation_db;
/**
* Give API Object
*
* @since 1.0
* @access public
*
* @var Give_API object
*/
public $api;
/**
* Give Template Loader Object
*
* @since 1.0
* @access public
*
* @var Give_Template_Loader object
*/
public $template_loader;
/**
* Give No Login Object
*
* @since 1.0
* @access public
*
* @var Give_Email_Access object
*/
public $email_access;
/**
* Give_tooltips Object
*
* @since 1.8.9
* @access public
*
* @var Give_Tooltips object
*/
public $tooltips;
/**
* Give notices Object
*
* @var Give_Notices $notices
*/
public $notices;
/**
* Give logging Object
*
* @var Give_Logging $logs
*/
public $logs;
/**
* Give log db Object
*
* @var Give_DB_Logs $log_db
*/
public $log_db;
/**
* Give log meta db Object
*
* @var Give_DB_Log_Meta $logmeta_db
*/
public $logmeta_db;
/**
* Give payment Object
*
* @var Give_DB_Payment_Meta $payment_meta
*/
public $payment_meta;
/**
* Give form Object
*
* @var Give_DB_Form_Meta $form_meta
*/
public $form_meta;
/**
* Give form Object
*
* @var Give_Async_Process $async_process
*/
public $async_process;
/**
* Give scripts Object.
*
* @var Give_Scripts
*/
public $scripts;
/**
* Give_Seq_Donation_Number Object.
*
* @var Give_Sequential_Donation_Number
*/
public $seq_donation_number;
/**
* Give_Comment Object
*
* @var Give_Comment
*/
public $comment;
/**
* Main Give Instance
*
* Ensures that only one instance of Give exists in memory at any one
* time. Also prevents needing to define globals all over the place.
*
* @since 1.0
* @access public
*
* @static
* @see Give()
*
* @return Give
*/
public static function instance() {
if ( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
}
/**
* Give Constructor.
*/
public function __construct() {
// PHP version
if ( ! defined( 'GIVE_REQUIRED_PHP_VERSION' ) ) {
define( 'GIVE_REQUIRED_PHP_VERSION', '5.3' );
}
// Bailout: Need minimum php version to load plugin.
if ( function_exists( 'phpversion' ) && version_compare( GIVE_REQUIRED_PHP_VERSION, phpversion(), '>' ) ) {
add_action( 'admin_notices', array( $this, 'minimum_phpversion_notice' ) );
return;
}
$this->setup_constants();
$this->includes();
$this->init_hooks();
do_action( 'give_loaded' );
}
/**
* Hook into actions and filters.
*
* @since 1.8.9
*/
private function init_hooks() {
register_activation_hook( GIVE_PLUGIN_FILE, 'give_install' );
add_action( 'plugins_loaded', array( $this, 'init' ), 0 );
}
/**
* Init Give when WordPress Initializes.
*
* @since 1.8.9
*/
public function init() {
/**
* Fires before the Give core is initialized.
*
* @since 1.8.9
*/
do_action( 'before_give_init' );
// Set up localization.
$this->load_textdomain();
$this->roles = new Give_Roles();
$this->api = new Give_API();
$this->give_settings = new Give_Admin_Settings();
$this->emails = new Give_Emails();
$this->email_tags = new Give_Email_Template_Tags();
$this->html = Give_HTML_Elements::get_instance();
$this->donors = new Give_DB_Donors();
$this->donor_meta = new Give_DB_Donor_Meta();
$this->tooltips = new Give_Tooltips();
$this->notices = new Give_Notices();
$this->payment_meta = new Give_DB_Payment_Meta();
$this->log_db = new Give_DB_Logs();
$this->logmeta_db = new Give_DB_Log_Meta();
$this->logs = new Give_Logging();
$this->form_meta = new Give_DB_Form_Meta();
$this->sequential_donation_db = new Give_DB_Sequential_Ordering();
$this->async_process = new Give_Async_Process();
$this->scripts = new Give_Scripts();
$this->seq_donation_number = Give_Sequential_Donation_Number::get_instance();
$this->comment = Give_Comment::get_instance();
$this->session_db = new Give_DB_Sessions();
$this->session = Give_Session::get_instance();
/**
* Fire the action after Give core loads.
*
* @param Give class instance.
*
* @since 1.8.7
*/
do_action( 'give_init', $this );
}
/**
* Throw error on object clone
*
* The whole idea of the singleton design pattern is that there is a single
* object, therefore we don't want the object to be cloned.
*
* @since 1.0
* @access protected
*
* @return void
*/
public function __clone() {
// Cloning instances of the class is forbidden.
give_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'give' ), '1.0' );
}
/**
* Disable unserializing of the class
*
* @since 1.0
* @access protected
*
* @return void
*/
public function __wakeup() {
// Unserializing instances of the class is forbidden.
give_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'give' ), '1.0' );
}
/**
* Setup plugin constants
*
* @since 1.0
* @access private
*
* @return void
*/
private function setup_constants() {
// Plugin version.
if ( ! defined( 'GIVE_VERSION' ) ) {
define( 'GIVE_VERSION', '2.4.3' );
}
// Plugin Root File.
if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) {
define( 'GIVE_PLUGIN_FILE', __FILE__ );
}
// Plugin Folder Path.
if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) {
define( 'GIVE_PLUGIN_DIR', plugin_dir_path( GIVE_PLUGIN_FILE ) );
}
// Plugin Folder URL.
if ( ! defined( 'GIVE_PLUGIN_URL' ) ) {
define( 'GIVE_PLUGIN_URL', plugin_dir_url( GIVE_PLUGIN_FILE ) );
}
// Plugin Basename aka: "give/give.php".
if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) {
define( 'GIVE_PLUGIN_BASENAME', plugin_basename( GIVE_PLUGIN_FILE ) );
}
// Make sure CAL_GREGORIAN is defined.
if ( ! defined( 'CAL_GREGORIAN' ) ) {
define( 'CAL_GREGORIAN', 1 );
}
}
/**
* Include required files
*
* @since 1.0
* @access private
*
* @return void
*/
private function includes() {
global $give_options;
require_once GIVE_PLUGIN_DIR . 'includes/class-give-cache-setting.php';
/**
* Load libraries.
*/
if ( ! class_exists( 'WP_Async_Request' ) ) {
include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-async-request.php' );
}
if ( ! class_exists( 'WP_Background_Process' ) ) {
include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-background-process.php' );
}
require_once GIVE_PLUGIN_DIR . 'includes/setting-functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/currency-functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/donors/frontend-donor-functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php';
/**
* Load plugin files
*/
require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-settings.php';
$give_options = give_get_settings();
require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-async-process.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-cache.php';
require_once GIVE_PLUGIN_DIR . 'includes/post-types.php';
require_once GIVE_PLUGIN_DIR . 'includes/filters.php';
require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php';
require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api-v2.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-tooltips.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-notices.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-translation.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-html-elements.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-scripts.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-meta.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-comments.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-comments-meta.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donors.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donor-meta.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-form-meta.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-sequential-ordering.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-logs.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-logs-meta.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-sessions.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-payment-meta.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-comment.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor-wall-widget.php';
require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php';
require_once GIVE_PLUGIN_DIR . 'includes/forms/class-give-forms-query.php';
require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php';
require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php';
require_once GIVE_PLUGIN_DIR . 'includes/formatting.php';
require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php';
require_once GIVE_PLUGIN_DIR . 'includes/login-register.php';
require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php';
require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-classes.php';
require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-actions.php';
require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-filters.php';
require_once GIVE_PLUGIN_DIR . 'includes/process-donation.php';
require_once GIVE_PLUGIN_DIR . 'includes/payments/backward-compatibility.php';
require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php';
require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php';
require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php';
require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-payment.php';
require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-sequential-donation-number.php';
require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php';
require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php';
require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php';
require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php';
require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php';
require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/emails/class-email-notifications.php';
require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php';
require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php';
require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php';
require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donors-query.php';
require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donor-wall.php';
require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donor-stats.php';
require_once GIVE_PLUGIN_DIR . 'includes/donors/backward-compatibility.php';
require_once GIVE_PLUGIN_DIR . 'includes/donors/actions.php';
require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/class-give-updates.php';
require_once GIVE_PLUGIN_DIR . 'blocks/load.php';
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php';
}
// Load file for frontend
if( $this->is_request('frontend' ) ) {
require_once GIVE_PLUGIN_DIR . 'includes/frontend/class-give-frontend.php';
}
if ( $this->is_request( 'admin' ) || $this->is_request( 'wpcli' ) ) {
require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-admin.php';
}// End if().
require_once GIVE_PLUGIN_DIR . 'includes/actions.php';
require_once GIVE_PLUGIN_DIR . 'includes/install.php';
}
/**
* Loads the plugin language files.
*
* @since 1.0
* @access public
*
* @return void
*/
public function load_textdomain() {
// Set filter for Give's languages directory
$give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/';
$give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir );
// Traditional WordPress plugin locale filter.
$locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
$locale = apply_filters( 'plugin_locale', $locale, 'give' );
unload_textdomain( 'give' );
load_textdomain( 'give', WP_LANG_DIR . '/give/give-' . $locale . '.mo' );
load_plugin_textdomain( 'give', false, $give_lang_dir );
}
/**
* Show minimum PHP version notice.
*
* @since 1.8.12
* @access public
*/
public function minimum_phpversion_notice() {
// Bailout.
if ( ! is_admin() ) {
return;
}
$notice_desc = '<p><strong>' . __( 'Your site could be faster and more secure with a newer PHP version.', 'give' ) . '</strong></p>';
$notice_desc .= '<p>' . __( 'Hey, we\'ve noticed that you\'re running an outdated version of PHP. PHP is the programming language that WordPress and Give are built on. The version that is currently used for your site is no longer supported. Newer versions of PHP are both faster and more secure. In fact, your version of PHP no longer receives security updates, which is why we\'re sending you this notice.', 'give' ) . '</p>';
$notice_desc .= '<p>' . __( 'Hosts have the ability to update your PHP version, but sometimes they don\'t dare to do that because they\'re afraid they\'ll break your site.', 'give' ) . '</p>';
$notice_desc .= '<p><strong>' . __( 'To which version should I update?', 'give' ) . '</strong></p>';
$notice_desc .= '<p>' . __( 'You should update your PHP version to either 5.6 or to 7.0 or 7.1. On a normal WordPress site, switching to PHP 5.6 should never cause issues. We would however actually recommend you switch to PHP7. There are some plugins that are not ready for PHP7 though, so do some testing first. PHP7 is much faster than PHP 5.6. It\'s also the only PHP version still in active development and therefore the better option for your site in the long run.', 'give' ) . '</p>';
$notice_desc .= '<p><strong>' . __( 'Can\'t update? Ask your host!', 'give' ) . '</strong></p>';
$notice_desc .= '<p>' . sprintf( __( 'If you cannot upgrade your PHP version yourself, you can send an email to your host. If they don\'t want to upgrade your PHP version, we would suggest you switch hosts. Have a look at one of the recommended %1$sWordPress hosting partners%2$s.', 'give' ), sprintf( '<a href="%1$s" target="_blank">', esc_url( 'https://wordpress.org/hosting/' ) ), '</a>' ) . '</p>';
echo sprintf(
'<div class="notice notice-error">%1$s</div>',
wp_kses_post( $notice_desc )
);
}
/**
* What type of request is this?
*
* @since 2.4.0
*
* @param string $type admin, ajax, cron or frontend.
* @return bool
*/
private function is_request( $type ) {
switch ( $type ) {
case 'admin':
return is_admin();
case 'ajax':
return defined( 'DOING_AJAX' );
case 'cron':
return defined( 'DOING_CRON' );
case 'frontend':
return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' ) && ! defined( 'REST_REQUEST' );
case 'wpcli':
return defined( 'WP_CLI' ) && WP_CLI;
}
}
}
endif; // End if class_exists check
/**
* Start Give
*
* The main function responsible for returning the one true Give instance to functions everywhere.
*
* Use this function like you would a global variable, except without needing
* to declare the global.
*
* Example: <?php $give = Give(); ?>
*
* @since 1.0
* @return object|Give
*/
function Give() {
return Give::instance();
}
Give();