Completed
Push — master ( bcb77d...aa4fea )
by
unknown
03:19
created
inc/extras.php 2 patches
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -198,6 +198,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) return; // Exit if accessed directly
3 3
 
4 4
 /**
5 5
  * Add and remove body_class() classes
@@ -8,21 +8,21 @@  discard block
 block discarded – undo
8 8
 	/*
9 9
 	 * Add the header layout class
10 10
 	 */
11
-	$header_layout = get_theme_mod('lsx_header_layout','inline');
12
-	$classes[] = 'header-'.$header_layout;
11
+	$header_layout = get_theme_mod('lsx_header_layout', 'inline');
12
+	$classes[] = 'header-' . $header_layout;
13 13
 		
14 14
 	
15 15
   // Add post/page slug
16
-  if (is_single() || is_page() && !is_front_page()) {
16
+  if (is_single() || is_page() && ! is_front_page()) {
17 17
     $classes[] = basename(get_permalink());
18 18
   }
19 19
   
20
-  if(!class_exists('Lsx_Banners')){
21
-		$post_types = array('page','post');
22
-		$post_types = apply_filters('lsx_allowed_post_type_banners',$post_types);  
20
+  if ( ! class_exists('Lsx_Banners')) {
21
+		$post_types = array('page', 'post');
22
+		$post_types = apply_filters('lsx_allowed_post_type_banners', $post_types);  
23 23
 
24
-		if((is_singular($post_types) && has_post_thumbnail()) 
25
-		|| (is_singular('jetpack-portfolio'))){
24
+		if ((is_singular($post_types) && has_post_thumbnail()) 
25
+		|| (is_singular('jetpack-portfolio'))) {
26 26
 			$classes[] = 'page-has-banner';
27 27
 		}
28 28
 	}
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
   	$classes[] = 'has-top-menu';
32 32
   }
33 33
 
34
-	if ( get_theme_mod( 'lsx_preloader_content_status', '1' ) === '1' ) {
34
+	if (get_theme_mod('lsx_preloader_content_status', '1') === '1') {
35 35
 		$classes[] = 'preloader-content-enable';
36 36
 	}
37 37
 
@@ -55,30 +55,30 @@  discard block
 block discarded – undo
55 55
  * @param string $sep Optional separator.
56 56
  * @return string The filtered title.
57 57
  */
58
-function lsx_wp_title( $title, $sep ) {
58
+function lsx_wp_title($title, $sep) {
59 59
 	global $page, $paged;
60 60
 
61
-	if ( is_feed() ) {
61
+	if (is_feed()) {
62 62
 		return $title;
63 63
 	}
64 64
 
65 65
 	// Add the blog name
66
-	$title .= get_bloginfo( 'name' );
66
+	$title .= get_bloginfo('name');
67 67
 
68 68
 	// Add the blog description for the home/front page.
69
-	$site_description = get_bloginfo( 'description', 'display' );
70
-	if ( $site_description && ( is_home() || is_front_page() ) ) {
69
+	$site_description = get_bloginfo('description', 'display');
70
+	if ($site_description && (is_home() || is_front_page())) {
71 71
 		$title .= " $sep $site_description";
72 72
 	}
73 73
 
74 74
 	// Add a page number if necessary:
75
-	if ( $paged >= 2 || $page >= 2 ) {
76
-		$title .= " $sep " . sprintf( __( 'Page %s', 'lsx' ), max( $paged, $page ) );
75
+	if ($paged >= 2 || $page >= 2) {
76
+		$title .= " $sep " . sprintf(__('Page %s', 'lsx'), max($paged, $page));
77 77
 	}
78 78
 
79 79
 	return $title;
80 80
 }
81
-add_filter( 'wp_title', 'lsx_wp_title', 10, 2 );
81
+add_filter('wp_title', 'lsx_wp_title', 10, 2);
82 82
 
83 83
 
84 84
 /**
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
 function lsx_remove_self_closing_tags($input) {
100 100
   return str_replace(' />', '>', $input);
101 101
 }
102
-add_filter('get_avatar',          'lsx_remove_self_closing_tags'); // <img />
103
-add_filter('comment_id_fields',   'lsx_remove_self_closing_tags'); // <input />
102
+add_filter('get_avatar', 'lsx_remove_self_closing_tags'); // <img />
103
+add_filter('comment_id_fields', 'lsx_remove_self_closing_tags'); // <input />
104 104
 add_filter('post_thumbnail_html', 'lsx_remove_self_closing_tags'); // <img />
105 105
 
106 106
 
107
-if (!function_exists('lsx_get_attachment_id')) {
107
+if ( ! function_exists('lsx_get_attachment_id')) {
108 108
 	/**
109 109
 	 * Get the Attachment ID for a given image URL.
110 110
 	 *
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	function lsx_get_attachment_id($url) {
116 116
 		$dir = wp_upload_dir();
117 117
 		// baseurl never has a trailing slash
118
-		if (false === strpos($url, $dir['baseurl'].'/')) {
118
+		if (false === strpos($url, $dir['baseurl'] . '/')) {
119 119
 			// URL points to a place outside of upload directory
120 120
 			return false;
121 121
 		}
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 		$query['meta_query'][0]['key'] = '_wp_attached_file';
134 134
 		// query attachments
135 135
 		$ids = get_posts($query);
136
-		if (!empty($ids)) {
136
+		if ( ! empty($ids)) {
137 137
 			foreach ($ids as $id) {
138 138
 				// first entry of returned array is the URL
139 139
 				$temp_url = wp_get_attachment_image_src($id, 'full');
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
  */
177 177
 function lsx_is_element_empty($element) {
178 178
 	$element = trim($element);
179
-	return empty($element)?false:true;
179
+	return empty($element) ? false : true;
180 180
 }
181 181
 
182 182
 
@@ -187,39 +187,39 @@  discard block
 block discarded – undo
187 187
  * @subpackage extras
188 188
  * @category thumbnails
189 189
  */
190
-function lsx_get_thumbnail($size,$image_src = false){
190
+function lsx_get_thumbnail($size, $image_src = false) {
191 191
 	
192
-	if(false === $image_src){
192
+	if (false === $image_src) {
193 193
 		$post_id = get_the_ID(); 
194
-		$post_thumbnail_id = get_post_thumbnail_id( $post_id );
195
-	}elseif(false != $image_src	){
196
-		if(is_numeric($image_src)){
194
+		$post_thumbnail_id = get_post_thumbnail_id($post_id);
195
+	}elseif (false != $image_src) {
196
+		if (is_numeric($image_src)) {
197 197
 			$post_thumbnail_id = $image_src;
198
-		}else{
198
+		} else {
199 199
 			$post_thumbnail_id = lsx_get_attachment_id_from_src($image_src);
200 200
 		}
201 201
 	}
202
-	$size = apply_filters('lsx_thumbnail_size',$size);
202
+	$size = apply_filters('lsx_thumbnail_size', $size);
203 203
 	$img = false;
204
-	if($size === 'lsx-thumbnail-wide' || $size === 'thumbnail'){
204
+	if ($size === 'lsx-thumbnail-wide' || $size === 'thumbnail') {
205 205
 		$srcset = false;
206
-		$img = wp_get_attachment_image_src($post_thumbnail_id,$size);
206
+		$img = wp_get_attachment_image_src($post_thumbnail_id, $size);
207 207
 		$img = $img[0];
208
-	}else{
208
+	} else {
209 209
 		$srcset = true;
210
-		$img = wp_get_attachment_image_srcset($post_thumbnail_id,$size);
211
-		if($img == false) {
210
+		$img = wp_get_attachment_image_srcset($post_thumbnail_id, $size);
211
+		if ($img == false) {
212 212
 			$srcset = false;
213
-			$img = wp_get_attachment_image_src($post_thumbnail_id,$size);
213
+			$img = wp_get_attachment_image_src($post_thumbnail_id, $size);
214 214
 			$img = $img[0];
215 215
 		}
216 216
 	}
217 217
 	if ($srcset) {
218
-		$img = '<img alt="'.get_the_title(get_the_ID()).'" class="attachment-responsive wp-post-image lsx-responsive" srcset="'.$img.'" />';
218
+		$img = '<img alt="' . get_the_title(get_the_ID()) . '" class="attachment-responsive wp-post-image lsx-responsive" srcset="' . $img . '" />';
219 219
 	} else {
220
-		$img = '<img alt="'.get_the_title(get_the_ID()).'" class="attachment-responsive wp-post-image lsx-responsive" src="'.$img.'" />';
220
+		$img = '<img alt="' . get_the_title(get_the_ID()) . '" class="attachment-responsive wp-post-image lsx-responsive" src="' . $img . '" />';
221 221
 	}
222
-	$img = apply_filters('lsx_lazyload_filter_images',$img);
222
+	$img = apply_filters('lsx_lazyload_filter_images', $img);
223 223
 	return $img;
224 224
 }
225 225
 
@@ -230,8 +230,8 @@  discard block
 block discarded – undo
230 230
  * @subpackage extras
231 231
  * @category thumbnails
232 232
  */
233
-function lsx_thumbnail( $size = 'thumbnail', $image_src = false ) {
234
-	echo wp_kses_post( lsx_get_thumbnail( $size, $image_src ) );
233
+function lsx_thumbnail($size = 'thumbnail', $image_src = false) {
234
+	echo wp_kses_post(lsx_get_thumbnail($size, $image_src));
235 235
 }
236 236
 
237 237
 
@@ -241,14 +241,14 @@  discard block
 block discarded – undo
241 241
  * @subpackage extras
242 242
  * @category thumbnails
243 243
  */
244
-function lsx_get_attachment_id_from_src( $image_src ) {
245
-	$post_id = wp_cache_get( $image_src, 'lsx_get_attachment_id_from_src' );
244
+function lsx_get_attachment_id_from_src($image_src) {
245
+	$post_id = wp_cache_get($image_src, 'lsx_get_attachment_id_from_src');
246 246
 	
247
-	if ( false === $post_id ) {
247
+	if (false === $post_id) {
248 248
 		global $wpdb;
249
-		$query = $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src );
250
-		$post_id = $wpdb->get_var( $query );
251
-		wp_cache_set( $image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600 );
249
+		$query = $wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src);
250
+		$post_id = $wpdb->get_var($query);
251
+		wp_cache_set($image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600);
252 252
 	}
253 253
 
254 254
 	return $post_id;
@@ -262,28 +262,28 @@  discard block
 block discarded – undo
262 262
  * @subpackage extras
263 263
  * @category banner
264 264
  */
265
-if (!function_exists('lsx_page_banner')) {
265
+if ( ! function_exists('lsx_page_banner')) {
266 266
 	function lsx_page_banner() {
267 267
 
268
-		$post_types = array('page','post');
269
-		$post_types = apply_filters('lsx_allowed_post_type_banners',$post_types);	
268
+		$post_types = array('page', 'post');
269
+		$post_types = apply_filters('lsx_allowed_post_type_banners', $post_types);	
270 270
 		
271
-		if ( (is_singular($post_types) && has_post_thumbnail())
272
-		 || (is_singular('jetpack-portfolio')) ) { ?>
271
+		if ((is_singular($post_types) && has_post_thumbnail())
272
+		 || (is_singular('jetpack-portfolio'))) { ?>
273 273
 	        
274 274
 	        <?php 
275 275
 	        	$bg_image = '';
276
-	        	if(has_post_thumbnail()){
277
-	        		$bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),'full');
276
+	        	if (has_post_thumbnail()) {
277
+	        		$bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full');
278 278
 	        		$bg_image = $bg_image[0];
279 279
 	        	}
280 280
 	        ?>
281 281
 
282
-	   		<?php if ( ! empty( $bg_image ) ) : ?>
282
+	   		<?php if ( ! empty($bg_image)) : ?>
283 283
 	        
284 284
 	        <div class="page-banner-wrap">
285 285
 		        <div class="page-banner">
286
-		        	<div class="page-banner-image" style="background-image:url(<?php echo esc_attr( $bg_image ); ?>);"></div>
286
+		        	<div class="page-banner-image" style="background-image:url(<?php echo esc_attr($bg_image); ?>);"></div>
287 287
 
288 288
 		        	<div class="container">
289 289
 			            <header class="page-header">
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 	    <?php } 
300 300
 	}
301 301
 }
302
-add_action( 'lsx_header_after', 'lsx_page_banner' );
302
+add_action('lsx_header_after', 'lsx_page_banner');
303 303
 
304 304
 
305 305
 /**
@@ -309,43 +309,43 @@  discard block
 block discarded – undo
309 309
  * @subpackage extras
310 310
  * @category mobile
311 311
  */
312
-function lsx_allow_sms_protocol( $protocols ) {
312
+function lsx_allow_sms_protocol($protocols) {
313 313
     $protocols[] = 'sms';
314 314
     return $protocols;
315 315
 }
316
-add_filter( 'kses_allowed_protocols', 'lsx_allow_sms_protocol' );
316
+add_filter('kses_allowed_protocols', 'lsx_allow_sms_protocol');
317 317
 
318 318
 
319 319
 /**
320 320
  * Adding browser and user-agent classes to body
321 321
  */
322 322
 function mv_browser_body_class($classes) {
323
-		$http_user_agent = sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) );
324
-		$http_user_agent = ! empty( $http_user_agent ) ? $http_user_agent : '';
323
+		$http_user_agent = sanitize_text_field(wp_unslash($_SERVER['HTTP_USER_AGENT']));
324
+		$http_user_agent = ! empty($http_user_agent) ? $http_user_agent : '';
325 325
 
326 326
         global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
327
-        if($is_lynx) $classes[] = 'lynx';
328
-        elseif($is_gecko) $classes[] = 'gecko';
329
-        elseif($is_opera) $classes[] = 'opera';
330
-        elseif($is_NS4) $classes[] = 'ns4';
331
-        elseif($is_safari) $classes[] = 'safari';
332
-        elseif($is_chrome) $classes[] = 'chrome';
333
-        elseif($is_IE) {
327
+        if ($is_lynx) $classes[] = 'lynx';
328
+        elseif ($is_gecko) $classes[] = 'gecko';
329
+        elseif ($is_opera) $classes[] = 'opera';
330
+        elseif ($is_NS4) $classes[] = 'ns4';
331
+        elseif ($is_safari) $classes[] = 'safari';
332
+        elseif ($is_chrome) $classes[] = 'chrome';
333
+        elseif ($is_IE) {
334 334
                 $classes[] = 'ie';
335
-                if(preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $http_user_agent, $browser_version))
336
-                $classes[] = 'ie'.$browser_version[1];
335
+                if (preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $http_user_agent, $browser_version))
336
+                $classes[] = 'ie' . $browser_version[1];
337 337
         } else $classes[] = 'unknown';
338
-        if($is_iphone) $classes[] = 'iphone';
339
-        if ( stristr( $http_user_agent, "mac") ) {
338
+        if ($is_iphone) $classes[] = 'iphone';
339
+        if (stristr($http_user_agent, "mac")) {
340 340
                  $classes[] = 'osx';
341
-           } elseif ( stristr( $http_user_agent, "linux") ) {
341
+           } elseif (stristr($http_user_agent, "linux")) {
342 342
                  $classes[] = 'linux';
343
-           } elseif ( stristr( $http_user_agent, "windows") ) {
343
+           } elseif (stristr($http_user_agent, "windows")) {
344 344
                  $classes[] = 'windows';
345 345
            }
346 346
         return $classes;
347 347
 }
348
-add_filter('body_class','mv_browser_body_class');
348
+add_filter('body_class', 'mv_browser_body_class');
349 349
 
350 350
 
351 351
 /**
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
  * @param		$form		Object
359 359
  * @return		String
360 360
  */
361
-function lsx_form_submit_button($button, $form){
361
+function lsx_form_submit_button($button, $form) {
362 362
 	return "<button class='btn btn-primary' id='gform_submit_button_{$form["id"]}'><span>Submit</span></button>";
363 363
 }
364 364
 add_filter("gform_submit_button", "lsx_form_submit_button", 10, 2);
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 	//return ' ... <a class="moretag" href="'. get_permalink($post->ID) . '">'.__('Continue reading','lsx').'</a>';
373 373
 	return '...';
374 374
 }
375
-add_filter( 'excerpt_more', 'lsx_excerpt_more' );
375
+add_filter('excerpt_more', 'lsx_excerpt_more');
376 376
 
377 377
 
378 378
 /**
@@ -381,44 +381,44 @@  discard block
 block discarded – undo
381 381
 function lsx_the_excerpt_filter($excerpt) {
382 382
 	$show_full_content = has_post_format(apply_filters('lsx_the_excerpt_filter_post_types', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio')));
383 383
 	
384
-	if (!$show_full_content) {
385
-		if ('' !== $excerpt  && !stristr($excerpt, 'moretag')) {
386
-			$pagination = wp_link_pages( array(
384
+	if ( ! $show_full_content) {
385
+		if ('' !== $excerpt && ! stristr($excerpt, 'moretag')) {
386
+			$pagination = wp_link_pages(array(
387 387
 							'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
388 388
 							'after' => '</div></div>',
389 389
 							'link_before' => '<span>',
390 390
 							'link_after' => '</span>',
391 391
 							'echo' => 0
392
-						) );
392
+						));
393 393
 
394
-			if ( ! empty( $pagination ) ) {
394
+			if ( ! empty($pagination)) {
395 395
 				$excerpt .= $pagination;
396 396
 			}
397 397
 			else {
398
-				$excerpt .= '<p><a class="moretag" href="'.get_permalink().'">'.__('Continue reading','lsx').'</a></p>';
398
+				$excerpt .= '<p><a class="moretag" href="' . get_permalink() . '">' . __('Continue reading', 'lsx') . '</a></p>';
399 399
 			}
400 400
 		}
401 401
 	}
402 402
 
403 403
 	return $excerpt;
404 404
 }
405
-add_filter( 'the_excerpt', 'lsx_the_excerpt_filter' , 1 , 20 );
405
+add_filter('the_excerpt', 'lsx_the_excerpt_filter', 1, 20);
406 406
 
407 407
 
408 408
 /**
409 409
  * Allow HTML tags in excerpt
410 410
  */
411
-if ( ! function_exists( 'wpse_custom_wp_trim_excerpt' ) ) {
411
+if ( ! function_exists('wpse_custom_wp_trim_excerpt')) {
412 412
 	function wpse_custom_wp_trim_excerpt($wpse_excerpt) {
413 413
 		global $post;
414 414
 		$raw_excerpt = $wpse_excerpt;
415 415
 
416
-		if ( '' == $wpse_excerpt ) {
416
+		if ('' == $wpse_excerpt) {
417 417
 			$wpse_excerpt = get_the_content('');
418 418
 			$show_full_content = has_post_format(array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio'));
419 419
 
420
-			if (!$show_full_content) {
421
-				$wpse_excerpt = strip_shortcodes( $wpse_excerpt );
420
+			if ( ! $show_full_content) {
421
+				$wpse_excerpt = strip_shortcodes($wpse_excerpt);
422 422
 				$wpse_excerpt = apply_filters('the_content', $wpse_excerpt);
423 423
 				$wpse_excerpt = str_replace(']]>', ']]>', $wpse_excerpt);
424 424
 				//$wpse_excerpt = strip_tags($wpse_excerpt, '<blockquote>,<p>');
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 				$wpse_excerpt = trim(force_balance_tags($excerptOutput));
447 447
 
448 448
 				if ($has_more) {
449
-					$excerpt_end = '<a class="moretag" href="'.get_permalink().'">'.__('More','lsx').'</a>';
449
+					$excerpt_end = '<a class="moretag" href="' . get_permalink() . '">' . __('More', 'lsx') . '</a>';
450 450
 					$excerpt_end = apply_filters('excerpt_more', ' ' . $excerpt_end); 
451 451
 
452 452
 					$pos = strrpos($wpse_excerpt, '</');
@@ -474,4 +474,4 @@  discard block
 block discarded – undo
474 474
 }
475 475
 remove_filter('get_the_excerpt', 'wp_trim_excerpt');
476 476
 add_filter('get_the_excerpt', 'wpse_custom_wp_trim_excerpt');
477
-remove_filter( 'the_excerpt', 'wpautop' );
477
+remove_filter('the_excerpt', 'wpautop');
Please login to merge, or discard this patch.
inc/layout.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -5,6 +5,7 @@
 block discarded – undo
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' ) {
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) return; // Exit if accessed directly
3 3
 
4 4
 /**
5 5
  * Layout hooks
@@ -7,15 +7,15 @@  discard block
 block discarded – undo
7 7
  * @package lsx
8 8
  */
9 9
 
10
-function lsx_layout_selector( $class, $area = 'site' ) {
10
+function lsx_layout_selector($class, $area = 'site') {
11 11
 
12
-	$layout = get_theme_mod('lsx_layout','2cr');
13
-	$layout = apply_filters( 'lsx_layout', $layout );
12
+	$layout = get_theme_mod('lsx_layout', '2cr');
13
+	$layout = apply_filters('lsx_layout', $layout);
14 14
 
15 15
 	$default_size = 'sm';
16
-	$size = apply_filters( 'lsx_bootstrap_column_size', $default_size );
16
+	$size = apply_filters('lsx_bootstrap_column_size', $default_size);
17 17
 
18
-	switch ( $layout ) {
18
+	switch ($layout) {
19 19
 		case '1c':
20 20
 			$main_class = 'col-' . $size . '-12';
21 21
 			$sidebar_class = 'col-' . $size . '-12';
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
 			break;
35 35
 	}
36 36
 
37
-	if ( $class == 'main' ) {
37
+	if ($class == 'main') {
38 38
 		return $main_class;
39 39
 	}
40 40
 
41
-	if ( $class == 'sidebar' ) {
41
+	if ($class == 'sidebar') {
42 42
 		return $sidebar_class;
43 43
 	}
44 44
 }
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
  * .main classes
48 48
  */
49 49
 function lsx_main_class() {
50
-	return lsx_layout_selector( 'main' );
50
+	return lsx_layout_selector('main');
51 51
 }
52 52
 
53 53
 function lsx_home_main_class() {
54
-	return lsx_layout_selector( 'main', 'home' );
54
+	return lsx_layout_selector('main', 'home');
55 55
 }
56 56
 
57 57
 /**
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
 function lsx_index_main_class() {
61 61
 
62 62
 	$show_on_front = get_option('show_on_front');
63
-	if('page' == $show_on_front){
64
-		return lsx_layout_selector( 'main', 'home' );
65
-	}else{
66
-		return lsx_layout_selector( 'main', 'site' );
63
+	if ('page' == $show_on_front) {
64
+		return lsx_layout_selector('main', 'home');
65
+	} else {
66
+		return lsx_layout_selector('main', 'site');
67 67
 	}
68 68
 
69 69
 }
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
  * .sidebar classes
73 73
  */
74 74
 function lsx_sidebar_class() {
75
-	return lsx_layout_selector( 'sidebar' );
75
+	return lsx_layout_selector('sidebar');
76 76
 }
77 77
 
78 78
 function lsx_home_sidebar_class() {
79
-	return lsx_layout_selector( 'sidebar', 'home' );
79
+	return lsx_layout_selector('sidebar', 'home');
80 80
 }
81 81
 
82 82
 /**
@@ -91,13 +91,13 @@  discard block
 block discarded – undo
91 91
 	$classes = 'banner navbar navbar-default';
92 92
 	
93 93
 	//Fixed header
94
-	$fixed_header = get_theme_mod('lsx_header_fixed',false);
95
-	if(false != $fixed_header){
94
+	$fixed_header = get_theme_mod('lsx_header_fixed', false);
95
+	if (false != $fixed_header) {
96 96
 		$classes .= ' navbar-static-top';
97 97
 	}
98 98
 	
99
-	if(false != $additional){
100
-		$classes .= ' '.$additional;
99
+	if (false != $additional) {
100
+		$classes .= ' ' . $additional;
101 101
 	}
102 102
 	echo $classes;
103 103
 }
@@ -114,37 +114,37 @@  discard block
 block discarded – undo
114 114
 	$classes = 'top-menu-default';
115 115
 	
116 116
 	//Fixed header
117
-	$fixed_header = get_theme_mod('lsx_header_fixed',false);
118
-	if(false != $fixed_header){
117
+	$fixed_header = get_theme_mod('lsx_header_fixed', false);
118
+	if (false != $fixed_header) {
119 119
 		$classes .= ' top-menu-fixed';
120 120
 	}
121 121
 	
122
-	if(false != $additional){
123
-		$classes .= ' '.$additional;
122
+	if (false != $additional) {
123
+		$classes .= ' ' . $additional;
124 124
 	}
125 125
 	echo $classes;
126 126
 }
127 127
 
128
-add_action( 'lsx_footer_before', 'lsx_add_footer_sidebar_area' );
129
-if ( ! function_exists( 'lsx_add_footer_sidebar_area' ) ) { 
128
+add_action('lsx_footer_before', 'lsx_add_footer_sidebar_area');
129
+if ( ! function_exists('lsx_add_footer_sidebar_area')) { 
130 130
 	function lsx_add_footer_sidebar_area() {
131
-		if ( is_active_sidebar( 'sidebar-footer-cta' ) ) : ?>
131
+		if (is_active_sidebar('sidebar-footer-cta')) : ?>
132 132
 			<div id="footer-cta">
133 133
 				<div class="container">
134 134
 					<div class="lsx-full-width">
135 135
 						<div class="lsx-hero-unit">
136
-							<?php dynamic_sidebar( 'sidebar-footer-cta' ); ?>
136
+							<?php dynamic_sidebar('sidebar-footer-cta'); ?>
137 137
 						</div>
138 138
 					</div>
139 139
 				</div>
140 140
 			</div>
141 141
 		<?php endif; ?>
142 142
 
143
-		<?php if ( is_active_sidebar( 'sidebar-footer' ) ) : ?>
143
+		<?php if (is_active_sidebar('sidebar-footer')) : ?>
144 144
 			<div id="footer-widgets">
145 145
 				<div class="container">
146 146
 					<div class="row">
147
-						<?php dynamic_sidebar( 'sidebar-footer' ); ?>
147
+						<?php dynamic_sidebar('sidebar-footer'); ?>
148 148
 					</div>
149 149
 				</div>
150 150
 			</div>
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		<?php
168 168
 	else*/if (is_singular('post')) :
169 169
 		$format = get_post_format();
170
-		if ( false === $format ) {
170
+		if (false === $format) {
171 171
 			$format = 'standard';
172 172
 		}
173 173
 		$format_link = get_post_format_link($format);
@@ -189,14 +189,14 @@  discard block
 block discarded – undo
189 189
 	elseif (is_search()) :
190 190
 		?>
191 191
 		<header class="archive-header">
192
-			<h1 class="archive-title"><?php printf( __( 'Search Results for: %s', 'lsx' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
192
+			<h1 class="archive-title"><?php printf(__('Search Results for: %s', 'lsx'), '<span>' . get_search_query() . '</span>'); ?></h1>
193 193
 		</header>
194 194
 		<?php
195 195
 	elseif (is_author()) :
196 196
 		?>
197 197
 		<header class="archive-header">
198 198
 			<h1 class="archive-title">
199
-				<?php printf( __( 'Author: %s', 'lsx' ), get_the_author() ); ?>
199
+				<?php printf(__('Author: %s', 'lsx'), get_the_author()); ?>
200 200
 			</h1>
201 201
 
202 202
 			<?php if (get_the_author_meta('description')) { ?>
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 			<?php } ?>
205 205
 		</header>
206 206
 		<?php
207
-	elseif (is_archive() && class_exists('WooCommerce') && is_post_type_archive('product') ) :
207
+	elseif (is_archive() && class_exists('WooCommerce') && is_post_type_archive('product')) :
208 208
 		?>
209 209
 		<header class="archive-header">
210 210
 			<h1 class="archive-title"><?php _e('Shop', 'lsx'); ?></h1>
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 		?>
216 216
 		<header class="archive-header">
217 217
 			<h1 class="archive-title">
218
-				<?php if ( has_post_format() && !is_category() && !is_tag() && !is_date() && !is_tax('post_format') ) { ?>
218
+				<?php if (has_post_format() && ! is_category() && ! is_tag() && ! is_date() && ! is_tax('post_format')) { ?>
219 219
 					Type: <?php the_archive_title(); ?>
220 220
 				<?php } else { ?>
221 221
 					<?php the_archive_title(); ?>
@@ -253,16 +253,16 @@  discard block
 block discarded – undo
253 253
 	?>
254 254
 		<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0">
255 255
 	<?php }
256
-add_action( 'wp_head', 'lsx_add_viewport_meta_tag' );
256
+add_action('wp_head', 'lsx_add_viewport_meta_tag');
257 257
 
258 258
 
259 259
 /**
260 260
  * Add a search form to just above the nav menu
261 261
  */
262 262
 function lsx_header_search_form() {
263
-	$search_form = get_theme_mod( 'lsx_header_search', 0 );
264
-	if($search_form || is_customize_preview()){
265
-		get_search_form( true );
263
+	$search_form = get_theme_mod('lsx_header_search', 0);
264
+	if ($search_form || is_customize_preview()) {
265
+		get_search_form(true);
266 266
 	}
267 267
 }
268
-add_action( 'lsx_nav_before', 'lsx_header_search_form', 0 );
269 268
\ No newline at end of file
269
+add_action('lsx_nav_before', 'lsx_header_search_form', 0);
270 270
\ No newline at end of file
Please login to merge, or discard this patch.
inc/lazyload.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -140,6 +140,9 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return;
2
+if ( ! defined('ABSPATH')) return;
3 3
 
4 4
 /*
5 5
  * LSX Lazy Load Images Class
@@ -25,138 +25,138 @@  discard block
 block discarded – undo
25 25
 	protected static $noscripts   = array();
26 26
 
27 27
 	static function init() {
28
-		if ( is_admin() )
28
+		if (is_admin())
29 29
 			return;
30 30
 
31
-		if ( get_theme_mod( 'lsx_lazyload_status', '1' ) === false ) {
31
+		if (get_theme_mod('lsx_lazyload_status', '1') === false) {
32 32
 			self::$enabled = false;
33 33
 			return;
34 34
 		}
35 35
 
36
-		if ( ! apply_filters( 'lsx_lazyload_is_enabled', true ) ) {
36
+		if ( ! apply_filters('lsx_lazyload_is_enabled', true)) {
37 37
 			self::$enabled = false;
38 38
 			return;
39 39
 		}
40 40
 
41
-		add_action( 'wp_enqueue_scripts', array( __CLASS__, 'add_scripts' ) );
42
-		add_action( 'wp_head', array( __CLASS__, 'setup_filters' ), 9999 );
41
+		add_action('wp_enqueue_scripts', array(__CLASS__, 'add_scripts'));
42
+		add_action('wp_head', array(__CLASS__, 'setup_filters'), 9999);
43 43
 	}
44 44
 
45 45
 	static function setup_filters() {
46 46
 		// WordPress
47
-		add_filter( 'the_content', array( __CLASS__, 'filter_images' ), 200 );
48
-		add_filter( 'widget_text', array( __CLASS__, 'filter_images' ), 200 );
49
-		add_filter( 'post_thumbnail_html', array( __CLASS__, 'filter_images' ), 200 );
50
-		add_filter( 'get_avatar', array( __CLASS__, 'filter_images' ), 200 );
47
+		add_filter('the_content', array(__CLASS__, 'filter_images'), 200);
48
+		add_filter('widget_text', array(__CLASS__, 'filter_images'), 200);
49
+		add_filter('post_thumbnail_html', array(__CLASS__, 'filter_images'), 200);
50
+		add_filter('get_avatar', array(__CLASS__, 'filter_images'), 200);
51 51
 		
52 52
 		// LSX
53
-		add_filter( 'lsx_lazyload_filter_images', array( __CLASS__, 'filter_images' ), 200 );
53
+		add_filter('lsx_lazyload_filter_images', array(__CLASS__, 'filter_images'), 200);
54 54
 
55 55
 		// Envira Gallery
56
-		add_filter( 'envira_gallery_output_image', array( __CLASS__, 'filter_images' ), 200 );
56
+		add_filter('envira_gallery_output_image', array(__CLASS__, 'filter_images'), 200);
57 57
 	}
58 58
 
59 59
 	static function add_scripts() {
60
-		wp_enqueue_script( 'lazysizes', get_template_directory_uri() .'/js/vendor/lazysizes.min.js', array( 'jquery' ), null, true );
60
+		wp_enqueue_script('lazysizes', get_template_directory_uri() . '/js/vendor/lazysizes.min.js', array('jquery'), null, true);
61 61
 		// Plugin that enables use lazysizes in brackground images
62 62
 		//wp_enqueue_script( 'lazysizes', get_template_directory_uri() .'/js/vendor/ls.unveilhooks.min.js', array( 'jquery', 'lazysizes' ), null, true );
63 63
 	}
64 64
 
65
-	static function filter_images( $content ) {
66
-		if ( ! self::is_enabled() ) {
65
+	static function filter_images($content) {
66
+		if ( ! self::is_enabled()) {
67 67
 			return $content;
68 68
 		}
69 69
 
70
-		if ( is_feed()
70
+		if (is_feed()
71 71
 			|| is_preview()
72
-			|| intval( get_query_var( 'print' ) ) == 1
73
-			|| intval( get_query_var( 'printpage' ) ) == 1
74
-			|| strpos( $_SERVER['HTTP_USER_AGENT'], 'Opera Mini' ) !== false
72
+			|| intval(get_query_var('print')) == 1
73
+			|| intval(get_query_var('printpage')) == 1
74
+			|| strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false
75 75
 		) {
76 76
 			return $content;
77 77
 		}
78 78
 
79 79
 		$skip_images_regex = '/class=".*(lazyload|disable-lazyload).*"/';
80
-		$placeholder_image = apply_filters( 'lsx_lazyload_placeholder_image', 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' );
80
+		$placeholder_image = apply_filters('lsx_lazyload_placeholder_image', 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==');
81 81
 
82 82
 		$matches = array();
83 83
 		$search = array();
84 84
 		$replace = array();
85 85
 		
86
-		$content = preg_replace_callback( '~<noscript.+?</noscript>~s', 'self::noscripts_remove', $content );
87
-		preg_match_all( '/<img[^>]*>/', $content, $matches );
86
+		$content = preg_replace_callback('~<noscript.+?</noscript>~s', 'self::noscripts_remove', $content);
87
+		preg_match_all('/<img[^>]*>/', $content, $matches);
88 88
 
89
-		foreach ( $matches[0] as $img_html ) {
90
-			if ( ! ( preg_match( $skip_images_regex, $img_html ) ) ) {
89
+		foreach ($matches[0] as $img_html) {
90
+			if ( ! (preg_match($skip_images_regex, $img_html))) {
91 91
 				$add_class = false;
92 92
 
93
-				if ( ! preg_match( '/src=[\'"]([^\'"]+)[\'"]/', $img_html ) && preg_match( '/srcset=[\'"]([^\'"]+)[\'"]/', $img_html ) ) {
94
-					$replace_html = preg_replace( '/<img(.*?)srcset=/i', '<img$1srcset="' . $placeholder_image . '" data-srcset=', $img_html );
93
+				if ( ! preg_match('/src=[\'"]([^\'"]+)[\'"]/', $img_html) && preg_match('/srcset=[\'"]([^\'"]+)[\'"]/', $img_html)) {
94
+					$replace_html = preg_replace('/<img(.*?)srcset=/i', '<img$1srcset="' . $placeholder_image . '" data-srcset=', $img_html);
95 95
 
96
-					if ( preg_match( '/sizes=[\'"]([^\'"]+)[\'"]/', $img_html ) ) {
97
-						$replace_html = preg_replace( '/sizes=/i', 'data-sizes=', $replace_html );
96
+					if (preg_match('/sizes=[\'"]([^\'"]+)[\'"]/', $img_html)) {
97
+						$replace_html = preg_replace('/sizes=/i', 'data-sizes=', $replace_html);
98 98
 					} else {
99
-						$replace_html = preg_replace( '/data-srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html );
99
+						$replace_html = preg_replace('/data-srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html);
100 100
 					}
101 101
 
102 102
 					$add_class = true;
103
-				} elseif ( preg_match( '/src=[\'"]([^\'"]+)[\'"]/', $img_html ) ) {
104
-					$replace_html = preg_replace( '/<img(.*?)src=/i', '<img$1src="' . $placeholder_image . '" data-src=', $img_html );
103
+				} elseif (preg_match('/src=[\'"]([^\'"]+)[\'"]/', $img_html)) {
104
+					$replace_html = preg_replace('/<img(.*?)src=/i', '<img$1src="' . $placeholder_image . '" data-src=', $img_html);
105 105
 
106
-					if ( preg_match( '/srcset=[\'"]([^\'"]+)[\'"]/', $img_html ) ) {
107
-						if ( preg_match( '/sizes=[\'"]([^\'"]+)[\'"]/', $img_html ) ) {
108
-							$replace_html = preg_replace( '/srcset=/i', 'data-srcset=', $replace_html );
109
-							$replace_html = preg_replace( '/sizes=/i', 'data-sizes=', $replace_html );
106
+					if (preg_match('/srcset=[\'"]([^\'"]+)[\'"]/', $img_html)) {
107
+						if (preg_match('/sizes=[\'"]([^\'"]+)[\'"]/', $img_html)) {
108
+							$replace_html = preg_replace('/srcset=/i', 'data-srcset=', $replace_html);
109
+							$replace_html = preg_replace('/sizes=/i', 'data-sizes=', $replace_html);
110 110
 						} else {
111
-							$replace_html = preg_replace( '/srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html );
111
+							$replace_html = preg_replace('/srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html);
112 112
 						}
113 113
 					}
114 114
 
115 115
 					$add_class = true;
116 116
 				}
117 117
 
118
-				if ( $add_class ) {
119
-					$replace_html = self::add_class( $replace_html, 'lazyload' );
118
+				if ($add_class) {
119
+					$replace_html = self::add_class($replace_html, 'lazyload');
120 120
 					$replace_html .= '<noscript>' . $img_html . '</noscript>';
121 121
 					
122
-					array_push( $search, $img_html );
123
-					array_push( $replace, $replace_html );
122
+					array_push($search, $img_html);
123
+					array_push($replace, $replace_html);
124 124
 				}
125 125
 			}
126 126
 		}
127 127
 
128
-		$content = str_replace( $search, $replace, $content );
129
-		$content = preg_replace_callback( '~' . chr(20) . '([0-9]+)' . chr(20) . '~', 'self::noscripts_restore', $content );
128
+		$content = str_replace($search, $replace, $content);
129
+		$content = preg_replace_callback('~' . chr(20) . '([0-9]+)' . chr(20) . '~', 'self::noscripts_restore', $content);
130 130
 		return $content;
131 131
 	}
132 132
 
133
-	static function noscripts_remove( $match ) {
133
+	static function noscripts_remove($match) {
134 134
 		self::$noscript_id++;
135 135
 		self::$noscripts[self::$noscript_id] = $match[0];
136 136
 		return chr(20) . self::$noscript_id . chr(20);
137 137
 	}
138 138
 
139
-	static function noscripts_restore( $match ) {
139
+	static function noscripts_restore($match) {
140 140
 		return self::$noscripts[(int) $match[1]];
141 141
 	}
142 142
 
143
-	static function add_class( $html_string = '', $new_class ) {
143
+	static function add_class($html_string = '', $new_class) {
144 144
 		$pattern = '/class=[\'"]([^\'"]*)[\'"]/';
145 145
 
146
-		if ( preg_match( $pattern, $html_string, $matches ) ) {
147
-			$defined_classes = explode( ' ', $matches[1] );
146
+		if (preg_match($pattern, $html_string, $matches)) {
147
+			$defined_classes = explode(' ', $matches[1]);
148 148
 
149
-			if ( ! in_array( $new_class, $defined_classes ) ) {
149
+			if ( ! in_array($new_class, $defined_classes)) {
150 150
 				$defined_classes[] = $new_class;
151 151
 
152 152
 				$html_string = str_replace(
153 153
 					$matches[0],
154
-					sprintf( 'class="%s"', implode( ' ', $defined_classes ) ),
154
+					sprintf('class="%s"', implode(' ', $defined_classes)),
155 155
 					$html_string
156 156
 				);
157 157
 			}
158 158
 		} else {
159
-			$html_string = preg_replace( '/(\<.+\s)/', sprintf( '$1class="%s" ', $new_class ), $html_string );
159
+			$html_string = preg_replace('/(\<.+\s)/', sprintf('$1class="%s" ', $new_class), $html_string);
160 160
 		}
161 161
 
162 162
 		return $html_string;
@@ -167,4 +167,4 @@  discard block
 block discarded – undo
167 167
 	}
168 168
 }
169 169
 
170
-add_action( 'init', array( 'LSX_LazyLoadImages', 'init' ) );
170
+add_action('init', array('LSX_LazyLoadImages', 'init'));
Please login to merge, or discard this patch.
inc/sanitize.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
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 ) {
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
  * @param  mixed    $setting    The setting for which the sanitizing is occurring.
18 18
  * @return mixed                The sanitized value.
19 19
 */
20
-function lsx_sanitize_choices( $value, $setting ) {
21
-	if ( is_object( $setting ) ) {
20
+function lsx_sanitize_choices($value, $setting) {
21
+	if (is_object($setting)) {
22 22
 		$setting = $setting->id;
23 23
 	}
24
-	$choices = lsx_customizer_sanitize_get_choices( $setting );
25
-	$allowed_choices = array_keys( $choices );
26
-	if ( ! in_array( $value, $allowed_choices ) ) {
27
-		$value = lsx_customizer_sanitize_get_default( $setting );
24
+	$choices = lsx_customizer_sanitize_get_choices($setting);
25
+	$allowed_choices = array_keys($choices);
26
+	if ( ! in_array($value, $allowed_choices)) {
27
+		$value = lsx_customizer_sanitize_get_default($setting);
28 28
 	}
29 29
 	return $value;
30 30
 }
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
  * @return mixed $field
40 40
  */
41 41
 
42
-function lsx_customizer_sanitize_get_choices( $id ) {
42
+function lsx_customizer_sanitize_get_choices($id) {
43 43
 	global $lsx_customizer;
44 44
 	//LSX_Theme_Customizer
45 45
 	
46 46
 	$field = $lsx_customizer->get_control($id);
47 47
 	
48
-	if ( isset( $field['choices'] ) ) {
48
+	if (isset($field['choices'])) {
49 49
 		return $field['choices'];
50 50
 	}
51 51
 
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
  * @return mixed $default
62 62
  */
63 63
 
64
-function lsx_customizer_sanitize_get_default( $id ) {
64
+function lsx_customizer_sanitize_get_default($id) {
65 65
 	global $lsx_customizer;
66 66
 	//LSX_Theme_Customizer
67 67
 
68 68
 	$setting = $lsx_customizer->get_setting($id);
69 69
 
70
-	if ( isset( $setting['default'] ) ) {
70
+	if (isset($setting['default'])) {
71 71
 		return $setting['default'];
72 72
 	}
73 73
 }
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
  * @param obj $setting
83 83
  * @return string $default
84 84
  */
85
-function lsx_sanitize_email( $email, $setting ) {
85
+function lsx_sanitize_email($email, $setting) {
86 86
 	// Sanitize $input as a hex value without the hash prefix.
87
-	$email = sanitize_email( $email );
87
+	$email = sanitize_email($email);
88 88
 
89 89
 	// If $email is a valid email, return it; otherwise, return the default.
90
-	return ( ! is_null( $email ) ? $email : $setting->default );
90
+	return ( ! is_null($email) ? $email : $setting->default);
91 91
 }
92 92
 
93 93
 /**
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
  * @param array $input
100 100
  * @return array $output
101 101
  */
102
-function lsx_sanitize_checkbox( $input ) {
103
-	if ( $input ) {
102
+function lsx_sanitize_checkbox($input) {
103
+	if ($input) {
104 104
 		$output = '1';
105 105
 	} else {
106 106
 		$output = false;
Please login to merge, or discard this patch.
inc/template-tags.php 2 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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.
Please login to merge, or discard this patch.
Spacing   +156 added lines, -156 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) return; // Exit if accessed directly
3 3
 
4 4
 /**
5 5
  * Yoast Breadcrumbs on Twitter Bootstrap
@@ -10,21 +10,21 @@  discard block
 block discarded – undo
10 10
  * @param string $sep Your custom separator
11 11
  */
12 12
 function lsx_breadcrumbs() {
13
-  if (!function_exists('yoast_breadcrumb') && !function_exists('woocommerce_breadcrumb')) {
13
+  if ( ! function_exists('yoast_breadcrumb') && ! function_exists('woocommerce_breadcrumb')) {
14 14
     return null;
15 15
   }
16 16
   
17 17
   $show_on_front = get_option('show_on_front');
18
-  if ( ('posts' == $show_on_front && is_home()) || ('page' == $show_on_front && is_front_page()) ) {
18
+  if (('posts' == $show_on_front && is_home()) || ('page' == $show_on_front && is_front_page())) {
19 19
   	return;
20 20
   }
21 21
 
22
-  if(function_exists('woocommerce_breadcrumb')){
22
+  if (function_exists('woocommerce_breadcrumb')) {
23 23
   		ob_start();
24 24
   		woocommerce_breadcrumb();
25 25
   		$output = ob_get_clean();
26 26
   		$output = str_replace('woocommerce-breadcrumb', 'woocommerce-breadcrumb breadcrumbs-container', $output);
27
-  }elseif(function_exists('yoast_breadcrumb')){
27
+  }elseif (function_exists('yoast_breadcrumb')) {
28 28
 	  	// Default Yoast Breadcrumbs Separator
29 29
 	  	$old_sep = '\&raquo\;';
30 30
 	  	
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 	  	$output = '<div class="breadcrumbs-container">' . $output . '</div>';
43 43
   }
44 44
   
45
-  $output = apply_filters('lsx_breadcrumbs',$output);
45
+  $output = apply_filters('lsx_breadcrumbs', $output);
46 46
 
47 47
   echo $output;
48 48
 }
49
-add_action( 'lsx_content_top', 'lsx_breadcrumbs', 100 );
49
+add_action('lsx_content_top', 'lsx_breadcrumbs', 100);
50 50
 
51 51
 /**
52 52
  * Replaces the seperator with a blank space.
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 function lsx_breadcrumbs_seperator_filter($seperator) {
56 56
 	return '';
57 57
 }
58
-add_filter( 'wpseo_breadcrumb_separator', 'lsx_breadcrumbs_seperator_filter' );
58
+add_filter('wpseo_breadcrumb_separator', 'lsx_breadcrumbs_seperator_filter');
59 59
 
60 60
 /**
61 61
  * Custom template tags for this theme.
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
  *
64 64
  * @package lsx
65 65
  */
66
-if ( ! function_exists( 'lsx_site_title' ) ) :
66
+if ( ! function_exists('lsx_site_title')) :
67 67
 	/**
68 68
 	 * Displays logo when applicable
69 69
 	 *
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 	function lsx_site_title() {
73 73
 		?>
74 74
 			<div class="site-branding">
75
-				<h1 class="site-title"><a title="<?php bloginfo( 'name' ); ?>" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
76
-				<p class="site-description"><?php bloginfo( 'description' ); ?></p>
75
+				<h1 class="site-title"><a title="<?php bloginfo('name'); ?>" href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></h1>
76
+				<p class="site-description"><?php bloginfo('description'); ?></p>
77 77
 			</div>		
78 78
 		<?php 
79 79
 	}
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
 /**
83 83
  * Add customisable post meta.
84 84
  */
85
-if ( ! function_exists( 'lsx_post_meta' ) ) {
85
+if ( ! function_exists('lsx_post_meta')) {
86 86
 	function lsx_post_meta() {
87
-		if ( ( is_page() && ! ( is_home() || is_front_page() ) ) && ! is_page_template( 'page-templates/template-blog.php' ) ) {
87
+		if ((is_page() && ! (is_home() || is_front_page())) && ! is_page_template('page-templates/template-blog.php')) {
88 88
 			return;
89 89
 		}
90 90
 		?>
@@ -99,83 +99,83 @@  discard block
 block discarded – undo
99 99
 /**
100 100
  * Add customisable post meta: post date
101 101
  */
102
-if ( ! function_exists( 'lsx_post_meta_date' ) ) {
102
+if ( ! function_exists('lsx_post_meta_date')) {
103 103
 	function lsx_post_meta_date() {
104 104
 		$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
105 105
 				
106
-		$time_string = sprintf( $time_string,
107
-			esc_attr( get_the_date( 'c' ) ),
106
+		$time_string = sprintf($time_string,
107
+			esc_attr(get_the_date('c')),
108 108
 			get_the_date(),
109
-			esc_attr( get_the_modified_date( 'c' ) ),
109
+			esc_attr(get_the_modified_date('c')),
110 110
 			get_the_modified_date()
111 111
 		);
112 112
 
113
-		printf( '<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>',
114
-			_x( 'Posted on:', 'Used before publish date.', 'lsx' ),
115
-			esc_url( get_permalink() ),
113
+		printf('<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>',
114
+			_x('Posted on:', 'Used before publish date.', 'lsx'),
115
+			esc_url(get_permalink()),
116 116
 			$time_string
117 117
 		);
118 118
 	}
119 119
 }
120
-add_action( 'lsx_content_post_meta', 'lsx_post_meta_date', 10 );
120
+add_action('lsx_content_post_meta', 'lsx_post_meta_date', 10);
121 121
 
122 122
 /**
123 123
  * Add customisable post meta: post author
124 124
  */
125
-if ( ! function_exists( 'lsx_post_meta_author' ) ) {
125
+if ( ! function_exists('lsx_post_meta_author')) {
126 126
 	function lsx_post_meta_author() {
127
-		printf( '<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>',
128
-			_x( 'Posted by:', 'Used before post author name.', 'lsx' ),
129
-			esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
127
+		printf('<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>',
128
+			_x('Posted by:', 'Used before post author name.', 'lsx'),
129
+			esc_url(get_author_posts_url(get_the_author_meta('ID'))),
130 130
 			get_the_author()
131 131
 		);
132 132
 	}
133 133
 }
134
-add_action( 'lsx_content_post_meta', 'lsx_post_meta_author', 20 );
134
+add_action('lsx_content_post_meta', 'lsx_post_meta_author', 20);
135 135
 
136 136
 /**
137 137
  * Add customisable post meta: post category(ies)
138 138
  */
139
-if ( ! function_exists( 'lsx_post_meta_category' ) ) {
139
+if ( ! function_exists('lsx_post_meta_category')) {
140 140
 	function lsx_post_meta_category() {
141
-		$post_categories = wp_get_post_categories( get_the_ID() );
141
+		$post_categories = wp_get_post_categories(get_the_ID());
142 142
 		$cats = array();
143 143
 
144
-		foreach( $post_categories as $c ) {
145
-			$cat = get_category( $c );
146
-			$cats[] = '<a href="' . get_category_link( $cat->term_id ) . '" title="' . sprintf( esc_html__( 'View all posts in %s' , 'lsx' ), $cat->name ) . '" ' . '>' . $cat->name . '</a>';
144
+		foreach ($post_categories as $c) {
145
+			$cat = get_category($c);
146
+			$cats[] = '<a href="' . get_category_link($cat->term_id) . '" title="' . sprintf(esc_html__('View all posts in %s', 'lsx'), $cat->name) . '" ' . '>' . $cat->name . '</a>';
147 147
 		}
148 148
 
149
-		if ( ! empty( $cats ) ) {
149
+		if ( ! empty($cats)) {
150 150
 			?>
151
-			<span class="post-meta-categories"><span><?php esc_html_e( 'Posted in:', 'lsx' ); ?></span> <?php echo implode( ', ', $cats ); ?></span>
151
+			<span class="post-meta-categories"><span><?php esc_html_e('Posted in:', 'lsx'); ?></span> <?php echo implode(', ', $cats); ?></span>
152 152
 			<?php
153 153
 		}
154 154
 	}
155 155
 }
156
-add_action( 'lsx_content_post_meta', 'lsx_post_meta_category', 30 );
156
+add_action('lsx_content_post_meta', 'lsx_post_meta_category', 30);
157 157
 
158 158
 /**
159 159
  * Add customisable post meta: post tag(s)
160 160
  */
161
-if ( ! function_exists( 'lsx_post_tags' ) ) {
161
+if ( ! function_exists('lsx_post_tags')) {
162 162
 	function lsx_post_tags() {
163
-		if ( has_tag() ) :
163
+		if (has_tag()) :
164 164
 			?>
165 165
 			<div class="post-tags">
166
-				<span><?php esc_html_e( 'Tagged as:', 'lsx' ); ?></span> <?php echo wp_kses_post( get_the_tag_list( '' ) ); ?>
166
+				<span><?php esc_html_e('Tagged as:', 'lsx'); ?></span> <?php echo wp_kses_post(get_the_tag_list('')); ?>
167 167
 			</div>
168 168
 			<?php
169 169
 		endif;
170 170
 	}
171 171
 }
172
-add_action( 'lsx_content_post_tags', 'lsx_post_tags', 10 );
172
+add_action('lsx_content_post_tags', 'lsx_post_tags', 10);
173 173
 
174 174
 /**
175 175
  * Add customisable post info: related posts
176 176
  */
177 177
 function lsx_related_posts() {
178
-	if ( is_singular( 'post' ) && class_exists( 'Jetpack_RelatedPosts' ) ) {
178
+	if (is_singular('post') && class_exists('Jetpack_RelatedPosts')) {
179 179
 		?>
180 180
 			<div class="row row-related-posts">
181 181
 				<div class="col-md-12">
@@ -185,15 +185,15 @@  discard block
 block discarded – undo
185 185
 		<?php
186 186
 	}
187 187
 }
188
-add_action( 'lsx_entry_bottom', 'lsx_related_posts', 10 );
188
+add_action('lsx_entry_bottom', 'lsx_related_posts', 10);
189 189
 
190 190
 /**
191 191
  * Translate post format to Font Awesome class
192 192
  */
193 193
 
194
-if ( ! function_exists( 'lsx_translate_format_to_fontawesome' ) ) {
195
-	function lsx_translate_format_to_fontawesome( $format ) {
196
-		switch ( $format ) {
194
+if ( ! function_exists('lsx_translate_format_to_fontawesome')) {
195
+	function lsx_translate_format_to_fontawesome($format) {
196
+		switch ($format) {
197 197
 			case 'image':
198 198
 				$format = 'camera';
199 199
 				break;
@@ -238,44 +238,44 @@  discard block
 block discarded – undo
238 238
  * to be added/modified where necessary.
239 239
  */
240 240
 
241
-if ( ! function_exists( 'lsx_portfolio_meta' ) ) {
241
+if ( ! function_exists('lsx_portfolio_meta')) {
242 242
 	function lsx_portfolio_meta() {
243 243
 		?>
244 244
 		<div id="portfolio-meta" class="portfolio-meta info-box-sticky info-box sticky-wrapper">
245 245
 			<?php 
246
-				$client = get_post_meta(get_the_ID(),'lsx-client',true);
247
-				if(false != $client){ ?>
246
+				$client = get_post_meta(get_the_ID(), 'lsx-client', true);
247
+				if (false != $client) { ?>
248 248
 					<div class="portfolio-client">
249
-						<span><span class="fa fa-user"></span><?php _e('Client','lsx'); ?></span>
249
+						<span><span class="fa fa-user"></span><?php _e('Client', 'lsx'); ?></span>
250 250
 						<span><?php echo $client ?></span>
251 251
 					</div>				
252 252
 			<?php }	?>
253 253
 
254 254
 			<?php 
255
-				$portfolio_type = get_the_term_list( get_the_ID(), 'jetpack-portfolio-type', '', ', ', '' );
255
+				$portfolio_type = get_the_term_list(get_the_ID(), 'jetpack-portfolio-type', '', ', ', '');
256 256
 				
257
-				if($portfolio_type){
257
+				if ($portfolio_type) {
258 258
 					?>
259 259
 					<div class="portfolio-industry">
260
-						<span><span class="fa fa-folder-open"></span><?php _e('Industry','lsx'); ?></span>
260
+						<span><span class="fa fa-folder-open"></span><?php _e('Industry', 'lsx'); ?></span>
261 261
 						<?php echo $portfolio_type; ?>
262 262
 					</div>			
263 263
 			<?php } ?>
264 264
 
265 265
 			<?php 
266
-				$services = get_the_term_list( get_the_ID(), 'jetpack-portfolio-tag', '', ', ', '' );
267
-				if(false != $services){ ?>
266
+				$services = get_the_term_list(get_the_ID(), 'jetpack-portfolio-tag', '', ', ', '');
267
+				if (false != $services) { ?>
268 268
 					<div class="portfolio-services">
269
-						<span><span class="fa fa-cog"></span><?php _e('Services','lsx'); ?></span>
269
+						<span><span class="fa fa-cog"></span><?php _e('Services', 'lsx'); ?></span>
270 270
 						<?php echo $services ?>
271 271
 					</div>				
272 272
 			<?php }	?>
273 273
 
274 274
 			<?php 
275
-				$website = esc_url( get_post_meta(get_the_ID(),'lsx-website',true) );
276
-				if(false != $website){ ?>
275
+				$website = esc_url(get_post_meta(get_the_ID(), 'lsx-website', true));
276
+				if (false != $website) { ?>
277 277
 					<div class="portfolio-website">
278
-						<span><span class="fa fa-link"></span><?php _e('Website','lsx'); ?></span>
278
+						<span><span class="fa fa-link"></span><?php _e('Website', 'lsx'); ?></span>
279 279
 						<a target="_blank" href="<?php echo esc_url($website); ?>"><?php echo $website ?></a>
280 280
 					</div>				
281 281
 			<?php }	?>
@@ -290,29 +290,29 @@  discard block
 block discarded – undo
290 290
  *
291 291
  */
292 292
 
293
-if ( ! function_exists( 'lsx_portfolio_gallery' ) ) {
293
+if ( ! function_exists('lsx_portfolio_gallery')) {
294 294
 	function lsx_portfolio_gallery() {
295 295
 
296
-		$media = get_attached_media( 'image' );
296
+		$media = get_attached_media('image');
297 297
 		$media_array = array();
298 298
 		$post_thumbnail_id = get_post_thumbnail_id(get_the_ID());
299 299
 		
300
-		if(!empty($media)){
301
-			foreach($media as $media_item){
302
-				if($post_thumbnail_id != $media_item->ID) {
300
+		if ( ! empty($media)) {
301
+			foreach ($media as $media_item) {
302
+				if ($post_thumbnail_id != $media_item->ID) {
303 303
 					$media_array[] = $media_item->ID;
304 304
 				}
305 305
 			}
306 306
 				
307
-			if(!empty($media_array)){
308
-				echo gallery_shortcode(array('size'=>'full','ids'=>implode(',', $media_array)));
307
+			if ( ! empty($media_array)) {
308
+				echo gallery_shortcode(array('size'=>'full', 'ids'=>implode(',', $media_array)));
309 309
 			}
310 310
 		}
311 311
 		
312 312
 	}
313 313
 }
314 314
 
315
-if ( ! function_exists( 'lsx_paging_nav' ) ) :
315
+if ( ! function_exists('lsx_paging_nav')) :
316 316
 	/**
317 317
 	 * Display navigation to next/previous set of posts when applicable.
318 318
 	 *
@@ -320,22 +320,22 @@  discard block
 block discarded – undo
320 320
 	 */
321 321
 	function lsx_paging_nav() {
322 322
 		// Don't print empty markup if there's only one page.
323
-		if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {
323
+		if ($GLOBALS['wp_query']->max_num_pages < 2) {
324 324
 			return;
325 325
 		}
326 326
 		
327
-		if(current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')){
327
+		if (current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')) {
328 328
 			return true;
329
-		}elseif(function_exists('wp_pagenavi')){
329
+		}elseif (function_exists('wp_pagenavi')) {
330 330
 			wp_pagenavi();
331
-		}else{
331
+		} else {
332 332
 			
333 333
 			$labels = array(
334
-				'next' 		=> '<span class="meta-nav">&larr;</span> '.__( 'Older posts', 'lsx' ),
335
-				'previous' 	=> __( 'Newer posts', 'lsx' ).' <span class="meta-nav">&rarr;</span>',
336
-				'title' 	=> __( 'Posts navigation', 'lsx' )
334
+				'next' 		=> '<span class="meta-nav">&larr;</span> ' . __('Older posts', 'lsx'),
335
+				'previous' 	=> __('Newer posts', 'lsx') . ' <span class="meta-nav">&rarr;</span>',
336
+				'title' 	=> __('Posts navigation', 'lsx')
337 337
 			);
338
-			$labels = apply_filters('lsx_post_navigation_labels',$labels);
338
+			$labels = apply_filters('lsx_post_navigation_labels', $labels);
339 339
 			
340 340
 			extract($labels);
341 341
 			?>
@@ -343,12 +343,12 @@  discard block
 block discarded – undo
343 343
 				<div class="lsx-breaker"></div>
344 344
 				<h1 class="screen-reader-text"><?php echo $title; ?></h1>
345 345
 				<div class="nav-links">
346
-					<?php if ( get_next_posts_link() ) : ?>
347
-					<div class="nav-previous"><?php next_posts_link( $next ); ?></div>
346
+					<?php if (get_next_posts_link()) : ?>
347
+					<div class="nav-previous"><?php next_posts_link($next); ?></div>
348 348
 					<?php endif; ?>
349 349
 		
350
-					<?php if ( get_previous_posts_link() ) : ?>
351
-					<div class="nav-next"><?php previous_posts_link( $previous ); ?></div>
350
+					<?php if (get_previous_posts_link()) : ?>
351
+					<div class="nav-next"><?php previous_posts_link($previous); ?></div>
352 352
 					<?php endif; ?>
353 353
 					
354 354
 					<div class="clearfix"></div>
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 	}
360 360
 endif;
361 361
 
362
-if ( ! function_exists( 'lsx_post_nav' ) ) :
362
+if ( ! function_exists('lsx_post_nav')) :
363 363
 /**
364 364
  * Display navigation to next/previous post when applicable.
365 365
  *
@@ -367,10 +367,10 @@  discard block
 block discarded – undo
367 367
  */
368 368
 function lsx_post_nav() {
369 369
 	// Don't print empty markup if there's nowhere to navigate.
370
-	$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
371
-	$next     = get_adjacent_post( false, '', false );
370
+	$previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true);
371
+	$next     = get_adjacent_post(false, '', false);
372 372
 
373
-	if ( ! $next && ! $previous ) {
373
+	if ( ! $next && ! $previous) {
374 374
 		return;
375 375
 	}
376 376
 	?>
@@ -380,13 +380,13 @@  discard block
 block discarded – undo
380 380
 		<div class="nav-links pager row">
381 381
 
382 382
 			<?php
383
-				$previous_post = get_previous_post_link( '%link', '<div class="previous col-md-6"><p class="nav-links-description">'._x( 'Previous Post', 'Previous post link', 'lsx' ).'</p><h3>%title</h3></div>' );
384
-				$previous_post = str_replace('<a','<a',$previous_post);
383
+				$previous_post = get_previous_post_link('%link', '<div class="previous col-md-6"><p class="nav-links-description">' . _x('Previous Post', 'Previous post link', 'lsx') . '</p><h3>%title</h3></div>');
384
+				$previous_post = str_replace('<a', '<a', $previous_post);
385 385
 				echo $previous_post;
386 386
 			?>
387 387
 			<?php
388
-				$next_post = get_next_post_link( '%link', '<div class="next col-md-6"><p class="nav-links-description">'._x( 'Next Post', 'Next post link', 'lsx' ).'</p><h3>%title</h3></div>' );
389
-				$next_post = str_replace('<a','<a',$next_post);
388
+				$next_post = get_next_post_link('%link', '<div class="next col-md-6"><p class="nav-links-description">' . _x('Next Post', 'Next post link', 'lsx') . '</p><h3>%title</h3></div>');
389
+				$next_post = str_replace('<a', '<a', $next_post);
390 390
 				echo $next_post;
391 391
 			?>
392 392
 
@@ -403,16 +403,16 @@  discard block
 block discarded – undo
403 403
  * @subpackage	template-tags
404 404
  * @category	header
405 405
  */
406
-if(!function_exists('lsx_site_identity')){
407
-	function lsx_site_identity(){
406
+if ( ! function_exists('lsx_site_identity')) {
407
+	function lsx_site_identity() {
408 408
 
409
-		if ( function_exists('has_custom_logo') && has_custom_logo() ) {
409
+		if (function_exists('has_custom_logo') && has_custom_logo()) {
410 410
 			the_custom_logo();
411
-		}elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) {
411
+		}elseif (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) {
412 412
 			jetpack_the_site_logo();
413
-		}else{
413
+		} else {
414 414
 			// shouldn't show both together.. its just strange
415
-			if(true == get_theme_mod('site_logo_header_text',1)){
415
+			if (true == get_theme_mod('site_logo_header_text', 1)) {
416 416
 				lsx_site_title();
417 417
 			}
418 418
 		}
@@ -427,17 +427,17 @@  discard block
 block discarded – undo
427 427
  * @subpackage	template-tags
428 428
  * @category	navigation
429 429
  */
430
-if(!function_exists('lsx_navbar_header')){
431
-	function lsx_navbar_header(){ ?>
430
+if ( ! function_exists('lsx_navbar_header')) {
431
+	function lsx_navbar_header() { ?>
432 432
 	   	<div class="navbar-header" itemscope itemtype="http://schema.org/WebPage">
433 433
 	   	
434 434
 	   		<?php 
435
-	   		$nav_menu = get_theme_mod('nav_menu_locations',false);
435
+	   		$nav_menu = get_theme_mod('nav_menu_locations', false);
436 436
 			//print_r(get_nav_menu_locations());
437 437
 
438
-	   		if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?>
438
+	   		if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?>
439 439
 		   		<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".primary-navbar">
440
-		        	<span class="sr-only"><?php _e('Toggle navigation','lsx'); ?></span>
440
+		        	<span class="sr-only"><?php _e('Toggle navigation', 'lsx'); ?></span>
441 441
 		        	<span class="icon-bar"></span>
442 442
 		        	<span class="icon-bar"></span>
443 443
 		        	<span class="icon-bar"></span>
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 	<?php }
450 450
 }
451 451
 //the if statement is for backwards compatability with previous versions of the theme.
452
-add_action('lsx_nav_before','lsx_navbar_header');
452
+add_action('lsx_nav_before', 'lsx_navbar_header');
453 453
 
454 454
 /**
455 455
  * Outputs the Nav Menu
@@ -458,16 +458,16 @@  discard block
 block discarded – undo
458 458
  * @subpackage	template-tags
459 459
  * @category	navigation
460 460
  */
461
-if(!function_exists('lsx_nav_menu')){
462
-	function lsx_nav_menu(){
463
-		$nav_menu = get_theme_mod('nav_menu_locations',false);
461
+if ( ! function_exists('lsx_nav_menu')) {
462
+	function lsx_nav_menu() {
463
+		$nav_menu = get_theme_mod('nav_menu_locations', false);
464 464
 		
465 465
 		//print_r(get_nav_menu_locations());
466 466
 
467
-	    if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?>
467
+	    if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?>
468 468
 			<nav class="primary-navbar collapse navbar-collapse">
469 469
 		    	<?php
470
-				wp_nav_menu( array(
470
+				wp_nav_menu(array(
471 471
 					'theme_location' => 'primary',
472 472
 					'menu' => $nav_menu['primary'],
473 473
 					'depth' => 3,
@@ -477,9 +477,9 @@  discard block
 block discarded – undo
477 477
 				);
478 478
 				?>
479 479
 		   		</nav>
480
-	    <?php } elseif(is_customize_preview()) { ?>
480
+	    <?php } elseif (is_customize_preview()) { ?>
481 481
 	    		<nav class="primary-navbar collapse navbar-collapse">
482
-	    			<div class="alert alert-info" role="alert"><?php _e('Create a menu and assign it here via the "Navigation" panel.','lsx');?></div>
482
+	    			<div class="alert alert-info" role="alert"><?php _e('Create a menu and assign it here via the "Navigation" panel.', 'lsx'); ?></div>
483 483
 	    		</nav>
484 484
 	    </div>
485 485
 	  	<?php }
@@ -493,9 +493,9 @@  discard block
 block discarded – undo
493 493
  * @subpackage	template-tags
494 494
  * @category	sitemap
495 495
  */
496
-function lsx_sitemap_pages(){
496
+function lsx_sitemap_pages() {
497 497
 	$posts_per_page = get_option('posts_per_page');
498
-	if(false == $posts_per_page){
498
+	if (false == $posts_per_page) {
499 499
 		$posts_per_page = 10;
500 500
 	}
501 501
 	
@@ -506,13 +506,13 @@  discard block
 block discarded – undo
506 506
 		'post_type'		=>	'page',
507 507
 	);
508 508
 	$pages = new WP_Query($page_args);
509
-	if($pages->have_posts()){
509
+	if ($pages->have_posts()) {
510 510
 
511
-		echo '<h2>'.__( 'Pages', 'lsx' ).'</h2>';
511
+		echo '<h2>' . __('Pages', 'lsx') . '</h2>';
512 512
 
513 513
 		echo '<ul>';
514
-		while($pages->have_posts()){ $pages->the_post();
515
-			echo '<li class="page_item page-item-'.get_the_ID().'"><a href="'.get_permalink().'" title="">'.get_the_title().'</a></li>';
514
+		while ($pages->have_posts()) { $pages->the_post();
515
+			echo '<li class="page_item page-item-' . get_the_ID() . '"><a href="' . get_permalink() . '" title="">' . get_the_title() . '</a></li>';
516 516
 		}
517 517
 		echo '</ul>';
518 518
 		
@@ -527,10 +527,10 @@  discard block
 block discarded – undo
527 527
  * @subpackage	template-tags
528 528
  * @category	sitemap
529 529
  */
530
-function lsx_sitemap_custom_post_type(){
530
+function lsx_sitemap_custom_post_type() {
531 531
 	
532 532
 	$posts_per_page = get_option('posts_per_page');
533
-	if(false == $posts_per_page){
533
+	if (false == $posts_per_page) {
534 534
 		$posts_per_page = 10;
535 535
 	}
536 536
 	
@@ -538,8 +538,8 @@  discard block
 block discarded – undo
538 538
 			'public'				=> true,
539 539
 			'_builtin' 				=> false
540 540
 	);
541
-	$post_types = get_post_types($args , 'names');
542
-	foreach($post_types as $post_type){	
541
+	$post_types = get_post_types($args, 'names');
542
+	foreach ($post_types as $post_type) {	
543 543
 
544 544
 		$post_type_args = array(
545 545
 				'post_type'		=>	'page',
@@ -550,19 +550,19 @@  discard block
 block discarded – undo
550 550
 		$post_type_items = new WP_Query($post_type_args);
551 551
 		
552 552
 		$post_type_object = get_post_type_object($post_type);
553
-		if(null != $post_type_object){
553
+		if (null != $post_type_object) {
554 554
 			$title = $post_type_object->labels->name;
555
-		}else{
555
+		} else {
556 556
 			$title = ucwords($post_type);
557 557
 		}
558 558
 		
559
-		if($post_type_items->have_posts()){
559
+		if ($post_type_items->have_posts()) {
560 560
 	
561
-			printf( '<h2>'.__( '%1$s', 'lsx' ).'</h2>', $title );
561
+			printf('<h2>' . __('%1$s', 'lsx') . '</h2>', $title);
562 562
 	
563 563
 			echo '<ul>';
564
-			while($post_type_items->have_posts()){ $post_type_items->the_post();
565
-				echo '<li class="'.get_post_type().'_item '.get_post_type().'-item-'.get_the_ID().'"><a href="'.get_permalink().'" title="">'.get_the_title().'</a></li>';
564
+			while ($post_type_items->have_posts()) { $post_type_items->the_post();
565
+				echo '<li class="' . get_post_type() . '_item ' . get_post_type() . '-item-' . get_the_ID() . '"><a href="' . get_permalink() . '" title="">' . get_the_title() . '</a></li>';
566 566
 			}
567 567
 			echo '</ul>';
568 568
 	
@@ -578,20 +578,20 @@  discard block
 block discarded – undo
578 578
  * @subpackage	template-tags
579 579
  * @category	sitemap
580 580
  */
581
-function lsx_sitemap_taxonomy_clouds(){
581
+function lsx_sitemap_taxonomy_clouds() {
582 582
 
583
-		$taxonomy_args =  array(
583
+		$taxonomy_args = array(
584 584
 			'public'				=> true,
585 585
 			'_builtin' 				=> false
586 586
 		);
587 587
 		$taxonomies = get_taxonomies($taxonomy_args);
588
-		if(!empty($taxonomies)){
589
-			foreach($taxonomies as $taxonomy_id => $taxonomy) {
588
+		if ( ! empty($taxonomies)) {
589
+			foreach ($taxonomies as $taxonomy_id => $taxonomy) {
590 590
 
591
-				$tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id,'echo'=>false));
592
-				if(null != $tag_cloud){
593
-					printf( '<h2>'.__( '%1$s', 'lsx' ).'</h2>', $taxonomy );
594
-					echo '<aside id="'.$taxonomy_id.'" class="widget widget_'.$taxonomy_id.'">'.$tag_cloud.'</aside>';
591
+				$tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id, 'echo'=>false));
592
+				if (null != $tag_cloud) {
593
+					printf('<h2>' . __('%1$s', 'lsx') . '</h2>', $taxonomy);
594
+					echo '<aside id="' . $taxonomy_id . '" class="widget widget_' . $taxonomy_id . '">' . $tag_cloud . '</aside>';
595 595
 		        }
596 596
 	        }
597 597
         } 
@@ -604,15 +604,15 @@  discard block
 block discarded – undo
604 604
  * @subpackage	hooks
605 605
  * @category	forms
606 606
  */
607
-add_action( 'lsx_footer_before', 'lsx_footer_subscription_cta', 10 );
607
+add_action('lsx_footer_before', 'lsx_footer_subscription_cta', 10);
608 608
 function lsx_footer_subscription_cta() {
609
-	if(!function_exists('lsx_is_form_enabled')){ return; }
609
+	if ( ! function_exists('lsx_is_form_enabled')) { return; }
610 610
 	$subscribe_form_id = lsx_is_form_enabled('subscribe');
611
-	if(false == $subscribe_form_id) { return; }
611
+	if (false == $subscribe_form_id) { return; }
612 612
 
613 613
 	//add Caldera Forms Fields Scripts
614
-	if( defined( 'CFCORE_VER' ) ){
615
-		wp_enqueue_script( 'cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER );
614
+	if (defined('CFCORE_VER')) {
615
+		wp_enqueue_script('cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER);
616 616
 	}
617 617
 
618 618
 	?>
@@ -620,8 +620,8 @@  discard block
 block discarded – undo
620 620
 		<div class="container">
621 621
 			<div class="row">
622 622
 				<div class="col-md-12">
623
-					<h2><?php _e( 'Subscribe to Our Newsletter', 'lsx' ); ?></h2>
624
-					<?php echo do_shortcode( '[caldera_form id="'.$subscribe_form_id.'"]' ); ?>
623
+					<h2><?php _e('Subscribe to Our Newsletter', 'lsx'); ?></h2>
624
+					<?php echo do_shortcode('[caldera_form id="' . $subscribe_form_id . '"]'); ?>
625 625
 				</div>
626 626
 			</div>
627 627
 		</div>
@@ -636,14 +636,14 @@  discard block
 block discarded – undo
636 636
  * @subpackage	hooks
637 637
  * @category	menu
638 638
  */
639
-add_action( 'lsx_header_top', 'lsx_add_top_menu' );
639
+add_action('lsx_header_top', 'lsx_add_top_menu');
640 640
 function lsx_add_top_menu() {
641 641
 	if (has_nav_menu('top-menu')) { ?>
642 642
 		<div id="top-menu" class="<?php lsx_top_menu_classes(); ?>">
643 643
 			<div class="container">
644 644
 				<nav class="top-menu">
645 645
 		    		<?php
646
-		    			wp_nav_menu( array(
646
+		    			wp_nav_menu(array(
647 647
 							'theme_location' => 'top-menu',
648 648
 							'walker' => new lsx_bootstrap_navwalker())
649 649
 						);
@@ -661,24 +661,24 @@  discard block
 block discarded – undo
661 661
  * @subpackage	template-tag
662 662
  * @category 	forms
663 663
  */
664
-if ( class_exists('Caldera_Forms') && !function_exists( 'lsx_is_form_enabled' ) ) {
664
+if (class_exists('Caldera_Forms') && ! function_exists('lsx_is_form_enabled')) {
665 665
 	function lsx_is_form_enabled($slug = false) {
666
-		if(false == $slug){ return false; }
666
+		if (false == $slug) { return false; }
667 667
 	
668 668
 		$match = false;
669
-		$forms = get_option( '_caldera_forms' , false );
670
-		if(false !== $forms ) {
671
-			foreach($forms as $form_id=>$form_maybe){
672
-				if( trim(strtolower($slug)) == strtolower($form_maybe['name']) ){
669
+		$forms = get_option('_caldera_forms', false);
670
+		if (false !== $forms) {
671
+			foreach ($forms as $form_id=>$form_maybe) {
672
+				if (trim(strtolower($slug)) == strtolower($form_maybe['name'])) {
673 673
 					$match = $form_id;
674 674
 					break;
675 675
 				}
676 676
 			}
677 677
 		}
678
-		if( false === $match ){
679
-			$is_form = Caldera_Forms::get_form( strtolower( $slug ) );
680
-			if( !empty( $is_form ) ){
681
-				return strtolower( $slug );
678
+		if (false === $match) {
679
+			$is_form = Caldera_Forms::get_form(strtolower($slug));
680
+			if ( ! empty($is_form)) {
681
+				return strtolower($slug);
682 682
 			}
683 683
 		}
684 684
 	
@@ -694,10 +694,10 @@  discard block
 block discarded – undo
694 694
  * @category 	urls
695 695
  */
696 696
 function lsx_get_my_url() {
697
-	if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) )
697
+	if ( ! preg_match('/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches))
698 698
 		return false;
699 699
 
700
-	return esc_url_raw( $matches[1] );
700
+	return esc_url_raw($matches[1]);
701 701
 }
702 702
 
703 703
 /**
@@ -707,19 +707,19 @@  discard block
 block discarded – undo
707 707
  * @subpackage 	extras
708 708
  * @category 	urls
709 709
  */
710
-function lsx_get_template_part($slug,$part) {
710
+function lsx_get_template_part($slug, $part) {
711 711
 	$template = array();
712 712
 	$part = (string) $part;
713
-	if ( '' !== $part ){
713
+	if ('' !== $part) {
714 714
 		$template = "{$slug}-{$part}.php";
715
-	}else{
715
+	} else {
716 716
 		$template = "{$slug}.php";
717 717
 	}
718
-	$file_path = apply_filters('lsx_content_path',false,$slug,$part);
718
+	$file_path = apply_filters('lsx_content_path', false, $slug, $part);
719 719
 
720
-	if ( false !== $file_path && '' == locate_template( array( $template ) ) && file_exists( $file_path.$template) ) {
721
-		load_template( $file_path.$template, false );
722
-	}else{
723
-		get_template_part($slug,$part);
720
+	if (false !== $file_path && '' == locate_template(array($template)) && file_exists($file_path . $template)) {
721
+		load_template($file_path . $template, false);
722
+	} else {
723
+		get_template_part($slug, $part);
724 724
 	}
725 725
 }
726 726
\ No newline at end of file
Please login to merge, or discard this patch.
inc/wp_bootstrap_navwalker.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,6 @@
 block discarded – undo
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 ) {
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) return; // Exit if accessed directly
3 3
 
4 4
 class lsx_bootstrap_navwalker extends Walker_Nav_Menu {
5 5
 
@@ -10,15 +10,15 @@  discard block
 block discarded – undo
10 10
 	 * @param string $output Passed by reference. Used to append additional content.
11 11
 	 * @param int $depth Depth of page. Used for padding.
12 12
 	 */
13
-	public function start_lvl( &$output, $depth = 0, $args = array() ) {
14
-		$indent = str_repeat( "\t", $depth );
13
+	public function start_lvl(&$output, $depth = 0, $args = array()) {
14
+		$indent = str_repeat("\t", $depth);
15 15
 		$output .= "\n$indent<ul role=\"menu\" class=\" dropdown-menu\">\n";
16 16
 	}
17 17
 	
18 18
 	/**
19 19
 	 * @param string $item Passed by reference. Used to append additional content.
20 20
 	 */
21
-	public function filter_default_pages( &$item ) {
21
+	public function filter_default_pages(&$item) {
22 22
 		
23 23
 		return $item;
24 24
 	}	
@@ -33,14 +33,14 @@  discard block
 block discarded – undo
33 33
 	 * @param int $current_page Menu item ID.
34 34
 	 * @param object $args
35 35
 	 */
36
-	public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
37
-		$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';	
36
+	public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) {
37
+		$indent = ($depth) ? str_repeat("\t", $depth) : '';	
38 38
 		
39 39
 		/**
40 40
 		 * If this is a default menu being called we need to fix
41 41
 		 * the item object thats coming through.
42 42
 		 */
43
-		if(!isset($item->title)){
43
+		if ( ! isset($item->title)) {
44 44
 			return;
45 45
 		}
46 46
 
@@ -52,63 +52,63 @@  discard block
 block discarded – undo
52 52
 		 * comparison that is not case sensitive. The strcasecmp() function returns
53 53
 		 * a 0 if the strings are equal.
54 54
 		 */
55
-		if ( strcasecmp( $item->attr_title, 'divider' ) == 0 && $depth === 1 ) {
55
+		if (strcasecmp($item->attr_title, 'divider') == 0 && $depth === 1) {
56 56
 			$output .= $indent . '<li role="presentation" class="divider">';
57
-		} else if ( strcasecmp( $item->title, 'divider') == 0 && $depth === 1 ) {
57
+		} else if (strcasecmp($item->title, 'divider') == 0 && $depth === 1) {
58 58
 			$output .= $indent . '<li role="presentation" class="divider">';
59
-		} else if ( strcasecmp( $item->attr_title, 'dropdown-header') == 0 && $depth === 1 ) {
60
-			$output .= $indent . '<li role="presentation" class="dropdown-header">' . esc_attr( $item->title );
61
-		} else if ( strcasecmp($item->attr_title, 'disabled' ) == 0 ) {
62
-			$output .= $indent . '<li role="presentation" class="disabled"><a href="#">' . esc_attr( $item->title ) . '</a>';
59
+		} else if (strcasecmp($item->attr_title, 'dropdown-header') == 0 && $depth === 1) {
60
+			$output .= $indent . '<li role="presentation" class="dropdown-header">' . esc_attr($item->title);
61
+		} else if (strcasecmp($item->attr_title, 'disabled') == 0) {
62
+			$output .= $indent . '<li role="presentation" class="disabled"><a href="#">' . esc_attr($item->title) . '</a>';
63 63
 		} else {
64 64
 
65 65
 			$class_names = $value = '';
66 66
 
67
-			$classes = empty( $item->classes ) ? array() : (array) $item->classes;
67
+			$classes = empty($item->classes) ? array() : (array) $item->classes;
68 68
 			$classes[] = 'menu-item-' . $item->ID;
69 69
 
70
-			$classes = apply_filters( 'lsx_nav_menu_css_class', array_filter( $classes ), $item, $args , $depth );
70
+			$classes = apply_filters('lsx_nav_menu_css_class', array_filter($classes), $item, $args, $depth);
71 71
 			
72
-			$class_names = join( ' ', $classes );
72
+			$class_names = join(' ', $classes);
73 73
 
74
-			if ( $args->has_children )
74
+			if ($args->has_children)
75 75
 				$class_names .= ' dropdown';
76 76
 
77
-			if ( in_array( 'current-menu-item', $classes ) )
77
+			if (in_array('current-menu-item', $classes))
78 78
 				$class_names .= ' active';
79 79
 			
80
-			if ( in_array( 'current-menu-parent', $classes ) )
80
+			if (in_array('current-menu-parent', $classes))
81 81
 				$class_names .= ' active';			
82 82
 			
83 83
 			//Check if this is ment to be a "social" type menu
84
-			$class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
84
+			$class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : '';
85 85
 
86
-			$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
87
-			$id = $id ? ' id="' . esc_attr( $id ) . '"' : '';
86
+			$id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args);
87
+			$id = $id ? ' id="' . esc_attr($id) . '"' : '';
88 88
 
89
-			$output .= $indent . '<li' . $id . $value . $class_names .'>';
89
+			$output .= $indent . '<li' . $id . $value . $class_names . '>';
90 90
 
91 91
 			$atts = array();
92
-			$atts['title']  = ! empty( $item->title )	? $item->title	: '';
93
-			$atts['target'] = ! empty( $item->target )	? $item->target	: '';
94
-			$atts['rel']    = ! empty( $item->xfn )		? $item->xfn	: '';
92
+			$atts['title']  = ! empty($item->title) ? $item->title : '';
93
+			$atts['target'] = ! empty($item->target) ? $item->target : '';
94
+			$atts['rel']    = ! empty($item->xfn) ? $item->xfn : '';
95 95
 
96 96
 			// If item has_children add atts to a.
97
-			if ( $args->has_children ) {
98
-				$atts['href']   		= ! empty( $item->url ) ? $item->url : '';
99
-				$atts['data-toggle']	= 'dropdown';
100
-				$atts['class']			= 'dropdown-toggle';
101
-				$atts['aria-haspopup']	= 'true';
97
+			if ($args->has_children) {
98
+				$atts['href'] = ! empty($item->url) ? $item->url : '';
99
+				$atts['data-toggle'] = 'dropdown';
100
+				$atts['class'] = 'dropdown-toggle';
101
+				$atts['aria-haspopup'] = 'true';
102 102
 			} else {
103
-				$atts['href'] = ! empty( $item->url ) ? $item->url : '';
103
+				$atts['href'] = ! empty($item->url) ? $item->url : '';
104 104
 			}
105 105
 
106
-			$atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args );
106
+			$atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args);
107 107
 
108 108
 			$attributes = '';
109
-			foreach ( $atts as $attr => $value ) {
110
-				if ( ! empty( $value ) ) {
111
-					$value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
109
+			foreach ($atts as $attr => $value) {
110
+				if ( ! empty($value)) {
111
+					$value = ('href' === $attr) ? esc_url($value) : esc_attr($value);
112 112
 					$attributes .= ' ' . $attr . '="' . $value . '"';
113 113
 				}
114 114
 			}
@@ -122,19 +122,19 @@  discard block
 block discarded – undo
122 122
 			 * if there is a value in the attr_title property. If the attr_title
123 123
 			 * property is NOT null we apply it as the class name for the glyphicon.
124 124
 			 */
125
-			if ( ! empty( $item->attr_title ) ) {
126
-				$item_output .= '<a'. $attributes .'"><span class="glyphicon ' . esc_attr( $item->attr_title ) . '"></span>&nbsp;';
125
+			if ( ! empty($item->attr_title)) {
126
+				$item_output .= '<a' . $attributes . '"><span class="glyphicon ' . esc_attr($item->attr_title) . '"></span>&nbsp;';
127 127
 			} else {
128
-				$item_output .= '<a'. $attributes .'>';
128
+				$item_output .= '<a' . $attributes . '>';
129 129
 			}
130 130
 
131
-			$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
132
-			$item_output .= ( $args->has_children && 0 === $depth ) ? ' <span class="caret"></span></a>' : '</a>';
131
+			$item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;
132
+			$item_output .= ($args->has_children && 0 === $depth) ? ' <span class="caret"></span></a>' : '</a>';
133 133
 			$item_output .= $args->after;
134 134
 
135 135
 			
136 136
 			
137
-			$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
137
+			$output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
138 138
 		}
139 139
 	}
140 140
   
@@ -158,17 +158,17 @@  discard block
 block discarded – undo
158 158
 	 * @param string $output Passed by reference. Used to append additional content.
159 159
 	 * @return null Null on failure with no changes to parameters.
160 160
 	 */
161
-	public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
162
-        if ( ! $element )
161
+	public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output) {
162
+        if ( ! $element)
163 163
             return;
164 164
 
165 165
         $id_field = $this->db_fields['id'];
166 166
 
167 167
         // Display this element.
168
-        if ( is_object( $args[0] ) )
169
-           $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] );
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 );
171
+        parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
172 172
     }
173 173
 
174 174
 	/**
@@ -182,20 +182,20 @@  discard block
 block discarded – undo
182 182
 	 * @param array $args passed from the wp_nav_menu function.
183 183
 	 *
184 184
 	 */
185
-	public static function fallback( $args ) {
186
-		if ( current_user_can( 'manage_options' ) ) {
185
+	public static function fallback($args) {
186
+		if (current_user_can('manage_options')) {
187 187
 
188
-			extract( $args );
188
+			extract($args);
189 189
 
190 190
 			$fb_output = null;
191 191
 
192
-			if ( $container ) {
192
+			if ($container) {
193 193
 				$fb_output = '<' . $container;
194 194
 
195
-				if ( $container_id )
195
+				if ($container_id)
196 196
 					$fb_output .= ' id="' . $container_id . '"';
197 197
 
198
-				if ( $container_class )
198
+				if ($container_class)
199 199
 					$fb_output .= ' class="' . $container_class . '"';
200 200
 
201 201
 				$fb_output .= '>';
@@ -203,17 +203,17 @@  discard block
 block discarded – undo
203 203
 
204 204
 			$fb_output .= '<ul';
205 205
 
206
-			if ( $menu_id )
206
+			if ($menu_id)
207 207
 				$fb_output .= ' id="' . $menu_id . '"';
208 208
 
209
-			if ( $menu_class )
209
+			if ($menu_class)
210 210
 				$fb_output .= ' class="' . $menu_class . '"';
211 211
 
212 212
 			$fb_output .= '>';
213
-			$fb_output .= '<li><a href="' . admin_url( 'nav-menus.php' ) . '">'.__('Add a menu','lsx').'</a></li>';
213
+			$fb_output .= '<li><a href="' . admin_url('nav-menus.php') . '">' . __('Add a menu', 'lsx') . '</a></li>';
214 214
 			$fb_output .= '</ul>';
215 215
 
216
-			if ( $container )
216
+			if ($container)
217 217
 				$fb_output .= '</' . $container . '>';
218 218
 
219 219
 			echo $fb_output;
@@ -225,9 +225,9 @@  discard block
 block discarded – undo
225 225
 /**
226 226
  * Add in our custom classes to the menus
227 227
  */
228
-function wpml_nav_language_switcher_fix( $items , $args ) {
229
-	$items = str_replace('menu-item-language-current','menu-item-language-current dropdown',$items);
230
-	$items = str_replace('submenu-languages','submenu-languages dropdown-menu',$items);
228
+function wpml_nav_language_switcher_fix($items, $args) {
229
+	$items = str_replace('menu-item-language-current', 'menu-item-language-current dropdown', $items);
230
+	$items = str_replace('submenu-languages', 'submenu-languages dropdown-menu', $items);
231 231
 	return $items;
232 232
 }
233
-add_filter( 'wp_nav_menu_items', 'wpml_nav_language_switcher_fix', 10, 2 );
233
+add_filter('wp_nav_menu_items', 'wpml_nav_language_switcher_fix', 10, 2);
Please login to merge, or discard this patch.
single-jetpack-portfolio.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@
 block discarded – undo
21 21
 
22 22
 			<?php lsx_content_top(); ?>
23 23
 			
24
-			<?php while ( have_posts() ) : the_post(); ?>
24
+			<?php while (have_posts()) : the_post(); ?>
25 25
 
26
-				<?php get_template_part( 'content', 'portfolio-single' ); ?>
26
+				<?php get_template_part('content', 'portfolio-single'); ?>
27 27
 
28 28
 			<?php endwhile; ?>
29 29
 
Please login to merge, or discard this patch.
sidebar.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 // Allow Plugins and themes to disable the sidebar incase of very customized layouts.
9
-$sidebar_enabled = apply_filters('lsx_sidebar_enable',true);
10
-if(true !== $sidebar_enabled){return true;}
9
+$sidebar_enabled = apply_filters('lsx_sidebar_enable', true);
10
+if (true !== $sidebar_enabled) {return true; }
11 11
 ?>
12 12
 <?php
13 13
 	$show_on_front = get_option('show_on_front');
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 		$sidebar = 'home';
18 18
 	} else {
19 19
 
20
-		$layout = get_theme_mod('lsx_layout','2cr');
21
-		$layout = apply_filters( 'lsx_layout', $layout );
20
+		$layout = get_theme_mod('lsx_layout', '2cr');
21
+		$layout = apply_filters('lsx_layout', $layout);
22 22
 		
23
-		if('posts' == $show_on_front && is_home()){
23
+		if ('posts' == $show_on_front && is_home()) {
24 24
 			$sidebar = 'home';
25
-		}else{
25
+		} else {
26 26
 			$sidebar = 'sidebar-1';
27 27
 		}
28 28
 	}
29
-	if ( $layout !== '1c' ) : ?>
29
+	if ($layout !== '1c') : ?>
30 30
 
31 31
 	<?php lsx_sidebars_before(); ?>
32 32
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	
35 35
 		<div id="secondary" class="widget-area <?php echo esc_attr(lsx_home_sidebar_class()); ?>" role="complementary">
36 36
 		
37
-	<?php elseif ( is_page_template('page-templates/template-blog.php') ) : ?>
37
+	<?php elseif (is_page_template('page-templates/template-blog.php')) : ?>
38 38
 	
39 39
 		<div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary">
40 40
 		
@@ -42,25 +42,25 @@  discard block
 block discarded – undo
42 42
 	
43 43
 		<div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary">
44 44
 		
45
-	<?php endif ; ?>
45
+	<?php endif; ?>
46 46
 
47 47
 		<?php lsx_sidebar_top(); ?>
48 48
 
49
-		<?php if ( ! dynamic_sidebar( $sidebar ) ) : ?>
49
+		<?php if ( ! dynamic_sidebar($sidebar)) : ?>
50 50
 
51 51
 			<aside id="search" class="widget widget_search">
52 52
 				<?php get_search_form(); ?>
53 53
 			</aside>
54 54
 
55 55
 			<aside id="archives" class="widget">
56
-				<h1 class="widget-title"><?php _e( 'Archives', 'lsx' ); ?></h1>
56
+				<h1 class="widget-title"><?php _e('Archives', 'lsx'); ?></h1>
57 57
 				<ul>
58
-					<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
58
+					<?php wp_get_archives(array('type' => 'monthly')); ?>
59 59
 				</ul>
60 60
 			</aside>
61 61
 
62 62
 			<aside id="meta" class="widget">
63
-				<h1 class="widget-title"><?php _e( 'Meta', 'lsx' ); ?></h1>
63
+				<h1 class="widget-title"><?php _e('Meta', 'lsx'); ?></h1>
64 64
 				<ul>
65 65
 					<?php wp_register(); ?>
66 66
 					<li><?php wp_loginout(); ?></li>
Please login to merge, or discard this patch.
sidebar-sitemap.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,21 +9,21 @@
 block discarded – undo
9 9
 <?php
10 10
 	$show_on_front = get_option('show_on_front');
11 11
 
12
-	$layout = get_theme_mod('lsx_layout','2cr');
13
-	if('posts' == $show_on_front && is_home()){
12
+	$layout = get_theme_mod('lsx_layout', '2cr');
13
+	if ('posts' == $show_on_front && is_home()) {
14 14
 		$sidebar = 'home';
15
-	}else{
15
+	} else {
16 16
 		$sidebar = 'sidebar-1';
17 17
 	}
18 18
 	
19
-	if ( $layout !== '1c' ) : ?>
19
+	if ($layout !== '1c') : ?>
20 20
 
21 21
 	<?php lsx_sidebars_before(); ?>
22 22
 
23 23
 	<div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary">
24 24
 
25 25
 		<?php lsx_sidebar_top(); ?>
26
-		<h2><?php _e('Categories','lsx'); ?></h2>
26
+		<h2><?php _e('Categories', 'lsx'); ?></h2>
27 27
         <aside id="categories" class="widget widget_categories">
28 28
         	<?php echo wp_tag_cloud(array('taxonomy'=>'category')); ?>
29 29
         </aside>		
Please login to merge, or discard this patch.