@@ -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 | |
@@ -271,12 +271,12 @@ discard block |
||
| 271 | 271 | || (is_singular('jetpack-portfolio')) ) { ?> |
| 272 | 272 | |
| 273 | 273 | <?php |
| 274 | - $bg_image = ''; |
|
| 275 | - if(has_post_thumbnail()){ |
|
| 276 | - $bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),'full'); |
|
| 277 | - $bg_image = $bg_image[0]; |
|
| 278 | - } |
|
| 279 | - ?> |
|
| 274 | + $bg_image = ''; |
|
| 275 | + if(has_post_thumbnail()){ |
|
| 276 | + $bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),'full'); |
|
| 277 | + $bg_image = $bg_image[0]; |
|
| 278 | + } |
|
| 279 | + ?> |
|
| 280 | 280 | |
| 281 | 281 | <?php if ( ! empty( $bg_image ) ) : ?> |
| 282 | 282 | |
@@ -309,8 +309,8 @@ discard block |
||
| 309 | 309 | * @category mobile |
| 310 | 310 | */ |
| 311 | 311 | function lsx_allow_sms_protocol( $protocols ) { |
| 312 | - $protocols[] = 'sms'; |
|
| 313 | - return $protocols; |
|
| 312 | + $protocols[] = 'sms'; |
|
| 313 | + return $protocols; |
|
| 314 | 314 | } |
| 315 | 315 | add_filter( 'kses_allowed_protocols', 'lsx_allow_sms_protocol' ); |
| 316 | 316 | |
@@ -322,27 +322,27 @@ discard block |
||
| 322 | 322 | $http_user_agent = sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); |
| 323 | 323 | $http_user_agent = ! empty( $http_user_agent ) ? $http_user_agent : ''; |
| 324 | 324 | |
| 325 | - global $is_lynx, $is_gecko, $is_ie, $is_opera, $is_ns4, $is_safari, $is_chrome, $is_iphone; |
|
| 326 | - if($is_lynx) $classes[] = 'lynx'; |
|
| 327 | - elseif($is_gecko) $classes[] = 'gecko'; |
|
| 328 | - elseif($is_opera) $classes[] = 'opera'; |
|
| 329 | - elseif($is_ns4) $classes[] = 'ns4'; |
|
| 330 | - elseif($is_safari) $classes[] = 'safari'; |
|
| 331 | - elseif($is_chrome) $classes[] = 'chrome'; |
|
| 332 | - elseif($is_ie) { |
|
| 333 | - $classes[] = 'ie'; |
|
| 334 | - if(preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $http_user_agent, $browser_version)) |
|
| 335 | - $classes[] = 'ie'.$browser_version[1]; |
|
| 336 | - } else $classes[] = 'unknown'; |
|
| 337 | - if($is_iphone) $classes[] = 'iphone'; |
|
| 338 | - if ( stristr( $http_user_agent, "mac") ) { |
|
| 339 | - $classes[] = 'osx'; |
|
| 340 | - } elseif ( stristr( $http_user_agent, "linux") ) { |
|
| 341 | - $classes[] = 'linux'; |
|
| 342 | - } elseif ( stristr( $http_user_agent, "windows") ) { |
|
| 343 | - $classes[] = 'windows'; |
|
| 344 | - } |
|
| 345 | - return $classes; |
|
| 325 | + global $is_lynx, $is_gecko, $is_ie, $is_opera, $is_ns4, $is_safari, $is_chrome, $is_iphone; |
|
| 326 | + if($is_lynx) $classes[] = 'lynx'; |
|
| 327 | + elseif($is_gecko) $classes[] = 'gecko'; |
|
| 328 | + elseif($is_opera) $classes[] = 'opera'; |
|
| 329 | + elseif($is_ns4) $classes[] = 'ns4'; |
|
| 330 | + elseif($is_safari) $classes[] = 'safari'; |
|
| 331 | + elseif($is_chrome) $classes[] = 'chrome'; |
|
| 332 | + elseif($is_ie) { |
|
| 333 | + $classes[] = 'ie'; |
|
| 334 | + if(preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $http_user_agent, $browser_version)) |
|
| 335 | + $classes[] = 'ie'.$browser_version[1]; |
|
| 336 | + } else $classes[] = 'unknown'; |
|
| 337 | + if($is_iphone) $classes[] = 'iphone'; |
|
| 338 | + if ( stristr( $http_user_agent, "mac") ) { |
|
| 339 | + $classes[] = 'osx'; |
|
| 340 | + } elseif ( stristr( $http_user_agent, "linux") ) { |
|
| 341 | + $classes[] = 'linux'; |
|
| 342 | + } elseif ( stristr( $http_user_agent, "windows") ) { |
|
| 343 | + $classes[] = 'windows'; |
|
| 344 | + } |
|
| 345 | + return $classes; |
|
| 346 | 346 | } |
| 347 | 347 | add_filter('body_class','mv_browser_body_class'); |
| 348 | 348 | |
@@ -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> |
@@ -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"; |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * Constructor |
| 15 | - **/ |
|
| 15 | + **/ |
|
| 16 | 16 | public function __construct($title, $location, $cssDeclaration, $cssClass) |
| 17 | 17 | { |
| 18 | 18 | $this->title = $title; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | /** |
| 25 | 25 | * Getters |
| 26 | 26 | * taken from: http://stackoverflow.com/questions/4478661/getter-and-setter |
| 27 | - **/ |
|
| 27 | + **/ |
|
| 28 | 28 | public function __get($property) |
| 29 | 29 | { |
| 30 | 30 | if (property_exists($this, $property)) { |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * Constructor |
| 15 | - **/ |
|
| 15 | + **/ |
|
| 16 | 16 | public function __construct($fonts) |
| 17 | 17 | { |
| 18 | 18 | if(empty($fonts)) |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | /** |
| 34 | 34 | * getFontFamilyNameArray Function |
| 35 | 35 | * this function returns an array containing all of the font family names |
| 36 | - **/ |
|
| 36 | + **/ |
|
| 37 | 37 | function getFontFamilyNameArray() |
| 38 | 38 | { |
| 39 | 39 | $result; |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | /** |
| 48 | 48 | * getTitle |
| 49 | 49 | * this function returns the font title |
| 50 | - **/ |
|
| 50 | + **/ |
|
| 51 | 51 | function getTitle($key) |
| 52 | 52 | { |
| 53 | 53 | return $this->fonts[$key]->__get("title"); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | /** |
| 57 | 57 | * getLocation |
| 58 | 58 | * this function returns the font location |
| 59 | - **/ |
|
| 59 | + **/ |
|
| 60 | 60 | function getLocation($key) |
| 61 | 61 | { |
| 62 | 62 | return $this->fonts[$key]->__get("location"); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | /** |
| 66 | 66 | * getCssDeclaration |
| 67 | 67 | * this function returns the font css declaration |
| 68 | - **/ |
|
| 68 | + **/ |
|
| 69 | 69 | function getCssDeclaration($key) |
| 70 | 70 | { |
| 71 | 71 | return $this->fonts[$key]->__get("cssDeclaration"); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * this function returns an array of css classes |
| 78 | 78 | * this function is used when displaying the fancy list of fonts in the theme customizer |
| 79 | 79 | * this function is used to send a JS file an array for the postMessage transport option in the theme customizer |
| 80 | - **/ |
|
| 80 | + **/ |
|
| 81 | 81 | function getCssClassArray() |
| 82 | 82 | { |
| 83 | 83 | $result; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | /** |
| 92 | 92 | * getTotalNumberOfFonts |
| 93 | 93 | * this function returns the total number of fonts |
| 94 | - **/ |
|
| 94 | + **/ |
|
| 95 | 95 | function getTotalNumberOfFonts() |
| 96 | 96 | { |
| 97 | 97 | return count($this->fonts); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | /** |
| 101 | 101 | * printThemeCustomizerCssLocations |
| 102 | 102 | * this function prints the links to the css files for the theme customizer |
| 103 | - **/ |
|
| 103 | + **/ |
|
| 104 | 104 | function printThemeCustomizerCssLocations() |
| 105 | 105 | { |
| 106 | 106 | foreach ($this->fonts as $key => $value) |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | /** |
| 117 | 117 | * printThemeCustomizerCssClasses |
| 118 | 118 | * this function prints the theme customizer css classes necessary to display all of the fonts |
| 119 | - **/ |
|
| 119 | + **/ |
|
| 120 | 120 | function printThemeCustomizerCssClasses() |
| 121 | 121 | { |
| 122 | 122 | ?> |