PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.0
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.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 / includes / widgets / class-charitable-widgets.php

class-charitable-widgets.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.0, at includes/widgets/class-charitable-widgets.php

79 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Charitable widgets class.
4 *
5 * Registers custom widgets for Charitable.
6 *
7 * @version 1.0.0
8 * @package Charitable/Classes/Charitable_Widgets
9 * @author David Bisset
10 * @copyright Copyright (c) 2023, WP Charitable LLC
11 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
12 */
13
14 // Exit if accessed directly.
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19 if ( ! class_exists( 'Charitable_Widgets' ) ) :
20
21 /**
22 * Charitable_Widgets
23 *
24 * @final
25 * @since 1.0.0
26 */
27 final class Charitable_Widgets {
28
29 /**
30 * The single instance of this class.
31 *
32 * @var Charitable_Widgets|null
33 */
34 private static $instance = null;
35
36 /**
37 * Returns and/or create the single instance of this class.
38 *
39 * @since 1.2.0
40 *
41 * @return Charitable_Widgets
42 */
43 public static function get_instance() {
44 if ( is_null( self::$instance ) ) {
45 self::$instance = new self();
46 }
47
48 return self::$instance;
49 }
50
51 /**
52 * Set up the class. This can only be loaded with the get_instance() method.
53 *
54 * @since 1.0.0
55 */
56 private function __construct() {
57 add_action( 'widgets_init', array( $this, 'register_widgets' ) );
58 }
59
60 /**
61 * Register widgets.
62 *
63 * @see widgets_init hook
64 *
65 * @since 1.0.0
66 *
67 * @return void
68 */
69 public function register_widgets() {
70 register_widget( 'Charitable_Campaign_Terms_Widget' );
71 register_widget( 'Charitable_Campaigns_Widget' );
72 register_widget( 'Charitable_Donors_Widget' );
73 register_widget( 'Charitable_Donate_Widget' );
74 register_widget( 'Charitable_Donation_Stats_Widget' );
75 }
76 }
77
78 endif;
79