PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.7.0.6
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.7.0.6
1.8.13.1 1.8.13 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 All 212 releases
charitable / includes / admin / dashboard-widgets / class-charitable-donations-dashboard-widget.php

class-charitable-donations-dashboard-widget.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.7.0.6, at includes/admin/dashboard-widgets/class-charitable-donations-dashboard-widget.php

73 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 * Sets up the Donations dashboard widget.
4 *
5 * @package Charitable/Classes/Charitable_Donations_Dashboard_Widget
6 * @version 1.2.0
7 * @author David Bisset
8 * @copyright Copyright (c) 2022, WP Charitable LLC
9 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10 */
11
12 // Exit if accessed directly.
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 if ( ! class_exists( 'Charitable_Donations_Dashboard_Widget' ) ) :
18
19 /**
20 * Charitable_Donations_Dashboard_Widget
21 *
22 * @since 1.2.0
23 */
24 class Charitable_Donations_Dashboard_Widget {
25
26 /**
27 * The widget ID.
28 */
29 const ID = 'charitable_dashboard_donations';
30
31 /**
32 * Create class object.
33 *
34 * @since 1.2.0
35 */
36 public static function register() {
37 if ( ! current_user_can( 'view_charitable_sensitive_data' ) ) {
38 return;
39 }
40
41 wp_add_dashboard_widget( self::ID, __( 'Charitable Donation Statistics', 'charitable' ), array( 'Charitable_Donations_Dashboard_Widget', 'display' ) );
42 }
43
44 /**
45 * Print the widget contents.
46 *
47 * @since 1.2.0
48 *
49 * @return void
50 */
51 public static function display() {
52 ?>
53 <p class="hide-if-no-js">
54 <img src="<?php echo charitable()->get_path( 'assets', false ) ?>/images/charitable-loading.gif" width="60" height="60" alt="<?php esc_attr_e( 'Loading&hellip;', 'charitable' ) ?>" />
55 </p>
56 <?php
57 }
58
59 /**
60 * Return the content to display inside the widget.
61 *
62 * @since 1.2.0
63 *
64 * @return void
65 */
66 public static function get_content() {
67 charitable_admin_view( 'dashboard-widgets/donations-widget' );
68 die();
69 }
70 }
71
72 endif;
73