1 | <?php |
||
17 | class Classy { |
||
18 | |||
19 | /** |
||
20 | * Singleton instance of plugin |
||
21 | * |
||
22 | * @var Classy |
||
23 | * @since 0.1.0 |
||
24 | */ |
||
25 | protected static $single_instance = null; |
||
26 | |||
27 | /** |
||
28 | * Creates or returns an instance of this class. |
||
29 | * |
||
30 | * @since 0.1.0 |
||
31 | * @return Classy A single instance of this class. |
||
32 | */ |
||
33 | public static function get_instance() { |
||
44 | |||
45 | /** |
||
46 | * Define the core functionality of the them. |
||
47 | * |
||
48 | * Set the theme name and the theme version that can be used throughout the theme. |
||
49 | * |
||
50 | * @since 1.0.0 |
||
51 | */ |
||
52 | protected function __construct() { |
||
63 | |||
64 | /** |
||
65 | * Init Appearance class. |
||
66 | */ |
||
67 | private function init_appearance() { |
||
70 | |||
71 | /** |
||
72 | * Load template functions. |
||
73 | */ |
||
74 | private function load_template_function() { |
||
77 | |||
78 | /** |
||
79 | * Defines plugin constants |
||
80 | * |
||
81 | * @since 1.0.0 |
||
82 | * @access private |
||
83 | */ |
||
84 | private function define_constants() { |
||
97 | |||
98 | /** |
||
99 | * Init Theme Configuration |
||
100 | */ |
||
101 | private function init_config() { |
||
104 | |||
105 | /** |
||
106 | * Filters registered templates and adds custom theme templates. |
||
107 | * |
||
108 | * @param array $page_templates Available WordPress templates. |
||
109 | * |
||
110 | * @return array |
||
111 | */ |
||
112 | public function filter_templates( $page_templates = array() ) { |
||
119 | |||
120 | /** |
||
121 | * Returns theme config variable. |
||
122 | * |
||
123 | * @param string $name Variable's name. |
||
124 | * |
||
125 | * @return mixed|bool Return false if variable not found. |
||
126 | */ |
||
127 | public static function get_config_var( $name ) { |
||
134 | |||
135 | /** |
||
136 | * Returns theme textdomain |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | public static function textdomain() { |
||
147 | |||
148 | /** |
||
149 | * Performs view render. |
||
150 | * If there is $view attribute presented, it will render requested view. |
||
151 | * If it's not it will try to find necessary view based on $wp_query |
||
152 | * |
||
153 | * @param string|null $view View path in blade format, ex: single, layout.default, single.partials.slider and etc. |
||
154 | * @param array|null $data Additional params. |
||
155 | * @return void |
||
156 | */ |
||
157 | public static function render( $view = null, $data = null ) { |
||
187 | |||
188 | /** |
||
189 | * Alias for Helper::get_archives_title() |
||
190 | * Returns page title for archive page. |
||
191 | * Example: Archives, Author: John Doe, Tag: Lorem Ipsum |
||
192 | * |
||
193 | * @return string |
||
194 | */ |
||
195 | public static function archives_title() { |
||
200 | |||
201 | /** |
||
202 | * Returns posts |
||
203 | * |
||
204 | * @param mixed $args Array of query args. |
||
205 | * @param string $return object/id/Post. |
||
206 | * |
||
207 | * @return array |
||
208 | */ |
||
209 | public static function get_posts( $args = false, $return = '\Classy\Models\Post' ) { |
||
237 | |||
238 | |||
239 | /** |
||
240 | * Returns post. |
||
241 | * |
||
242 | * @param mixed $args Array of query args. |
||
243 | * @param string $return_type Post/object/id. |
||
244 | * |
||
245 | * @return mixed |
||
246 | */ |
||
247 | public static function get_post( $args = false, $return_type = '\Classy\Models\Post' ) { |
||
256 | |||
257 | /** |
||
258 | * @todo: Write description here. |
||
259 | * |
||
260 | * @param array $prefs Args for paginate_links. |
||
261 | * |
||
262 | * @return array mixed |
||
263 | */ |
||
264 | public static function get_pagination( $prefs = array() ) { |
||
322 | } |
||
323 |