-
Notifications
You must be signed in to change notification settings - Fork 0
/
expert-finder.php
84 lines (73 loc) · 1.81 KB
/
expert-finder.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
78
79
80
81
82
83
84
<?php
/**
* Plugin Name: Expert Finder
* Plugin URI: https://wordpress.org/plugins/expert-finder
* Description: This WordPress plugin provides a search engine to find experts who created or commented various WordPress content types
* Version: 1.0.0
* Author: Konnektiv
* Author URI: http://konnektiv.de/
* License: GNU AGPL (license.txt)
* Text Domain: expert-finder
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class Expert_Finder {
/**
* @var Expert_Finder
*/
private static $instance;
/**
* Main Expert_Finder Instance
*
* Insures that only one instance of Expert_Finder exists in memory at
* any one time. Also prevents needing to define globals all over the place.
*
* @since Expert_Finder (1.0.0)
*
* @staticvar array $instance
*
* @return Expert_Finder
*/
public static function instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new Expert_Finder;
self::$instance->includes();
self::$instance->setup_globals();
}
return self::$instance;
}
/**
* A dummy constructor to prevent loading more than one instance
*
* @since Expert_Finder (1.0.0)
*/
private function __construct() { /* Do nothing here */
}
/**
* Component global variables
*
* @since Expert_Finder (1.0.0)
* @access private
*
*/
private function setup_globals() {
Expert_Finder_Shortcode::instance();
Expert_Finder_Settings::instance();
}
/**
* Includes
*
* @since Expert_Finder (1.0.0)
* @access private
*/
private function includes() {
require_once( 'includes/expertfinder-autoloader-class.php' );
Expert_Finder_AutoLoader::add_path( './' );
Expert_Finder_AutoLoader::add_path( 'factories/' );
Expert_Finder_AutoLoader::add_path( 'finder/' );
Expert_Finder_AutoLoader::add_path( 'results/' );
}
}
Expert_Finder::instance();