-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathindex.php
54 lines (46 loc) · 1.34 KB
/
index.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
<?php
/*
Plugin Name: bbPress Messages
Plugin URI: https://github.com/elhardoum/bbp-messages
Description: Simple yet powerful private messaging system tailored for bbPress.
Author: Samuel Elh
Version: 2.0.9.1
Author URI: https://samelh.com
Text Domain: bbp-messages
Donate link: https://go.samelh.com/buy-me-a-coffee
*/
if ( !defined('BBP_MESSAGES_FILE') ) {
define('BBP_MESSAGES_FILE', __FILE__);
}
/**
* Require version and dependencies check class
*
* Making sure client has PHP 5.3 at least, required
* for PHP namespaces and closures.
*
* Making sure client has bbPress parent plugin
* installed and activated
*/
$bbPMCheckReady = require('CheckReady.php');
if ($bbPMCheckReady instanceof bbPMCheckReady) {
if ( method_exists($bbPMCheckReady, 'check') ) {
// activation check
register_activation_hook(BBP_MESSAGES_FILE, array($bbPMCheckReady, 'check'));
}
// load plugin
require('BbpMessages.php');
// init
global $bbpm_loader;
// loader class
$bbpm_loader = new \BBP_MESSAGES\BbpMessages;
// setup
$bbpm_loader->setup();
}
function bbp_messages_loaded(){
global $bbpm_loader;
if( ! class_exists('bbPress') ) {
return add_action('admin_init', array($bbpm_loader, 'deactivate'));
}
$bbpm_loader->init();
}
add_action('plugins_loaded', 'bbp_messages_loaded', 10, 0);