-
Notifications
You must be signed in to change notification settings - Fork 3
/
meta-inspector.php
executable file
·58 lines (50 loc) · 1.6 KB
/
meta-inspector.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
<?php
/**
* Plugin Name: Meta Inspector
* Description: View various types of meta data about WordPress objects to assist debugging.
* Author: alleyinteractive, jameswalterburke
* Author URI: https://alley.com/
* Text Domain: meta-inspector
* Version: 1.1.3
*
* @package Meta_Inspector
*/
namespace Meta_Inspector;
// Load base traits.
require_once __DIR__ . '/inc/trait-singleton.php';
// Load base classes.
require_once __DIR__ . '/inc/class-table.php';
require_once __DIR__ . '/inc/class-wp-object.php';
// Load object classes.
require_once __DIR__ . '/inc/objects/class-post.php';
require_once __DIR__ . '/inc/objects/class-term.php';
require_once __DIR__ . '/inc/objects/class-user.php';
require_once __DIR__ . '/inc/objects/class-comment.php';
require_once __DIR__ . '/inc/objects/class-fm-term-meta.php';
require_once __DIR__ . '/inc/objects/class-bp-group.php';
require_once __DIR__ . '/inc/objects/class-bp-activity.php';
// Initalize classes.
add_action(
'plugins_loaded', // Load early so we can use other hooks.
function () {
/**
* Filter the capability needed to view the meta boxes.
*
* @param string $capability The capability needed to view the meta boxes.
*/
if ( ! current_user_can( apply_filters( 'meta_inspector_capability', 'manage_options' ) ) ) {
return;
}
Post::instance();
Term::instance();
User::instance();
Comment::instance();
// Legacy FM Term Meta Data support.
Fm_Term_Meta::instance();
// BuddyPress support.
if ( class_exists( 'BuddyPress' ) ) {
BP_Group::instance();
BP_Activity::instance();
}
}
);