|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Plugin Name: PrintCenter |
|
4
|
|
|
* Plugin URI: http://customerprintcenter.com |
|
5
|
|
|
* Description: Provides the server components for the Customer Print Center aspect of Grow Thrive Print |
|
6
|
|
|
* Version: 1.0.0 |
|
7
|
|
|
* Author: Daniel J Griffiths |
|
8
|
|
|
* Author URI: http://section214.com |
|
9
|
|
|
* Text Domain: printcenter |
|
10
|
|
|
* |
|
11
|
|
|
* @package PrintCenter |
|
12
|
|
|
* @author Daniel J Griffiths <[email protected]> |
|
13
|
|
|
*/ |
|
14
|
|
|
|
|
15
|
|
|
|
|
16
|
|
|
// Exit if accessed directly |
|
17
|
|
|
if( ! defined( 'ABSPATH' ) ) { |
|
18
|
|
|
exit; |
|
19
|
|
|
} |
|
20
|
|
|
|
|
21
|
|
|
|
|
22
|
|
|
if( ! class_exists( 'PrintCenter' ) ) { |
|
23
|
|
|
|
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Main PrintCenter class |
|
27
|
|
|
* |
|
28
|
|
|
* @since 1.0.0 |
|
29
|
|
|
*/ |
|
30
|
|
|
class PrintCenter { |
|
31
|
|
|
|
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @access private |
|
35
|
|
|
* @since 1.0.0 |
|
36
|
|
|
* @var PrintCenter $instance The one true PrintCenter |
|
37
|
|
|
*/ |
|
38
|
|
|
private static $instance; |
|
39
|
|
|
|
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @access public |
|
43
|
|
|
* @since 1.0.0 |
|
44
|
|
|
* @var object $loader The PrintCenter loader object |
|
45
|
|
|
*/ |
|
46
|
|
|
public $loader; |
|
47
|
|
|
|
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* Get active instance |
|
51
|
|
|
* |
|
52
|
|
|
* @access public |
|
53
|
|
|
* @since 1.0.0 |
|
54
|
|
|
* @return self::$instance The one true PrintCenter |
|
55
|
|
|
*/ |
|
56
|
1 |
|
public static function instance() { |
|
57
|
1 |
|
if( ! isset( self::$instance ) && ! ( self::$instance instanceof PrintCenter ) ) { |
|
58
|
|
|
self::$instance = new PrintCenter(); |
|
59
|
|
|
|
|
60
|
|
|
// Bootstrap the plugin |
|
61
|
|
|
if( ! class_exists( 'PrintCenter_Loader' ) ) { |
|
62
|
|
|
require_once 'includes/class.loader.php'; |
|
63
|
|
|
} |
|
64
|
|
|
self::$instance->loader = new PrintCenter_Loader( __FILE__ ); |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
1 |
|
return self::$instance; |
|
68
|
|
|
} |
|
69
|
|
|
} |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* The main function responsible for returning the one true PrintCenter |
|
75
|
|
|
* instance to functions everywhere |
|
76
|
|
|
* |
|
77
|
|
|
* @since 1.0.0 |
|
78
|
|
|
* @return PrintCenter The one true PrintCenter |
|
79
|
|
|
*/ |
|
80
|
|
|
function PrintCenter() { |
|
81
|
1 |
|
return PrintCenter::instance(); |
|
82
|
|
|
} |
|
83
|
|
|
add_action( 'plugins_loaded', 'printcenter', 9 ); |
|
84
|
|
|
|