forked from imath/custom-file-for-messages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
custom-file-for-messages.php
50 lines (44 loc) · 1.67 KB
/
custom-file-for-messages.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
<?php
/**
* Sample plugin to illustrate BP Attachment use
* -> require BuddyPress 2.3
*
* @author The BuddyPress community
* @license GPL-2.0+
* @link http://codex.buddypress.org
*
* @buddypress-plugin
* Plugin Name: Custom file for messages
* Plugin URI: http://codex.buddypress.org
* Description: Sample plugin to illustrate BP Attachment use
* Version: 1.0.0
* Author: The BuddyPress community
* Author URI: http://buddypress.org
* Text Domain: custom-domain
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Domain Path: /languages/
* GitHub Plugin URI: https://github.com/imath/custom-file-for-messages
*/
// Exit if accessed directly
defined( 'ABSPATH' ) or die;
/**
* Wait BuddyPress is fully loaded before including
* the Attachment class and our functions
*
* Hook bp_include to do so.
*/
function custom_file_for_messages_require() {
// This plugin requires BuddyPress 2.3 and the messages component
if ( ! version_compare( bp_get_version(), '2.3-alpha', '>=' ) || ! bp_is_active( 'messages' ) ) {
return;
}
// The Custom Attachment class
require( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/class-custom-attachment.php' );
// The Custom functions for the messages component
require( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/functions.php' );
}
add_action( 'bp_include', 'custom_file_for_messages_require' );
//declare complianz with consent level API
$plugin = plugin_basename( __FILE__ );
add_filter( "wp_consent_api_registered_{$plugin}", '__return_true' );