@@ -12,7 +12,7 @@ |
||
12 | 12 | /** |
13 | 13 | * Returns list of allowed variables that can be used in theme config |
14 | 14 | * |
15 | - * @return array |
|
15 | + * @return string[] |
|
16 | 16 | */ |
17 | 17 | private static function get_allowed_variables() { |
18 | 18 |
@@ -50,7 +50,8 @@ discard block |
||
50 | 50 | |
51 | 51 | } |
52 | 52 | |
53 | - } else { |
|
53 | + } |
|
54 | + else { |
|
54 | 55 | |
55 | 56 | die('There is no config file in ' . THEME . ' custom/config.php'); |
56 | 57 | |
@@ -73,16 +74,24 @@ discard block |
||
73 | 74 | $vars = self::get_vars(); |
74 | 75 | |
75 | 76 | // Init Post Types |
76 | - if (isset($vars['post_types'])) self::init_post_types( $vars['post_types'] ); |
|
77 | + if (isset($vars['post_types'])) { |
|
78 | + self::init_post_types( $vars['post_types'] ); |
|
79 | + } |
|
77 | 80 | |
78 | 81 | // Init Taxonomies |
79 | - if (isset($vars['taxonomies'])) self::init_taxonomies( $vars['taxonomies'] ); |
|
82 | + if (isset($vars['taxonomies'])) { |
|
83 | + self::init_taxonomies( $vars['taxonomies'] ); |
|
84 | + } |
|
80 | 85 | |
81 | 86 | // Init Post Formats |
82 | - if (isset($vars['post_formats'])) self::init_post_formats( $vars['post_formats'] ); |
|
87 | + if (isset($vars['post_formats'])) { |
|
88 | + self::init_post_formats( $vars['post_formats'] ); |
|
89 | + } |
|
83 | 90 | |
84 | 91 | // Init Sidebars |
85 | - if (isset($vars['sidebars'])) self::init_sidebars( $vars['sidebars'] ); |
|
92 | + if (isset($vars['sidebars'])) { |
|
93 | + self::init_sidebars( $vars['sidebars'] ); |
|
94 | + } |
|
86 | 95 | |
87 | 96 | } |
88 | 97 |
@@ -54,6 +54,7 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @param string |
56 | 56 | * @param string |
57 | + * @param string $name |
|
57 | 58 | */ |
58 | 59 | private function define( $name, $value ) { |
59 | 60 | if ( !defined($name) ) { |
@@ -241,7 +242,7 @@ discard block |
||
241 | 242 | |
242 | 243 | /** |
243 | 244 | * @param array $prefs |
244 | - * @return array mixed |
|
245 | + * @return stdClass mixed |
|
245 | 246 | */ |
246 | 247 | public static function get_pagination( $prefs = array() ) { |
247 | 248 | global $wp_query; |
@@ -190,7 +190,9 @@ discard block |
||
190 | 190 | |
191 | 191 | $vars = ClassyConfig::get_vars(); |
192 | 192 | |
193 | - if (isset($vars[$name])) return $vars[$name]; |
|
193 | + if (isset($vars[$name])) { |
|
194 | + return $vars[$name]; |
|
195 | + } |
|
194 | 196 | |
195 | 197 | return false; |
196 | 198 | |
@@ -230,13 +232,15 @@ discard block |
||
230 | 232 | |
231 | 233 | $scope = array_merge($common_scope, $data); |
232 | 234 | |
233 | - } else { |
|
235 | + } |
|
236 | + else { |
|
234 | 237 | |
235 | 238 | $scope = $common_scope; |
236 | 239 | |
237 | 240 | } |
238 | 241 | |
239 | - } else { |
|
242 | + } |
|
243 | + else { |
|
240 | 244 | |
241 | 245 | $view = ClassyView::get_view(); |
242 | 246 | |
@@ -285,11 +289,13 @@ discard block |
||
285 | 289 | |
286 | 290 | $_return[] = new ClassyPost($post); |
287 | 291 | |
288 | - } elseif($return_type == 'id') { |
|
292 | + } |
|
293 | + elseif($return_type == 'id') { |
|
289 | 294 | |
290 | 295 | $_return[] = $post->id; |
291 | 296 | |
292 | - } else { |
|
297 | + } |
|
298 | + else { |
|
293 | 299 | |
294 | 300 | $_return[] = $post; |
295 | 301 | |
@@ -344,7 +350,8 @@ discard block |
||
344 | 350 | $args['format'] = 'page/%#%'; |
345 | 351 | $args['base'] = trailingslashit( $url[0] ).'%_%'; |
346 | 352 | |
347 | - } else { |
|
353 | + } |
|
354 | + else { |
|
348 | 355 | $big = 999999999; |
349 | 356 | $args['base'] = str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ); |
350 | 357 | } |
@@ -356,7 +363,8 @@ discard block |
||
356 | 363 | |
357 | 364 | if ( is_int( $prefs ) ) { |
358 | 365 | $args['mid_size'] = $prefs - 2; |
359 | - } else { |
|
366 | + } |
|
367 | + else { |
|
360 | 368 | $args = array_merge( $args, $prefs ); |
361 | 369 | } |
362 | 370 |
@@ -61,6 +61,9 @@ |
||
61 | 61 | $this->init(); |
62 | 62 | } |
63 | 63 | |
64 | + /** |
|
65 | + * @param integer|null $uid |
|
66 | + */ |
|
64 | 67 | private function verify_id($uid) { |
65 | 68 | return $uid; |
66 | 69 | } |
@@ -43,7 +43,8 @@ |
||
43 | 43 | |
44 | 44 | wp_register_script( 'theme_plugins', THEME_DIR . 'assets/js/min/production.js', array( 'jquery' ), THEME_VERSION, true ); |
45 | 45 | |
46 | - } else { |
|
46 | + } |
|
47 | + else { |
|
47 | 48 | |
48 | 49 | wp_register_script( 'theme_plugins', THEME_DIR . 'assets/js/plugins.js', array( 'jquery' ), THEME_VERSION, true ); |
49 | 50 |
@@ -43,7 +43,8 @@ |
||
43 | 43 | |
44 | 44 | wp_register_script( 'theme_plugins', THEME_DIR . 'assets/js/min/production.js', array( 'jquery' ), THEME_VERSION, true ); |
45 | 45 | |
46 | - } else { |
|
46 | + } |
|
47 | + else { |
|
47 | 48 | |
48 | 49 | wp_register_script( 'theme_plugins', THEME_DIR . 'assets/js/plugins.js', array( 'jquery' ), THEME_VERSION, true ); |
49 | 50 |
@@ -16,13 +16,15 @@ |
||
16 | 16 | |
17 | 17 | return self::get_current_query(); |
18 | 18 | |
19 | - } elseif (is_array($args)) { |
|
19 | + } |
|
20 | + elseif (is_array($args)) { |
|
20 | 21 | |
21 | 22 | $args = array_merge($default_args, $args); |
22 | 23 | |
23 | 24 | return new WP_Query($args); |
24 | 25 | |
25 | - } else { |
|
26 | + } |
|
27 | + else { |
|
26 | 28 | |
27 | 29 | return new WP_Query($default_args); |
28 | 30 |
@@ -28,7 +28,8 @@ |
||
28 | 28 | |
29 | 29 | $this->$key = $value; |
30 | 30 | |
31 | - } else if ( !empty( $key ) && !method_exists($this, $key) ){ |
|
31 | + } |
|
32 | + else if ( !empty( $key ) && !method_exists($this, $key) ) { |
|
32 | 33 | |
33 | 34 | $this->$key = $value; |
34 | 35 |
@@ -29,7 +29,8 @@ discard block |
||
29 | 29 | |
30 | 30 | $menu_id = $this->check_menu_id($arg); |
31 | 31 | |
32 | - } elseif (is_string($arg)) { |
|
32 | + } |
|
33 | + elseif (is_string($arg)) { |
|
33 | 34 | |
34 | 35 | $menu_id = $this->get_menu_id_by_name($arg); |
35 | 36 | |
@@ -148,11 +149,15 @@ discard block |
||
148 | 149 | |
149 | 150 | $menu_id = get_term_by('slug', $slug, 'nav_menu'); |
150 | 151 | |
151 | - if ($menu_id) return $menu_id; |
|
152 | + if ($menu_id) { |
|
153 | + return $menu_id; |
|
154 | + } |
|
152 | 155 | |
153 | 156 | $menu_id = get_term_by('name', $slug, 'nav_menu'); |
154 | 157 | |
155 | - if ($menu_id) return $menu_id; |
|
158 | + if ($menu_id) { |
|
159 | + return $menu_id; |
|
160 | + } |
|
156 | 161 | |
157 | 162 | } |
158 | 163 |
@@ -37,7 +37,8 @@ discard block |
||
37 | 37 | preg_match_all( '/./u', $text, $words_array ); |
38 | 38 | $words_array = array_slice( $words_array[0], 0, $num_words + 1 ); |
39 | 39 | $sep = ''; |
40 | - } else { |
|
40 | + } |
|
41 | + else { |
|
41 | 42 | $words_array = preg_split( "/[\n\r\t ]+/", $text, $num_words + 1, PREG_SPLIT_NO_EMPTY ); |
42 | 43 | $sep = ' '; |
43 | 44 | } |
@@ -46,7 +47,8 @@ discard block |
||
46 | 47 | array_pop( $words_array ); |
47 | 48 | $text = implode( $sep, $words_array ); |
48 | 49 | $text = $text . $more; |
49 | - } else { |
|
50 | + } |
|
51 | + else { |
|
50 | 52 | $text = implode( $sep, $words_array ); |
51 | 53 | } |
52 | 54 | |
@@ -85,7 +87,8 @@ discard block |
||
85 | 87 | for ( $i = 0; $i < $len_opened; $i++ ) { |
86 | 88 | if ( !in_array( $openedtags[$i], $closedtags ) ) { |
87 | 89 | $html .= '</' . $openedtags[$i] . '>'; |
88 | - } else { |
|
90 | + } |
|
91 | + else { |
|
89 | 92 | unset( $closedtags[array_search( $openedtags[$i], $closedtags )] ); |
90 | 93 | } |
91 | 94 | } |
@@ -170,7 +173,8 @@ discard block |
||
170 | 173 | 'current' => true |
171 | 174 | ); |
172 | 175 | $dots = true; |
173 | - } else { |
|
176 | + } |
|
177 | + else { |
|
174 | 178 | if ( $args['show_all'] || ( $n <= $args['end_size'] || ( $args['current'] && $n >= $args['current'] - $args['mid_size'] && $n <= $args['current'] + $args['mid_size'] ) || $n > $args['total'] - $args['end_size'] ) ) { |
175 | 179 | $link = str_replace( '%_%', 1 == $n ? '' : $args['format'], $args['base'] ); |
176 | 180 | $link = str_replace( '%#%', $n, $link ); |
@@ -188,7 +192,8 @@ discard block |
||
188 | 192 | 'current' => $args['current'] == $n |
189 | 193 | ); |
190 | 194 | $dots = true; |
191 | - } elseif ( $dots && !$args['show_all'] ) { |
|
195 | + } |
|
196 | + elseif ( $dots && !$args['show_all'] ) { |
|
192 | 197 | $page_links[] = array( |
193 | 198 | 'class' => 'dots', |
194 | 199 | 'title' => __( '…' ) |
@@ -227,7 +232,8 @@ discard block |
||
227 | 232 | if (strlen($k)) { |
228 | 233 | if (is_array($v)) { |
229 | 234 | $obj->{$k} = self::array_to_object($v); //RECURSION |
230 | - } else { |
|
235 | + } |
|
236 | + else { |
|
231 | 237 | $obj->{$k} = $v; |
232 | 238 | } |
233 | 239 | } |
@@ -251,11 +257,13 @@ discard block |
||
251 | 257 | |
252 | 258 | $archives_title = single_cat_title( '', false ); |
253 | 259 | |
254 | - } else if ( is_tag() ) { |
|
260 | + } |
|
261 | + else if ( is_tag() ) { |
|
255 | 262 | |
256 | 263 | $archives_title = 'Tag: ' . single_tag_title( '', false ); |
257 | 264 | |
258 | - } else if ( is_author() ) { |
|
265 | + } |
|
266 | + else if ( is_author() ) { |
|
259 | 267 | |
260 | 268 | if ( have_posts() ) { |
261 | 269 | |
@@ -266,31 +274,37 @@ discard block |
||
266 | 274 | |
267 | 275 | rewind_posts(); |
268 | 276 | |
269 | - } else if ( is_search() ) { |
|
277 | + } |
|
278 | + else if ( is_search() ) { |
|
270 | 279 | |
271 | 280 | $archives_title = sprintf( __( 'Search Results for: %s', 'flotheme' ), '<span>' . get_search_query() . '</span>' ); |
272 | 281 | |
273 | - } else if ( is_archive() ) { |
|
282 | + } |
|
283 | + else if ( is_archive() ) { |
|
274 | 284 | |
275 | 285 | if ( is_day() ) { |
276 | 286 | |
277 | 287 | $archives_title = get_the_date(); |
278 | 288 | |
279 | - } elseif ( is_month() ) { |
|
289 | + } |
|
290 | + elseif ( is_month() ) { |
|
280 | 291 | |
281 | 292 | $archives_title = get_the_date( _x( 'F Y', 'monthly archives date format', 'flotheme')); |
282 | 293 | |
283 | - } elseif ( is_year() ) { |
|
294 | + } |
|
295 | + elseif ( is_year() ) { |
|
284 | 296 | |
285 | 297 | $archives_title = get_the_date( _x( 'Y', 'yearly archives date format', 'flotheme')); |
286 | 298 | |
287 | - } else { |
|
299 | + } |
|
300 | + else { |
|
288 | 301 | |
289 | 302 | $archives_title = 'Archives'; |
290 | 303 | |
291 | 304 | } |
292 | 305 | |
293 | - } else { |
|
306 | + } |
|
307 | + else { |
|
294 | 308 | |
295 | 309 | $archives_title = 'Archives'; |
296 | 310 |
@@ -62,7 +62,7 @@ |
||
62 | 62 | /** |
63 | 63 | * Returns ClassyUser object of comment author |
64 | 64 | * |
65 | - * @return object ClassyUser |
|
65 | + * @return ClassyUser ClassyUser |
|
66 | 66 | */ |
67 | 67 | public function author() { |
68 | 68 |
@@ -70,7 +70,8 @@ discard block |
||
70 | 70 | |
71 | 71 | return new ClassyUser($this->user_id); |
72 | 72 | |
73 | - } else { |
|
73 | + } |
|
74 | + else { |
|
74 | 75 | |
75 | 76 | $author = new ClassyUser(0); |
76 | 77 | |
@@ -139,7 +140,9 @@ discard block |
||
139 | 140 | return false; |
140 | 141 | } |
141 | 142 | |
142 | - if (!is_numeric($size)) $size = '92'; |
|
143 | + if (!is_numeric($size)) { |
|
144 | + $size = '92'; |
|
145 | + } |
|
143 | 146 | |
144 | 147 | |
145 | 148 | $email = $this->get_avatar_email(); |
@@ -154,7 +157,8 @@ discard block |
||
154 | 157 | |
155 | 158 | if (!empty($email)) { |
156 | 159 | $avatar = $this->get_avatar_url($default, $host, $email_hash, $size); |
157 | - } else { |
|
160 | + } |
|
161 | + else { |
|
158 | 162 | $avatar = $default; |
159 | 163 | } |
160 | 164 | |
@@ -174,7 +178,8 @@ discard block |
||
174 | 178 | |
175 | 179 | if ($user) { |
176 | 180 | $email = $user->user_email; |
177 | - } else { |
|
181 | + } |
|
182 | + else { |
|
178 | 183 | $email = $this->comment_author_email; |
179 | 184 | } |
180 | 185 | |
@@ -201,7 +206,8 @@ discard block |
||
201 | 206 | $avatar_default = get_option('avatar_default'); |
202 | 207 | if (empty($avatar_default)) { |
203 | 208 | $default = 'mystery'; |
204 | - } else { |
|
209 | + } |
|
210 | + else { |
|
205 | 211 | $default = $avatar_default; |
206 | 212 | } |
207 | 213 | } |
@@ -209,13 +215,17 @@ discard block |
||
209 | 215 | if ('mystery' == $default) { |
210 | 216 | $default = $host . '/avatar/ad516503a11cd5ca435acc9bb6523536?s=' . $size; |
211 | 217 | // ad516503a11cd5ca435acc9bb6523536 == md5('[email protected]') |
212 | - } else if ('blank' == $default) { |
|
218 | + } |
|
219 | + else if ('blank' == $default) { |
|
213 | 220 | $default = $email ? 'blank' : includes_url('images/blank.gif'); |
214 | - } else if (!empty($email) && 'gravatar_default' == $default) { |
|
221 | + } |
|
222 | + else if (!empty($email) && 'gravatar_default' == $default) { |
|
215 | 223 | $default = ''; |
216 | - } else if ('gravatar_default' == $default) { |
|
224 | + } |
|
225 | + else if ('gravatar_default' == $default) { |
|
217 | 226 | $default = $host . '/avatar/?s=' . $size; |
218 | - } else if (empty($email) && !strstr($default, 'http://')) { |
|
227 | + } |
|
228 | + else if (empty($email) && !strstr($default, 'http://')) { |
|
219 | 229 | $default = $host . '/avatar/?d=' . $default . '&s=' . $size; |
220 | 230 | } |
221 | 231 | |
@@ -233,10 +243,12 @@ discard block |
||
233 | 243 | |
234 | 244 | if (is_ssl()) { |
235 | 245 | $host = 'https://secure.gravatar.com'; |
236 | - } else { |
|
246 | + } |
|
247 | + else { |
|
237 | 248 | if (!empty($email_hash)) { |
238 | 249 | $host = sprintf("http://%d.gravatar.com", (hexdec($email_hash[0]) % 2)); |
239 | - } else { |
|
250 | + } |
|
251 | + else { |
|
240 | 252 | $host = 'http://0.gravatar.com'; |
241 | 253 | } |
242 | 254 | } |