-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTheme.php
71 lines (67 loc) · 1.86 KB
/
Theme.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
<?php
namespace Cubetech;
use \Cubetech\Base\CubetechPost;
use \Cubetech\Helpers\RestrictionHandler;
use \Cubetech\Controller\ActionController;
use \Cubetech\Controller\StyleController;
use \Cubetech\Controller\ScriptController;
use \Cubetech\Controller\NavigationController;
use \Cubetech\Controller\ThemeController;
use \Cubetech\Controller\PosttypeController;
use \Cubetech\Controller\SidebarController;
use \Cubetech\Controller\PackageController;
use \Cubetech\Controller\ImageController;
/**
* Base class for the Theme
*
* Sets up everything needed for the theme to function
* i.e. views, components, navigations etc.
*
* @author Alex Scherer <[email protected]>
* @author Marc Mentha <[email protected]>
* @since Version 1.1.0
*/
class Theme
{
/**
* Calls every controllers addAction method
*
* @return void
*
* @author Alex Scherer <[email protected]>
* @author Marc Mentha <[email protected]>
* @since 1.0.0
* @version 2.0.0
*/
public function initialize()
{
ThemeController::addActions();
StyleController::addActions();
ScriptController::addActions();
PosttypeController::addActions();
NavigationController::addActions();
SidebarController::addActions();
PackageController::addActions();
ImageController::addActions();
RestrictionHandler::hideAdminBarForNoBackendUser();
}
/**
* Get Cubetech Posts from given arguments
*
* @param array $args
* @return array <CubetechPost>
*
* @author Marc Mentha <[email protected]>
* @since 1.0.0
* @version 1.0.0
*/
public static function getPosts($args)
{
$posts = get_posts($args);
$results = [];
foreach ($posts as $post) {
$results[] = new CubetechPost($post);
}
return $results;
}
}