-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathloader.php
57 lines (50 loc) · 1.32 KB
/
loader.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
<?php
/**
* Plugin Name: BuddyPress Message Attachment
* Description: Extend BuddyPress' private message feature by enabling attachments. This plugin enables users to send attachments in private messages.
* Version: 3.0.0
* Author: ckchaudhary
* Author URI: https://twitter.com/ckchaudhary
* Text Domain: bp-msgat
* Domain Path: /languages
*
* @package bpmsgat
* @since 1.0.0
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Directory.
if ( ! defined( 'BPMSGAT_PLUGIN_DIR' ) ) {
define( 'BPMSGAT_PLUGIN_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
}
// Url.
if ( ! defined( 'BPMSGAT_PLUGIN_URL' ) ) {
$plugin_url = trailingslashit( plugin_dir_url( __FILE__ ) );
// If we're using https, update the protocol.
if ( is_ssl() ) {
$plugin_url = str_replace( 'http://', 'https://', $plugin_url );
}
define( 'BPMSGAT_PLUGIN_URL', $plugin_url );
}
/**
* Instantiate the main plugin class
*
* @return void
*/
function bp_msgat_init() {
require BPMSGAT_PLUGIN_DIR . 'includes/class-bp-msgat-plugin.php';
bp_message_attachment();
}
add_action( 'plugins_loaded', 'bp_msgat_init' );
/**
* Returns plugins instance.
* Must be called after plugins_loaded.
*
* @since 2.0
* @return \BP_Msgat_Plugin plugin object
*/
function bp_message_attachment() {
return BP_Msgat_Plugin::instance();
}