@@ -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; |
@@ -229,12 +229,14 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | $scope = array_merge( $common_scope, $data ); |
| 231 | 231 | |
| 232 | - } else { |
|
| 232 | + } |
|
| 233 | + else { |
|
| 233 | 234 | |
| 234 | 235 | $scope = $common_scope; |
| 235 | 236 | |
| 236 | 237 | } |
| 237 | - } else { |
|
| 238 | + } |
|
| 239 | + else { |
|
| 238 | 240 | |
| 239 | 241 | $view = ClassyView::get_view(); |
| 240 | 242 | |
@@ -283,11 +285,13 @@ discard block |
||
| 283 | 285 | |
| 284 | 286 | $_return[] = $post->id; |
| 285 | 287 | |
| 286 | - } elseif ( 'object' == $return ) { |
|
| 288 | + } |
|
| 289 | + elseif ( 'object' == $return ) { |
|
| 287 | 290 | |
| 288 | 291 | $_return[] = $post; |
| 289 | 292 | |
| 290 | - } elseif ( class_exists( $return ) ) { |
|
| 293 | + } |
|
| 294 | + elseif ( class_exists( $return ) ) { |
|
| 291 | 295 | |
| 292 | 296 | $_return[] = new $return( $post ); |
| 293 | 297 | |
@@ -341,7 +345,8 @@ discard block |
||
| 341 | 345 | $args['format'] = 'page/%#%'; |
| 342 | 346 | $args['base'] = trailingslashit( $url[0] ).'%_%'; |
| 343 | 347 | |
| 344 | - } else { |
|
| 348 | + } |
|
| 349 | + else { |
|
| 345 | 350 | $big = 999999999; |
| 346 | 351 | $args['base'] = str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ); |
| 347 | 352 | } |
@@ -353,7 +358,8 @@ discard block |
||
| 353 | 358 | |
| 354 | 359 | if ( is_int( $prefs ) ) { |
| 355 | 360 | $args['mid_size'] = $prefs - 2; |
| 356 | - } else { |
|
| 361 | + } |
|
| 362 | + else { |
|
| 357 | 363 | $args = array_merge( $args, $prefs ); |
| 358 | 364 | } |
| 359 | 365 | |
@@ -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 | |
@@ -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 | |
@@ -152,7 +153,8 @@ discard block |
||
| 152 | 153 | |
| 153 | 154 | if ( ! empty( $email ) ) { |
| 154 | 155 | $avatar = $this->get_avatar_url( $default, $host, $email_hash, $size ); |
| 155 | - } else { |
|
| 156 | + } |
|
| 157 | + else { |
|
| 156 | 158 | $avatar = $default; |
| 157 | 159 | } |
| 158 | 160 | |
@@ -172,7 +174,8 @@ discard block |
||
| 172 | 174 | |
| 173 | 175 | if ( $user ) { |
| 174 | 176 | $email = $user->user_email; |
| 175 | - } else { |
|
| 177 | + } |
|
| 178 | + else { |
|
| 176 | 179 | $email = $this->comment_author_email; |
| 177 | 180 | } |
| 178 | 181 | |
@@ -199,7 +202,8 @@ discard block |
||
| 199 | 202 | $avatar_default = get_option( 'avatar_default' ); |
| 200 | 203 | if ( empty( $avatar_default ) ) { |
| 201 | 204 | $default = 'mystery'; |
| 202 | - } else { |
|
| 205 | + } |
|
| 206 | + else { |
|
| 203 | 207 | $default = $avatar_default; |
| 204 | 208 | } |
| 205 | 209 | } |
@@ -207,13 +211,17 @@ discard block |
||
| 207 | 211 | if ( 'mystery' == $default ) { |
| 208 | 212 | $default = $host . '/avatar/ad516503a11cd5ca435acc9bb6523536?s=' . $size; |
| 209 | 213 | // ad516503a11cd5ca435acc9bb6523536 == md5('[email protected]') |
| 210 | - } else if ( 'blank' == $default ) { |
|
| 214 | + } |
|
| 215 | + else if ( 'blank' == $default ) { |
|
| 211 | 216 | $default = $email ? 'blank' : includes_url( 'images/blank.gif' ); |
| 212 | - } else if ( ! empty( $email ) && 'gravatar_default' == $default ) { |
|
| 217 | + } |
|
| 218 | + else if ( ! empty( $email ) && 'gravatar_default' == $default ) { |
|
| 213 | 219 | $default = ''; |
| 214 | - } else if ( 'gravatar_default' == $default ) { |
|
| 220 | + } |
|
| 221 | + else if ( 'gravatar_default' == $default ) { |
|
| 215 | 222 | $default = $host . '/avatar/?s=' . $size; |
| 216 | - } else if ( empty( $email ) && ! strstr( $default, 'http://' ) ) { |
|
| 223 | + } |
|
| 224 | + else if ( empty( $email ) && ! strstr( $default, 'http://' ) ) { |
|
| 217 | 225 | $default = $host . '/avatar/?d=' . $default . '&s=' . $size; |
| 218 | 226 | } |
| 219 | 227 | |
@@ -231,10 +239,12 @@ discard block |
||
| 231 | 239 | |
| 232 | 240 | if ( is_ssl() ) { |
| 233 | 241 | $host = 'https://secure.gravatar.com'; |
| 234 | - } else { |
|
| 242 | + } |
|
| 243 | + else { |
|
| 235 | 244 | if ( ! empty( $email_hash ) ) { |
| 236 | 245 | $host = sprintf( 'http://%d.gravatar.com', (hexdec( $email_hash[0] ) % 2) ); |
| 237 | - } else { |
|
| 246 | + } |
|
| 247 | + else { |
|
| 238 | 248 | $host = 'http://0.gravatar.com'; |
| 239 | 249 | } |
| 240 | 250 | } |
@@ -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,6 +43,7 @@ |
||
| 43 | 43 | /** |
| 44 | 44 | * Extends Scope with scope that is defined in theme_name/scope folder |
| 45 | 45 | * |
| 46 | + * @param string|false $view_name |
|
| 46 | 47 | * @return array |
| 47 | 48 | */ |
| 48 | 49 | public static function extend_scope($scope, $view_name) { |
@@ -77,7 +77,8 @@ discard block |
||
| 77 | 77 | if ( is_integer( $post ) ) { |
| 78 | 78 | $this->ID = $post; |
| 79 | 79 | $this->init(); |
| 80 | - } elseif ( is_a( $post, 'WP_Post' ) ) { |
|
| 80 | + } |
|
| 81 | + elseif ( is_a( $post, 'WP_Post' ) ) { |
|
| 81 | 82 | $this->import( $post ); |
| 82 | 83 | } |
| 83 | 84 | } |
@@ -259,7 +260,8 @@ discard block |
||
| 259 | 260 | if ( $force ) { |
| 260 | 261 | $text = ClassyHelper::trim_words( $this->post_excerpt, $len, false ); |
| 261 | 262 | $trimmed = true; |
| 262 | - } else { |
|
| 263 | + } |
|
| 264 | + else { |
|
| 263 | 265 | $text = $this->post_excerpt; |
| 264 | 266 | } |
| 265 | 267 | } |
@@ -318,7 +320,8 @@ discard block |
||
| 318 | 320 | |
| 319 | 321 | if ( $readmore && isset( $readmore_matches ) && ! empty( $readmore_matches[1] ) ) { |
| 320 | 322 | $text .= ' <a href="' . $this->get_permalink() . '" class="read-more">' . trim( $readmore_matches[1] ) . '</a>'; |
| 321 | - } elseif ( $readmore ) { |
|
| 323 | + } |
|
| 324 | + elseif ( $readmore ) { |
|
| 322 | 325 | $text .= ' <a href="' . $this->get_permalink() . '" class="read-more">' . trim( $readmore ) . '</a>'; |
| 323 | 326 | } |
| 324 | 327 | |
@@ -186,7 +186,7 @@ |
||
| 186 | 186 | /** |
| 187 | 187 | * Returns first attached image id |
| 188 | 188 | * |
| 189 | - * @return int|boolean |
|
| 189 | + * @return integer|null |
|
| 190 | 190 | */ |
| 191 | 191 | public function get_first_attached_image_id() { |
| 192 | 192 | |
@@ -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 | |
@@ -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 | } |
@@ -253,11 +259,13 @@ discard block |
||
| 253 | 259 | |
| 254 | 260 | $archives_title = single_cat_title( '', false ); |
| 255 | 261 | |
| 256 | - } else if ( is_tag() ) { |
|
| 262 | + } |
|
| 263 | + else if ( is_tag() ) { |
|
| 257 | 264 | |
| 258 | 265 | $archives_title = 'Tag: ' . single_tag_title( '', false ); |
| 259 | 266 | |
| 260 | - } else if ( is_author() ) { |
|
| 267 | + } |
|
| 268 | + else if ( is_author() ) { |
|
| 261 | 269 | |
| 262 | 270 | if ( have_posts() ) { |
| 263 | 271 | |
@@ -268,30 +276,36 @@ discard block |
||
| 268 | 276 | |
| 269 | 277 | rewind_posts(); |
| 270 | 278 | |
| 271 | - } else if ( is_search() ) { |
|
| 279 | + } |
|
| 280 | + else if ( is_search() ) { |
|
| 272 | 281 | |
| 273 | 282 | $archives_title = sprintf( __( 'Search Results for: %s', $textdomain ), '<span>' . get_search_query() . '</span>' ); |
| 274 | 283 | |
| 275 | - } else if ( is_archive() ) { |
|
| 284 | + } |
|
| 285 | + else if ( is_archive() ) { |
|
| 276 | 286 | |
| 277 | 287 | if ( is_day() ) { |
| 278 | 288 | |
| 279 | 289 | $archives_title = get_the_date(); |
| 280 | 290 | |
| 281 | - } elseif ( is_month() ) { |
|
| 291 | + } |
|
| 292 | + elseif ( is_month() ) { |
|
| 282 | 293 | |
| 283 | 294 | $archives_title = get_the_date( _x( 'F Y', 'monthly archives date format', $textdomain ) ); |
| 284 | 295 | |
| 285 | - } elseif ( is_year() ) { |
|
| 296 | + } |
|
| 297 | + elseif ( is_year() ) { |
|
| 286 | 298 | |
| 287 | 299 | $archives_title = get_the_date( _x( 'Y', 'yearly archives date format', $textdomain ) ); |
| 288 | 300 | |
| 289 | - } else { |
|
| 301 | + } |
|
| 302 | + else { |
|
| 290 | 303 | |
| 291 | 304 | $archives_title = 'Archives'; |
| 292 | 305 | |
| 293 | 306 | } |
| 294 | - } else { |
|
| 307 | + } |
|
| 308 | + else { |
|
| 295 | 309 | |
| 296 | 310 | $archives_title = 'Archives'; |
| 297 | 311 | |
@@ -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 | |