forked from BracketSpace/Notification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotification.php
60 lines (48 loc) · 1.46 KB
/
notification.php
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
<?php
/**
* Plugin Name: Notification
* Description: Customisable email and webhook notifications with powerful developer friendly API for custom triggers and notifications. Send alerts easily.
* Author: BracketSpace
* Author URI: https://bracketspace.com
* Version: 6.2.0
* License: GPL3
* Text Domain: notification
* Domain Path: /languages
*
* @package notification
*/
define( 'NOTIFICATION_VERSION', '6.1.6' );
require_once dirname( __FILE__ ) . '/vendor/autoload.php';
/**
* Requirements check
*/
$requirements = new BracketSpace\Notification\Utils\Requirements( __( 'Notification', 'notification' ), [
'php' => '7.0',
'wp' => '5.2',
'function_collision' => [ 'notification' ],
] );
if ( ! $requirements->satisfied() ) {
add_action( 'admin_notices', [ $requirements, 'notice' ] );
return;
}
global $notification_runtime;
/**
* Gets the plugin runtime.
*
* @param string $property Optional property to get.
* @return object Runtime class instance
*/
function notification_runtime( $property = null ) {
global $notification_runtime;
if ( empty( $notification_runtime ) ) {
$notification_runtime = new BracketSpace\Notification\Runtime( __FILE__ );
}
if ( null !== $property && isset( $notification_runtime->{ $property } ) ) {
return $notification_runtime->{ $property };
}
return $notification_runtime;
}
add_action( 'plugins_loaded', function() {
$runtime = notification_runtime();
$runtime->boot();
}, 5 );