Completed
Push — master ( 1ca606...3ee43f )
by
unknown
03:22
created
inc/comment-walker.php 1 patch
Spacing   +8 added lines, -8 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
  * lsx Comment Walker
@@ -29,12 +29,12 @@  discard block
 block discarded – undo
29 29
     $GLOBALS['comment_depth'] = $depth;
30 30
     $GLOBALS['comment'] = $comment;
31 31
 
32
-    if (!empty($args['callback'])) {
32
+    if ( ! empty($args['callback'])) {
33 33
       call_user_func($args['callback'], $comment, $args, $depth);
34 34
       return;
35 35
     }
36 36
 
37
-    extract($args, EXTR_SKIP);?>
37
+    extract($args, EXTR_SKIP); ?>
38 38
 
39 39
   	<li id="comment-<?php comment_ID(); ?>" <?php comment_class('media comment-' . get_comment_ID()); ?>>
40 40
     <?php get_template_part('comment'); ?>
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
   }
43 43
 
44 44
   function end_el(&$output, $comment, $depth = 0, $args = array()) {
45
-    if (!empty($args['end-callback'])) {
45
+    if ( ! empty($args['end-callback'])) {
46 46
       call_user_func($args['end-callback'], $comment, $args, $depth);
47 47
       return;
48 48
     }
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
  * @subpackage layout
65 65
  */
66 66
 function lsx_comment_form_fields_filter($fields) {	
67
-	foreach($fields as &$field){
68
-		if(stristr('class=', $field)){
67
+	foreach ($fields as &$field) {
68
+		if (stristr('class=', $field)) {
69 69
 			$field = str_replace('class="', 'class="form-control ', $field);
70
-		}else{
70
+		} else {
71 71
 			$field = str_replace('<input', '<input class="form-control" ', $field);
72 72
 		}
73 73
 	}
74 74
 	return $fields;
75 75
 }
76
-add_filter( 'comment_form_default_fields', 'lsx_comment_form_fields_filter');
76
+add_filter('comment_form_default_fields', 'lsx_comment_form_fields_filter');
Please login to merge, or discard this patch.
inc/template-tags.php 1 patch
Spacing   +144 added lines, -144 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
 	}
@@ -88,43 +88,43 @@  discard block
 block discarded – undo
88 88
  * to be added/modified where necessary.
89 89
  */
90 90
 
91
-if ( ! function_exists( 'lsx_post_meta' ) ) {
91
+if ( ! function_exists('lsx_post_meta')) {
92 92
 	function lsx_post_meta() {
93
-		if ( (is_page() && !(is_home() || is_front_page())) && ! is_page_template( 'page-templates/template-blog.php' ) ) { return; } ?>
93
+		if ((is_page() && ! (is_home() || is_front_page())) && ! is_page_template('page-templates/template-blog.php')) { return; } ?>
94 94
 		
95 95
 		<div class="post-meta">
96 96
 				<?php
97 97
 					$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
98 98
 					
99
-					$time_string = sprintf( $time_string,
100
-						esc_attr( get_the_date( 'c' ) ),
99
+					$time_string = sprintf($time_string,
100
+						esc_attr(get_the_date('c')),
101 101
 						get_the_date(),
102
-						esc_attr( get_the_modified_date( 'c' ) ),
102
+						esc_attr(get_the_modified_date('c')),
103 103
 						get_the_modified_date()
104 104
 					);
105
-					printf( '<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>',
106
-						_x( 'Posted on:', 'Used before publish date.', 'lsx' ),
107
-						esc_url( get_permalink() ),
105
+					printf('<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>',
106
+						_x('Posted on:', 'Used before publish date.', 'lsx'),
107
+						esc_url(get_permalink()),
108 108
 						$time_string
109 109
 					);
110 110
 				?>
111 111
 
112
-				<?php printf( '<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>',
113
-					_x( 'Posted by:', 'Used before post author name.', 'lsx' ),
114
-					esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
112
+				<?php printf('<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>',
113
+					_x('Posted by:', 'Used before post author name.', 'lsx'),
114
+					esc_url(get_author_posts_url(get_the_author_meta('ID'))),
115 115
 					get_the_author()
116 116
 				); ?>
117 117
 
118 118
 
119 119
 			<?php 
120
-		    	$post_categories = wp_get_post_categories( get_the_ID() );
120
+		    	$post_categories = wp_get_post_categories(get_the_ID());
121 121
 		    	$cats = array();
122
-		    	foreach($post_categories as $c){
123
-		    			$cat = get_category( $c );
124
-		    			$cats[] = '<a href="' . get_category_link( $cat->term_id ) . '" title="' . sprintf( __( "View all posts in %s" , 'lsx' ), $cat->name ) . '" ' . '>' . $cat->name.'</a>';
122
+		    	foreach ($post_categories as $c) {
123
+		    			$cat = get_category($c);
124
+		    			$cats[] = '<a href="' . get_category_link($cat->term_id) . '" title="' . sprintf(__("View all posts in %s", 'lsx'), $cat->name) . '" ' . '>' . $cat->name . '</a>';
125 125
 		    	}
126
-		    	if(!empty($cats)){ ?>
127
-						<span class="post-meta-categories"><span><?php _e('Posted in:','lsx'); ?></span> <?php echo implode(', ', $cats); ?></span>
126
+		    	if ( ! empty($cats)) { ?>
127
+						<span class="post-meta-categories"><span><?php _e('Posted in:', 'lsx'); ?></span> <?php echo implode(', ', $cats); ?></span>
128 128
 			<?php } ?>
129 129
 			
130 130
 			<div class="clearfix"></div>
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
  * Translate post format to Font Awesome class
138 138
  */
139 139
 
140
-if ( ! function_exists( 'lsx_translate_format_to_fontawesome' ) ) {
141
-	function lsx_translate_format_to_fontawesome( $format ) {
142
-		switch ( $format ) {
140
+if ( ! function_exists('lsx_translate_format_to_fontawesome')) {
141
+	function lsx_translate_format_to_fontawesome($format) {
142
+		switch ($format) {
143 143
 			case 'image':
144 144
 				$format = 'camera';
145 145
 				break;
@@ -184,44 +184,44 @@  discard block
 block discarded – undo
184 184
  * to be added/modified where necessary.
185 185
  */
186 186
 
187
-if ( ! function_exists( 'lsx_portfolio_meta' ) ) {
187
+if ( ! function_exists('lsx_portfolio_meta')) {
188 188
 	function lsx_portfolio_meta() {
189 189
 		?>
190 190
 		<div id="portfolio-meta" class="portfolio-meta info-box-sticky info-box sticky-wrapper">
191 191
 			<?php 
192
-				$client = get_post_meta(get_the_ID(),'lsx-client',true);
193
-				if(false != $client){ ?>
192
+				$client = get_post_meta(get_the_ID(), 'lsx-client', true);
193
+				if (false != $client) { ?>
194 194
 					<div class="portfolio-client">
195
-						<span><span class="fa fa-user"></span><?php _e('Client','lsx'); ?></span>
195
+						<span><span class="fa fa-user"></span><?php _e('Client', 'lsx'); ?></span>
196 196
 						<span><?php echo $client ?></span>
197 197
 					</div>				
198 198
 			<?php }	?>
199 199
 
200 200
 			<?php 
201
-				$portfolio_type = get_the_term_list( get_the_ID(), 'jetpack-portfolio-type', '', ', ', '' );
201
+				$portfolio_type = get_the_term_list(get_the_ID(), 'jetpack-portfolio-type', '', ', ', '');
202 202
 				
203
-				if($portfolio_type){
203
+				if ($portfolio_type) {
204 204
 					?>
205 205
 					<div class="portfolio-industry">
206
-						<span><span class="fa fa-folder-open"></span><?php _e('Industry','lsx'); ?></span>
206
+						<span><span class="fa fa-folder-open"></span><?php _e('Industry', 'lsx'); ?></span>
207 207
 						<?php echo $portfolio_type; ?>
208 208
 					</div>			
209 209
 			<?php } ?>
210 210
 
211 211
 			<?php 
212
-				$services = get_the_term_list( get_the_ID(), 'jetpack-portfolio-tag', '', ', ', '' );
213
-				if(false != $services){ ?>
212
+				$services = get_the_term_list(get_the_ID(), 'jetpack-portfolio-tag', '', ', ', '');
213
+				if (false != $services) { ?>
214 214
 					<div class="portfolio-services">
215
-						<span><span class="fa fa-cog"></span><?php _e('Services','lsx'); ?></span>
215
+						<span><span class="fa fa-cog"></span><?php _e('Services', 'lsx'); ?></span>
216 216
 						<?php echo $services ?>
217 217
 					</div>				
218 218
 			<?php }	?>
219 219
 
220 220
 			<?php 
221
-				$website = esc_url( get_post_meta(get_the_ID(),'lsx-website',true) );
222
-				if(false != $website){ ?>
221
+				$website = esc_url(get_post_meta(get_the_ID(), 'lsx-website', true));
222
+				if (false != $website) { ?>
223 223
 					<div class="portfolio-website">
224
-						<span><span class="fa fa-link"></span><?php _e('Website','lsx'); ?></span>
224
+						<span><span class="fa fa-link"></span><?php _e('Website', 'lsx'); ?></span>
225 225
 						<a target="_blank" href="<?php echo esc_url($website); ?>"><?php echo $website ?></a>
226 226
 					</div>				
227 227
 			<?php }	?>
@@ -236,29 +236,29 @@  discard block
 block discarded – undo
236 236
  *
237 237
  */
238 238
 
239
-if ( ! function_exists( 'lsx_portfolio_gallery' ) ) {
239
+if ( ! function_exists('lsx_portfolio_gallery')) {
240 240
 	function lsx_portfolio_gallery() {
241 241
 
242
-		$media = get_attached_media( 'image' );
242
+		$media = get_attached_media('image');
243 243
 		$media_array = array();
244 244
 		$post_thumbnail_id = get_post_thumbnail_id(get_the_ID());
245 245
 		
246
-		if(!empty($media)){
247
-			foreach($media as $media_item){
248
-				if($post_thumbnail_id != $media_item->ID) {
246
+		if ( ! empty($media)) {
247
+			foreach ($media as $media_item) {
248
+				if ($post_thumbnail_id != $media_item->ID) {
249 249
 					$media_array[] = $media_item->ID;
250 250
 				}
251 251
 			}
252 252
 				
253
-			if(!empty($media_array)){
254
-				echo gallery_shortcode(array('size'=>'full','ids'=>implode(',', $media_array)));
253
+			if ( ! empty($media_array)) {
254
+				echo gallery_shortcode(array('size'=>'full', 'ids'=>implode(',', $media_array)));
255 255
 			}
256 256
 		}
257 257
 		
258 258
 	}
259 259
 }
260 260
 
261
-if ( ! function_exists( 'lsx_paging_nav' ) ) :
261
+if ( ! function_exists('lsx_paging_nav')) :
262 262
 	/**
263 263
 	 * Display navigation to next/previous set of posts when applicable.
264 264
 	 *
@@ -266,22 +266,22 @@  discard block
 block discarded – undo
266 266
 	 */
267 267
 	function lsx_paging_nav() {
268 268
 		// Don't print empty markup if there's only one page.
269
-		if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {
269
+		if ($GLOBALS['wp_query']->max_num_pages < 2) {
270 270
 			return;
271 271
 		}
272 272
 		
273
-		if(current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')){
273
+		if (current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')) {
274 274
 			return true;
275
-		}elseif(function_exists('wp_pagenavi')){
275
+		}elseif (function_exists('wp_pagenavi')) {
276 276
 			wp_pagenavi();
277
-		}else{
277
+		} else {
278 278
 			
279 279
 			$labels = array(
280
-				'next' 		=> '<span class="meta-nav">&larr;</span> '.__( 'Older posts', 'lsx' ),
281
-				'previous' 	=> __( 'Newer posts', 'lsx' ).' <span class="meta-nav">&rarr;</span>',
282
-				'title' 	=> __( 'Posts navigation', 'lsx' )
280
+				'next' 		=> '<span class="meta-nav">&larr;</span> ' . __('Older posts', 'lsx'),
281
+				'previous' 	=> __('Newer posts', 'lsx') . ' <span class="meta-nav">&rarr;</span>',
282
+				'title' 	=> __('Posts navigation', 'lsx')
283 283
 			);
284
-			$labels = apply_filters('lsx_post_navigation_labels',$labels);
284
+			$labels = apply_filters('lsx_post_navigation_labels', $labels);
285 285
 			
286 286
 			extract($labels);
287 287
 			?>
@@ -289,12 +289,12 @@  discard block
 block discarded – undo
289 289
 				<div class="lsx-breaker"></div>
290 290
 				<h1 class="screen-reader-text"><?php echo $title; ?></h1>
291 291
 				<div class="nav-links">
292
-					<?php if ( get_next_posts_link() ) : ?>
293
-					<div class="nav-previous"><?php next_posts_link( $next ); ?></div>
292
+					<?php if (get_next_posts_link()) : ?>
293
+					<div class="nav-previous"><?php next_posts_link($next); ?></div>
294 294
 					<?php endif; ?>
295 295
 		
296
-					<?php if ( get_previous_posts_link() ) : ?>
297
-					<div class="nav-next"><?php previous_posts_link( $previous ); ?></div>
296
+					<?php if (get_previous_posts_link()) : ?>
297
+					<div class="nav-next"><?php previous_posts_link($previous); ?></div>
298 298
 					<?php endif; ?>
299 299
 					
300 300
 					<div class="clearfix"></div>
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 	}
306 306
 endif;
307 307
 
308
-if ( ! function_exists( 'lsx_post_nav' ) ) :
308
+if ( ! function_exists('lsx_post_nav')) :
309 309
 /**
310 310
  * Display navigation to next/previous post when applicable.
311 311
  *
@@ -313,10 +313,10 @@  discard block
 block discarded – undo
313 313
  */
314 314
 function lsx_post_nav() {
315 315
 	// Don't print empty markup if there's nowhere to navigate.
316
-	$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
317
-	$next     = get_adjacent_post( false, '', false );
316
+	$previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true);
317
+	$next     = get_adjacent_post(false, '', false);
318 318
 
319
-	if ( ! $next && ! $previous ) {
319
+	if ( ! $next && ! $previous) {
320 320
 		return;
321 321
 	}
322 322
 	?>
@@ -326,13 +326,13 @@  discard block
 block discarded – undo
326 326
 		<div class="nav-links pager row">
327 327
 
328 328
 			<?php
329
-				$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>' );
330
-				$previous_post = str_replace('<a','<a',$previous_post);
329
+				$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>');
330
+				$previous_post = str_replace('<a', '<a', $previous_post);
331 331
 				echo $previous_post;
332 332
 			?>
333 333
 			<?php
334
-				$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>' );
335
-				$next_post = str_replace('<a','<a',$next_post);
334
+				$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>');
335
+				$next_post = str_replace('<a', '<a', $next_post);
336 336
 				echo $next_post;
337 337
 			?>
338 338
 
@@ -349,16 +349,16 @@  discard block
 block discarded – undo
349 349
  * @subpackage	template-tags
350 350
  * @category	header
351 351
  */
352
-if(!function_exists('lsx_site_identity')){
353
-	function lsx_site_identity(){
352
+if ( ! function_exists('lsx_site_identity')) {
353
+	function lsx_site_identity() {
354 354
 
355
-		if ( function_exists('has_custom_logo') && has_custom_logo() ) {
355
+		if (function_exists('has_custom_logo') && has_custom_logo()) {
356 356
 			the_custom_logo();
357
-		}elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) {
357
+		}elseif (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) {
358 358
 			jetpack_the_site_logo();
359
-		}else{
359
+		} else {
360 360
 			// shouldn't show both together.. its just strange
361
-			if(true == get_theme_mod('site_logo_header_text',1)){
361
+			if (true == get_theme_mod('site_logo_header_text', 1)) {
362 362
 				lsx_site_title();
363 363
 			}
364 364
 		}
@@ -373,17 +373,17 @@  discard block
 block discarded – undo
373 373
  * @subpackage	template-tags
374 374
  * @category	navigation
375 375
  */
376
-if(!function_exists('lsx_navbar_header')){
377
-	function lsx_navbar_header(){ ?>
376
+if ( ! function_exists('lsx_navbar_header')) {
377
+	function lsx_navbar_header() { ?>
378 378
 	   	<div class="navbar-header" itemscope itemtype="http://schema.org/WebPage">
379 379
 	   	
380 380
 	   		<?php 
381
-	   		$nav_menu = get_theme_mod('nav_menu_locations',false);
381
+	   		$nav_menu = get_theme_mod('nav_menu_locations', false);
382 382
 			//print_r(get_nav_menu_locations());
383 383
 
384
-	   		if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?>
384
+	   		if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?>
385 385
 		   		<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".primary-navbar">
386
-		        	<span class="sr-only"><?php _e('Toggle navigation','lsx'); ?></span>
386
+		        	<span class="sr-only"><?php _e('Toggle navigation', 'lsx'); ?></span>
387 387
 		        	<span class="icon-bar"></span>
388 388
 		        	<span class="icon-bar"></span>
389 389
 		        	<span class="icon-bar"></span>
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 	<?php }
396 396
 }
397 397
 //the if statement is for backwards compatability with previous versions of the theme.
398
-add_action('lsx_nav_before','lsx_navbar_header');
398
+add_action('lsx_nav_before', 'lsx_navbar_header');
399 399
 
400 400
 /**
401 401
  * Outputs the Nav Menu
@@ -404,16 +404,16 @@  discard block
 block discarded – undo
404 404
  * @subpackage	template-tags
405 405
  * @category	navigation
406 406
  */
407
-if(!function_exists('lsx_nav_menu')){
408
-	function lsx_nav_menu(){
409
-		$nav_menu = get_theme_mod('nav_menu_locations',false);
407
+if ( ! function_exists('lsx_nav_menu')) {
408
+	function lsx_nav_menu() {
409
+		$nav_menu = get_theme_mod('nav_menu_locations', false);
410 410
 		
411 411
 		//print_r(get_nav_menu_locations());
412 412
 
413
-	    if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?>
413
+	    if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?>
414 414
 			<nav class="primary-navbar collapse navbar-collapse">
415 415
 		    	<?php
416
-				wp_nav_menu( array(
416
+				wp_nav_menu(array(
417 417
 					'theme_location' => 'primary',
418 418
 					'menu' => $nav_menu['primary'],
419 419
 					'depth' => 3,
@@ -423,9 +423,9 @@  discard block
 block discarded – undo
423 423
 				);
424 424
 				?>
425 425
 		   		</nav>
426
-	    <?php } elseif(is_customize_preview()) { ?>
426
+	    <?php } elseif (is_customize_preview()) { ?>
427 427
 	    		<nav class="primary-navbar collapse navbar-collapse">
428
-	    			<div class="alert alert-info" role="alert"><?php _e('Create a menu and assign it here via the "Navigation" panel.','lsx');?></div>
428
+	    			<div class="alert alert-info" role="alert"><?php _e('Create a menu and assign it here via the "Navigation" panel.', 'lsx'); ?></div>
429 429
 	    		</nav>
430 430
 	    </div>
431 431
 	  	<?php }
@@ -439,9 +439,9 @@  discard block
 block discarded – undo
439 439
  * @subpackage	template-tags
440 440
  * @category	sitemap
441 441
  */
442
-function lsx_sitemap_pages(){
442
+function lsx_sitemap_pages() {
443 443
 	$posts_per_page = get_option('posts_per_page');
444
-	if(false == $posts_per_page){
444
+	if (false == $posts_per_page) {
445 445
 		$posts_per_page = 10;
446 446
 	}
447 447
 	
@@ -452,13 +452,13 @@  discard block
 block discarded – undo
452 452
 		'post_type'		=>	'page',
453 453
 	);
454 454
 	$pages = new WP_Query($page_args);
455
-	if($pages->have_posts()){
455
+	if ($pages->have_posts()) {
456 456
 
457
-		echo '<h2>'.__( 'Pages', 'lsx' ).'</h2>';
457
+		echo '<h2>' . __('Pages', 'lsx') . '</h2>';
458 458
 
459 459
 		echo '<ul>';
460
-		while($pages->have_posts()){ $pages->the_post();
461
-			echo '<li class="page_item page-item-'.get_the_ID().'"><a href="'.get_permalink().'" title="">'.get_the_title().'</a></li>';
460
+		while ($pages->have_posts()) { $pages->the_post();
461
+			echo '<li class="page_item page-item-' . get_the_ID() . '"><a href="' . get_permalink() . '" title="">' . get_the_title() . '</a></li>';
462 462
 		}
463 463
 		echo '</ul>';
464 464
 		
@@ -473,10 +473,10 @@  discard block
 block discarded – undo
473 473
  * @subpackage	template-tags
474 474
  * @category	sitemap
475 475
  */
476
-function lsx_sitemap_custom_post_type(){
476
+function lsx_sitemap_custom_post_type() {
477 477
 	
478 478
 	$posts_per_page = get_option('posts_per_page');
479
-	if(false == $posts_per_page){
479
+	if (false == $posts_per_page) {
480 480
 		$posts_per_page = 10;
481 481
 	}
482 482
 	
@@ -484,8 +484,8 @@  discard block
 block discarded – undo
484 484
 			'public'				=> true,
485 485
 			'_builtin' 				=> false
486 486
 	);
487
-	$post_types = get_post_types($args , 'names');
488
-	foreach($post_types as $post_type){	
487
+	$post_types = get_post_types($args, 'names');
488
+	foreach ($post_types as $post_type) {	
489 489
 
490 490
 		$post_type_args = array(
491 491
 				'post_type'		=>	'page',
@@ -496,19 +496,19 @@  discard block
 block discarded – undo
496 496
 		$post_type_items = new WP_Query($post_type_args);
497 497
 		
498 498
 		$post_type_object = get_post_type_object($post_type);
499
-		if(null != $post_type_object){
499
+		if (null != $post_type_object) {
500 500
 			$title = $post_type_object->labels->name;
501
-		}else{
501
+		} else {
502 502
 			$title = ucwords($post_type);
503 503
 		}
504 504
 		
505
-		if($post_type_items->have_posts()){
505
+		if ($post_type_items->have_posts()) {
506 506
 	
507
-			printf( '<h2>'.__( '%1$s', 'lsx' ).'</h2>', $title );
507
+			printf('<h2>' . __('%1$s', 'lsx') . '</h2>', $title);
508 508
 	
509 509
 			echo '<ul>';
510
-			while($post_type_items->have_posts()){ $post_type_items->the_post();
511
-				echo '<li class="'.get_post_type().'_item '.get_post_type().'-item-'.get_the_ID().'"><a href="'.get_permalink().'" title="">'.get_the_title().'</a></li>';
510
+			while ($post_type_items->have_posts()) { $post_type_items->the_post();
511
+				echo '<li class="' . get_post_type() . '_item ' . get_post_type() . '-item-' . get_the_ID() . '"><a href="' . get_permalink() . '" title="">' . get_the_title() . '</a></li>';
512 512
 			}
513 513
 			echo '</ul>';
514 514
 	
@@ -524,20 +524,20 @@  discard block
 block discarded – undo
524 524
  * @subpackage	template-tags
525 525
  * @category	sitemap
526 526
  */
527
-function lsx_sitemap_taxonomy_clouds(){
527
+function lsx_sitemap_taxonomy_clouds() {
528 528
 
529
-		$taxonomy_args =  array(
529
+		$taxonomy_args = array(
530 530
 			'public'				=> true,
531 531
 			'_builtin' 				=> false
532 532
 		);
533 533
 		$taxonomies = get_taxonomies($taxonomy_args);
534
-		if(!empty($taxonomies)){
535
-			foreach($taxonomies as $taxonomy_id => $taxonomy) {
534
+		if ( ! empty($taxonomies)) {
535
+			foreach ($taxonomies as $taxonomy_id => $taxonomy) {
536 536
 
537
-				$tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id,'echo'=>false));
538
-				if(null != $tag_cloud){
539
-					printf( '<h2>'.__( '%1$s', 'lsx' ).'</h2>', $taxonomy );
540
-					echo '<aside id="'.$taxonomy_id.'" class="widget widget_'.$taxonomy_id.'">'.$tag_cloud.'</aside>';
537
+				$tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id, 'echo'=>false));
538
+				if (null != $tag_cloud) {
539
+					printf('<h2>' . __('%1$s', 'lsx') . '</h2>', $taxonomy);
540
+					echo '<aside id="' . $taxonomy_id . '" class="widget widget_' . $taxonomy_id . '">' . $tag_cloud . '</aside>';
541 541
 		        }
542 542
 	        }
543 543
         } 
@@ -550,15 +550,15 @@  discard block
 block discarded – undo
550 550
  * @subpackage	hooks
551 551
  * @category	forms
552 552
  */
553
-add_action( 'lsx_footer_before', 'lsx_footer_subscription_cta', 10 );
553
+add_action('lsx_footer_before', 'lsx_footer_subscription_cta', 10);
554 554
 function lsx_footer_subscription_cta() {
555
-	if(!function_exists('lsx_is_form_enabled')){ return; }
555
+	if ( ! function_exists('lsx_is_form_enabled')) { return; }
556 556
 	$subscribe_form_id = lsx_is_form_enabled('subscribe');
557
-	if(false == $subscribe_form_id) { return; }
557
+	if (false == $subscribe_form_id) { return; }
558 558
 
559 559
 	//add Caldera Forms Fields Scripts
560
-	if( defined( 'CFCORE_VER' ) ){
561
-		wp_enqueue_script( 'cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER );
560
+	if (defined('CFCORE_VER')) {
561
+		wp_enqueue_script('cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER);
562 562
 	}
563 563
 
564 564
 	?>
@@ -566,8 +566,8 @@  discard block
 block discarded – undo
566 566
 		<div class="container">
567 567
 			<div class="row">
568 568
 				<div class="col-md-12">
569
-					<h2><?php _e( 'Subscribe to Our Newsletter', 'lsx' ); ?></h2>
570
-					<?php echo do_shortcode( '[caldera_form id="'.$subscribe_form_id.'"]' ); ?>
569
+					<h2><?php _e('Subscribe to Our Newsletter', 'lsx'); ?></h2>
570
+					<?php echo do_shortcode('[caldera_form id="' . $subscribe_form_id . '"]'); ?>
571 571
 				</div>
572 572
 			</div>
573 573
 		</div>
@@ -582,14 +582,14 @@  discard block
 block discarded – undo
582 582
  * @subpackage	hooks
583 583
  * @category	menu
584 584
  */
585
-add_action( 'lsx_header_top', 'lsx_add_top_menu' );
585
+add_action('lsx_header_top', 'lsx_add_top_menu');
586 586
 function lsx_add_top_menu() {
587 587
 	if (has_nav_menu('top-menu')) { ?>
588 588
 		<div id="top-menu" class="<?php lsx_top_menu_classes(); ?>">
589 589
 			<div class="container">
590 590
 				<nav class="top-menu">
591 591
 		    		<?php
592
-		    			wp_nav_menu( array(
592
+		    			wp_nav_menu(array(
593 593
 							'theme_location' => 'top-menu',
594 594
 							'walker' => new lsx_bootstrap_navwalker())
595 595
 						);
@@ -607,24 +607,24 @@  discard block
 block discarded – undo
607 607
  * @subpackage	template-tag
608 608
  * @category 	forms
609 609
  */
610
-if ( class_exists('Caldera_Forms') && !function_exists( 'lsx_is_form_enabled' ) ) {
610
+if (class_exists('Caldera_Forms') && ! function_exists('lsx_is_form_enabled')) {
611 611
 	function lsx_is_form_enabled($slug = false) {
612
-		if(false == $slug){ return false; }
612
+		if (false == $slug) { return false; }
613 613
 	
614 614
 		$match = false;
615
-		$forms = get_option( '_caldera_forms' , false );
616
-		if(false !== $forms ) {
617
-			foreach($forms as $form_id=>$form_maybe){
618
-				if( trim(strtolower($slug)) == strtolower($form_maybe['name']) ){
615
+		$forms = get_option('_caldera_forms', false);
616
+		if (false !== $forms) {
617
+			foreach ($forms as $form_id=>$form_maybe) {
618
+				if (trim(strtolower($slug)) == strtolower($form_maybe['name'])) {
619 619
 					$match = $form_id;
620 620
 					break;
621 621
 				}
622 622
 			}
623 623
 		}
624
-		if( false === $match ){
625
-			$is_form = Caldera_Forms::get_form( strtolower( $slug ) );
626
-			if( !empty( $is_form ) ){
627
-				return strtolower( $slug );
624
+		if (false === $match) {
625
+			$is_form = Caldera_Forms::get_form(strtolower($slug));
626
+			if ( ! empty($is_form)) {
627
+				return strtolower($slug);
628 628
 			}
629 629
 		}
630 630
 	
@@ -640,10 +640,10 @@  discard block
 block discarded – undo
640 640
  * @category 	urls
641 641
  */
642 642
 function lsx_get_my_url() {
643
-	if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) )
643
+	if ( ! preg_match('/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches))
644 644
 		return false;
645 645
 
646
-	return esc_url_raw( $matches[1] );
646
+	return esc_url_raw($matches[1]);
647 647
 }
648 648
 
649 649
 /**
@@ -653,19 +653,19 @@  discard block
 block discarded – undo
653 653
  * @subpackage 	extras
654 654
  * @category 	urls
655 655
  */
656
-function lsx_get_template_part($slug,$part) {
656
+function lsx_get_template_part($slug, $part) {
657 657
 	$template = array();
658 658
 	$part = (string) $part;
659
-	if ( '' !== $part ){
659
+	if ('' !== $part) {
660 660
 		$template = "{$slug}-{$part}.php";
661
-	}else{
661
+	} else {
662 662
 		$template = "{$slug}.php";
663 663
 	}
664
-	$file_path = apply_filters('lsx_content_path',false,$slug,$part);
664
+	$file_path = apply_filters('lsx_content_path', false, $slug, $part);
665 665
 
666
-	if ( false !== $file_path && '' == locate_template( array( $template ) ) && file_exists( $file_path.$template) ) {
667
-		load_template( $file_path.$template, false );
668
-	}else{
669
-		get_template_part($slug,$part);
666
+	if (false !== $file_path && '' == locate_template(array($template)) && file_exists($file_path . $template)) {
667
+		load_template($file_path . $template, false);
668
+	} else {
669
+		get_template_part($slug, $part);
670 670
 	}
671 671
 }
672 672
\ No newline at end of file
Please login to merge, or discard this patch.
inc/widgets.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,54 +1,54 @@  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
  * Register widgetized area and update sidebar with default widgets.
6 6
  */
7 7
 function lsx_widget_area_init() {
8 8
 	
9
-	register_sidebar( array(
10
-		'name'          => __( 'Home', 'lsx' ),
9
+	register_sidebar(array(
10
+		'name'          => __('Home', 'lsx'),
11 11
 		'id'            => 'sidebar-home',
12 12
 		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
13 13
 		'after_widget'  => '</aside>',
14 14
 		'before_title'  => '<h3 class="widget-title">',
15 15
 		'after_title'   => '</h3>',
16
-	) );
16
+	));
17 17
 	
18
-	register_sidebar( array(
19
-		'name'          => __( 'Sidebar', 'lsx' ),
18
+	register_sidebar(array(
19
+		'name'          => __('Sidebar', 'lsx'),
20 20
 		'id'            => 'sidebar-1',
21 21
 		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
22 22
 		'after_widget'  => '</aside>',
23 23
 		'before_title'  => '<h3 class="widget-title">',
24 24
 		'after_title'   => '</h3>',
25
-	) );
25
+	));
26 26
 
27
-	register_sidebar( array(
28
-		'name'          => __( 'Footer', 'lsx' ),
27
+	register_sidebar(array(
28
+		'name'          => __('Footer', 'lsx'),
29 29
 		'id'            => 'sidebar-footer',
30 30
 		'before_widget' => '<div class="styler"><aside id="%1$s" class="widget %2$s">',
31 31
 		'after_widget'  => '</aside></div>',
32 32
 		'before_title'  => '<h3 class="widget-title">',
33 33
 		'after_title'   => '</h3>',
34
-	) );
34
+	));
35 35
 
36
-	register_sidebar( array(
37
-		'name'          => __( 'Footer Call to Action', 'lsx' ),
36
+	register_sidebar(array(
37
+		'name'          => __('Footer Call to Action', 'lsx'),
38 38
 		'id'            => 'sidebar-footer-cta',
39 39
 		'before_widget' => '<div class="styler"><aside id="%1$s" class="widget %2$s">',
40 40
 		'after_widget'  => '</aside></div>',
41 41
 		'before_title'  => '<h3 class="widget-title">',
42 42
 		'after_title'   => '</h3>',
43
-	) );
43
+	));
44 44
 }
45
-add_action( 'widgets_init', 'lsx_widget_area_init' );
45
+add_action('widgets_init', 'lsx_widget_area_init');
46 46
 
47
-function lsx_sidebar_footer_params( $params ) {
47
+function lsx_sidebar_footer_params($params) {
48 48
 
49 49
     $sidebar_id = $params[0]['id'];
50 50
 
51
-    if ( $sidebar_id == 'sidebar-footer' ) {
51
+    if ($sidebar_id == 'sidebar-footer') {
52 52
 
53 53
         $total_widgets = wp_get_sidebars_widgets();
54 54
         $sidebar_widgets = count($total_widgets[$sidebar_id]);
@@ -58,4 +58,4 @@  discard block
 block discarded – undo
58 58
 
59 59
     return $params;
60 60
 }
61
-add_filter( 'dynamic_sidebar_params', 'lsx_sidebar_footer_params' ); 
62 61
\ No newline at end of file
62
+add_filter('dynamic_sidebar_params', 'lsx_sidebar_footer_params'); 
63 63
\ No newline at end of file
Please login to merge, or discard this patch.
inc/wp-job-manager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,6 +14,6 @@
 block discarded – undo
14 14
  */
15 15
 
16 16
 function lsx_wp_job_manager_styles() {
17
-    wp_enqueue_style( 'wp_job_manager', get_template_directory_uri() . '/css/wp-job-manager.css' );
17
+    wp_enqueue_style('wp_job_manager', get_template_directory_uri() . '/css/wp-job-manager.css');
18 18
 }
19
-add_action( 'wp_enqueue_scripts', 'lsx_wp_job_manager_styles' );
20 19
\ No newline at end of file
20
+add_action('wp_enqueue_scripts', 'lsx_wp_job_manager_styles');
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
inc/customizer-header-layout.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  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
  * Customizer Header Swatch Control Class
6 6
  *
7 7
  * @since 1.0.0
8 8
  */
9
-if( !class_exists( 'WP_Customize_Control' ) ){
9
+if ( ! class_exists('WP_Customize_Control')) {
10 10
 	return;
11 11
 }
12 12
 class LSX_Customize_Header_Layout_Control extends WP_Customize_Control {
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 	 * @param string $id
39 39
 	 * @param array $args
40 40
 	 */
41
-	public function __construct( $manager, $id, $args = array() ) {
42
-		parent::__construct( $manager, $id, $args );
43
-		if( !empty( $args['choices'] ) ){
41
+	public function __construct($manager, $id, $args = array()) {
42
+		parent::__construct($manager, $id, $args);
43
+		if ( ! empty($args['choices'])) {
44 44
 			$this->layouts = $args['choices'];
45 45
 		}
46 46
 	}
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	public function enqueue() {
54 54
 		// 
55
-		wp_enqueue_script( 'lsx-header-layout-control', get_template_directory_uri() .'/js/customizer-header-layout.js', array('jquery'), null, true );
55
+		wp_enqueue_script('lsx-header-layout-control', get_template_directory_uri() . '/js/customizer-header-layout.js', array('jquery'), null, true);
56 56
 	}
57 57
 
58 58
 	/**
@@ -62,26 +62,26 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function render_content() {
64 64
 		
65
-		$post_id    = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) );
65
+		$post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id));
66 66
 		$class = 'customize-control customize-control-' . $this->type;
67 67
 		$value = $this->value();
68 68
 
69 69
 		?>
70 70
 		<label>
71
-			<?php if ( ! empty( $this->label ) ) { ?>
72
-				<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
71
+			<?php if ( ! empty($this->label)) { ?>
72
+				<span class="customize-control-title"><?php echo esc_html($this->label); ?></span>
73 73
 			<?php }
74
-			if ( ! empty( $this->description ) ) { ?>
74
+			if ( ! empty($this->description)) { ?>
75 75
 				<span class="description customize-control-description"><?php echo $this->description; ?></span>
76 76
 			<?php } ?>
77 77
 			<div class="header-layouts-selector">
78 78
 			<?php
79
-			foreach( $this->layouts as $layout ){
79
+			foreach ($this->layouts as $layout) {
80 80
 				$sel = 'border: 1px solid transparent;';
81
-				if( $value == $layout ){
81
+				if ($value == $layout) {
82 82
 					$sel = 'border: 1px solid rgb(43, 166, 203);';
83 83
 				}
84
-				echo '<img class="header-layout-button" style="padding:2px;'. $sel .'" src="' . get_template_directory_uri() .'/img/header-' . $layout . '.png" data-option="' . $layout . '">';
84
+				echo '<img class="header-layout-button" style="padding:2px;' . $sel . '" src="' . get_template_directory_uri() . '/img/header-' . $layout . '.png" data-option="' . $layout . '">';
85 85
 			}
86 86
 
87 87
 			?>
Please login to merge, or discard this patch.
inc/google-font-collection.php 1 patch
Spacing   +4 added lines, -4 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
  * Google Font_Collection Class
5 5
 **/
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	**/
16 16
 	public function __construct($fonts)
17 17
 	{
18
-		if(empty($fonts))
18
+		if (empty($fonts))
19 19
 		{
20 20
 			//we didn't get the required data
21 21
 			return false;
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 		// create fonts
25 25
 		foreach ($fonts as $key => $value) 
26 26
 		{	
27
-			if( empty( $value["system"] ) ){
27
+			if (empty($value["system"])) {
28 28
 				$this->fonts[$value["title"]] = new LSX_Google_Font($value["title"], $value["location"], $value["cssDeclaration"], $value["cssClass"]);
29 29
 			}
30 30
 		}
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 		foreach ($this->fonts as $key => $value) 
107 107
 		{
108 108
 			$protocol = 'http';
109
-			if(is_ssl()){ $protocol.='s'; }
109
+			if (is_ssl()) { $protocol .= 's'; }
110 110
 			?>
111 111
 			<link href="<?php echo $protocol; ?>://fonts.googleapis.com/css?family=<?php echo $value->__get("location"); ?>" rel='stylesheet' type='text/css'>
112 112
 			<?php
Please login to merge, or discard this patch.
inc/extras.php 1 patch
Spacing   +82 added lines, -82 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,8 +99,8 @@  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
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 add_filter('style_loader_tag', 'lsx_clean_style_tag');
117 117
 
118 118
 
119
-if (!function_exists('lsx_get_attachment_id')) {
119
+if ( ! function_exists('lsx_get_attachment_id')) {
120 120
 	/**
121 121
 	 * Get the Attachment ID for a given image URL.
122 122
 	 *
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	function lsx_get_attachment_id($url) {
128 128
 		$dir = wp_upload_dir();
129 129
 		// baseurl never has a trailing slash
130
-		if (false === strpos($url, $dir['baseurl'].'/')) {
130
+		if (false === strpos($url, $dir['baseurl'] . '/')) {
131 131
 			// URL points to a place outside of upload directory
132 132
 			return false;
133 133
 		}
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		$query['meta_query'][0]['key'] = '_wp_attached_file';
146 146
 		// query attachments
147 147
 		$ids = get_posts($query);
148
-		if (!empty($ids)) {
148
+		if ( ! empty($ids)) {
149 149
 			foreach ($ids as $id) {
150 150
 				// first entry of returned array is the URL
151 151
 				$temp_url = wp_get_attachment_image_src($id, 'full');
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
  */
189 189
 function lsx_is_element_empty($element) {
190 190
 	$element = trim($element);
191
-	return empty($element)?false:true;
191
+	return empty($element) ? false : true;
192 192
 }
193 193
 
194 194
 
@@ -199,39 +199,39 @@  discard block
 block discarded – undo
199 199
  * @subpackage extras
200 200
  * @category thumbnails
201 201
  */
202
-function lsx_get_thumbnail($size,$image_src = false){
202
+function lsx_get_thumbnail($size, $image_src = false) {
203 203
 	
204
-	if(false === $image_src){
204
+	if (false === $image_src) {
205 205
 		$post_id = get_the_ID(); 
206
-		$post_thumbnail_id = get_post_thumbnail_id( $post_id );
207
-	}elseif(false != $image_src	){
208
-		if(is_numeric($image_src)){
206
+		$post_thumbnail_id = get_post_thumbnail_id($post_id);
207
+	}elseif (false != $image_src) {
208
+		if (is_numeric($image_src)) {
209 209
 			$post_thumbnail_id = $image_src;
210
-		}else{
210
+		} else {
211 211
 			$post_thumbnail_id = lsx_get_attachment_id_from_src($image_src);
212 212
 		}
213 213
 	}
214
-	$size = apply_filters('lsx_thumbnail_size',$size);
214
+	$size = apply_filters('lsx_thumbnail_size', $size);
215 215
 	$img = false;
216
-	if($size === 'lsx-thumbnail-wide' || $size === 'thumbnail'){
216
+	if ($size === 'lsx-thumbnail-wide' || $size === 'thumbnail') {
217 217
 		$srcset = false;
218
-		$img = wp_get_attachment_image_src($post_thumbnail_id,$size);
218
+		$img = wp_get_attachment_image_src($post_thumbnail_id, $size);
219 219
 		$img = $img[0];
220
-	}else{
220
+	} else {
221 221
 		$srcset = true;
222
-		$img = wp_get_attachment_image_srcset($post_thumbnail_id,$size);
223
-		if($img == false) {
222
+		$img = wp_get_attachment_image_srcset($post_thumbnail_id, $size);
223
+		if ($img == false) {
224 224
 			$srcset = false;
225
-			$img = wp_get_attachment_image_src($post_thumbnail_id,$size);
225
+			$img = wp_get_attachment_image_src($post_thumbnail_id, $size);
226 226
 			$img = $img[0];
227 227
 		}
228 228
 	}
229 229
 	if ($srcset) {
230
-		$img = '<img alt="'.get_the_title(get_the_ID()).'" class="attachment-responsive wp-post-image lsx-responsive" srcset="'.$img.'" />';
230
+		$img = '<img alt="' . get_the_title(get_the_ID()) . '" class="attachment-responsive wp-post-image lsx-responsive" srcset="' . $img . '" />';
231 231
 	} else {
232
-		$img = '<img alt="'.get_the_title(get_the_ID()).'" class="attachment-responsive wp-post-image lsx-responsive" src="'.$img.'" />';
232
+		$img = '<img alt="' . get_the_title(get_the_ID()) . '" class="attachment-responsive wp-post-image lsx-responsive" src="' . $img . '" />';
233 233
 	}
234
-	$img = apply_filters('lsx_lazyload_filter_images',$img);
234
+	$img = apply_filters('lsx_lazyload_filter_images', $img);
235 235
 	return $img;
236 236
 }
237 237
 
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
  * @subpackage extras
243 243
  * @category thumbnails
244 244
  */
245
-function lsx_thumbnail($size = 'thumbnail',$image_src = false){
246
-	echo lsx_get_thumbnail($size,$image_src);
245
+function lsx_thumbnail($size = 'thumbnail', $image_src = false) {
246
+	echo lsx_get_thumbnail($size, $image_src);
247 247
 }
248 248
 
249 249
 
@@ -268,24 +268,24 @@  discard block
 block discarded – undo
268 268
  * @subpackage extras
269 269
  * @category banner
270 270
  */
271
-if (!function_exists('lsx_page_banner')) {
271
+if ( ! function_exists('lsx_page_banner')) {
272 272
 	function lsx_page_banner() {
273 273
 
274
-		$post_types = array('page','post');
275
-		$post_types = apply_filters('lsx_allowed_post_type_banners',$post_types);	
274
+		$post_types = array('page', 'post');
275
+		$post_types = apply_filters('lsx_allowed_post_type_banners', $post_types);	
276 276
 		
277
-		if ( (is_singular($post_types) && has_post_thumbnail())
278
-		 || (is_singular('jetpack-portfolio')) ) { ?>
277
+		if ((is_singular($post_types) && has_post_thumbnail())
278
+		 || (is_singular('jetpack-portfolio'))) { ?>
279 279
 	        
280 280
 	        <?php 
281 281
 	        	$bg_image = '';
282
-	        	if(has_post_thumbnail()){
283
-	        		$bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),'full');
282
+	        	if (has_post_thumbnail()) {
283
+	        		$bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full');
284 284
 	        		$bg_image = $bg_image[0];
285 285
 	        	}
286 286
 	        ?>
287 287
 
288
-	   		<?php if ( ! empty( $bg_image ) ) : ?>
288
+	   		<?php if ( ! empty($bg_image)) : ?>
289 289
 	        
290 290
 	        <div class="page-banner-wrap">
291 291
 		        <div class="page-banner">
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 	    <?php } 
306 306
 	}
307 307
 }
308
-add_action( 'lsx_header_after', 'lsx_page_banner' );
308
+add_action('lsx_header_after', 'lsx_page_banner');
309 309
 
310 310
 
311 311
 /**
@@ -315,11 +315,11 @@  discard block
 block discarded – undo
315 315
  * @subpackage extras
316 316
  * @category mobile
317 317
  */
318
-function lsx_allow_sms_protocol( $protocols ) {
318
+function lsx_allow_sms_protocol($protocols) {
319 319
     $protocols[] = 'sms';
320 320
     return $protocols;
321 321
 }
322
-add_filter( 'kses_allowed_protocols', 'lsx_allow_sms_protocol' );
322
+add_filter('kses_allowed_protocols', 'lsx_allow_sms_protocol');
323 323
 
324 324
 
325 325
 /**
@@ -327,28 +327,28 @@  discard block
 block discarded – undo
327 327
  */
328 328
 function mv_browser_body_class($classes) {
329 329
         global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
330
-        if($is_lynx) $classes[] = 'lynx';
331
-        elseif($is_gecko) $classes[] = 'gecko';
332
-        elseif($is_opera) $classes[] = 'opera';
333
-        elseif($is_NS4) $classes[] = 'ns4';
334
-        elseif($is_safari) $classes[] = 'safari';
335
-        elseif($is_chrome) $classes[] = 'chrome';
336
-        elseif($is_IE) {
330
+        if ($is_lynx) $classes[] = 'lynx';
331
+        elseif ($is_gecko) $classes[] = 'gecko';
332
+        elseif ($is_opera) $classes[] = 'opera';
333
+        elseif ($is_NS4) $classes[] = 'ns4';
334
+        elseif ($is_safari) $classes[] = 'safari';
335
+        elseif ($is_chrome) $classes[] = 'chrome';
336
+        elseif ($is_IE) {
337 337
                 $classes[] = 'ie';
338
-                if(preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $_SERVER['HTTP_USER_AGENT'], $browser_version))
339
-                $classes[] = 'ie'.$browser_version[1];
338
+                if (preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $_SERVER['HTTP_USER_AGENT'], $browser_version))
339
+                $classes[] = 'ie' . $browser_version[1];
340 340
         } else $classes[] = 'unknown';
341
-        if($is_iphone) $classes[] = 'iphone';
342
-        if ( stristr( $_SERVER['HTTP_USER_AGENT'],"mac") ) {
341
+        if ($is_iphone) $classes[] = 'iphone';
342
+        if (stristr($_SERVER['HTTP_USER_AGENT'], "mac")) {
343 343
                  $classes[] = 'osx';
344
-           } elseif ( stristr( $_SERVER['HTTP_USER_AGENT'],"linux") ) {
344
+           } elseif (stristr($_SERVER['HTTP_USER_AGENT'], "linux")) {
345 345
                  $classes[] = 'linux';
346
-           } elseif ( stristr( $_SERVER['HTTP_USER_AGENT'],"windows") ) {
346
+           } elseif (stristr($_SERVER['HTTP_USER_AGENT'], "windows")) {
347 347
                  $classes[] = 'windows';
348 348
            }
349 349
         return $classes;
350 350
 }
351
-add_filter('body_class','mv_browser_body_class');
351
+add_filter('body_class', 'mv_browser_body_class');
352 352
 
353 353
 
354 354
 /**
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
  * @param		$form		Object
362 362
  * @return		String
363 363
  */
364
-function lsx_form_submit_button($button, $form){
364
+function lsx_form_submit_button($button, $form) {
365 365
 	return "<button class='btn btn-primary' id='gform_submit_button_{$form["id"]}'><span>Submit</span></button>";
366 366
 }
367 367
 add_filter("gform_submit_button", "lsx_form_submit_button", 10, 2);
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 	//return ' ... <a class="moretag" href="'. get_permalink($post->ID) . '">'.__('Continue reading','lsx').'</a>';
376 376
 	return '...';
377 377
 }
378
-add_filter( 'excerpt_more', 'lsx_excerpt_more' );
378
+add_filter('excerpt_more', 'lsx_excerpt_more');
379 379
 
380 380
 
381 381
 /**
@@ -384,44 +384,44 @@  discard block
 block discarded – undo
384 384
 function lsx_the_excerpt_filter($excerpt) {
385 385
 	$show_full_content = has_post_format(apply_filters('lsx_the_excerpt_filter_post_types', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio')));
386 386
 	
387
-	if (!$show_full_content) {
388
-		if ('' !== $excerpt  && !stristr($excerpt, 'moretag')) {
389
-			$pagination = wp_link_pages( array(
387
+	if ( ! $show_full_content) {
388
+		if ('' !== $excerpt && ! stristr($excerpt, 'moretag')) {
389
+			$pagination = wp_link_pages(array(
390 390
 							'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
391 391
 							'after' => '</div></div>',
392 392
 							'link_before' => '<span>',
393 393
 							'link_after' => '</span>',
394 394
 							'echo' => 0
395
-						) );
395
+						));
396 396
 
397
-			if ( ! empty( $pagination ) ) {
397
+			if ( ! empty($pagination)) {
398 398
 				$excerpt .= $pagination;
399 399
 			}
400 400
 			else {
401
-				$excerpt .= '<p><a class="moretag" href="'.get_permalink().'">'.__('Continue reading','lsx').'</a></p>';
401
+				$excerpt .= '<p><a class="moretag" href="' . get_permalink() . '">' . __('Continue reading', 'lsx') . '</a></p>';
402 402
 			}
403 403
 		}
404 404
 	}
405 405
 
406 406
 	return $excerpt;
407 407
 }
408
-add_filter( 'the_excerpt', 'lsx_the_excerpt_filter' , 1 , 20 );
408
+add_filter('the_excerpt', 'lsx_the_excerpt_filter', 1, 20);
409 409
 
410 410
 
411 411
 /**
412 412
  * Allow HTML tags in excerpt
413 413
  */
414
-if ( ! function_exists( 'wpse_custom_wp_trim_excerpt' ) ) {
414
+if ( ! function_exists('wpse_custom_wp_trim_excerpt')) {
415 415
 	function wpse_custom_wp_trim_excerpt($wpse_excerpt) {
416 416
 		global $post;
417 417
 		$raw_excerpt = $wpse_excerpt;
418 418
 
419
-		if ( '' == $wpse_excerpt ) {
419
+		if ('' == $wpse_excerpt) {
420 420
 			$wpse_excerpt = get_the_content('');
421 421
 			$show_full_content = has_post_format(array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio'));
422 422
 
423
-			if (!$show_full_content) {
424
-				$wpse_excerpt = strip_shortcodes( $wpse_excerpt );
423
+			if ( ! $show_full_content) {
424
+				$wpse_excerpt = strip_shortcodes($wpse_excerpt);
425 425
 				$wpse_excerpt = apply_filters('the_content', $wpse_excerpt);
426 426
 				$wpse_excerpt = str_replace(']]>', ']]>', $wpse_excerpt);
427 427
 				//$wpse_excerpt = strip_tags($wpse_excerpt, '<blockquote>,<p>');
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 				$wpse_excerpt = trim(force_balance_tags($excerptOutput));
450 450
 
451 451
 				if ($has_more) {
452
-					$excerpt_end = '<a class="moretag" href="'.get_permalink().'">'.__('More','lsx').'</a>';
452
+					$excerpt_end = '<a class="moretag" href="' . get_permalink() . '">' . __('More', 'lsx') . '</a>';
453 453
 					$excerpt_end = apply_filters('excerpt_more', ' ' . $excerpt_end); 
454 454
 
455 455
 					$pos = strrpos($wpse_excerpt, '</');
@@ -477,4 +477,4 @@  discard block
 block discarded – undo
477 477
 }
478 478
 remove_filter('get_the_excerpt', 'wp_trim_excerpt');
479 479
 add_filter('get_the_excerpt', 'wpse_custom_wp_trim_excerpt');
480
-remove_filter( 'the_excerpt', 'wpautop' );
480
+remove_filter('the_excerpt', 'wpautop');
Please login to merge, or discard this patch.
inc/scripts.php 1 patch
Spacing   +28 added lines, -28 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
  * Enqueue scripts and styles.
@@ -10,12 +10,12 @@  discard block
 block discarded – undo
10 10
 function lsx_scripts() {
11 11
 	global $content_width;
12 12
 	
13
-	wp_enqueue_style('lsx_main_style', get_stylesheet_uri() , false, '23a2bd43791de3fa3cab2d2af5fec6a2');
13
+	wp_enqueue_style('lsx_main_style', get_stylesheet_uri(), false, '23a2bd43791de3fa3cab2d2af5fec6a2');
14 14
 	
15 15
 	wp_enqueue_style('lsx_main', get_template_directory_uri() . '/css/app.css', false, '48a2bd26791de3fa7cab2d2af5fec6a2');
16 16
 	
17
-	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
18
-		wp_enqueue_script( 'comment-reply' );
17
+	if (is_singular() && comments_open() && get_option('thread_comments')) {
18
+		wp_enqueue_script('comment-reply');
19 19
 	}
20 20
 
21 21
 	wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/vendor/bootstrap.min.js', array('jquery'), 'c9f983e2965b9c7888dac272e56c4f4b', false);
@@ -26,38 +26,38 @@  discard block
 block discarded – undo
26 26
 	wp_enqueue_script('picturefill', get_template_directory_uri() . '/js/vendor/picturefill.min.js', array(), null, false);
27 27
 
28 28
 	wp_enqueue_script('masonry');
29
-	wp_enqueue_script('imagesLoaded', get_template_directory_uri().'/js/vendor/imagesloaded.pkgd.min.js', array('jquery','masonry'));	
30
-	if(defined('WP_DEBUG') && true === WP_DEBUG){
29
+	wp_enqueue_script('imagesLoaded', get_template_directory_uri() . '/js/vendor/imagesloaded.pkgd.min.js', array('jquery', 'masonry'));	
30
+	if (defined('WP_DEBUG') && true === WP_DEBUG) {
31 31
 		wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.js', array('masonry'), null, false);
32
-	}else{
32
+	} else {
33 33
 		wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.min.js', array('masonry'), null, false);
34 34
 	}
35 35
 	
36 36
 	//Set some parameters that we can use in the JS
37 37
 	$is_portfolio = false;
38
-	if(is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag') || is_page_template('page-templates/template-portfolio.php')){
38
+	if (is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag') || is_page_template('page-templates/template-portfolio.php')) {
39 39
 		$is_portfolio = true;
40 40
 	}
41 41
 	$param_array = array(
42 42
 			'is_portfolio' => $is_portfolio
43 43
 	);
44 44
 	//Set the columns for the archives
45
-	$param_array['columns'] = apply_filters('lsx_archive_column_number',3);
46
-	wp_localize_script( 'lsx_script', 'lsx_params', $param_array );
45
+	$param_array['columns'] = apply_filters('lsx_archive_column_number', 3);
46
+	wp_localize_script('lsx_script', 'lsx_params', $param_array);
47 47
 
48 48
 
49
-	wp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css');
49
+	wp_enqueue_style('fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css');
50 50
 	
51 51
 	
52
-	if(is_child_theme() && file_exists(get_stylesheet_directory() . '/custom.css')) {
53
-		wp_enqueue_style( 'child-css', get_stylesheet_directory_uri() . '/custom.css' );
52
+	if (is_child_theme() && file_exists(get_stylesheet_directory() . '/custom.css')) {
53
+		wp_enqueue_style('child-css', get_stylesheet_directory_uri() . '/custom.css');
54 54
 	}
55 55
 
56 56
 	wp_enqueue_style('medium-break', get_template_directory_uri() . '/css/medium-nav-break.css', false);
57 57
 	
58 58
 	
59
-	$font = get_theme_mod('lsx_font','raleway_open_sans');
60
-	switch($font){
59
+	$font = get_theme_mod('lsx_font', 'raleway_open_sans');
60
+	switch ($font) {
61 61
 		case 'raleway_open_sans':
62 62
 			$header_font_location = 'Raleway';
63 63
 			$body_font_location = 'Open+Sans';
@@ -86,18 +86,18 @@  discard block
 block discarded – undo
86 86
 	}
87 87
 	
88 88
 	$http_var = 'http';
89
-	if(is_ssl()){ $http_var .= 's'; }
89
+	if (is_ssl()) { $http_var .= 's'; }
90 90
 	
91 91
 	//Call the Google Fonts and then Enque them.
92
-	wp_register_style('lsx-header-font', $http_var.'://fonts.googleapis.com/css?family='.$header_font_location);
93
-	wp_register_style('lsx-body-font', $http_var.'://fonts.googleapis.com/css?family='.$body_font_location);
94
-	wp_enqueue_style( 'lsx-header-font');
95
-	wp_enqueue_style( 'lsx-body-font');
92
+	wp_register_style('lsx-header-font', $http_var . '://fonts.googleapis.com/css?family=' . $header_font_location);
93
+	wp_register_style('lsx-body-font', $http_var . '://fonts.googleapis.com/css?family=' . $body_font_location);
94
+	wp_enqueue_style('lsx-header-font');
95
+	wp_enqueue_style('lsx-body-font');
96 96
 	
97
-	wp_enqueue_style('lsx_font_scheme', esc_url( get_template_directory_uri() . '/css/'.$font.'.css'), false, '48a2bd26791de3fa7cab2d2af5fec6a4');
97
+	wp_enqueue_style('lsx_font_scheme', esc_url(get_template_directory_uri() . '/css/' . $font . '.css'), false, '48a2bd26791de3fa7cab2d2af5fec6a4');
98 98
 	
99 99
 }
100
-add_action( 'wp_enqueue_scripts', 'lsx_scripts' );
100
+add_action('wp_enqueue_scripts', 'lsx_scripts');
101 101
 
102 102
 /**
103 103
  * Defer JavaScript
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
  * @package 	lsx
106 106
  * @subpackage	scripts
107 107
  */
108
-function lsx_scripts_defer_parsing( $url ) {
109
-	if ( ! ( is_admin() ) ) {
110
-		if ( FALSE === strpos( $url, '.js' ) ) return $url;
111
-		if ( strpos( $url, 'jquery.js' ) ) return $url;
112
-		if ( strpos( $url, ' defer ' ) ) return $url;
108
+function lsx_scripts_defer_parsing($url) {
109
+	if ( ! (is_admin())) {
110
+		if (FALSE === strpos($url, '.js')) return $url;
111
+		if (strpos($url, 'jquery.js')) return $url;
112
+		if (strpos($url, ' defer ')) return $url;
113 113
 		return "$url' defer onload='";
114 114
 	}
115 115
 
116 116
 	return $url;
117 117
 }
118
-add_filter( 'clean_url', 'lsx_scripts_defer_parsing', 11, 1 );
118
+add_filter('clean_url', 'lsx_scripts_defer_parsing', 11, 1);
Please login to merge, or discard this patch.
inc/customizer.php 1 patch
Spacing   +44 added lines, -44 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
  * Customizer Configuration File
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @author  [email protected] <lsdev.biz>
10 10
  * 
11 11
  */
12
-if ( ! class_exists( 'LSX_Theme_Customizer' ) ) {
12
+if ( ! class_exists('LSX_Theme_Customizer')) {
13 13
 	
14 14
 	class LSX_Theme_Customizer {
15 15
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 		 *
30 30
 		 * @since     1.0.0
31 31
 		 */
32
-		public function __construct( $controls ) {
32
+		public function __construct($controls) {
33 33
 			require get_template_directory() . '/inc/google-font.php';
34 34
 			require get_template_directory() . '/inc/google-font-collection.php';
35 35
 			require get_template_directory() . '/inc/customizer-core.php';
@@ -40,19 +40,19 @@  discard block
 block discarded – undo
40 40
 
41 41
 			$this->controls = $controls;
42 42
 
43
-			add_action( 'customize_preview_init', array($this,'customize_preview_js' ),20);
44
-			add_action( 'customize_register', array($this,'customizer'), 11 );
43
+			add_action('customize_preview_init', array($this, 'customize_preview_js'), 20);
44
+			add_action('customize_register', array($this, 'customizer'), 11);
45 45
 			
46
-			add_action( 'wp_ajax_customizer_site_title', array($this,'ajax_site_title') );
47
-			add_action( 'wp_ajax_nopriv_customizer_site_title', array($this,'ajax_site_title') );
46
+			add_action('wp_ajax_customizer_site_title', array($this, 'ajax_site_title'));
47
+			add_action('wp_ajax_nopriv_customizer_site_title', array($this, 'ajax_site_title'));
48 48
 		}
49 49
 		
50 50
 		/**
51 51
 		 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
52 52
 		 */
53 53
 		function customize_preview_js() {
54
-			wp_enqueue_script( 'lsx_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ) , wp_get_theme()->Version, true );
55
-			wp_localize_script( 'lsx_customizer', 'lsx_customizer_params', array( 'template_directory' => get_template_directory_uri() ) );
54
+			wp_enqueue_script('lsx_customizer', get_template_directory_uri() . '/js/customizer.js', array('customize-preview'), wp_get_theme()->Version, true);
55
+			wp_localize_script('lsx_customizer', 'lsx_customizer_params', array('template_directory' => get_template_directory_uri()));
56 56
 		}
57 57
 		
58 58
 		/**
@@ -60,40 +60,40 @@  discard block
 block discarded – undo
60 60
 		 *
61 61
 		 * @since     1.0.0
62 62
 		 */		
63
-		public function customizer( $wp_customize ) {
63
+		public function customizer($wp_customize) {
64 64
 			// start panels
65
-			if( !empty( $this->controls['panels'] ) ){
66
-				foreach( $this->controls['panels'] as $panel_slug => $args ){
67
-					$this->add_panel( $panel_slug, $args, $wp_customize );
65
+			if ( ! empty($this->controls['panels'])) {
66
+				foreach ($this->controls['panels'] as $panel_slug => $args) {
67
+					$this->add_panel($panel_slug, $args, $wp_customize);
68 68
 				}
69 69
 			}
70 70
 
71 71
 			// start sections
72
-			if( !empty( $this->controls['sections'] ) ){
73
-				foreach( $this->controls['sections'] as $section_slug => $args ){
74
-					$this->add_section( $section_slug, $args, $wp_customize );
72
+			if ( ! empty($this->controls['sections'])) {
73
+				foreach ($this->controls['sections'] as $section_slug => $args) {
74
+					$this->add_section($section_slug, $args, $wp_customize);
75 75
 				}
76 76
 			}
77 77
 
78 78
 			// start settings
79
-			if( !empty( $this->controls['settings'] ) ){
80
-				foreach( $this->controls['settings'] as $settings_slug => $args ){
81
-					$this->add_setting( $settings_slug, $args, $wp_customize );
79
+			if ( ! empty($this->controls['settings'])) {
80
+				foreach ($this->controls['settings'] as $settings_slug => $args) {
81
+					$this->add_setting($settings_slug, $args, $wp_customize);
82 82
 				}
83 83
 			}
84 84
 
85 85
 			// start fields
86
-			if( !empty( $this->controls['fields'] ) ){
87
-				foreach( $this->controls['fields'] as $field_slug => $args ){
88
-					$this->add_control( $field_slug, $args, $wp_customize );
86
+			if ( ! empty($this->controls['fields'])) {
87
+				foreach ($this->controls['fields'] as $field_slug => $args) {
88
+					$this->add_control($field_slug, $args, $wp_customize);
89 89
 				}
90 90
 			}
91 91
 			
92
-			$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
93
-			$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
94
-			$wp_customize->get_setting( 'background_color' )->transport = 'postMessage';
92
+			$wp_customize->get_setting('blogname')->transport = 'postMessage';
93
+			$wp_customize->get_setting('blogdescription')->transport = 'postMessage';
94
+			$wp_customize->get_setting('background_color')->transport = 'postMessage';
95 95
 
96
-			$wp_customize->remove_control( 'background_color' );
96
+			$wp_customize->remove_control('background_color');
97 97
 		}
98 98
 
99 99
 		/**
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		 *
102 102
 		 * @since     1.0.0
103 103
 		 */		
104
-		private function add_panel( $slug, $args, $wp_customize ) {
104
+		private function add_panel($slug, $args, $wp_customize) {
105 105
 			$default_args = array(
106 106
 				'title' 		=> null,
107 107
 				'description' 	=> null,
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
 			$wp_customize->add_panel(
111 111
 				$slug,
112
-				array_merge( $default_args, $args )
112
+				array_merge($default_args, $args)
113 113
 			);
114 114
 		}
115 115
 
@@ -118,14 +118,14 @@  discard block
 block discarded – undo
118 118
 		 *
119 119
 		 * @since     1.0.0
120 120
 		 */		
121
-		private function add_section( $slug, $args, $wp_customize ) {
121
+		private function add_section($slug, $args, $wp_customize) {
122 122
 			$default_args = array(
123 123
 				'capability' => 'edit_theme_options', //Capability needed to tweak
124 124
 				'description' => null, //Descriptive tooltip
125 125
 			);
126 126
 
127
-			$wp_customize->add_section( $slug, 
128
-				array_merge( $default_args, $args )
127
+			$wp_customize->add_section($slug, 
128
+				array_merge($default_args, $args)
129 129
 			);
130 130
 		}
131 131
 
@@ -134,15 +134,15 @@  discard block
 block discarded – undo
134 134
 		 *
135 135
 		 * @since     1.0.0
136 136
 		 */		
137
-		private function add_setting( $slug, $args, $wp_customize ) {
138
-			$wp_customize->add_setting( $slug, //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record
139
-				array_merge( array(
137
+		private function add_setting($slug, $args, $wp_customize) {
138
+			$wp_customize->add_setting($slug, //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record
139
+				array_merge(array(
140 140
 					'default' 			=> null, //Default setting/value to save
141 141
 					'type' 				=> 'theme_mod', //Is this an 'option' or a 'theme_mod'?
142 142
 					'capability'		=> 'edit_theme_options', //Optional. Special permissions for accessing this setting.
143 143
 					'transport' 		=> 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)?
144 144
 					'sanitize_callback'	=> 'lsx_sanitize_choices'
145
-				), $args )
145
+				), $args)
146 146
 			);
147 147
 		}
148 148
 
@@ -151,28 +151,28 @@  discard block
 block discarded – undo
151 151
 		 *
152 152
 		 * @since     1.0.0
153 153
 		 */		
154
-		private function add_control( $slug, $args, $wp_customize ) {
154
+		private function add_control($slug, $args, $wp_customize) {
155 155
 			$default_args = array(
156 156
 
157 157
 			);
158 158
 
159
-			if( isset( $args['control'] ) && class_exists( $args['control'] )){
159
+			if (isset($args['control']) && class_exists($args['control'])) {
160 160
 				
161 161
 				$control_class = $args['control'];
162
-				unset( $args['control'] );
162
+				unset($args['control']);
163 163
 
164
-				$control = new $control_class( $wp_customize, $slug, array_merge( $default_args, $args ) );
165
-				$wp_customize->add_control( $control );
164
+				$control = new $control_class($wp_customize, $slug, array_merge($default_args, $args));
165
+				$wp_customize->add_control($control);
166 166
 			
167
-			}else{
167
+			} else {
168 168
 				
169
-				if( isset( $args['control'] ) ){
170
-					unset( $args['control'] );
169
+				if (isset($args['control'])) {
170
+					unset($args['control']);
171 171
 				}
172 172
 
173 173
 				$wp_customize->add_control(
174 174
 					$slug,
175
-					array_merge( $default_args, $args )
175
+					array_merge($default_args, $args)
176 176
 				);
177 177
 			}
178 178
 		}
Please login to merge, or discard this patch.