-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
68 lines (43 loc) · 1.61 KB
/
index.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
<?php
/*
* Plugin Name: bbPress Custom Profile Fields
* Description: Adds custom fields to the bbPress profile
* Author: Lance Jernigan
* Author URI: https://lancejernigan.com
* Version: 0.0.2
*/
if (! class_exists('bbCPF')) :
class bbCPF {
public $isSaving = false,
$url = null,
$path = null,
$fields = null,
$utils = null;
public function __construct() {}
private function setup() {
$this->isSaving = isset($_POST['bbCPF']);
$this->url = plugin_dir_url(__FILE__);
$this->path = plugin_dir_path(__FILE__);
}
private function includes() {
include($this->path . 'includes/class-utils.php');
include($this->path . 'includes/class-fields.php');
include($this->path . 'includes/template-override.php');
$this->utils = new bbCPF_Utils;
$this->fields = new bbCPF_Fields($this->isSaving);
}
public static function instance() {
static $instance = null;
if ($instance === null) {
$instance = new bbCPF;
$instance->setup();
$instance->includes();
}
return $instance = ($instance === null ? new bbCPF : $instance);
}
}
function bbCPF() {
return bbCPF::instance();
}
add_action('plugins_loaded', 'bbCPF');
endif;