-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotification-store.php
74 lines (58 loc) · 1.88 KB
/
notification-store.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/*
Plugin Name: Notification Store
Description: Store your notifications to display it on frontend
Plugin URI: https://notification.underdev.it
Author: HugoPoi
Author URI: https://blog.hugopoi.net/
Version: 1.0
License: GPL3
Text Domain: notification-store
Domain Path: /languages
*/
/**
* Composer autoload
*/
require_once( 'vendor/autoload.php' );
/**
* Setup plugin
* @return void
*/
function notification_store_plugin_setup() {
load_plugin_textdomain( 'notification-store', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}
add_action( 'plugins_loaded', 'notification_store_plugin_setup' );
/**
* Initialize plugin
* @return void
*/
function notification_store_settings_initialize() {
/**
* Settings instance
*/
new HugoPoi\Notification\Store\Settings();
}
add_action( 'init', 'notification_store_settings_initialize', 5 );
/**
* Initialize plugin
* @return void
*/
function notifications_store_initialize() {
/**
* Init NotificationsStore service
*/
HugoPoi\Notification\Store\NotificationsStore::get();
new HugoPoi\Notification\Store\RegisterAcf();
}
add_action( 'init', 'notifications_store_initialize', 10 );
/**
* Do some check on plugin activation
* @return void
*/
function notification_store_activation() {
if ( version_compare( PHP_VERSION, '5.3', '<' ) || ! is_plugin_active( 'notification/notification.php' ) || ! is_plugin_active( 'advanced-custom-fields/acf.php' ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) );
wp_die( __( 'This plugin requires PHP in version at least 5.3, Notification and Advanced Custom Fields plugins active. WordPress itself <a href="https://wordpress.org/about/requirements/" target="_blank">requires at least PHP 5.6</a>. Please upgrade your PHP version or contact your Server administrator.', 'notification-store' ) );
}
}
register_activation_hook( __FILE__, 'notification_store_activation' );