-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
101 lines (91 loc) · 2.21 KB
/
index.php
File metadata and controls
101 lines (91 loc) · 2.21 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
/**
* Check if the class does not exits then only allow the file to add
*/
if( ! class_exists( 'WPBoilerplate_Plugins_Info' ) ) {
/**
* Fired during plugin licences.
*
* This class defines all code necessary to run during the plugin's licences and update.
*
* @since 1.0.0
* @package WPBoilerplate_Plugins_Info
* @subpackage WPBoilerplate_Plugins_Info/includes
*/
class WPBoilerplate_Plugins_Info {
/**
* The single instance of the class.
*
* @var WPBoilerplate_Plugins_Info
* @since 1.0.0
*/
protected static $_instance = null;
/**
* Main WPBoilerplate_Plugins_Info Instance.
*
* Ensures only one instance of WooCommerce is loaded or can be loaded.
*
* @since 1.0.0
* @static
* @see WPBoilerplate_Plugins_Info()
* @return WPBoilerplate_Plugins_Info - Main instance.
*/
public static function instance() {
if ( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
}
/**
* Get the vendor path of composer
*
* @return string Path of the vendor dir
*/
public function get_vendor_path() {
return \SzepeViktor\Composer\PackagePath::getVendorPath();
}
/**
* Get the plugin path
*
* @return string Path of the plugins
*/
public function get_plugin_path() {
return dirname( $this->get_vendor_path() );
}
/**
* Get the plugin path
*
* @return string Path of the plugins
*/
public function get_full_plugin_path() {
return $this->get_plugin_path() . '/' . $this->get_plugin_file_name() . '.php';
}
/**
* Get the plugin path
*
* @return string Path of the plugins
*/
public function get_plugin_file_name() {
return basename( $this->get_plugin_path() );
}
/**
* Get the plugin path basename
*
* @return string Path of the plugins
*/
public function get_plugin_basename() {
return plugin_basename( $this->get_full_plugin_path() );
}
/**
* Get the plugin path
*
* @return string Path of the plugins
*/
public function get_block_path() {
return $this->get_plugin_path() . '/build/blocks';
}
}
WPBoilerplate_Plugins_Info::instance();
}