-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmemberdata.php
More file actions
80 lines (72 loc) · 2.64 KB
/
memberdata.php
File metadata and controls
80 lines (72 loc) · 2.64 KB
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
78
79
80
<?php
/**
* Memberdata
*
* @package memberdata
* @author Michiel Uitdehaag
* @copyright 2020 - 2023 Michiel Uitdehaag for muis IT
* @licenses GPL-3.0-or-later
*
* @wordpress-plugin
* Plugin Name: memberdata
* Plugin URI: https://github.com/muisit/wp-elo
* Description: Basic registration of membership data without creating WP accounts
* Version: 1.1.9
* Requires at least: 6.1
* Requires PHP: 8.0
* Author: Michiel Uitdehaag
* Author URI: https://www.muisit.nl
* License: GNU GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: memberdata
* Domain Path: /languages
*
* This file is part of memberdata.
*
* memberdata is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* memberdata is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with memberdata. If not, see <https://www.gnu.org/licenses/>.
*/
define('MEMBERDATA_VERSION', "1.1.9");
define('MEMBERDATA_PACKAGENAME', 'memberdata');
define('MEMBERDATA_DEBUG', true);
function memberdata_autoloader($name)
{
if (!strncmp($name, 'MemberData\\', 11)) {
$elements = explode('\\', $name);
// require at least MemberData\<sub>\<name>, so 3 elements
if (sizeof($elements) > 2 && $elements[0] == "MemberData") {
$fname = $elements[sizeof($elements) - 1] . ".php";
$dir = implode("/", array_splice($elements, 1, -1)); // remove the base part and the file itself
if (file_exists(__DIR__ . "/" . strtolower($dir) . "/" . $fname)) {
include(__DIR__ . "/" . strtolower($dir) . "/" . $fname);
}
}
}
}
spl_autoload_register('memberdata_autoloader');
require_once('vendor/autoload.php');
if (defined('ABSPATH')) {
\MemberData\Lib\Activator::register(__FILE__);
add_action('plugins_loaded', function () {
\MemberData\Lib\Display::register(__FILE__);
\MemberData\Lib\API::register(__FILE__);
\MemberData\Lib\Plugin::register(__FILE__);
do_action('memberdata_loaded');
});
}
function memberdata_log($txt)
{
if (MEMBERDATA_DEBUG) {
error_log($txt);
}
}