@@ -2,5 +2,5 @@ |
||
| 2 | 2 | /** |
| 3 | 3 | * Init our WordPress Theme. |
| 4 | 4 | */ |
| 5 | -require_once( __DIR__ . '/vendor/autoload.php' ); |
|
| 5 | +require_once(__DIR__.'/vendor/autoload.php'); |
|
| 6 | 6 | \Classy\Classy::get_instance(); |
@@ -2,4 +2,4 @@ |
||
| 2 | 2 | /** |
| 3 | 3 | * Theme header. |
| 4 | 4 | */ |
| 5 | -get_theme_framework()::render( 'layout.header' ); |
|
| 5 | +get_theme_framework()::render('layout.header'); |
|
@@ -2,4 +2,4 @@ |
||
| 2 | 2 | /** |
| 3 | 3 | * Theme footer. |
| 4 | 4 | */ |
| 5 | -get_theme_framework()::render( 'layout.footer' ); |
|
| 5 | +get_theme_framework()::render('layout.footer'); |
|
@@ -2,6 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | global $post; |
| 4 | 4 | |
| 5 | -$classypost = new \Classy\Models\Post( $post ); |
|
| 5 | +$classypost = new \Classy\Models\Post($post); |
|
| 6 | 6 | |
| 7 | -Classy\Classy::render( 'layout.comments', array( 'post' => $classypost ) ); |
|
| 7 | +Classy\Classy::render('layout.comments', array('post' => $classypost)); |
|
@@ -93,12 +93,12 @@ discard block |
||
| 93 | 93 | * |
| 94 | 94 | * @param object|int $post WP_Post or WP_Post.ID. |
| 95 | 95 | */ |
| 96 | - public function __construct( $post = null ) { |
|
| 97 | - if ( is_integer( $post ) ) { |
|
| 96 | + public function __construct($post = null) { |
|
| 97 | + if (is_integer($post)) { |
|
| 98 | 98 | $this->ID = $post; |
| 99 | 99 | $this->init(); |
| 100 | - } elseif ( is_a( $post, '\WP_Post' ) ) { |
|
| 101 | - $this->import( $post ); |
|
| 100 | + } elseif (is_a($post, '\WP_Post')) { |
|
| 101 | + $this->import($post); |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
@@ -108,8 +108,8 @@ discard block |
||
| 108 | 108 | protected function init() { |
| 109 | 109 | $post = $this->get_object(); |
| 110 | 110 | |
| 111 | - if ( is_a( $post, '\WP_Post' ) ) { |
|
| 112 | - $this->import( $post ); |
|
| 111 | + if (is_a($post, '\WP_Post')) { |
|
| 112 | + $this->import($post); |
|
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | * @return \WP_Post |
| 120 | 120 | */ |
| 121 | 121 | public function get_object() { |
| 122 | - $object = get_post( $this->ID ); |
|
| 122 | + $object = get_post($this->ID); |
|
| 123 | 123 | |
| 124 | 124 | return $object; |
| 125 | 125 | } |
@@ -130,10 +130,10 @@ discard block |
||
| 130 | 130 | * @return boolean |
| 131 | 131 | */ |
| 132 | 132 | public function can_edit() { |
| 133 | - if ( ! function_exists( 'current_user_can' ) ) { |
|
| 133 | + if (!function_exists('current_user_can')) { |
|
| 134 | 134 | return false; |
| 135 | 135 | } |
| 136 | - if ( current_user_can( 'edit_post', $this->ID ) ) { |
|
| 136 | + if (current_user_can('edit_post', $this->ID)) { |
|
| 137 | 137 | return true; |
| 138 | 138 | } |
| 139 | 139 | |
@@ -146,8 +146,8 @@ discard block |
||
| 146 | 146 | * @return string |
| 147 | 147 | */ |
| 148 | 148 | public function get_edit_url() { |
| 149 | - if ( $this->can_edit() ) { |
|
| 150 | - return get_edit_post_link( $this->ID ); |
|
| 149 | + if ($this->can_edit()) { |
|
| 150 | + return get_edit_post_link($this->ID); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | return ''; |
@@ -170,9 +170,9 @@ discard block |
||
| 170 | 170 | 'fields' => 'ids', |
| 171 | 171 | ); |
| 172 | 172 | |
| 173 | - $images = get_children( $attrs ); |
|
| 173 | + $images = get_children($attrs); |
|
| 174 | 174 | |
| 175 | - if ( ! count( $images ) ) { |
|
| 175 | + if (!count($images)) { |
|
| 176 | 176 | return false; |
| 177 | 177 | } |
| 178 | 178 | |
@@ -189,11 +189,11 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | $images = $this->get_attached_images(); |
| 191 | 191 | |
| 192 | - if ( $images ) { |
|
| 192 | + if ($images) { |
|
| 193 | 193 | |
| 194 | - foreach ( $images as $image_id ) { |
|
| 194 | + foreach ($images as $image_id) { |
|
| 195 | 195 | |
| 196 | - $_return[] = new Image( $image_id ); |
|
| 196 | + $_return[] = new Image($image_id); |
|
| 197 | 197 | |
| 198 | 198 | } |
| 199 | 199 | } |
@@ -219,13 +219,13 @@ discard block |
||
| 219 | 219 | 'fields' => 'ids', |
| 220 | 220 | ); |
| 221 | 221 | |
| 222 | - $images = get_children( $attrs ); |
|
| 222 | + $images = get_children($attrs); |
|
| 223 | 223 | |
| 224 | - if ( ! count( $images ) ) { |
|
| 224 | + if (!count($images)) { |
|
| 225 | 225 | return false; |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - $images = array_values( $images ); |
|
| 228 | + $images = array_values($images); |
|
| 229 | 229 | |
| 230 | 230 | return $images[0]; |
| 231 | 231 | } |
@@ -239,8 +239,8 @@ discard block |
||
| 239 | 239 | |
| 240 | 240 | $image_id = $this->get_first_attached_image_id(); |
| 241 | 241 | |
| 242 | - if ( $image_id ) { |
|
| 243 | - return new Image( $image_id ); |
|
| 242 | + if ($image_id) { |
|
| 243 | + return new Image($image_id); |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | return new Image(); |
@@ -252,12 +252,12 @@ discard block |
||
| 252 | 252 | * @return Image |
| 253 | 253 | */ |
| 254 | 254 | public function thumbnail() { |
| 255 | - if ( function_exists( 'get_post_thumbnail_id' ) ) { |
|
| 256 | - $image_id = get_post_thumbnail_id( $this->ID ); |
|
| 255 | + if (function_exists('get_post_thumbnail_id')) { |
|
| 256 | + $image_id = get_post_thumbnail_id($this->ID); |
|
| 257 | 257 | |
| 258 | - if ( $image_id ) { |
|
| 258 | + if ($image_id) { |
|
| 259 | 259 | |
| 260 | - return new Image( $image_id ); |
|
| 260 | + return new Image($image_id); |
|
| 261 | 261 | |
| 262 | 262 | } |
| 263 | 263 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | * @return string |
| 272 | 272 | */ |
| 273 | 273 | public function get_title() { |
| 274 | - return apply_filters( 'the_title', $this->post_title, $this->ID ); |
|
| 274 | + return apply_filters('the_title', $this->post_title, $this->ID); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /** |
@@ -290,24 +290,24 @@ discard block |
||
| 290 | 290 | * |
| 291 | 291 | * @return string Post content |
| 292 | 292 | */ |
| 293 | - public function get_content( $page = 0 ) { |
|
| 294 | - if ( 0 === absint( $page ) && $this->post_content ) { |
|
| 293 | + public function get_content($page = 0) { |
|
| 294 | + if (0 === absint($page) && $this->post_content) { |
|
| 295 | 295 | return $this->post_content; |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | $content = $this->post_content; |
| 299 | 299 | |
| 300 | - if ( $page ) { |
|
| 301 | - $contents = explode( '<!--nextpage-->', $content ); |
|
| 300 | + if ($page) { |
|
| 301 | + $contents = explode('<!--nextpage-->', $content); |
|
| 302 | 302 | |
| 303 | 303 | $page--; |
| 304 | 304 | |
| 305 | - if ( count( $contents ) > $page ) { |
|
| 306 | - $content = $contents[ $page ]; |
|
| 305 | + if (count($contents) > $page) { |
|
| 306 | + $content = $contents[$page]; |
|
| 307 | 307 | } |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - $content = apply_filters( 'the_content', ($content) ); |
|
| 310 | + $content = apply_filters('the_content', ($content)); |
|
| 311 | 311 | |
| 312 | 312 | return $content; |
| 313 | 313 | } |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | * @return object |
| 328 | 328 | */ |
| 329 | 329 | public function get_post_type() { |
| 330 | - return get_post_type_object( $this->post_type ); |
|
| 330 | + return get_post_type_object($this->post_type); |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | /** |
@@ -336,11 +336,11 @@ discard block |
||
| 336 | 336 | * @return string |
| 337 | 337 | */ |
| 338 | 338 | public function get_permalink() { |
| 339 | - if ( isset( $this->permalink ) ) { |
|
| 339 | + if (isset($this->permalink)) { |
|
| 340 | 340 | return $this->permalink; |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | - $this->permalink = get_permalink( $this->ID ); |
|
| 343 | + $this->permalink = get_permalink($this->ID); |
|
| 344 | 344 | |
| 345 | 345 | return $this->permalink; |
| 346 | 346 | } |
@@ -366,84 +366,84 @@ discard block |
||
| 366 | 366 | * |
| 367 | 367 | * @return string Post preview. |
| 368 | 368 | */ |
| 369 | - public function get_preview( $len = 50, $force = false, $readmore = 'Read More', $strip = true ) { |
|
| 369 | + public function get_preview($len = 50, $force = false, $readmore = 'Read More', $strip = true) { |
|
| 370 | 370 | $text = ''; |
| 371 | 371 | $trimmed = false; |
| 372 | 372 | |
| 373 | - if ( isset( $this->post_excerpt ) && strlen( $this->post_excerpt ) ) { |
|
| 373 | + if (isset($this->post_excerpt) && strlen($this->post_excerpt)) { |
|
| 374 | 374 | |
| 375 | - if ( $force ) { |
|
| 376 | - $text = Helper::trim_words( $this->post_excerpt, $len, false ); |
|
| 375 | + if ($force) { |
|
| 376 | + $text = Helper::trim_words($this->post_excerpt, $len, false); |
|
| 377 | 377 | $trimmed = true; |
| 378 | 378 | } else { |
| 379 | 379 | $text = $this->post_excerpt; |
| 380 | 380 | } |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | - if ( ! strlen( $text ) && preg_match( '/<!--\s?more(.*?)?-->/', $this->post_content, $readmore_matches ) ) { |
|
| 383 | + if (!strlen($text) && preg_match('/<!--\s?more(.*?)?-->/', $this->post_content, $readmore_matches)) { |
|
| 384 | 384 | |
| 385 | - $pieces = explode( $readmore_matches[0], $this->post_content ); |
|
| 385 | + $pieces = explode($readmore_matches[0], $this->post_content); |
|
| 386 | 386 | $text = $pieces[0]; |
| 387 | 387 | |
| 388 | - if ( $force ) { |
|
| 389 | - $text = Helper::trim_words( $text, $len, false ); |
|
| 388 | + if ($force) { |
|
| 389 | + $text = Helper::trim_words($text, $len, false); |
|
| 390 | 390 | $trimmed = true; |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | - $text = do_shortcode( $text ); |
|
| 393 | + $text = do_shortcode($text); |
|
| 394 | 394 | |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | - if ( ! strlen( $text ) ) { |
|
| 397 | + if (!strlen($text)) { |
|
| 398 | 398 | |
| 399 | - $text = Helper::trim_words( $this->get_content(), $len, false ); |
|
| 399 | + $text = Helper::trim_words($this->get_content(), $len, false); |
|
| 400 | 400 | $trimmed = true; |
| 401 | 401 | |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | - if ( ! strlen( trim( $text ) ) ) { |
|
| 404 | + if (!strlen(trim($text))) { |
|
| 405 | 405 | |
| 406 | - return trim( $text ); |
|
| 406 | + return trim($text); |
|
| 407 | 407 | |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | - if ( $strip ) { |
|
| 410 | + if ($strip) { |
|
| 411 | 411 | |
| 412 | - $text = trim( strip_tags( $text ) ); |
|
| 412 | + $text = trim(strip_tags($text)); |
|
| 413 | 413 | |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | - if ( strlen( $text ) ) { |
|
| 416 | + if (strlen($text)) { |
|
| 417 | 417 | |
| 418 | - $text = trim( $text ); |
|
| 419 | - $last = $text[ strlen( $text ) - 1 ]; |
|
| 418 | + $text = trim($text); |
|
| 419 | + $last = $text[strlen($text) - 1]; |
|
| 420 | 420 | |
| 421 | - if ( '.' !== $last && $trimmed ) { |
|
| 421 | + if ('.' !== $last && $trimmed) { |
|
| 422 | 422 | $text .= ' … '; |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | - if ( ! $strip ) { |
|
| 426 | - $last_p_tag = strrpos( $text, '</p>' ); |
|
| 427 | - if ( false !== $last_p_tag ) { |
|
| 428 | - $text = substr( $text, 0, $last_p_tag ); |
|
| 425 | + if (!$strip) { |
|
| 426 | + $last_p_tag = strrpos($text, '</p>'); |
|
| 427 | + if (false !== $last_p_tag) { |
|
| 428 | + $text = substr($text, 0, $last_p_tag); |
|
| 429 | 429 | } |
| 430 | - if ( '.' !== $last && $trimmed ) { |
|
| 430 | + if ('.' !== $last && $trimmed) { |
|
| 431 | 431 | $text .= ' … '; |
| 432 | 432 | } |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | - if ( $readmore && isset( $readmore_matches ) && ! empty( $readmore_matches[1] ) ) { |
|
| 436 | - $text .= ' <a href="' . $this->get_permalink() . '" class="read-more">' . trim( $readmore_matches[1] ) . '</a>'; |
|
| 437 | - } elseif ( $readmore ) { |
|
| 438 | - $text .= ' <a href="' . $this->get_permalink() . '" class="read-more">' . trim( $readmore ) . '</a>'; |
|
| 435 | + if ($readmore && isset($readmore_matches) && !empty($readmore_matches[1])) { |
|
| 436 | + $text .= ' <a href="'.$this->get_permalink().'" class="read-more">'.trim($readmore_matches[1]).'</a>'; |
|
| 437 | + } elseif ($readmore) { |
|
| 438 | + $text .= ' <a href="'.$this->get_permalink().'" class="read-more">'.trim($readmore).'</a>'; |
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | - if ( ! $strip ) { |
|
| 441 | + if (!$strip) { |
|
| 442 | 442 | $text .= '</p>'; |
| 443 | 443 | } |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | - return trim( $text ); |
|
| 446 | + return trim($text); |
|
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | /** |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | * |
| 455 | 455 | * @return array |
| 456 | 456 | */ |
| 457 | - public function get_comments( $status = 'approve', $order = 'DESC' ) { |
|
| 457 | + public function get_comments($status = 'approve', $order = 'DESC') { |
|
| 458 | 458 | |
| 459 | 459 | $_return = array(); |
| 460 | 460 | |
@@ -464,25 +464,25 @@ discard block |
||
| 464 | 464 | 'order' => $order, |
| 465 | 465 | ); |
| 466 | 466 | |
| 467 | - $comments = get_comments( $args ); |
|
| 467 | + $comments = get_comments($args); |
|
| 468 | 468 | |
| 469 | - foreach ( $comments as $comment ) { |
|
| 469 | + foreach ($comments as $comment) { |
|
| 470 | 470 | |
| 471 | - $_return[ $comment->comment_ID ] = new Comment( $comment ); |
|
| 471 | + $_return[$comment->comment_ID] = new Comment($comment); |
|
| 472 | 472 | |
| 473 | 473 | } |
| 474 | 474 | |
| 475 | - foreach ( $_return as $key => $comment ) { |
|
| 475 | + foreach ($_return as $key => $comment) { |
|
| 476 | 476 | |
| 477 | - if ( $comment->has_parent() ) { |
|
| 477 | + if ($comment->has_parent()) { |
|
| 478 | 478 | |
| 479 | - $_return[ $comment->comment_parent ]->add_child( $comment ); |
|
| 479 | + $_return[$comment->comment_parent]->add_child($comment); |
|
| 480 | 480 | |
| 481 | - unset( $_return[ $key ] ); |
|
| 481 | + unset($_return[$key]); |
|
| 482 | 482 | |
| 483 | 483 | } |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | - return array_values( $_return ); |
|
| 486 | + return array_values($_return); |
|
| 487 | 487 | } |
| 488 | 488 | } |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | * |
| 67 | 67 | * @param int $uid User id. |
| 68 | 68 | */ |
| 69 | - public function __construct( $uid = null ) { |
|
| 70 | - $this->ID = $this->verify_id( $uid ); |
|
| 69 | + public function __construct($uid = null) { |
|
| 70 | + $this->ID = $this->verify_id($uid); |
|
| 71 | 71 | |
| 72 | 72 | $this->init(); |
| 73 | 73 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * |
| 80 | 80 | * @return int |
| 81 | 81 | */ |
| 82 | - private function verify_id( $uid ) { |
|
| 82 | + private function verify_id($uid) { |
|
| 83 | 83 | // @todo: Realize this method. |
| 84 | 84 | return $uid; |
| 85 | 85 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | private function init() { |
| 91 | 91 | $this->object = $this->get_object(); |
| 92 | 92 | |
| 93 | - $this->import( $this->object ); |
|
| 93 | + $this->import($this->object); |
|
| 94 | 94 | |
| 95 | 95 | $this->setup_user_name(); |
| 96 | 96 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @return object |
| 102 | 102 | */ |
| 103 | 103 | private function get_object() { |
| 104 | - return get_user_by( 'id', $this->ID ); |
|
| 104 | + return get_user_by('id', $this->ID); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -155,8 +155,8 @@ discard block |
||
| 155 | 155 | * @return string |
| 156 | 156 | */ |
| 157 | 157 | public function link() { |
| 158 | - if ( ! $this->link ) { |
|
| 159 | - $this->link = get_author_posts_url( $this->ID ); |
|
| 158 | + if (!$this->link) { |
|
| 159 | + $this->link = get_author_posts_url($this->ID); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | return $this->link; |
@@ -167,8 +167,8 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | private function setup_user_name() { |
| 169 | 169 | $this->name = 'Anonymous'; |
| 170 | - if ( isset( $this->object->first_name ) && isset( $this->object->last_name ) ) { |
|
| 171 | - $this->name = $this->object->first_name . ' ' . $this->object->last_name; |
|
| 170 | + if (isset($this->object->first_name) && isset($this->object->last_name)) { |
|
| 171 | + $this->name = $this->object->first_name.' '.$this->object->last_name; |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | $this->display_name = $this->object->display_name; |
@@ -12,10 +12,10 @@ discard block |
||
| 12 | 12 | * Main constructor function. Requires image id |
| 13 | 13 | * @param int $pid |
| 14 | 14 | */ |
| 15 | - public function __construct( $pid = null ) { |
|
| 15 | + public function __construct($pid = null) { |
|
| 16 | 16 | |
| 17 | 17 | // Checks if image with this id exists |
| 18 | - if ( null !== $pid && wp_get_attachment_image_src( $pid ) ) { |
|
| 18 | + if (null !== $pid && wp_get_attachment_image_src($pid)) { |
|
| 19 | 19 | |
| 20 | 20 | $this->ID = $pid; |
| 21 | 21 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | public static function get_default_image() { |
| 34 | 34 | |
| 35 | 35 | // You can put here any url |
| 36 | - return CLASSY_THEME_DIR . '/assets/noimage.png'; |
|
| 36 | + return CLASSY_THEME_DIR.'/assets/noimage.png'; |
|
| 37 | 37 | |
| 38 | 38 | } |
| 39 | 39 | |
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | * @param string $size |
| 43 | 43 | * @return string |
| 44 | 44 | */ |
| 45 | - public function src( $size = 'medium' ) { |
|
| 45 | + public function src($size = 'medium') { |
|
| 46 | 46 | |
| 47 | - if ( $this->ID ) { |
|
| 47 | + if ($this->ID) { |
|
| 48 | 48 | |
| 49 | - $thumb = wp_get_attachment_image_src( $this->ID, $size ); |
|
| 49 | + $thumb = wp_get_attachment_image_src($this->ID, $size); |
|
| 50 | 50 | |
| 51 | 51 | return $thumb[0]; |
| 52 | 52 | |
@@ -29,9 +29,9 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | $request = Hierarchy::get_current_request(); |
| 31 | 31 | |
| 32 | - $file = Hierarchy::get_available_file( 'view', $request ); |
|
| 32 | + $file = Hierarchy::get_available_file('view', $request); |
|
| 33 | 33 | |
| 34 | - $view = self::get_blade_view( $file ); |
|
| 34 | + $view = self::get_blade_view($file); |
|
| 35 | 35 | |
| 36 | 36 | return $view; |
| 37 | 37 | |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @return string |
| 46 | 46 | */ |
| 47 | - public static function get_blade_view( $view ) { |
|
| 47 | + public static function get_blade_view($view) { |
|
| 48 | 48 | |
| 49 | - return str_replace( '/', '.', $view ); |
|
| 49 | + return str_replace('/', '.', $view); |
|
| 50 | 50 | |
| 51 | 51 | } |
| 52 | 52 | |
@@ -59,21 +59,21 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | $templates = array(); |
| 61 | 61 | |
| 62 | - $files = (array) glob( CLASSY_THEME_PATH . '/' . self::$folder . '/*/*.blade.php' ); |
|
| 62 | + $files = (array) glob(CLASSY_THEME_PATH.'/'.self::$folder.'/*/*.blade.php'); |
|
| 63 | 63 | |
| 64 | - foreach ( $files as $filename ) { |
|
| 64 | + foreach ($files as $filename) { |
|
| 65 | 65 | |
| 66 | - if ( ! empty( $filename ) ) { |
|
| 66 | + if (!empty($filename)) { |
|
| 67 | 67 | |
| 68 | - if ( ! preg_match( '/\{\{\-\-\s*Template Name:(.*)\s*\-\-\}\}/mi', file_get_contents( $filename ), $header ) ) { continue; } |
|
| 68 | + if (!preg_match('/\{\{\-\-\s*Template Name:(.*)\s*\-\-\}\}/mi', file_get_contents($filename), $header)) { continue; } |
|
| 69 | 69 | |
| 70 | - $template_name = trim( $header[1] ); |
|
| 70 | + $template_name = trim($header[1]); |
|
| 71 | 71 | |
| 72 | - preg_match( '/\/([^\/]*)\.blade.php$/is', $filename, $filename_match ); |
|
| 72 | + preg_match('/\/([^\/]*)\.blade.php$/is', $filename, $filename_match); |
|
| 73 | 73 | |
| 74 | - $template_file = 'classy-' . $filename_match[1]; |
|
| 74 | + $template_file = 'classy-'.$filename_match[1]; |
|
| 75 | 75 | |
| 76 | - $templates[ $template_file ] = $template_name; |
|
| 76 | + $templates[$template_file] = $template_name; |
|
| 77 | 77 | |
| 78 | 78 | } |
| 79 | 79 | } |
@@ -12,13 +12,13 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | public function __construct() { |
| 14 | 14 | |
| 15 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); |
|
| 15 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_styles')); |
|
| 16 | 16 | |
| 17 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); |
|
| 17 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts')); |
|
| 18 | 18 | |
| 19 | - add_action( 'wp_print_scripts', array( $this, 'init_js_vars' ) ); |
|
| 19 | + add_action('wp_print_scripts', array($this, 'init_js_vars')); |
|
| 20 | 20 | |
| 21 | - add_action( 'after_setup_theme', array( $this, 'setup_theme' ) ); |
|
| 21 | + add_action('after_setup_theme', array($this, 'setup_theme')); |
|
| 22 | 22 | |
| 23 | 23 | } |
| 24 | 24 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function enqueue_styles() { |
| 29 | 29 | |
| 30 | - wp_register_style( 'general_css', CLASSY_THEME_DIR . 'assets/css/general.css', array(), CLASSY_THEME_VERSION, 'all' ); |
|
| 30 | + wp_register_style('general_css', CLASSY_THEME_DIR.'assets/css/general.css', array(), CLASSY_THEME_VERSION, 'all'); |
|
| 31 | 31 | |
| 32 | 32 | } |
| 33 | 33 | |
@@ -36,13 +36,13 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | public function enqueue_scripts() { |
| 38 | 38 | |
| 39 | - if ( 'production' === Classy::get_config_var( 'environment' ) ) { |
|
| 39 | + if ('production' === Classy::get_config_var('environment')) { |
|
| 40 | 40 | |
| 41 | - wp_register_script( 'theme_scripts', CLASSY_THEME_DIR . 'assets/js/min/production.js', array( 'jquery' ), CLASSY_THEME_VERSION, true ); |
|
| 41 | + wp_register_script('theme_scripts', CLASSY_THEME_DIR.'assets/js/min/production.js', array('jquery'), CLASSY_THEME_VERSION, true); |
|
| 42 | 42 | |
| 43 | 43 | } else { |
| 44 | 44 | |
| 45 | - wp_register_script( 'theme_scripts', CLASSY_THEME_DIR . 'assets/js/scripts.js', array( 'jquery' ), CLASSY_THEME_VERSION, true ); |
|
| 45 | + wp_register_script('theme_scripts', CLASSY_THEME_DIR.'assets/js/scripts.js', array('jquery'), CLASSY_THEME_VERSION, true); |
|
| 46 | 46 | |
| 47 | 47 | } |
| 48 | 48 | |
@@ -54,10 +54,10 @@ discard block |
||
| 54 | 54 | public function init_js_vars() { |
| 55 | 55 | |
| 56 | 56 | $options = array( |
| 57 | - 'base_url' => home_url( '' ), |
|
| 58 | - 'blog_url' => home_url( 'archives/' ), |
|
| 57 | + 'base_url' => home_url(''), |
|
| 58 | + 'blog_url' => home_url('archives/'), |
|
| 59 | 59 | 'template_dir' => CLASSY_THEME_DIR, |
| 60 | - 'ajax_load_url' => admin_url( 'admin-ajax.php' ), |
|
| 60 | + 'ajax_load_url' => admin_url('admin-ajax.php'), |
|
| 61 | 61 | 'is_mobile' => (int) wp_is_mobile(), |
| 62 | 62 | ); |
| 63 | 63 | |
@@ -85,12 +85,12 @@ discard block |
||
| 85 | 85 | * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails |
| 86 | 86 | */ |
| 87 | 87 | |
| 88 | - add_theme_support( 'post-thumbnails' ); |
|
| 88 | + add_theme_support('post-thumbnails'); |
|
| 89 | 89 | |
| 90 | 90 | // This theme uses wp_nav_menu() in one location. |
| 91 | 91 | register_nav_menus(array( |
| 92 | - 'header-menu' => __( 'Header Menu', Classy::textdomain() ), |
|
| 93 | - 'footer-menu' => __( 'Footer Menu', Classy::textdomain() ), |
|
| 92 | + 'header-menu' => __('Header Menu', Classy::textdomain()), |
|
| 93 | + 'footer-menu' => __('Footer Menu', Classy::textdomain()), |
|
| 94 | 94 | )); |
| 95 | 95 | |
| 96 | 96 | /* |