-
Notifications
You must be signed in to change notification settings - Fork 0
/
jsm-show-user-meta.php
77 lines (57 loc) · 2.12 KB
/
jsm-show-user-meta.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
75
76
77
<?php
/*
* Plugin Name: JSM Show User Metadata
* Text Domain: jsm-show-user-meta
* Domain Path: /languages
* Plugin URI: https://surniaulula.com/extend/plugins/jsm-show-user-meta/
* Assets URI: https://jsmoriss.github.io/jsm-show-user-meta/assets/
* Author: JS Morisset
* Author URI: https://surniaulula.com/
* License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl.txt
* Description: Show user metadata in a metabox when editing users - a great tool for debugging issues with user metadata.
* Requires PHP: 7.4.33
* Requires At Least: 5.9
* Tested Up To: 6.7.0
* Version: 4.6.0
*
* Version Numbering: {major}.{minor}.{bugfix}[-{stage}.{level}]
*
* {major} Major structural code changes and/or incompatible API changes (ie. breaking changes).
* {minor} New functionality was added or improved in a backwards-compatible manner.
* {bugfix} Backwards-compatible bug fixes or small improvements.
* {stage}.{level} Pre-production release: dev < a (alpha) < b (beta) < rc (release candidate).
*
* Copyright 2016-2024 Jean-Sebastien Morisset (https://surniaulula.com/)
*/
if ( ! defined( 'ABSPATH' ) ) {
die( 'These aren\'t the droids you\'re looking for.' );
}
if ( ! class_exists( 'JsmSum' ) ) {
class JsmSum {
private static $instance = null; // JsmSum class object.
public function __construct() {
if ( ! is_admin() ) return; // This is an admin-only plugin.
$plugin_dir = trailingslashit( dirname( __FILE__ ) );
require_once $plugin_dir . 'lib/config.php';
JsmSumConfig::set_constants( __FILE__ );
JsmSumConfig::require_libs( __FILE__ );
add_action( 'init', array( $this, 'init_textdomain' ) );
add_action( 'init', array( $this, 'init_objects' ) );
}
public static function &get_instance() {
if ( null === self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
public function init_textdomain() {
load_plugin_textdomain( 'jsm-show-user-meta', false, 'jsm-show-user-meta/languages/' );
}
public function init_objects() {
new JsmSumScript();
new JsmSumUser();
}
}
JsmSum::get_instance();
}