charitable
/
includes
/
admin
/
intergrations
/
class-charitable-intergrations-privacy-compliance.php
class-charitable-intergrations-privacy-compliance.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at includes/admin/intergrations/class-charitable-intergrations-privacy-compliance.php
| 1 | <?php |
| 2 | /** |
| 3 | * Privacy Compliance Integration |
| 4 | * |
| 5 | * @package Charitable/Classes/Charitable_Intergrations_Privacy_Compliance |
| 6 | * @author David Bisset |
| 7 | * @copyright Copyright (c) 2023, WP Charitable LLC |
| 8 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 | * @since 1.8.8 |
| 10 | * @version 1.8.8 |
| 11 | */ |
| 12 | |
| 13 | // Exit if accessed directly. |
| 14 | if ( ! defined( 'ABSPATH' ) ) { |
| 15 | exit; |
| 16 | } |
| 17 | |
| 18 | if ( ! class_exists( 'Charitable_Intergrations_Privacy_Compliance' ) ) : |
| 19 | |
| 20 | /** |
| 21 | * Charitable_Intergrations_Privacy_Compliance |
| 22 | * |
| 23 | * @final |
| 24 | * @since 1.8.8 |
| 25 | */ |
| 26 | class Charitable_Intergrations_Privacy_Compliance { |
| 27 | |
| 28 | /** |
| 29 | * The single instance of this class. |
| 30 | * |
| 31 | * @since 1.8.8 |
| 32 | * |
| 33 | * @var Charitable_Intergrations_Privacy_Compliance|null |
| 34 | */ |
| 35 | private static $instance = null; |
| 36 | |
| 37 | /** |
| 38 | * Hooks. |
| 39 | * |
| 40 | * @since 1.8.8 |
| 41 | */ |
| 42 | private function hooks() { |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Enqueue assets. |
| 47 | * |
| 48 | * @since 1.8.8 |
| 49 | */ |
| 50 | public function enqueue_scripts() { |
| 51 | |
| 52 | if ( ! class_exists( 'Charitable' ) ) { |
| 53 | return; |
| 54 | } |
| 55 | |
| 56 | $min = charitable_get_min_suffix(); |
| 57 | $version = charitable()->get_version(); |
| 58 | $assets_dir = charitable()->get_path( 'assets', false ); |
| 59 | |
| 60 | /* The following styles are only loaded on Charitable screens. */ |
| 61 | $screen = get_current_screen(); |
| 62 | |
| 63 | |
| 64 | |
| 65 | if ( ( ! empty( $_GET['page'] ) && 'charitable-privacy-compliance' === $_GET['page'] ) ) { // phpcs:ignore |
| 66 | |
| 67 | wp_enqueue_style( |
| 68 | 'charitable-privacy-compliance', |
| 69 | $assets_dir . 'css/integrations/privacy-compliance.css', |
| 70 | array(), |
| 71 | $version |
| 72 | ); |
| 73 | |
| 74 | wp_register_script( |
| 75 | 'charitable-admin-plugins', |
| 76 | $assets_dir . 'js/plugins/charitable-admin-plugins' . $min . '.js', |
| 77 | array( 'jquery' ), |
| 78 | $version, |
| 79 | true |
| 80 | ); |
| 81 | |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Returns and/or create the single instance of this class. |
| 87 | * |
| 88 | * @since 1.8.8 |
| 89 | * |
| 90 | * @return Charitable_Intergrations_Privacy_Compliance |
| 91 | */ |
| 92 | public static function get_instance() { |
| 93 | if ( is_null( self::$instance ) ) { |
| 94 | self::$instance = new self(); |
| 95 | } |
| 96 | |
| 97 | return self::$instance; |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | endif; |
| 102 |