-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCore.php
More file actions
executable file
·59 lines (47 loc) · 2.03 KB
/
Core.php
File metadata and controls
executable file
·59 lines (47 loc) · 2.03 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
<?php
namespace Xeeeveee\Core;
use Xeeeveee\Core\Utility\Singleton;
use Xeeeveee\Core\Configuration\ConfigurationTrait;
use Xeeeveee\Core\Container\Container;
use Xeeeveee\Core\WordPress\Enqueue\Script\AdminMain;
use Xeeeveee\Core\WordPress\Enqueue\Style\ColorPicker;
use Xeeeveee\Core\WordPress\Enqueue\Style\JQueryUi;
use Xeeeveee\Core\WordPress\Prepare\Post;
use Xeeeveee\Core\WordPress\Prepare\Term;
use Xeeeveee\Core\WordPress\Register\Decorators\PostDecorator;
class Core extends Singleton {
use ConfigurationTrait;
/**
* Registers appropriate actions with WordPress
*/
protected function __construct() {
add_action( 'plugins_loaded', [ $this, 'boot' ] );
}
/**
* Initialize required classes and add them to the container
*
* @throws Exceptions\ContainerOverrideException
* @throws Exceptions\NotStringException
*/
public function boot() {
$container = Container::get_instance();
if ( apply_filters( $this->filter_base . 'core/register/prepare/post', true ) ) {
$container->add( 'Xeeeveee\Core\WordPress\Prepare\Post', Post::get_instance() );
}
if ( apply_filters( $this->filter_base . 'core/register/prepare/post', true ) ) {
$container->add( 'Xeeeveee\Core\WordPress\Prepare\Term', Term::get_instance() );
}
if ( apply_filters( $this->filter_base . 'core/register/prepare/post', true ) ) {
$container->add( 'Xeeeveee\Core\WordPress\Register\Decorators\PostDecorator', PostDecorator::get_instance() );
}
if ( apply_filters( $this->filter_base . 'core/register/enqueue/admin_scripts', true ) ) {
$container->add( 'Xeeeveee\Core\WordPress\Enqueue\Script\AdminScripts', AdminMain::get_instance() );
}
if ( apply_filters( $this->filter_base . 'core/register/enqueue/color_picker_styles', true ) ) {
$container->add( 'Xeeeveee\Core\WordPress\Enqueue\Style\ColorPicker', ColorPicker::get_instance() );
}
if ( apply_filters( $this->filter_base . 'core/register/enqueue/jquery_ui_styles', true ) ) {
$container->add( 'Xeeeveee\Core\WordPress\Enqueue\Style\JQueryUi', JQueryUi::get_instance() );
}
}
}