1 | <?php |
||
7 | class Theme |
||
8 | { |
||
9 | public $postmeta; |
||
10 | |||
11 | public function __construct( PostMeta $postmeta ) |
||
12 | { |
||
13 | $this->postmeta = $postmeta; |
||
14 | } |
||
15 | |||
16 | /** |
||
17 | * @param string $asset |
||
18 | * |
||
19 | * @return string |
||
20 | */ |
||
21 | public function assetPath( $asset ) |
||
25 | |||
26 | /** |
||
27 | * @param string $asset |
||
28 | * |
||
29 | * @return string |
||
30 | */ |
||
31 | public function assetUri( $asset ) |
||
35 | |||
36 | /** |
||
37 | * @return bool |
||
38 | */ |
||
39 | public function displaySidebar() |
||
51 | |||
52 | /** |
||
53 | * @param string $asset |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | public function imagePath( $asset ) |
||
61 | |||
62 | /** |
||
63 | * @param string $asset |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | public function imageUri( $asset ) |
||
71 | |||
72 | public function pageTitle() |
||
73 | { |
||
74 | foreach( ['is_404', 'is_archive', 'is_home', 'is_page', 'is_search'] as $bool ) { |
||
75 | if( !$bool() )continue; |
||
76 | $method = sprintf( 'get%sTitle', ucfirst( str_replace( 'is_', '', $bool ))); |
||
77 | return $this->$method(); |
||
78 | } |
||
79 | |||
80 | return get_the_title(); |
||
81 | } |
||
82 | |||
83 | /** |
||
84 | * @param null|string $path |
||
85 | * |
||
86 | * @return array|string |
||
87 | */ |
||
88 | public function paths( $path = null ) |
||
106 | |||
107 | /** |
||
108 | * @param null|string $path |
||
109 | * |
||
110 | * @return string|null |
||
111 | */ |
||
112 | public function svg( $path = null ) |
||
118 | |||
119 | protected function get404Title() |
||
123 | |||
124 | protected function getArchiveTitle() |
||
128 | |||
129 | protected function getHomeTitle() |
||
135 | |||
136 | protected function getPageTitle() |
||
142 | |||
143 | protected function getSearchTitle() |
||
147 | } |
||
148 |