@@ -198,6 +198,7 @@ discard block |
||
| 198 | 198 | * @package lsx |
| 199 | 199 | * @subpackage extras |
| 200 | 200 | * @category thumbnails |
| 201 | + * @param string $size |
|
| 201 | 202 | */ |
| 202 | 203 | function lsx_get_thumbnail($size,$image_src = false){ |
| 203 | 204 | |
@@ -252,6 +253,7 @@ discard block |
||
| 252 | 253 | * @package lsx |
| 253 | 254 | * @subpackage extras |
| 254 | 255 | * @category thumbnails |
| 256 | + * @param boolean $image_src |
|
| 255 | 257 | */ |
| 256 | 258 | function lsx_get_attachment_id_from_src($image_src) { |
| 257 | 259 | global $wpdb; |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | // Add post/page slug |
| 16 | 16 | if (is_single() || is_page() && !is_front_page()) { |
| 17 | - $classes[] = basename(get_permalink()); |
|
| 17 | + $classes[] = basename(get_permalink()); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | if(!class_exists('Lsx_Banners')){ |
@@ -38,8 +38,8 @@ discard block |
||
| 38 | 38 | // Remove unnecessary classes |
| 39 | 39 | $home_id_class = 'page-id-' . get_option('page_on_front'); |
| 40 | 40 | $remove_classes = array( |
| 41 | - 'page-template-default', |
|
| 42 | - $home_id_class |
|
| 41 | + 'page-template-default', |
|
| 42 | + $home_id_class |
|
| 43 | 43 | ); |
| 44 | 44 | $classes = array_diff($classes, $remove_classes); |
| 45 | 45 | |
@@ -278,12 +278,12 @@ discard block |
||
| 278 | 278 | || (is_singular('jetpack-portfolio')) ) { ?> |
| 279 | 279 | |
| 280 | 280 | <?php |
| 281 | - $bg_image = ''; |
|
| 282 | - if(has_post_thumbnail()){ |
|
| 283 | - $bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),'full'); |
|
| 284 | - $bg_image = $bg_image[0]; |
|
| 285 | - } |
|
| 286 | - ?> |
|
| 281 | + $bg_image = ''; |
|
| 282 | + if(has_post_thumbnail()){ |
|
| 283 | + $bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),'full'); |
|
| 284 | + $bg_image = $bg_image[0]; |
|
| 285 | + } |
|
| 286 | + ?> |
|
| 287 | 287 | |
| 288 | 288 | <?php if ( ! empty( $bg_image ) ) : ?> |
| 289 | 289 | |
@@ -316,8 +316,8 @@ discard block |
||
| 316 | 316 | * @category mobile |
| 317 | 317 | */ |
| 318 | 318 | function lsx_allow_sms_protocol( $protocols ) { |
| 319 | - $protocols[] = 'sms'; |
|
| 320 | - return $protocols; |
|
| 319 | + $protocols[] = 'sms'; |
|
| 320 | + return $protocols; |
|
| 321 | 321 | } |
| 322 | 322 | add_filter( 'kses_allowed_protocols', 'lsx_allow_sms_protocol' ); |
| 323 | 323 | |
@@ -326,27 +326,27 @@ discard block |
||
| 326 | 326 | * Adding browser and user-agent classes to body |
| 327 | 327 | */ |
| 328 | 328 | function mv_browser_body_class($classes) { |
| 329 | - global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone; |
|
| 330 | - if($is_lynx) $classes[] = 'lynx'; |
|
| 331 | - elseif($is_gecko) $classes[] = 'gecko'; |
|
| 332 | - elseif($is_opera) $classes[] = 'opera'; |
|
| 333 | - elseif($is_NS4) $classes[] = 'ns4'; |
|
| 334 | - elseif($is_safari) $classes[] = 'safari'; |
|
| 335 | - elseif($is_chrome) $classes[] = 'chrome'; |
|
| 336 | - elseif($is_IE) { |
|
| 337 | - $classes[] = 'ie'; |
|
| 338 | - if(preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $_SERVER['HTTP_USER_AGENT'], $browser_version)) |
|
| 339 | - $classes[] = 'ie'.$browser_version[1]; |
|
| 340 | - } else $classes[] = 'unknown'; |
|
| 341 | - if($is_iphone) $classes[] = 'iphone'; |
|
| 342 | - if ( stristr( $_SERVER['HTTP_USER_AGENT'],"mac") ) { |
|
| 343 | - $classes[] = 'osx'; |
|
| 344 | - } elseif ( stristr( $_SERVER['HTTP_USER_AGENT'],"linux") ) { |
|
| 345 | - $classes[] = 'linux'; |
|
| 346 | - } elseif ( stristr( $_SERVER['HTTP_USER_AGENT'],"windows") ) { |
|
| 347 | - $classes[] = 'windows'; |
|
| 348 | - } |
|
| 349 | - return $classes; |
|
| 329 | + global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone; |
|
| 330 | + if($is_lynx) $classes[] = 'lynx'; |
|
| 331 | + elseif($is_gecko) $classes[] = 'gecko'; |
|
| 332 | + elseif($is_opera) $classes[] = 'opera'; |
|
| 333 | + elseif($is_NS4) $classes[] = 'ns4'; |
|
| 334 | + elseif($is_safari) $classes[] = 'safari'; |
|
| 335 | + elseif($is_chrome) $classes[] = 'chrome'; |
|
| 336 | + elseif($is_IE) { |
|
| 337 | + $classes[] = 'ie'; |
|
| 338 | + if(preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $_SERVER['HTTP_USER_AGENT'], $browser_version)) |
|
| 339 | + $classes[] = 'ie'.$browser_version[1]; |
|
| 340 | + } else $classes[] = 'unknown'; |
|
| 341 | + if($is_iphone) $classes[] = 'iphone'; |
|
| 342 | + if ( stristr( $_SERVER['HTTP_USER_AGENT'],"mac") ) { |
|
| 343 | + $classes[] = 'osx'; |
|
| 344 | + } elseif ( stristr( $_SERVER['HTTP_USER_AGENT'],"linux") ) { |
|
| 345 | + $classes[] = 'linux'; |
|
| 346 | + } elseif ( stristr( $_SERVER['HTTP_USER_AGENT'],"windows") ) { |
|
| 347 | + $classes[] = 'windows'; |
|
| 348 | + } |
|
| 349 | + return $classes; |
|
| 350 | 350 | } |
| 351 | 351 | add_filter('body_class','mv_browser_body_class'); |
| 352 | 352 | |
@@ -5,6 +5,7 @@ |
||
| 5 | 5 | * Layout hooks |
| 6 | 6 | * |
| 7 | 7 | * @package lsx |
| 8 | + * @param string $class |
|
| 8 | 9 | */ |
| 9 | 10 | |
| 10 | 11 | function lsx_layout_selector( $class, $area = 'site' ) { |
@@ -140,6 +140,9 @@ |
||
| 140 | 140 | return self::$noscripts[(int) $match[1]]; |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | + /** |
|
| 144 | + * @param string $new_class |
|
| 145 | + */ |
|
| 143 | 146 | static function add_class( $html_string = '', $new_class ) { |
| 144 | 147 | $pattern = '/class=[\'"]([^\'"]*)[\'"]/'; |
| 145 | 148 | |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | * @subpackage sanitize |
| 98 | 98 | * |
| 99 | 99 | * @param array $input |
| 100 | - * @return array $output |
|
| 100 | + * @return string|false $output |
|
| 101 | 101 | */ |
| 102 | 102 | function lsx_sanitize_checkbox( $input ) { |
| 103 | 103 | if ( $input ) { |
@@ -7,7 +7,6 @@ discard block |
||
| 7 | 7 | * @author Novrian <[email protected]> |
| 8 | 8 | * @copyright (c) 2013. Novrian Y.F. |
| 9 | 9 | * @license MIT License |
| 10 | - * @param string $sep Your custom separator |
|
| 11 | 10 | */ |
| 12 | 11 | function lsx_breadcrumbs() { |
| 13 | 12 | if (!function_exists('yoast_breadcrumb') && !function_exists('woocommerce_breadcrumb')) { |
@@ -262,7 +261,7 @@ discard block |
||
| 262 | 261 | /** |
| 263 | 262 | * Display navigation to next/previous set of posts when applicable. |
| 264 | 263 | * |
| 265 | - * @return void |
|
| 264 | + * @return null|boolean |
|
| 266 | 265 | */ |
| 267 | 266 | function lsx_paging_nav() { |
| 268 | 267 | // Don't print empty markup if there's only one page. |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | function lsx_breadcrumbs() { |
| 13 | 13 | if (!function_exists('yoast_breadcrumb') && !function_exists('woocommerce_breadcrumb')) { |
| 14 | - return null; |
|
| 14 | + return null; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | $show_on_front = get_option('show_on_front'); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * Displays logo when applicable |
| 69 | 69 | * |
| 70 | 70 | * @return void |
| 71 | - */ |
|
| 71 | + */ |
|
| 72 | 72 | function lsx_site_title() { |
| 73 | 73 | ?> |
| 74 | 74 | <div class="site-branding"> |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | |
| 419 | 419 | //print_r(get_nav_menu_locations()); |
| 420 | 420 | |
| 421 | - if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
| 421 | + if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
| 422 | 422 | <nav class="primary-navbar collapse navbar-collapse"> |
| 423 | 423 | <?php |
| 424 | 424 | wp_nav_menu( array( |
@@ -546,9 +546,9 @@ discard block |
||
| 546 | 546 | if(null != $tag_cloud){ |
| 547 | 547 | printf( '<h2>'.__( '%1$s', 'lsx' ).'</h2>', $taxonomy ); |
| 548 | 548 | echo '<aside id="'.$taxonomy_id.'" class="widget widget_'.$taxonomy_id.'">'.$tag_cloud.'</aside>'; |
| 549 | - } |
|
| 550 | - } |
|
| 551 | - } |
|
| 549 | + } |
|
| 550 | + } |
|
| 551 | + } |
|
| 552 | 552 | } |
| 553 | 553 | |
| 554 | 554 | /** |
@@ -597,11 +597,11 @@ discard block |
||
| 597 | 597 | <div class="container"> |
| 598 | 598 | <nav class="top-menu"> |
| 599 | 599 | <?php |
| 600 | - wp_nav_menu( array( |
|
| 600 | + wp_nav_menu( array( |
|
| 601 | 601 | 'theme_location' => 'top-menu', |
| 602 | 602 | 'walker' => new lsx_bootstrap_navwalker()) |
| 603 | 603 | ); |
| 604 | - ?> |
|
| 604 | + ?> |
|
| 605 | 605 | </nav> |
| 606 | 606 | </div> |
| 607 | 607 | </div> |
@@ -30,7 +30,6 @@ |
||
| 30 | 30 | * @param string $output Passed by reference. Used to append additional content. |
| 31 | 31 | * @param object $item Menu item data object. |
| 32 | 32 | * @param int $depth Depth of menu item. Used for padding. |
| 33 | - * @param int $current_page Menu item ID. |
|
| 34 | 33 | * @param object $args |
| 35 | 34 | */ |
| 36 | 35 | public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { |
@@ -159,17 +159,17 @@ |
||
| 159 | 159 | * @return null Null on failure with no changes to parameters. |
| 160 | 160 | */ |
| 161 | 161 | public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) { |
| 162 | - if ( ! $element ) |
|
| 163 | - return; |
|
| 162 | + if ( ! $element ) |
|
| 163 | + return; |
|
| 164 | 164 | |
| 165 | - $id_field = $this->db_fields['id']; |
|
| 165 | + $id_field = $this->db_fields['id']; |
|
| 166 | 166 | |
| 167 | - // Display this element. |
|
| 168 | - if ( is_object( $args[0] ) ) |
|
| 169 | - $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] ); |
|
| 167 | + // Display this element. |
|
| 168 | + if ( is_object( $args[0] ) ) |
|
| 169 | + $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] ); |
|
| 170 | 170 | |
| 171 | - parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); |
|
| 172 | - } |
|
| 171 | + parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); |
|
| 172 | + } |
|
| 173 | 173 | |
| 174 | 174 | /** |
| 175 | 175 | * Menu Fallback |
@@ -60,12 +60,12 @@ |
||
| 60 | 60 | <strong><?php _e( 'Get your Tourism Establishment Online', 'lsx' ); ?></strong> |
| 61 | 61 | |
| 62 | 62 | <?php |
| 63 | - if(is_singular('landing-page')){ |
|
| 64 | - $email_address = get_post_meta(get_the_ID(),'email_address',true); |
|
| 65 | - if(false === $email_address){ |
|
| 63 | + if(is_singular('landing-page')){ |
|
| 64 | + $email_address = get_post_meta(get_the_ID(),'email_address',true); |
|
| 65 | + if(false === $email_address){ |
|
| 66 | 66 | $email_address = '[email protected]'; |
| 67 | 67 | } |
| 68 | - } ?> |
|
| 68 | + } ?> |
|
| 69 | 69 | |
| 70 | 70 | <span class="email-address"><?php _e( 'Questions? Email Us: ', 'lsx' ); ?><a href="mailto:<?php echo $email_address; ?>"><?php echo $email_address; ?></a></span> |
| 71 | 71 | </div> |
@@ -123,11 +123,11 @@ discard block |
||
| 123 | 123 | * @category portfolio |
| 124 | 124 | */ |
| 125 | 125 | function lsx_remove_single_related_posts() { |
| 126 | - if ( is_single() && class_exists( 'Jetpack_RelatedPosts' ) ) { |
|
| 127 | - $jprp = Jetpack_RelatedPosts::init(); |
|
| 128 | - $callback = array( $jprp, 'filter_add_target_to_dom' ); |
|
| 129 | - remove_filter( 'the_content', $callback, 40 ); |
|
| 130 | - } |
|
| 126 | + if ( is_single() && class_exists( 'Jetpack_RelatedPosts' ) ) { |
|
| 127 | + $jprp = Jetpack_RelatedPosts::init(); |
|
| 128 | + $callback = array( $jprp, 'filter_add_target_to_dom' ); |
|
| 129 | + remove_filter( 'the_content', $callback, 40 ); |
|
| 130 | + } |
|
| 131 | 131 | } |
| 132 | 132 | add_filter( 'wp', 'lsx_remove_single_related_posts', 20 ); |
| 133 | 133 | |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | if(is_array($types)){ |
| 312 | 312 | foreach ($types as $type) { |
| 313 | 313 | $content = '<li><a href="#" data-filter=".'.$type->slug.'">'; |
| 314 | - $content .= $type->name; |
|
| 314 | + $content .= $type->name; |
|
| 315 | 315 | $content .= '</a></li>'; |
| 316 | 316 | echo $content; |
| 317 | 317 | echo "\n"; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * @category styles |
| 126 | 126 | */ |
| 127 | 127 | function lsx_sensei_styles() { |
| 128 | - wp_enqueue_style( 'sensei', get_template_directory_uri() . '/css/sensei.css' ); |
|
| 128 | + wp_enqueue_style( 'sensei', get_template_directory_uri() . '/css/sensei.css' ); |
|
| 129 | 129 | } |
| 130 | 130 | add_action( 'wp_enqueue_scripts', 'lsx_sensei_styles' ); |
| 131 | 131 | |
@@ -136,10 +136,10 @@ discard block |
||
| 136 | 136 | * @category styles |
| 137 | 137 | */ |
| 138 | 138 | function lsx_sensei_redirect_to_home( $query ){ |
| 139 | - if(!is_admin() && is_post_type_archive( 'lesson' ) ) { |
|
| 140 | - wp_redirect( home_url() . '/courses-overview' ); |
|
| 141 | - exit; |
|
| 142 | - } |
|
| 139 | + if(!is_admin() && is_post_type_archive( 'lesson' ) ) { |
|
| 140 | + wp_redirect( home_url() . '/courses-overview' ); |
|
| 141 | + exit; |
|
| 142 | + } |
|
| 143 | 143 | } |
| 144 | 144 | add_action( 'parse_query', 'lsx_sensei_redirect_to_home' ); |
| 145 | 145 | |