PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.5.0
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.5.0
1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 1.8.0 All 210 releases
charitable / charitable.php

charitable.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.5.0, at charitable.php

903 lines 28.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Charitable
4 * Plugin URI: https://www.wpcharitable.com
5 * Description: The WordPress fundraising alternative for non-profits, created to help non-profits raise money on their own website.
6 * Version: 1.5.0
7 * Author: WP Charitable
8 * Author URI: https://wpcharitable.com
9 * Requires at least: 4.1
10 * Tested up to: 4.8.3
11 *
12 * Text Domain: charitable
13 * Domain Path: /i18n/languages/
14 *
15 * @package Charitable
16 * @author Eric Daams
17 * @copyright Copyright (c) 2017, Studio 164a
18 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
19 */
20
21 // Exit if accessed directly.
22 if ( ! defined( 'ABSPATH' ) ) { exit; }
23
24 if ( ! class_exists( 'Charitable' ) ) :
25
26 /**
27 * Main Charitable class
28 *
29 * @class Charitable
30 * @version 1.5.0
31 */
32 class Charitable {
33
34 /**
35 * Plugin version.
36 *
37 * @var string
38 */
39 const VERSION = '1.5.0';
40
41 /**
42 * Version of database schema.
43 *
44 * @var string A date in the format: YYYYMMDD
45 */
46 const DB_VERSION = '20150615';
47
48 /**
49 * Campaign post type.
50 *
51 * @var string
52 */
53 const CAMPAIGN_POST_TYPE = 'campaign';
54
55 /**
56 * Donation post type.
57 *
58 * @var string
59 */
60 const DONATION_POST_TYPE = 'donation';
61
62 /**
63 * Single instance of this class.
64 *
65 * @since 1.0.0
66 *
67 * @var Charitable
68 */
69 private static $instance = null;
70
71 /**
72 * The absolute path to this plugin's directory.
73 *
74 * @since 1.0.0
75 *
76 * @var string
77 */
78 private $directory_path;
79
80 /**
81 * The URL of this plugin's directory.
82 *
83 * @since 1.0.0
84 *
85 * @var string
86 */
87 private $directory_url;
88
89 /**
90 * Directory path for the includes folder of the plugin.
91 *
92 * @since 1.0.0
93 *
94 * @var string
95 */
96 private $includes_path;
97
98 /**
99 * Store of registered objects.
100 *
101 * @since 1.0.0
102 * @since 1.5.0 Changed to Charitable_Registry object. Previously it was an array.
103 *
104 * @var Charitable_Registry
105 */
106 private $registry;
107
108 /**
109 * Classmap.
110 *
111 * @since 1.5.0
112 *
113 * @var array
114 */
115 private $classmap;
116
117 /**
118 * Create class instance.
119 *
120 * @since 1.0.0
121 */
122 public function __construct() {
123 $this->directory_path = plugin_dir_path( __FILE__ );
124 $this->directory_url = plugin_dir_url( __FILE__ );
125 $this->includes_path = $this->directory_path . 'includes/';
126
127 spl_autoload_register( array( $this, 'autoloader' ) );
128
129 $this->load_dependencies();
130
131 register_activation_hook( __FILE__, array( $this, 'activate' ) );
132 register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) );
133
134 add_action( 'plugins_loaded', array( $this, 'start' ), 1 );
135 }
136
137 /**
138 * Returns the original instance of this class.
139 *
140 * @since 1.0.0
141 *
142 * @return Charitable
143 */
144 public static function get_instance() {
145 return self::$instance;
146 }
147
148 /**
149 * Run the startup sequence.
150 *
151 * This is only ever executed once.
152 *
153 * @since 1.0.0
154 *
155 * @return void
156 */
157 public function start() {
158 /* If we've already started (i.e. run this function once before), do not pass go. */
159 if ( $this->started() ) {
160 return;
161 }
162
163 /* Set static instance. */
164 self::$instance = $this;
165
166 /* Set up the registry and instantiate objects we need straight away. */
167 $this->registry();
168
169 $this->maybe_start_ajax();
170
171 $this->attach_hooks_and_filters();
172
173 $this->maybe_start_admin();
174
175 $this->maybe_start_public();
176
177 Charitable_Addons::load( $this );
178 }
179
180 /**
181 * Include necessary files.
182 *
183 * @since 1.0.0
184 *
185 * @return void
186 */
187 private function load_dependencies() {
188 $includes_path = $this->get_path( 'includes' );
189
190 /* Load files with hooks & functions. Classes are autoloaded. */
191 require_once( $includes_path . 'charitable-core-functions.php' );
192 require_once( $includes_path . 'campaigns/charitable-campaign-functions.php' );
193 require_once( $includes_path . 'campaigns/charitable-campaign-hooks.php' );
194 require_once( $includes_path . 'compat/charitable-compat-functions.php' );
195 require_once( $includes_path . 'currency/charitable-currency-functions.php' );
196 require_once( $includes_path . 'deprecated/charitable-deprecated-functions.php' );
197 require_once( $includes_path . 'donations/charitable-donation-hooks.php' );
198 require_once( $includes_path . 'donations/charitable-donation-functions.php' );
199 require_once( $includes_path . 'emails/charitable-email-hooks.php' );
200 require_once( $includes_path . 'endpoints/charitable-endpoints-functions.php' );
201 require_once( $includes_path . 'public/charitable-template-helpers.php' );
202 require_once( $includes_path . 'shortcodes/charitable-shortcodes-hooks.php' );
203 require_once( $includes_path . 'upgrades/charitable-upgrade-hooks.php' );
204 require_once( $includes_path . 'users/charitable-user-functions.php' );
205 require_once( $includes_path . 'user-management/charitable-user-management-hooks.php' );
206 require_once( $includes_path . 'utilities/charitable-utility-functions.php' );
207 }
208
209 /**
210 * Dynamically loads the class attempting to be instantiated elsewhere in the
211 * plugin by looking at the $class_name parameter being passed as an argument.
212 *
213 * @since 1.5.0
214 *
215 * @param string $class_name The fully-qualified name of the class to load.
216 * @return boolean
217 */
218 public function autoloader( $class_name ) {
219 /* If the specified $class_name already exists, bail. */
220 if ( class_exists( $class_name ) ) {
221 return false;
222 }
223
224 /* If the specified $class_name does not include our namespace, duck out. */
225 if ( false === strpos( $class_name, 'Charitable_' ) ) {
226 return false;
227 }
228
229 /* Autogenerated class map. */
230 if ( ! isset( $this->classmap ) ) {
231 $this->classmap = include( 'includes/autoloader/charitable-class-map.php' );
232 }
233
234 $file_path = isset( $this->classmap[ $class_name ] ) ? $this->get_path( 'includes' ) . $this->classmap[ $class_name ] : false;
235
236 if ( $file_path && file_exists( $file_path ) && is_file( $file_path ) ) {
237 require_once( $file_path );
238 return true;
239 }
240
241 return false;
242 }
243
244 /**
245 * Returns a registered class object.
246 *
247 * @since 1.5.0
248 *
249 * @return Charitable_Registry
250 */
251 public function registry() {
252 if ( ! isset( $this->registry ) ) {
253 $this->registry = new Charitable_Registry();
254 $this->registry->register_object( Charitable_Emails::get_instance() );
255 $this->registry->register_object( Charitable_Request::get_instance() );
256 $this->registry->register_object( Charitable_Gateways::get_instance() );
257 $this->registry->register_object( Charitable_i18n::get_instance() );
258 $this->registry->register_object( Charitable_Post_Types::get_instance() );
259 $this->registry->register_object( Charitable_Cron::get_instance() );
260 $this->registry->register_object( Charitable_Widgets::get_instance() );
261 $this->registry->register_object( Charitable_Licenses::get_instance() );
262 $this->registry->register_object( Charitable_User_Dashboard::get_instance() );
263 $this->registry->register_object( Charitable_Locations::get_instance() );
264 }
265
266 return $this->registry;
267 }
268
269 /**
270 * Set up hook and filter callback functions.
271 *
272 * @since 1.0.0
273 *
274 * @return void
275 */
276 private function attach_hooks_and_filters() {
277 add_action( 'wpmu_new_blog', array( $this, 'maybe_activate_charitable_on_new_site' ) );
278 add_action( 'plugins_loaded', array( $this, 'charitable_install' ), 100 );
279 add_action( 'plugins_loaded', array( $this, 'charitable_start' ), 100 );
280 add_action( 'plugins_loaded', array( $this, 'endpoints' ), 100 );
281 add_action( 'plugins_loaded', array( $this, 'donation_fields' ), 100 );
282 add_action( 'plugins_loaded', 'charitable_load_compat_functions' );
283 add_action( 'setup_theme', array( 'Charitable_Customizer', 'start' ) );
284 add_action( 'wp_enqueue_scripts', array( $this, 'maybe_start_qunit' ), 100 );
285
286 /**
287 * We do this on priority 20 so that any functionality that is loaded on init (such
288 * as addons) has a chance to run before the event.
289 */
290 add_action( 'init', array( $this, 'do_charitable_actions' ), 20 );
291 }
292
293 /**
294 * Checks whether we're in the admin area and if so, loads the admin-only functionality.
295 *
296 * @since 1.0.0
297 *
298 * @return Charitable_Admin|false
299 */
300 private function maybe_start_admin() {
301 if ( ! is_admin() ) {
302 return false;
303 }
304
305 require_once( $this->get_path( 'admin' ) . 'class-charitable-admin.php' );
306 require_once( $this->get_path( 'admin' ) . 'charitable-admin-hooks.php' );
307
308 $admin = Charitable_Admin::get_instance();
309
310 $this->registry->register_object( $admin );
311
312 return $admin;
313 }
314
315 /**
316 * Checks whether we're on the public-facing side and if so, loads the public-facing functionality.
317 *
318 * @since 1.0.0
319 *
320 * @return Charitable_Public|false
321 */
322 private function maybe_start_public() {
323 if ( is_admin() && ! $this->is_ajax() ) {
324 return false;
325 }
326
327 require_once( $this->get_path( 'public' ) . 'class-charitable-public.php' );
328
329 $public = Charitable_Public::get_instance();
330
331 $this->registry->register_object( $public );
332
333 return $public;
334 }
335
336 /**
337 * Load the QUnit tests if ?qunit is appended to the request.
338 *
339 * @since 1.4.17
340 *
341 * @return boolean
342 */
343 public function maybe_start_qunit() {
344 /* Skip out early if ?qunit isn't included in the request. */
345 if ( ! array_key_exists( 'qunit', $_GET ) ) {
346 return false;
347 }
348
349 /* The unit tests have to exist. */
350 if ( ! file_exists( $this->get_path( 'directory' ) . 'tests/qunit/tests.js' ) ) {
351 return false;
352 }
353
354 wp_register_script( 'qunit', 'https://code.jquery.com/qunit/qunit-2.3.3.js', array(), '2.3.3', true );
355 /* Version: '20170615-15:44' */
356 wp_register_script( 'qunit-tests', $this->get_path( 'directory', false ) . 'tests/qunit/tests.js', array( 'jquery-core', 'qunit' ), time(), true );
357 wp_enqueue_script( 'qunit-tests' );
358
359 wp_register_style( 'qunit', 'https://code.jquery.com/qunit/qunit-2.3.3.css', array(), '2.3.3', 'all' );
360 wp_enqueue_style( 'qunit' );
361 }
362
363 /**
364 * Checks whether the current request is an AJAX request.
365 *
366 * @since 1.5.0
367 *
368 * @return boolean
369 */
370 private function is_ajax() {
371 return false !== ( defined( 'DOING_AJAX' ) && DOING_AJAX );
372 }
373
374 /**
375 * Checks whether we're executing an AJAX hook and if so, loads some AJAX functionality.
376 *
377 * @since 1.0.0
378 *
379 * @return void
380 */
381 private function maybe_start_ajax() {
382 if ( ! $this->is_ajax() ) {
383 return;
384 }
385
386 require_once( $this->get_path( 'includes' ) . 'ajax/charitable-ajax-functions.php' );
387 require_once( $this->get_path( 'includes' ) . 'ajax/charitable-ajax-hooks.php' );
388 }
389
390 /**
391 * This method is fired after all plugins are loaded and simply fires the charitable_start hook.
392 *
393 * Extensions can use the charitable_start event to load their own functionality.
394 *
395 * @since 1.0.0
396 *
397 * @return void
398 */
399 public function charitable_start() {
400 do_action( 'charitable_start', $this );
401 }
402
403 /**
404 * Fires off an action right after Charitable is installed, allowing other
405 * plugins/themes to do something at this point.
406 *
407 * @since 1.0.1
408 *
409 * @return void
410 */
411 public function charitable_install() {
412 $install = get_transient( 'charitable_install' );
413
414 if ( ! $install ) {
415 return;
416 }
417
418 require_once( $this->get_path( 'includes' ) . 'class-charitable-install.php' );
419
420 Charitable_Install::finish_installing();
421
422 do_action( 'charitable_install' );
423
424 delete_transient( 'charitable_install' );
425 }
426
427 /**
428 * Returns whether we are currently in the start phase of the plugin.
429 *
430 * @since 1.0.0
431 *
432 * @return boolean
433 */
434 public function is_start() {
435 return current_filter() == 'charitable_start';
436 }
437
438 /**
439 * Returns whether the plugin has already started.
440 *
441 * @since 1.0.0
442 *
443 * @return boolean
444 */
445 public function started() {
446 return did_action( 'charitable_start' ) || current_filter() == 'charitable_start';
447 }
448
449 /**
450 * Returns whether the plugin is being activated.
451 *
452 * @since 1.0.0
453 *
454 * @return boolean
455 */
456 public function is_activation() {
457 return current_filter() == 'activate_charitable/charitable.php';
458 }
459
460 /**
461 * Returns whether the plugin is being deactivated.
462 *
463 * @since 1.0.0
464 *
465 * @return boolean
466 */
467 public function is_deactivation() {
468 return current_filter() == 'deactivate_charitable/charitable.php';
469 }
470
471 /**
472 * Returns plugin paths.
473 *
474 * @since 1.0.0
475 *
476 * @param string $type If empty, returns the path to the plugin.
477 * @param boolean $absolute_path If true, returns the file system path. If false, returns it as a URL.
478 * @return string
479 */
480 public function get_path( $type = '', $absolute_path = true ) {
481 $base = $absolute_path ? $this->directory_path : $this->directory_url;
482
483 switch ( $type ) {
484 case 'includes' :
485 $path = $base . 'includes/';
486 break;
487
488 case 'admin' :
489 $path = $base . 'includes/admin/';
490 break;
491
492 case 'public' :
493 $path = $base . 'includes/public/';
494 break;
495
496 case 'assets' :
497 $path = $base . 'assets/';
498 break;
499
500 case 'templates' :
501 $path = $base . 'templates/';
502 break;
503
504 case 'directory' :
505 $path = $base;
506 break;
507
508 default :
509 $path = __FILE__;
510
511 }//end switch
512
513 return $path;
514 }
515
516 /**
517 * Returns the plugin's version number.
518 *
519 * @since 1.0.0
520 *
521 * @return string
522 */
523 public function get_version() {
524 $version = self::VERSION;
525
526 if ( false !== strpos( $version, '-' ) ) {
527 $parts = explode( '-', $version );
528 $version = $parts[0];
529 }
530
531 return $version;
532 }
533
534 /**
535 * Get the donation fields registry
536 *
537 * If the registry has not been set up yet, this will also
538 * perform the task of setting it up initially.
539 *
540 * This method is called on the plugins_loaded hook.
541 *
542 * @since 1.5.0
543 *
544 * @return Charitable_Donation_Field_Registry
545 */
546 public function donation_fields() {
547 if ( ! $this->registry->has( 'donation_field_registry' ) ) {
548 $donation_fields = new Charitable_Donation_Field_Registry();
549 $donation_fields->set_default_section( 'user', 'public' );
550 $donation_fields->set_default_section( 'user', 'admin' );
551
552 $fields = include( $this->get_path( 'includes' ) . 'fields/default-fields/donation-fields.php' );
553
554 foreach ( $fields as $key => $args ) {
555 $donation_fields->register_field( new Charitable_Donation_Field( $key, $args ) );
556 }
557
558 $this->registry->register_object( $donation_fields );
559 }
560
561 return $this->registry->get( 'donation_field_registry' );
562 }
563
564 /**
565 * Return the Endpoints API object.
566 *
567 * If the Endpoints API has not been set up yet, this will also
568 * perform the task of setting it up initially.
569 *
570 * This method is called on the plugins_loaded hook.
571 *
572 * @since 1.5.0
573 *
574 * @return Charitable_Endpoints
575 */
576 public function endpoints() {
577 if ( ! $this->registry->has( 'endpoints' ) ) {
578 /**
579 * The order in which we register endpoints is important, because
580 * it determines the order in which the endpoints are checked to
581 * find whether they are the current page.
582 *
583 * Any endpoint that builds on another endpoint should be registered
584 * BEFORE the endpoint it builds on. In other words, move from
585 * most specific to least specific.
586 */
587 $endpoints = new Charitable_Endpoints();
588 $endpoints->register( new Charitable_Campaign_Donation_Endpoint );
589 $endpoints->register( new Charitable_Campaign_Widget_Endpoint );
590 $endpoints->register( new Charitable_Campaign_Endpoint );
591 $endpoints->register( new Charitable_Donation_Cancellation_Endpoint );
592 $endpoints->register( new Charitable_Donation_Processing_Endpoint );
593 $endpoints->register( new Charitable_Donation_Receipt_Endpoint );
594 $endpoints->register( new Charitable_Email_Preview_Endpoint );
595 $endpoints->register( new Charitable_Email_Verification_Endpoint );
596 $endpoints->register( new Charitable_Registration_Endpoint );
597 $endpoints->register( new Charitable_Forgot_Password_Endpoint );
598 $endpoints->register( new Charitable_Reset_Password_Endpoint );
599 $endpoints->register( new Charitable_Login_Endpoint );
600 $endpoints->register( new Charitable_Profile_Endpoint );
601
602 $this->registry->register_object( $endpoints );
603 }
604
605 return $this->registry->get( 'endpoints' );
606 }
607
608 /**
609 * Returns a registered object.
610 *
611 * @since 1.0.0
612 *
613 * @param string $class The type of class to be retrieved.
614 * @return object
615 */
616 public function get_registered_object( $class ) {
617 return $this->registry->get( $class );
618 }
619
620 /**
621 * Returns the model for one of Charitable's database tables.
622 *
623 * @since 1.0.0
624 *
625 * @param string $table The database table to retrieve.
626 * @return Charitable_DB
627 */
628 public function get_db_table( $table ) {
629 $tables = $this->get_tables();
630
631 if ( ! isset( $tables[ $table ] ) ) {
632 charitable_get_deprecated()->doing_it_wrong(
633 __METHOD__,
634 sprintf( 'Invalid table %s passed', $table ),
635 '1.0.0'
636 );
637 return null;
638 }
639
640 return $this->registry->get( $tables[ $table ] );
641 }
642
643 /**
644 * Return the filtered list of registered tables.
645 *
646 * @since 1.0.0
647 *
648 * @return string[]
649 */
650 private function get_tables() {
651 /**
652 * Filter the array of available Charitable table classes.
653 *
654 * @since 1.0.0
655 *
656 * @param array $tables List of tables as a key=>value array.
657 */
658 return apply_filters( 'charitable_db_tables', array(
659 'campaign_donations' => 'Charitable_Campaign_Donations_DB',
660 'donors' => 'Charitable_Donors_DB',
661 ) );
662 }
663
664 /**
665 * Maybe activate Charitable when a new site is added in a multisite network.
666 *
667 * @since 1.4.6
668 *
669 * @param int $blog_id The blog to activate Charitable on.
670 * @return boolean
671 */
672 public function maybe_activate_charitable_on_new_site( $blog_id ) {
673 if ( is_plugin_active_for_network( basename( $this->directory_path ) . '/charitable.php' ) ) {
674 switch_to_blog( $blog_id );
675 $this->activate( false );
676 restore_current_blog();
677 }
678 }
679
680 /**
681 * Runs on plugin activation.
682 *
683 * @see register_activation_hook
684 *
685 * @since 1.0.0
686 *
687 * @param boolean $network_wide Whether to enable the plugin for all sites in the network
688 * or just the current site. Multisite only. Default is false.
689 * @return void
690 */
691 public function activate( $network_wide = false ) {
692 require_once( $this->get_path( 'includes' ) . 'class-charitable-install.php' );
693
694 if ( is_multisite() && $network_wide ) {
695 global $wpdb;
696
697 foreach ( $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" ) as $blog_id ) {
698 switch_to_blog( $blog_id );
699 new Charitable_Install();
700 restore_current_blog();
701 }
702 } else {
703 new Charitable_Install();
704 }
705 }
706
707 /**
708 * Runs on plugin deactivation.
709 *
710 * @see register_deactivation_hook
711 *
712 * @since 1.0.0
713 *
714 * @return void
715 */
716 public function deactivate() {
717 require_once( $this->get_path( 'includes' ) . 'class-charitable-uninstall.php' );
718 new Charitable_Uninstall();
719 }
720
721 /**
722 * If a charitable_action event is triggered, delegate the event using do_action.
723 *
724 * @since 1.0.0
725 *
726 * @return void
727 */
728 public function do_charitable_actions() {
729 if ( isset( $_REQUEST['charitable_action'] ) ) {
730
731 $action = $_REQUEST['charitable_action'];
732
733 /**
734 * Handle Charitable action.
735 *
736 * @since 1.0.0
737 */
738 do_action( 'charitable_' . $action );
739 }
740 }
741
742 /**
743 * Throw error on object clone.
744 *
745 * This class is specifically designed to be instantiated once. You can retrieve the instance using charitable()
746 *
747 * @since 1.0.0
748 *
749 * @return void
750 */
751 public function __clone() {
752 charitable_get_deprecated()->doing_it_wrong(
753 __FUNCTION__,
754 __( 'Cheatin&#8217; huh?', 'charitable' ),
755 '1.0.0'
756 );
757 }
758
759 /**
760 * Disable unserializing of the class.
761 *
762 * @since 1.0.0
763 *
764 * @return void
765 */
766 public function __wakeup() {
767 charitable_get_deprecated()->doing_it_wrong(
768 __FUNCTION__,
769 __( 'Cheatin&#8217; huh?', 'charitable' ),
770 '1.0.0'
771 );
772 }
773
774 /**
775 * DEPRECATED METHODS
776 */
777
778 /**
779 * Load plugin compatibility files on plugins_loaded hook.
780 *
781 * @deprecated 1.8.0
782 *
783 * @since 1.4.18
784 * @since 1.5.0 Deprecated.
785 *
786 * @return void
787 */
788 public function load_plugin_compat_files() {
789 charitable_get_deprecated()->deprecated_function(
790 __METHOD__,
791 '1.5.0.',
792 'charitable_load_compat_functions'
793 );
794
795 charitable_load_compat_functions();
796 }
797
798 /**
799 * Stores an object in the plugin's registry.
800 *
801 * @deprecated 1.8.0
802 *
803 * @since 1.0.0
804 * @since 1.5.0 Deprecated.
805 *
806 * @param mixed $object Object to be registered.
807 * @return void
808 */
809 public function register_object( $object ) {
810 charitable_get_deprecated()->deprecated_function(
811 __METHOD__,
812 '1.5.0',
813 'charitable()->registry()->register_object()'
814 );
815
816 return $this->registry->register_object( $object );
817 }
818
819 /**
820 * Returns the public class.
821 *
822 * @deprecated 1.8.0
823 *
824 * @since 1.0.0
825 * @since 1.5.0 Deprecated.
826 *
827 * @return Charitable_Public
828 */
829 public function get_public() {
830 charitable_get_deprecated()->deprecated_function(
831 __METHOD__,
832 '1.5.0',
833 'charitable_get_helper'
834 );
835
836 return $this->registry->get( 'Charitable_Public' );
837 }
838
839 /**
840 * Returns the admin class.
841 *
842 * @deprecated 1.8.0
843 *
844 * @since 1.0.0
845 * @since 1.5.0 Deprecated.
846 *
847 * @return Charitable_Admin
848 */
849 public function get_admin() {
850 charitable_get_deprecated()->deprecated_function(
851 __METHOD__,
852 '1.5.0',
853 'charitable_get_helper'
854 );
855
856 return $this->registry->get( 'Charitable_Admin' );
857 }
858
859 /**
860 * Return the current request object.
861 *
862 * @deprecated 1.8.0
863 *
864 * @since 1.0.0
865 * @since 1.5.0 Deprecated.
866 *
867 * @return Charitable_Request
868 */
869 public function get_request() {
870 charitable_get_deprecated()->deprecated_function(
871 __METHOD__,
872 '1.5.0',
873 'charitable_get_helper'
874 );
875
876 return $this->registry->get( 'Charitable_Request' );
877 }
878
879 /**
880 * @deprecated 1.7.0
881 *
882 * @since 1.4.0 Deprecated.
883 */
884 public function get_currency_helper() {
885 charitable_get_deprecated()->deprecated_function( __METHOD__, '1.4.0', 'charitable_get_currency_helper' );
886 return charitable_get_currency_helper();
887 }
888
889 /**
890 * @deprecated 1.6.0
891 *
892 * @since 1.2.0 Deprecated.
893 */
894 public function get_location_helper() {
895 charitable_get_deprecated()->deprecated_function( __METHOD__, '1.2.0', 'charitable_get_location_helper' );
896 return charitable_get_location_helper();
897 }
898 }
899
900 $charitable = new Charitable();
901
902 endif;
903