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 ) { |
||
189 | |||
190 | /** |
||
191 | * Minifies html in case the minify_html option is set to true. |
||
192 | * |
||
193 | * @param string $html HTML string. |
||
194 | * @return string |
||
195 | */ |
||
196 | private static function maybe_minify( $html ) { |
||
209 | |||
210 | /** |
||
211 | * Returns minified version of string with removed whitespaces and empty strings. |
||
212 | * |
||
213 | * @param string $html HTML string. |
||
214 | * @return string |
||
215 | */ |
||
216 | private static function minify_html( $html ) { |
||
237 | |||
238 | /** |
||
239 | * Alias for Helper::get_archives_title() |
||
240 | * Returns page title for archive page. |
||
241 | * Example: Archives, Author: John Doe, Tag: Lorem Ipsum |
||
242 | * |
||
243 | * @return string |
||
244 | */ |
||
245 | public static function archives_title() { |
||
250 | |||
251 | /** |
||
252 | * Returns posts |
||
253 | * |
||
254 | * @param mixed $args Array of query args. |
||
255 | * @param string $return object/id/Post. |
||
256 | * |
||
257 | * @return array |
||
258 | */ |
||
259 | public static function get_posts( $args = false, $return = '\Classy\Models\Post' ) { |
||
287 | |||
288 | |||
289 | /** |
||
290 | * Returns post. |
||
291 | * |
||
292 | * @param mixed $args Array of query args. |
||
293 | * @param string $return_type Post/object/id. |
||
294 | * |
||
295 | * @return mixed |
||
296 | */ |
||
297 | public static function get_post( $args = false, $return_type = '\Classy\Models\Post' ) { |
||
306 | |||
307 | /** |
||
308 | * @todo: Write description here. |
||
309 | * |
||
310 | * @param array $prefs Args for paginate_links. |
||
311 | * |
||
312 | * @return array mixed |
||
313 | */ |
||
314 | public static function get_pagination( $prefs = array() ) { |
||
372 | } |
||
373 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: