@@ -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 | |
@@ -110,9 +110,9 @@ discard block |
||
| 110 | 110 | * @param string $date_format |
| 111 | 111 | * @return string |
| 112 | 112 | */ |
| 113 | - public function date( $date_format = '' ) { |
|
| 113 | + public function date($date_format = '') { |
|
| 114 | 114 | $df = $date_format ? $date_format : get_option('date_format'); |
| 115 | - $the_date = (string)mysql2date($df, $this->comment_date); |
|
| 115 | + $the_date = (string) mysql2date($df, $this->comment_date); |
|
| 116 | 116 | |
| 117 | 117 | return apply_filters('get_comment_date ', $the_date, $df); |
| 118 | 118 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | protected function get_avatar_email() { |
| 171 | 171 | |
| 172 | - $id = (int)$this->user_id; |
|
| 172 | + $id = (int) $this->user_id; |
|
| 173 | 173 | $user = get_userdata($id); |
| 174 | 174 | |
| 175 | 175 | if ($user) { |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | protected function get_default_avatar($default, $email, $size, $host) { |
| 195 | 195 | |
| 196 | 196 | if (substr($default, 0, 1) == '/') { |
| 197 | - $default = home_url() . $default; |
|
| 197 | + $default = home_url().$default; |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | if (empty($default)) { |
@@ -207,16 +207,16 @@ discard block |
||
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | if ('mystery' == $default) { |
| 210 | - $default = $host . '/avatar/ad516503a11cd5ca435acc9bb6523536?s=' . $size; |
|
| 210 | + $default = $host.'/avatar/ad516503a11cd5ca435acc9bb6523536?s='.$size; |
|
| 211 | 211 | // ad516503a11cd5ca435acc9bb6523536 == md5('[email protected]') |
| 212 | 212 | } else if ('blank' == $default) { |
| 213 | 213 | $default = $email ? 'blank' : includes_url('images/blank.gif'); |
| 214 | 214 | } else if (!empty($email) && 'gravatar_default' == $default) { |
| 215 | 215 | $default = ''; |
| 216 | 216 | } else if ('gravatar_default' == $default) { |
| 217 | - $default = $host . '/avatar/?s=' . $size; |
|
| 217 | + $default = $host.'/avatar/?s='.$size; |
|
| 218 | 218 | } else if (empty($email) && !strstr($default, 'http://')) { |
| 219 | - $default = $host . '/avatar/?d=' . $default . '&s=' . $size; |
|
| 219 | + $default = $host.'/avatar/?d='.$default.'&s='.$size; |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | return $default; |
@@ -256,11 +256,11 @@ discard block |
||
| 256 | 256 | */ |
| 257 | 257 | protected function get_avatar_url($default, $host, $email_hash, $size) { |
| 258 | 258 | |
| 259 | - $_return = $host . '/avatar/' . $email_hash . '?s=' . $size . '&d=' . urlencode($default); |
|
| 259 | + $_return = $host.'/avatar/'.$email_hash.'?s='.$size.'&d='.urlencode($default); |
|
| 260 | 260 | $rating = get_option('avatar_rating'); |
| 261 | 261 | |
| 262 | 262 | if (!empty($rating)) { |
| 263 | - $_return .= '&r=' . $rating; |
|
| 263 | + $_return .= '&r='.$rating; |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | return str_replace('&', '&', esc_url($_return)); |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | |
| 294 | 294 | if (is_array($this->children)) { |
| 295 | 295 | |
| 296 | - foreach( $this->children as $child ) { |
|
| 296 | + foreach ($this->children as $child) { |
|
| 297 | 297 | $child->level = $this->level + 1; |
| 298 | 298 | $child->update_child_levels(); |
| 299 | 299 | } |
@@ -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 | } |
@@ -124,8 +124,8 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public function add_child($item) { |
| 126 | 126 | |
| 127 | - if ( !$this->has_child ) { |
|
| 128 | - $this->add_class( 'menu-item-has-children' ); |
|
| 127 | + if (!$this->has_child) { |
|
| 128 | + $this->add_class('menu-item-has-children'); |
|
| 129 | 129 | $this->has_child = true; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | protected function filter_classes() { |
| 147 | 147 | |
| 148 | - $this->classes = apply_filters( 'nav_menu_css_class', $this->classes, $this ); |
|
| 148 | + $this->classes = apply_filters('nav_menu_css_class', $this->classes, $this); |
|
| 149 | 149 | |
| 150 | 150 | } |
| 151 | 151 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | if (is_array($this->children)) { |
| 160 | 160 | |
| 161 | - foreach( $this->children as $child ) { |
|
| 161 | + foreach ($this->children as $child) { |
|
| 162 | 162 | $child->level = $this->level + 1; |
| 163 | 163 | $child->update_child_levels(); |
| 164 | 164 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * Checks if template exists |
| 112 | 112 | * |
| 113 | 113 | * @param string $type template/scope |
| 114 | - * @param string $template in blade path format, ex: layout/header |
|
| 114 | + * @param string|false $file |
|
| 115 | 115 | * @return boolean true/false |
| 116 | 116 | */ |
| 117 | 117 | public static function file_exists($type = 'template', $file) { |
@@ -129,8 +129,9 @@ discard block |
||
| 129 | 129 | * Returns template name for render, based on type of request |
| 130 | 130 | * |
| 131 | 131 | * @param string $type template/scope |
| 132 | - * @param string $type |
|
| 133 | - * @return array |
|
| 132 | + * @param string $type |
|
| 133 | + * @param string $page |
|
| 134 | + * @return string|false |
|
| 134 | 135 | */ |
| 135 | 136 | public static function get_available_file($type = 'template', $page) { |
| 136 | 137 | |
@@ -377,7 +378,7 @@ discard block |
||
| 377 | 378 | /** |
| 378 | 379 | * Returns classy template name or boolean if this is not classy template |
| 379 | 380 | * |
| 380 | - * @return mixed |
|
| 381 | + * @return string|false |
|
| 381 | 382 | */ |
| 382 | 383 | public static function get_classy_template() { |
| 383 | 384 | |
@@ -21,39 +21,39 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | protected static function check_request() { |
| 23 | 23 | |
| 24 | - if ( is_404()) : return '404'; |
|
| 24 | + if (is_404()) : return '404'; |
|
| 25 | 25 | |
| 26 | - elseif ( is_search() ) : return 'search'; |
|
| 26 | + elseif (is_search()) : return 'search'; |
|
| 27 | 27 | |
| 28 | - elseif ( is_front_page() ) : return 'front-page'; |
|
| 28 | + elseif (is_front_page()) : return 'front-page'; |
|
| 29 | 29 | |
| 30 | - elseif ( is_home() ) : return 'home'; |
|
| 30 | + elseif (is_home()) : return 'home'; |
|
| 31 | 31 | |
| 32 | - elseif ( is_post_type_archive() ) : return 'post_type_archive'; |
|
| 32 | + elseif (is_post_type_archive()) : return 'post_type_archive'; |
|
| 33 | 33 | |
| 34 | - elseif ( is_tax() ) : return 'taxonomy'; |
|
| 34 | + elseif (is_tax()) : return 'taxonomy'; |
|
| 35 | 35 | |
| 36 | - elseif ( is_attachment() ) : return 'attachment'; |
|
| 36 | + elseif (is_attachment()) : return 'attachment'; |
|
| 37 | 37 | |
| 38 | - elseif ( is_single() ) : return 'single'; |
|
| 38 | + elseif (is_single()) : return 'single'; |
|
| 39 | 39 | |
| 40 | - elseif ( self::is_classy_template() ) : return 'classy-template'; |
|
| 40 | + elseif (self::is_classy_template()) : return 'classy-template'; |
|
| 41 | 41 | |
| 42 | - elseif ( is_page() ) : return 'page'; |
|
| 42 | + elseif (is_page()) : return 'page'; |
|
| 43 | 43 | |
| 44 | - elseif ( is_singular() ) : return 'singular'; |
|
| 44 | + elseif (is_singular()) : return 'singular'; |
|
| 45 | 45 | |
| 46 | - elseif ( is_category() ) : return 'category'; |
|
| 46 | + elseif (is_category()) : return 'category'; |
|
| 47 | 47 | |
| 48 | - elseif ( is_tag() ) : return 'tag'; |
|
| 48 | + elseif (is_tag()) : return 'tag'; |
|
| 49 | 49 | |
| 50 | - elseif ( is_author() ) : return 'author'; |
|
| 50 | + elseif (is_author()) : return 'author'; |
|
| 51 | 51 | |
| 52 | - elseif ( is_date() ) : return 'date'; |
|
| 52 | + elseif (is_date()) : return 'date'; |
|
| 53 | 53 | |
| 54 | - elseif ( is_archive() ) : return 'archive'; |
|
| 54 | + elseif (is_archive()) : return 'archive'; |
|
| 55 | 55 | |
| 56 | - elseif ( is_paged() ) : return 'paged'; |
|
| 56 | + elseif (is_paged()) : return 'paged'; |
|
| 57 | 57 | |
| 58 | 58 | else : |
| 59 | 59 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public static function get_current_request() { |
| 72 | 72 | |
| 73 | - if ( null === self::$current_request ) { |
|
| 73 | + if (null === self::$current_request) { |
|
| 74 | 74 | |
| 75 | 75 | self::$current_request = self::check_request(); |
| 76 | 76 | |
@@ -94,13 +94,13 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | $folder = ClassyTemplate::$folder; |
| 96 | 96 | |
| 97 | - return THEME_PATH . $folder . '/' . $template . '.blade.php'; |
|
| 97 | + return THEME_PATH.$folder.'/'.$template.'.blade.php'; |
|
| 98 | 98 | |
| 99 | 99 | } elseif ($type == 'scope') { |
| 100 | 100 | |
| 101 | 101 | $folder = ClassyScope::$folder; |
| 102 | 102 | |
| 103 | - return THEME_PATH . $folder . '/' . $template . '.php'; |
|
| 103 | + return THEME_PATH.$folder.'/'.$template.'.php'; |
|
| 104 | 104 | |
| 105 | 105 | } |
| 106 | 106 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | foreach ($templates as $template) { |
| 140 | 140 | |
| 141 | - if ( self::file_exists($type, $template) ): |
|
| 141 | + if (self::file_exists($type, $template)): |
|
| 142 | 142 | |
| 143 | 143 | return $template; |
| 144 | 144 | |
@@ -163,38 +163,38 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | // Home |
| 165 | 165 | |
| 166 | - if ( $type == 'home' ) : |
|
| 166 | + if ($type == 'home') : |
|
| 167 | 167 | |
| 168 | 168 | $templates[] = 'home'; |
| 169 | 169 | |
| 170 | 170 | // Single |
| 171 | 171 | |
| 172 | - elseif ( $type == 'single' ) : |
|
| 172 | + elseif ($type == 'single') : |
|
| 173 | 173 | |
| 174 | 174 | $post_type = get_post_type(); |
| 175 | 175 | |
| 176 | - $templates[] = $post_type . '.single'; |
|
| 176 | + $templates[] = $post_type.'.single'; |
|
| 177 | 177 | |
| 178 | 178 | $templates[] = 'single'; |
| 179 | 179 | |
| 180 | 180 | // Post type |
| 181 | 181 | |
| 182 | - elseif ( $type == 'post_type_archive' ) : |
|
| 182 | + elseif ($type == 'post_type_archive') : |
|
| 183 | 183 | |
| 184 | 184 | $post_type = get_post_type(); |
| 185 | 185 | |
| 186 | - $templates[] = $post_type . '.archive'; |
|
| 186 | + $templates[] = $post_type.'.archive'; |
|
| 187 | 187 | |
| 188 | 188 | $templates[] = 'archive'; |
| 189 | 189 | |
| 190 | 190 | |
| 191 | 191 | // Taxonomy |
| 192 | 192 | |
| 193 | - elseif ( $type == 'taxonomy' ): |
|
| 193 | + elseif ($type == 'taxonomy'): |
|
| 194 | 194 | |
| 195 | 195 | $term = get_queried_object(); |
| 196 | 196 | |
| 197 | - if ( ! empty( $term->slug ) ) { |
|
| 197 | + if (!empty($term->slug)) { |
|
| 198 | 198 | |
| 199 | 199 | $taxonomy = $term->taxonomy; |
| 200 | 200 | |
@@ -209,11 +209,11 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | // Category |
| 211 | 211 | |
| 212 | - elseif ( $type == 'category' ): |
|
| 212 | + elseif ($type == 'category'): |
|
| 213 | 213 | |
| 214 | 214 | $category = get_queried_object(); |
| 215 | 215 | |
| 216 | - if ( ! empty( $category->slug ) ) { |
|
| 216 | + if (!empty($category->slug)) { |
|
| 217 | 217 | $templates[] = "category.{$category->slug}"; |
| 218 | 218 | $templates[] = "category.{$category->term_id}"; |
| 219 | 219 | } |
@@ -225,23 +225,23 @@ discard block |
||
| 225 | 225 | |
| 226 | 226 | // Attachment |
| 227 | 227 | |
| 228 | - elseif ( $type == 'attachment' ): |
|
| 228 | + elseif ($type == 'attachment'): |
|
| 229 | 229 | |
| 230 | 230 | $attachment = get_queried_object(); |
| 231 | 231 | |
| 232 | - if ( $attachment ) { |
|
| 232 | + if ($attachment) { |
|
| 233 | 233 | |
| 234 | - if ( false !== strpos( $attachment->post_mime_type, '/' ) ) { |
|
| 234 | + if (false !== strpos($attachment->post_mime_type, '/')) { |
|
| 235 | 235 | |
| 236 | - list( $type, $subtype ) = explode( '/', $attachment->post_mime_type ); |
|
| 236 | + list($type, $subtype) = explode('/', $attachment->post_mime_type); |
|
| 237 | 237 | |
| 238 | 238 | } else { |
| 239 | 239 | |
| 240 | - list( $type, $subtype ) = array( $attachment->post_mime_type, '' ); |
|
| 240 | + list($type, $subtype) = array($attachment->post_mime_type, ''); |
|
| 241 | 241 | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - if ( ! empty( $subtype ) ) { |
|
| 244 | + if (!empty($subtype)) { |
|
| 245 | 245 | $templates[] = "attachment.{$type}.{$subtype}"; |
| 246 | 246 | $templates[] = "attachment.{$subtype}"; |
| 247 | 247 | |
@@ -261,11 +261,11 @@ discard block |
||
| 261 | 261 | |
| 262 | 262 | // Tag |
| 263 | 263 | |
| 264 | - elseif ( $type == 'tag' ): |
|
| 264 | + elseif ($type == 'tag'): |
|
| 265 | 265 | |
| 266 | 266 | $tag = get_queried_object(); |
| 267 | 267 | |
| 268 | - if ( ! empty( $tag->slug ) ) { |
|
| 268 | + if (!empty($tag->slug)) { |
|
| 269 | 269 | $templates[] = "post.tag.{$tag->slug}"; |
| 270 | 270 | $templates[] = "post.tag.{$tag->term_id}"; |
| 271 | 271 | |
@@ -279,11 +279,11 @@ discard block |
||
| 279 | 279 | |
| 280 | 280 | // Author |
| 281 | 281 | |
| 282 | - elseif ( $type == 'author' ): |
|
| 282 | + elseif ($type == 'author'): |
|
| 283 | 283 | |
| 284 | 284 | $author = get_queried_object(); |
| 285 | 285 | |
| 286 | - if ( $author instanceof WP_User ) { |
|
| 286 | + if ($author instanceof WP_User) { |
|
| 287 | 287 | $templates[] = "post.author.{$author->user_nicename}"; |
| 288 | 288 | $templates[] = "post.author.{$author->ID}"; |
| 289 | 289 | |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | |
| 299 | 299 | // Front Page |
| 300 | 300 | |
| 301 | - elseif ( $type == 'front-page' ): |
|
| 301 | + elseif ($type == 'front-page'): |
|
| 302 | 302 | |
| 303 | 303 | $templates[] = 'front-page.front-page'; |
| 304 | 304 | $templates[] = 'front-page'; |
@@ -310,18 +310,18 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | // Page |
| 312 | 312 | |
| 313 | - elseif ( $type == 'classy-template' ): |
|
| 313 | + elseif ($type == 'classy-template'): |
|
| 314 | 314 | |
| 315 | 315 | $template = self::get_classy_template(); |
| 316 | 316 | |
| 317 | 317 | $templates[] = $template; |
| 318 | 318 | |
| 319 | - $templates[] = 'page.' . $template; |
|
| 319 | + $templates[] = 'page.'.$template; |
|
| 320 | 320 | |
| 321 | - $templates[] = 'template.' . $template; |
|
| 321 | + $templates[] = 'template.'.$template; |
|
| 322 | 322 | |
| 323 | 323 | |
| 324 | - elseif ( $type == 'page' ): |
|
| 324 | + elseif ($type == 'page'): |
|
| 325 | 325 | |
| 326 | 326 | $id = get_queried_object_id(); |
| 327 | 327 | |
@@ -329,18 +329,18 @@ discard block |
||
| 329 | 329 | |
| 330 | 330 | $pagename = get_query_var('pagename'); |
| 331 | 331 | |
| 332 | - if ( ! $pagename && $id ) { |
|
| 332 | + if (!$pagename && $id) { |
|
| 333 | 333 | // If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object |
| 334 | 334 | $post = get_queried_object(); |
| 335 | - if ( $post ) |
|
| 335 | + if ($post) |
|
| 336 | 336 | $pagename = $post->post_name; |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | - if ( $template && $template != 'index' ) |
|
| 339 | + if ($template && $template != 'index') |
|
| 340 | 340 | $templates[] = $template; |
| 341 | - if ( $pagename ) |
|
| 341 | + if ($pagename) |
|
| 342 | 342 | $templates[] = "page.$pagename"; |
| 343 | - if ( $id ) |
|
| 343 | + if ($id) |
|
| 344 | 344 | $templates[] = "page.$id"; |
| 345 | 345 | |
| 346 | 346 | $templates[] = 'page.page'; |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | |
| 386 | 386 | preg_match('/classy\-(.*)/', $template_slug, $matches); |
| 387 | 387 | |
| 388 | - if ( $matches && isset($matches[1]) ) return $matches[1]; |
|
| 388 | + if ($matches && isset($matches[1])) return $matches[1]; |
|
| 389 | 389 | |
| 390 | 390 | return false; |
| 391 | 391 | |
@@ -55,9 +55,11 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | elseif ( is_paged() ) : return 'paged'; |
| 57 | 57 | |
| 58 | - else : |
|
| 58 | + else { |
|
| 59 | + : |
|
| 59 | 60 | |
| 60 | 61 | return 'index'; |
| 62 | + } |
|
| 61 | 63 | |
| 62 | 64 | endif; |
| 63 | 65 | |
@@ -96,7 +98,8 @@ discard block |
||
| 96 | 98 | |
| 97 | 99 | return THEME_PATH . $folder . '/' . $template . '.blade.php'; |
| 98 | 100 | |
| 99 | - } elseif ($type == 'scope') { |
|
| 101 | + } |
|
| 102 | + elseif ($type == 'scope') { |
|
| 100 | 103 | |
| 101 | 104 | $folder = ClassyScope::$folder; |
| 102 | 105 | |
@@ -235,7 +238,8 @@ discard block |
||
| 235 | 238 | |
| 236 | 239 | list( $type, $subtype ) = explode( '/', $attachment->post_mime_type ); |
| 237 | 240 | |
| 238 | - } else { |
|
| 241 | + } |
|
| 242 | + else { |
|
| 239 | 243 | |
| 240 | 244 | list( $type, $subtype ) = array( $attachment->post_mime_type, '' ); |
| 241 | 245 | |
@@ -332,16 +336,20 @@ discard block |
||
| 332 | 336 | if ( ! $pagename && $id ) { |
| 333 | 337 | // If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object |
| 334 | 338 | $post = get_queried_object(); |
| 335 | - if ( $post ) |
|
| 336 | - $pagename = $post->post_name; |
|
| 339 | + if ( $post ) { |
|
| 340 | + $pagename = $post->post_name; |
|
| 341 | + } |
|
| 337 | 342 | } |
| 338 | 343 | |
| 339 | - if ( $template && $template != 'index' ) |
|
| 340 | - $templates[] = $template; |
|
| 341 | - if ( $pagename ) |
|
| 342 | - $templates[] = "page.$pagename"; |
|
| 343 | - if ( $id ) |
|
| 344 | - $templates[] = "page.$id"; |
|
| 344 | + if ( $template && $template != 'index' ) { |
|
| 345 | + $templates[] = $template; |
|
| 346 | + } |
|
| 347 | + if ( $pagename ) { |
|
| 348 | + $templates[] = "page.$pagename"; |
|
| 349 | + } |
|
| 350 | + if ( $id ) { |
|
| 351 | + $templates[] = "page.$id"; |
|
| 352 | + } |
|
| 345 | 353 | |
| 346 | 354 | $templates[] = 'page.page'; |
| 347 | 355 | |
@@ -350,9 +358,11 @@ discard block |
||
| 350 | 358 | |
| 351 | 359 | // Default |
| 352 | 360 | |
| 353 | - else: |
|
| 361 | + else { |
|
| 362 | + : |
|
| 354 | 363 | |
| 355 | 364 | $templates[] = $type; |
| 365 | + } |
|
| 356 | 366 | |
| 357 | 367 | endif; |
| 358 | 368 | |
@@ -385,7 +395,9 @@ discard block |
||
| 385 | 395 | |
| 386 | 396 | preg_match('/classy\-(.*)/', $template_slug, $matches); |
| 387 | 397 | |
| 388 | - if ( $matches && isset($matches[1]) ) return $matches[1]; |
|
| 398 | + if ( $matches && isset($matches[1]) ) { |
|
| 399 | + return $matches[1]; |
|
| 400 | + } |
|
| 389 | 401 | |
| 390 | 402 | return false; |
| 391 | 403 | |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | |
| 55 | 55 | $templates = array(); |
| 56 | 56 | |
| 57 | - $files = (array) glob( THEME_PATH . '/' . self::$folder . '/*/*.blade.php' ); |
|
| 57 | + $files = (array) glob( THEME_PATH . '/' . self::$folder . '/*/*.blade.php' ); |
|
| 58 | 58 | |
| 59 | 59 | foreach ( $files as $filename ) { |
| 60 | 60 | |
@@ -54,19 +54,19 @@ |
||
| 54 | 54 | |
| 55 | 55 | $templates = array(); |
| 56 | 56 | |
| 57 | - $files = (array) glob( THEME_PATH . '/' . self::$folder . '/*/*.blade.php' ); |
|
| 57 | + $files = (array) glob(THEME_PATH.'/'.self::$folder.'/*/*.blade.php'); |
|
| 58 | 58 | |
| 59 | - foreach ( $files as $filename ) { |
|
| 59 | + foreach ($files as $filename) { |
|
| 60 | 60 | |
| 61 | - if ( !empty($filename) ) { |
|
| 61 | + if (!empty($filename)) { |
|
| 62 | 62 | |
| 63 | - if ( ! preg_match( '/\{\{\-\-\s*Template Name:(.*)\s*\-\-\}\}/mi', file_get_contents( $filename ), $header ) ) continue; |
|
| 63 | + if (!preg_match('/\{\{\-\-\s*Template Name:(.*)\s*\-\-\}\}/mi', file_get_contents($filename), $header)) continue; |
|
| 64 | 64 | |
| 65 | 65 | $template_name = trim($header[1]); |
| 66 | 66 | |
| 67 | 67 | preg_match('/\/([^\/]*)\.blade.php$/is', $filename, $filename_match); |
| 68 | 68 | |
| 69 | - $template_file = 'classy-' . $filename_match[1]; |
|
| 69 | + $template_file = 'classy-'.$filename_match[1]; |
|
| 70 | 70 | |
| 71 | 71 | $templates[$template_file] = $template_name; |
| 72 | 72 | |
@@ -60,7 +60,9 @@ |
||
| 60 | 60 | |
| 61 | 61 | if ( !empty($filename) ) { |
| 62 | 62 | |
| 63 | - if ( ! preg_match( '/\{\{\-\-\s*Template Name:(.*)\s*\-\-\}\}/mi', file_get_contents( $filename ), $header ) ) continue; |
|
| 63 | + if ( ! preg_match( '/\{\{\-\-\s*Template Name:(.*)\s*\-\-\}\}/mi', file_get_contents( $filename ), $header ) ) { |
|
| 64 | + continue; |
|
| 65 | + } |
|
| 64 | 66 | |
| 65 | 67 | $template_name = trim($header[1]); |
| 66 | 68 | |