-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgive-double-the-donation.php
More file actions
61 lines (49 loc) · 1.99 KB
/
give-double-the-donation.php
File metadata and controls
61 lines (49 loc) · 1.99 KB
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
<?php
/**
* Plugin Name: Give - Double the Donation
* Plugin URI: https://givewp.com/addons/give-double-the-donation/
* Description: Easily integrate with the Double the Donation employer matching platform.
* Version: 2.1.2
* Author: GiveWP
* Requires at least: 6.6
* Requires PHP: 7.2
* Author URI: https://givewp.com/
* Text Domain: give-double-the-donation
* Domain Path: /languages
*/
namespace GiveDoubleTheDonation;
use GiveDoubleTheDonation\Addon\Activation;
use GiveDoubleTheDonation\Addon\Environment;
use GiveDoubleTheDonation\DoubleTheDonation\AddonServiceProvider;
use GiveDoubleTheDonation\DoubleTheDonation\FormExtension\ServiceProvider as FormExtensionServiceProvider;
defined( 'ABSPATH' ) or exit;
// Add-on name
define( 'GIVE_DTD_NAME', 'Give - Double the Donation Integration' );
// Versions
define( 'GIVE_DTD_VERSION', '2.1.2' );
define( 'GIVE_DTD_MIN_GIVE_VERSION', '3.8.0' );
// Add-on paths
define( 'GIVE_DTD_FILE', __FILE__ );
define( 'GIVE_DTD_DIR', plugin_dir_path( GIVE_DTD_FILE ) );
define( 'GIVE_DTD_URL', plugin_dir_url( GIVE_DTD_FILE ) );
define( 'GIVE_DTD_BASENAME', plugin_basename( GIVE_DTD_FILE ) );
require 'vendor/autoload.php';
// Activate add-on hook.
register_activation_hook( GIVE_DTD_FILE, [ Activation::class, 'activateAddon' ] );
// Deactivate add-on hook.
register_deactivation_hook( GIVE_DTD_FILE, [ Activation::class, 'deactivateAddon' ] );
// Uninstall add-on hook.
register_uninstall_hook( GIVE_DTD_FILE, [ Activation::class, 'uninstallAddon' ] );
// Register the add-on service provider with the GiveWP core.
add_action(
'before_give_init',
function () {
// Check Give min required version.
if ( Environment::giveMinRequiredVersionCheck() ) {
give()->registerServiceProvider( AddonServiceProvider::class );
give()->registerServiceProvider( FormExtensionServiceProvider::class );
}
}
);
// Check to make sure GiveWP core is installed and compatible with this add-on.
add_action( 'admin_init', [ Environment::class, 'checkEnvironment' ] );