@@ -128,7 +128,7 @@ |
||
128 | 128 | * Builds an image object array from an image URL |
129 | 129 | * |
130 | 130 | * @param string $image_url |
131 | - * @param string|array $size Optional. Image size. Accepts any valid image size, or an array of width |
|
131 | + * @param integer[] $size Optional. Image size. Accepts any valid image size, or an array of width |
|
132 | 132 | * and height values in pixels (in that order). Default 'full'. |
133 | 133 | * |
134 | 134 | * @return bool|array |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | */ |
16 | 16 | |
17 | 17 | function lsx_amp_init() { |
18 | - add_post_type_support( 'jetpack-portfolio', AMP_QUERY_VAR ); |
|
19 | - add_post_type_support( 'pages', AMP_QUERY_VAR ); |
|
20 | - add_post_type_support( 'product', AMP_QUERY_VAR ); |
|
18 | + add_post_type_support( 'jetpack-portfolio', AMP_QUERY_VAR ); |
|
19 | + add_post_type_support( 'pages', AMP_QUERY_VAR ); |
|
20 | + add_post_type_support( 'product', AMP_QUERY_VAR ); |
|
21 | 21 | } |
22 | 22 | add_action( 'amp_init', 'lsx_amp_init' ); |
23 | 23 | |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | * @category template |
31 | 31 | */ |
32 | 32 | function lxs_amp_custom_template( $file, $type, $post ) { |
33 | - if ( 'single' === $type) { |
|
34 | - $file = get_template_directory() . '/mobile-templates/single-'.$post->post_type.'.php'; |
|
35 | - } |
|
36 | - return $file; |
|
33 | + if ( 'single' === $type) { |
|
34 | + $file = get_template_directory() . '/mobile-templates/single-'.$post->post_type.'.php'; |
|
35 | + } |
|
36 | + return $file; |
|
37 | 37 | } |
38 | 38 | add_filter( 'amp_post_template_file', 'lxs_amp_custom_template', 10, 3 ); |
39 | 39 |
@@ -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"> |
@@ -117,13 +117,13 @@ discard block |
||
117 | 117 | |
118 | 118 | |
119 | 119 | <?php |
120 | - $post_categories = wp_get_post_categories( get_the_ID() ); |
|
121 | - $cats = array(); |
|
122 | - foreach($post_categories as $c){ |
|
123 | - $cat = get_category( $c ); |
|
124 | - $cats[] = '<a href="' . get_category_link( $cat->term_id ) . '" title="' . sprintf( __( "View all posts in %s" , 'lsx' ), $cat->name ) . '" ' . '>' . $cat->name.'</a>'; |
|
125 | - } |
|
126 | - if(!empty($cats)){ ?> |
|
120 | + $post_categories = wp_get_post_categories( get_the_ID() ); |
|
121 | + $cats = array(); |
|
122 | + foreach($post_categories as $c){ |
|
123 | + $cat = get_category( $c ); |
|
124 | + $cats[] = '<a href="' . get_category_link( $cat->term_id ) . '" title="' . sprintf( __( "View all posts in %s" , 'lsx' ), $cat->name ) . '" ' . '>' . $cat->name.'</a>'; |
|
125 | + } |
|
126 | + if(!empty($cats)){ ?> |
|
127 | 127 | <span class="post-meta-categories"><span><?php _e('Posted in:','lsx'); ?></span> <?php echo implode(', ', $cats); ?></span> |
128 | 128 | <?php } ?> |
129 | 129 | |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | |
411 | 411 | //print_r(get_nav_menu_locations()); |
412 | 412 | |
413 | - if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
413 | + if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
414 | 414 | <nav class="primary-navbar collapse navbar-collapse"> |
415 | 415 | <?php |
416 | 416 | wp_nav_menu( array( |
@@ -538,9 +538,9 @@ discard block |
||
538 | 538 | if(null != $tag_cloud){ |
539 | 539 | printf( '<h2>'.__( '%1$s', 'lsx' ).'</h2>', $taxonomy ); |
540 | 540 | echo '<aside id="'.$taxonomy_id.'" class="widget widget_'.$taxonomy_id.'">'.$tag_cloud.'</aside>'; |
541 | - } |
|
542 | - } |
|
543 | - } |
|
541 | + } |
|
542 | + } |
|
543 | + } |
|
544 | 544 | } |
545 | 545 | |
546 | 546 | /** |
@@ -589,11 +589,11 @@ discard block |
||
589 | 589 | <div class="container"> |
590 | 590 | <nav class="top-menu"> |
591 | 591 | <?php |
592 | - wp_nav_menu( array( |
|
592 | + wp_nav_menu( array( |
|
593 | 593 | 'theme_location' => 'top-menu', |
594 | 594 | 'walker' => new lsx_bootstrap_navwalker()) |
595 | 595 | ); |
596 | - ?> |
|
596 | + ?> |
|
597 | 597 | </nav> |
598 | 598 | </div> |
599 | 599 | </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> |
@@ -31,17 +31,17 @@ discard block |
||
31 | 31 | |
32 | 32 | <div class="entry-meta"> |
33 | 33 | <?php |
34 | - $metadata = wp_get_attachment_metadata(); |
|
35 | - printf( __( 'Published <span class="entry-date"><time class="entry-date" datetime="%1$s" pubdate>%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s × %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%7$s</a>', 'lsx' ), |
|
36 | - esc_attr( get_the_date( 'c' ) ), |
|
37 | - esc_html( get_the_date() ), |
|
38 | - wp_get_attachment_url(), |
|
39 | - $metadata['width'], |
|
40 | - $metadata['height'], |
|
41 | - get_permalink( $post->post_parent ), |
|
42 | - get_the_title( $post->post_parent ) |
|
43 | - ); |
|
44 | - ?> |
|
34 | + $metadata = wp_get_attachment_metadata(); |
|
35 | + printf( __( 'Published <span class="entry-date"><time class="entry-date" datetime="%1$s" pubdate>%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s × %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%7$s</a>', 'lsx' ), |
|
36 | + esc_attr( get_the_date( 'c' ) ), |
|
37 | + esc_html( get_the_date() ), |
|
38 | + wp_get_attachment_url(), |
|
39 | + $metadata['width'], |
|
40 | + $metadata['height'], |
|
41 | + get_permalink( $post->post_parent ), |
|
42 | + get_the_title( $post->post_parent ) |
|
43 | + ); |
|
44 | + ?> |
|
45 | 45 | <?php edit_post_link( __( 'Edit', 'lsx' ), '<span class="sep"> | </span> <span class="edit-link">', '</span>' ); ?> |
46 | 46 | </div><!-- .entry-meta --> |
47 | 47 | |
@@ -56,34 +56,34 @@ discard block |
||
56 | 56 | <div class="entry-attachment"> |
57 | 57 | <div class="attachment"> |
58 | 58 | <?php |
59 | - /** |
|
60 | - * Grab the IDs of all the image attachments in a gallery so we can get the URL of the next adjacent image in a gallery, |
|
61 | - * or the first image (if we're looking at the last image in a gallery), or, in a gallery of one, just the link to that image file |
|
62 | - */ |
|
63 | - $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); |
|
64 | - foreach ( $attachments as $k => $attachment ) { |
|
65 | - if ( $attachment->ID == $post->ID ) |
|
66 | - break; |
|
67 | - } |
|
68 | - $k++; |
|
69 | - // If there is more than 1 attachment in a gallery |
|
70 | - if ( count( $attachments ) > 1 ) { |
|
71 | - if ( isset( $attachments[ $k ] ) ) |
|
72 | - // get the URL of the next image attachment |
|
73 | - $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); |
|
74 | - else |
|
75 | - // or get the URL of the first image attachment |
|
76 | - $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); |
|
77 | - } else { |
|
78 | - // or, if there's only 1 image, get the URL of the image |
|
79 | - $next_attachment_url = wp_get_attachment_url(); |
|
80 | - } |
|
81 | - ?> |
|
59 | + /** |
|
60 | + * Grab the IDs of all the image attachments in a gallery so we can get the URL of the next adjacent image in a gallery, |
|
61 | + * or the first image (if we're looking at the last image in a gallery), or, in a gallery of one, just the link to that image file |
|
62 | + */ |
|
63 | + $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); |
|
64 | + foreach ( $attachments as $k => $attachment ) { |
|
65 | + if ( $attachment->ID == $post->ID ) |
|
66 | + break; |
|
67 | + } |
|
68 | + $k++; |
|
69 | + // If there is more than 1 attachment in a gallery |
|
70 | + if ( count( $attachments ) > 1 ) { |
|
71 | + if ( isset( $attachments[ $k ] ) ) |
|
72 | + // get the URL of the next image attachment |
|
73 | + $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); |
|
74 | + else |
|
75 | + // or get the URL of the first image attachment |
|
76 | + $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); |
|
77 | + } else { |
|
78 | + // or, if there's only 1 image, get the URL of the image |
|
79 | + $next_attachment_url = wp_get_attachment_url(); |
|
80 | + } |
|
81 | + ?> |
|
82 | 82 | |
83 | 83 | <a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php |
84 | - $attachment_size = apply_filters( 'shape_attachment_size', array( 1200, 1200 ) ); // Filterable image size. |
|
85 | - echo wp_get_attachment_image( $post->ID, $attachment_size ); |
|
86 | - ?></a> |
|
84 | + $attachment_size = apply_filters( 'shape_attachment_size', array( 1200, 1200 ) ); // Filterable image size. |
|
85 | + echo wp_get_attachment_image( $post->ID, $attachment_size ); |
|
86 | + ?></a> |
|
87 | 87 | </div><!-- .attachment --> |
88 | 88 | |
89 | 89 | <?php if ( ! empty( $post->post_excerpt ) ) : ?> |
@@ -94,15 +94,15 @@ discard block |
||
94 | 94 | </div><!-- .entry-attachment --> |
95 | 95 | |
96 | 96 | <?php |
97 | - the_content(); |
|
97 | + the_content(); |
|
98 | 98 | |
99 | - wp_link_pages( array( |
|
100 | - 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
|
101 | - 'after' => '</div></div>', |
|
102 | - 'link_before' => '<span>', |
|
103 | - 'link_after' => '</span>' |
|
104 | - ) ); |
|
105 | - ?> |
|
99 | + wp_link_pages( array( |
|
100 | + 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
|
101 | + 'after' => '</div></div>', |
|
102 | + 'link_before' => '<span>', |
|
103 | + 'link_after' => '</span>' |
|
104 | + ) ); |
|
105 | + ?> |
|
106 | 106 | |
107 | 107 | </div><!-- .entry-content --> |
108 | 108 |