Completed
Push — master ( 55f18a...0fb8d7 )
by Fernando
05:05 queued 02:16
created
inc/google-font-collection.php 1 patch
Spacing   +7 added lines, -7 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,9 +106,9 @@  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
-			<link href="<?php echo esc_attr( $protocol ); ?>://fonts.googleapis.com/css?family=<?php echo esc_attr( $value->__get( "location" ) ); ?>" rel='stylesheet'>
111
+			<link href="<?php echo esc_attr($protocol); ?>://fonts.googleapis.com/css?family=<?php echo esc_attr($value->__get("location")); ?>" rel='stylesheet'>
112 112
 			<?php
113 113
 		}
114 114
 	}
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 			foreach ($this->fonts as $key => $value) 
126 126
 			{
127 127
 				?>
128
-				.<?php echo esc_attr( $value->__get( "cssClass" ) ); ?>{
129
-					font-family: <?php echo esc_attr( $value->__get( "cssDeclaration" ) ); ?>;
128
+				.<?php echo esc_attr($value->__get("cssClass")); ?>{
129
+					font-family: <?php echo esc_attr($value->__get("cssDeclaration")); ?>;
130 130
 				}
131 131
 				<?php
132 132
 			}
Please login to merge, or discard this patch.
page-templates/template-archives.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 
6 6
 	<?php lsx_content_wrap_before(); ?>
7 7
 
8
-	<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
8
+	<div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>">
9 9
 
10 10
 		<?php lsx_content_before(); ?>
11 11
 
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 			<?php lsx_content_top(); ?>
15 15
 
16
-			<?php while ( have_posts() ) : the_post(); ?>
16
+			<?php while (have_posts()) : the_post(); ?>
17 17
 
18 18
 				<?php lsx_entry_before(); ?>
19 19
 
@@ -22,28 +22,28 @@  discard block
 block discarded – undo
22 22
 					<?php lsx_entry_top(); ?>
23 23
 
24 24
 					<div class="entry-content">
25
-						<h2><?php esc_html_e( 'The Last 30 Posts', 'lsx' ); ?></h3>
25
+						<h2><?php esc_html_e('The Last 30 Posts', 'lsx'); ?></h3>
26 26
                         <ul>
27
-                            <?php $loop = new WP_Query( array( 'posts_per_page' => 30 ) ); ?>
28
-                            <?php if ( $loop->have_posts() ) { while ( $loop->have_posts() ) { $loop->the_post(); ?>
27
+                            <?php $loop = new WP_Query(array('posts_per_page' => 30)); ?>
28
+                            <?php if ($loop->have_posts()) { while ($loop->have_posts()) { $loop->the_post(); ?>
29 29
                                 <?php $loop->is_home = false; ?>
30
-                                <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> - <?php the_time( get_option( 'date_format' ) ); ?> - <?php echo esc_html( $post->comment_count ); ?> <?php esc_html_e( 'comments', 'lsx' ); ?></li>
30
+                                <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> - <?php the_time(get_option('date_format')); ?> - <?php echo esc_html($post->comment_count); ?> <?php esc_html_e('comments', 'lsx'); ?></li>
31 31
                             <?php } } wp_reset_postdata(); ?>
32 32
                         </ul>
33 33
 
34
-                        <h2><?php esc_html_e( 'Categories', 'lsx' ); ?></h3>
34
+                        <h2><?php esc_html_e('Categories', 'lsx'); ?></h3>
35 35
 
36 36
                         <ul>
37
-                            <?php wp_list_categories( 'title_li=&hierarchical=0&show_count=1' ); ?>
37
+                            <?php wp_list_categories('title_li=&hierarchical=0&show_count=1'); ?>
38 38
                         </ul>
39 39
 
40
-                        <h2><?php esc_html_e( 'Monthly Archives', 'lsx' ); ?></h3>
40
+                        <h2><?php esc_html_e('Monthly Archives', 'lsx'); ?></h3>
41 41
 
42 42
                         <ul>
43
-                            <?php wp_get_archives( 'type=monthly&show_post_count=1' ); ?>
43
+                            <?php wp_get_archives('type=monthly&show_post_count=1'); ?>
44 44
                         </ul>
45 45
 					</div><!-- .entry-content -->
46
-					<?php edit_post_link( esc_html__( 'Edit', 'lsx' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?>
46
+					<?php edit_post_link(esc_html__('Edit', 'lsx'), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>'); ?>
47 47
 
48 48
 					<?php lsx_entry_bottom(); ?>
49 49
 					
Please login to merge, or discard this patch.
page-templates/template-portfolio.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 
18 18
 			<?php lsx_content_top(); ?>
19 19
 
20
-			<?php if(have_posts()) { ?>
21
-				<?php while(have_posts()) { the_post(); ?>
20
+			<?php if (have_posts()) { ?>
21
+				<?php while (have_posts()) { the_post(); ?>
22 22
 					<div class="entry-content">
23 23
 						
24 24
 						<?php the_content(); ?>
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 			<?php } ?>
30 30
 
31 31
 			<?php
32
-				if ( get_query_var( 'paged' ) ) :
33
-					$paged = get_query_var( 'paged' );
34
-				elseif ( get_query_var( 'page' ) ) :
35
-					$paged = get_query_var( 'page' );
32
+				if (get_query_var('paged')) :
33
+					$paged = get_query_var('paged');
34
+				elseif (get_query_var('page')) :
35
+					$paged = get_query_var('page');
36 36
 				else :
37 37
 					$paged = 1;
38 38
 				endif;
@@ -41,18 +41,18 @@  discard block
 block discarded – undo
41 41
 					'post_type'      => 'jetpack-portfolio',
42 42
 					'posts_per_page' => 99,
43 43
 				);
44
-				$project_query = new WP_Query ( $args );
45
-				if ( post_type_exists( 'jetpack-portfolio' ) && $project_query -> have_posts() ) :
44
+				$project_query = new WP_Query($args);
45
+				if (post_type_exists('jetpack-portfolio') && $project_query -> have_posts()) :
46 46
 			?>
47 47
 			
48 48
 				<?php lsx_portfolio_sorter(); ?>
49 49
 
50 50
 				<div class="filter-items-wrapper lsx-portfolio-wrapper">
51 51
 					<div class="filter-items-container lsx-portfolio masonry">
52
-						<?php while ( $project_query -> have_posts() ) : $project_query -> the_post(); ?>
52
+						<?php while ($project_query -> have_posts()) : $project_query -> the_post(); ?>
53 53
 
54
-							<?php if(has_post_thumbnail()) { ?>
55
-								<?php get_template_part( 'content', 'portfolio' ); ?>
54
+							<?php if (has_post_thumbnail()) { ?>
55
+								<?php get_template_part('content', 'portfolio'); ?>
56 56
 							<?php } ?>
57 57
 
58 58
 						<?php endwhile; ?>
@@ -63,17 +63,17 @@  discard block
 block discarded – undo
63 63
 
64 64
 				<section class="no-results not-found">
65 65
 					<header class="page-header">
66
-						<h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'lsx' ); ?></h1>
66
+						<h1 class="page-title"><?php esc_html_e('Nothing Found', 'lsx'); ?></h1>
67 67
 					</header><!-- .page-header -->
68 68
 
69 69
 					<div class="page-content">
70
-						<?php if ( current_user_can( 'publish_posts' ) ) : ?>
70
+						<?php if (current_user_can('publish_posts')) : ?>
71 71
 
72
-							<p><?php esc_html_e( 'Ready to publish your first project?', 'lsx' ); ?> <a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=jetpack-portfolio' ) ) ?>"><?php esc_html_e( 'Get started here', 'lsx' ); ?></a></p>
72
+							<p><?php esc_html_e('Ready to publish your first project?', 'lsx'); ?> <a href="<?php echo esc_url(admin_url('post-new.php?post_type=jetpack-portfolio')) ?>"><?php esc_html_e('Get started here', 'lsx'); ?></a></p>
73 73
 
74 74
 						<?php else : ?>
75 75
 
76
-							<p><?php esc_html_e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'lsx' ); ?></p>
76
+							<p><?php esc_html_e('It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'lsx'); ?></p>
77 77
 							<?php get_search_form(); ?>
78 78
 
79 79
 						<?php endif; ?>
Please login to merge, or discard this patch.
searchform.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,19 +8,19 @@
 block discarded – undo
8 8
 // This is to help the customizer function better
9 9
 $style = '';
10 10
 
11
-if ( is_customize_preview() ) {
12
-	$search_form = get_theme_mod( 'lsx_header_search', 0 );
11
+if (is_customize_preview()) {
12
+	$search_form = get_theme_mod('lsx_header_search', 0);
13 13
 	
14
-	if ( ! $search_form ) {
14
+	if ( ! $search_form) {
15 15
 		$style = 'display:none;';
16 16
 	}
17 17
 }
18 18
 ?>
19 19
 
20
-<form role="search" method="get" style="<?php echo esc_attr( $style ); ?>" class="search-form form-inline" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
20
+<form role="search" method="get" style="<?php echo esc_attr($style); ?>" class="search-form form-inline" id="searchform" action="<?php echo esc_url(home_url('/')); ?>">
21 21
 	<div class="input-group">
22
-		<input type="search" value="<?php if (is_search()) { echo get_search_query(); } ?>" name="s" class="search-field form-control" placeholder="<?php esc_attr_e( 'Search', 'lsx' ); ?> <?php echo esc_attr( get_bloginfo( 'name' ) ); ?>">
23
-		<label class="hide"><?php esc_attr_e( 'Search for:', 'lsx' ); ?></label>
22
+		<input type="search" value="<?php if (is_search()) { echo get_search_query(); } ?>" name="s" class="search-field form-control" placeholder="<?php esc_attr_e('Search', 'lsx'); ?> <?php echo esc_attr(get_bloginfo('name')); ?>">
23
+		<label class="hide"><?php esc_attr_e('Search for:', 'lsx'); ?></label>
24 24
 		<span class="input-group-btn">
25 25
 			<button type="submit" class="search-submit btn btn-default"><span class="fa fa-search"></span></button>
26 26
 		</span>
Please login to merge, or discard this patch.
inc/template-tags.php 1 patch
Spacing   +165 added lines, -165 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
-  echo wp_kses_post( $output );
47
+  echo wp_kses_post($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
-			esc_html_x( 'Posted on:', 'Used before publish date.', 'lsx' ),
115
-			esc_url( get_permalink() ),
116
-			wp_kses_post( $time_string )
113
+		printf('<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>',
114
+			esc_html_x('Posted on:', 'Used before publish date.', 'lsx'),
115
+			esc_url(get_permalink()),
116
+			wp_kses_post($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
-			esc_html_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
+			esc_html_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 wp_kses_post( implode( ', ', $cats ) ); ?></span>
151
+			<span class="post-meta-categories"><span><?php esc_html_e('Posted in:', 'lsx'); ?></span> <?php echo wp_kses_post(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,45 +238,45 @@  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 esc_html_e( 'Client','lsx' ); ?></span>
250
-						<span><?php echo esc_html( $client ); ?></span>
249
+						<span><span class="fa fa-user"></span><?php esc_html_e('Client', 'lsx'); ?></span>
250
+						<span><?php echo esc_html($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 esc_html_e( 'Industry', 'lsx' ); ?></span>
261
-						<?php echo wp_kses_post( $portfolio_type ); ?>
260
+						<span><span class="fa fa-folder-open"></span><?php esc_html_e('Industry', 'lsx'); ?></span>
261
+						<?php echo wp_kses_post($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 esc_html_e( 'Services', 'lsx' ); ?></span>
270
-						<?php echo wp_kses_post( $services ); ?>
269
+						<span><span class="fa fa-cog"></span><?php esc_html_e('Services', 'lsx'); ?></span>
270
+						<?php echo wp_kses_post($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 esc_html_e( 'Website', 'lsx' ); ?></span>
279
-						<a target="_blank" href="<?php echo esc_url( $website ); ?>"><?php echo esc_html( $website ) ?></a>
278
+						<span><span class="fa fa-link"></span><?php esc_html_e('Website', 'lsx'); ?></span>
279
+						<a target="_blank" href="<?php echo esc_url($website); ?>"><?php echo esc_html($website) ?></a>
280 280
 					</div>				
281 281
 			<?php }	?>
282 282
 
@@ -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 wp_kses_post( gallery_shortcode( array( 'size' => 'full', 'ids' => implode( ',', $media_array ) ) ) );
307
+			if ( ! empty($media_array)) {
308
+				echo wp_kses_post(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,33 +320,33 @@  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> '.esc_html__( 'Older posts', 'lsx' ),
335
-				'previous' 	=> esc_html__( 'Newer posts', 'lsx' ).' <span class="meta-nav">&rarr;</span>',
336
-				'title' 	=> esc_html__( 'Posts navigation', 'lsx' )
334
+				'next' 		=> '<span class="meta-nav">&larr;</span> ' . esc_html__('Older posts', 'lsx'),
335
+				'previous' 	=> esc_html__('Newer posts', 'lsx') . ' <span class="meta-nav">&rarr;</span>',
336
+				'title' 	=> esc_html__('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
 			<nav class="navigation paging-navigation" role="navigation">
341 341
 				<div class="lsx-breaker"></div>
342
-				<h1 class="screen-reader-text"><?php echo esc_html( $labels['title'] ); ?></h1>
342
+				<h1 class="screen-reader-text"><?php echo esc_html($labels['title']); ?></h1>
343 343
 				<div class="nav-links">
344
-					<?php if ( get_next_posts_link() ) : ?>
345
-					<div class="nav-previous"><?php next_posts_link( $labels['next'] ); ?></div>
344
+					<?php if (get_next_posts_link()) : ?>
345
+					<div class="nav-previous"><?php next_posts_link($labels['next']); ?></div>
346 346
 					<?php endif; ?>
347 347
 		
348
-					<?php if ( get_previous_posts_link() ) : ?>
349
-					<div class="nav-next"><?php previous_posts_link( $labels['previous'] ); ?></div>
348
+					<?php if (get_previous_posts_link()) : ?>
349
+					<div class="nav-next"><?php previous_posts_link($labels['previous']); ?></div>
350 350
 					<?php endif; ?>
351 351
 					
352 352
 					<div class="clearfix"></div>
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 	}
358 358
 endif;
359 359
 
360
-if ( ! function_exists( 'lsx_post_nav' ) ) :
360
+if ( ! function_exists('lsx_post_nav')) :
361 361
 /**
362 362
  * Display navigation to next/previous post when applicable.
363 363
  *
@@ -365,10 +365,10 @@  discard block
 block discarded – undo
365 365
  */
366 366
 function lsx_post_nav() {
367 367
 	// Don't print empty markup if there's nowhere to navigate.
368
-	$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
369
-	$next     = get_adjacent_post( false, '', false );
368
+	$previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true);
369
+	$next     = get_adjacent_post(false, '', false);
370 370
 
371
-	if ( ! $next && ! $previous ) {
371
+	if ( ! $next && ! $previous) {
372 372
 		return;
373 373
 	}
374 374
 	?>
@@ -378,14 +378,14 @@  discard block
 block discarded – undo
378 378
 		<div class="nav-links pager row">
379 379
 
380 380
 			<?php
381
-				$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>' );
382
-				$previous_post = str_replace('<a','<a',$previous_post);
383
-				echo wp_kses_post( $previous_post );
381
+				$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>');
382
+				$previous_post = str_replace('<a', '<a', $previous_post);
383
+				echo wp_kses_post($previous_post);
384 384
 			?>
385 385
 			<?php
386
-				$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>' );
387
-				$next_post = str_replace('<a','<a',$next_post);
388
-				echo wp_kses_post( $next_post );
386
+				$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>');
387
+				$next_post = str_replace('<a', '<a', $next_post);
388
+				echo wp_kses_post($next_post);
389 389
 			?>
390 390
 
391 391
 		</div><!-- .nav-links -->
@@ -401,16 +401,16 @@  discard block
 block discarded – undo
401 401
  * @subpackage	template-tags
402 402
  * @category	header
403 403
  */
404
-if(!function_exists('lsx_site_identity')){
405
-	function lsx_site_identity(){
404
+if ( ! function_exists('lsx_site_identity')) {
405
+	function lsx_site_identity() {
406 406
 
407
-		if ( function_exists('has_custom_logo') && has_custom_logo() ) {
407
+		if (function_exists('has_custom_logo') && has_custom_logo()) {
408 408
 			the_custom_logo();
409
-		}elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) {
409
+		}elseif (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) {
410 410
 			jetpack_the_site_logo();
411
-		}else{
411
+		} else {
412 412
 			// shouldn't show both together.. its just strange
413
-			if(true == get_theme_mod('site_logo_header_text',1)){
413
+			if (true == get_theme_mod('site_logo_header_text', 1)) {
414 414
 				lsx_site_title();
415 415
 			}
416 416
 		}
@@ -425,17 +425,17 @@  discard block
 block discarded – undo
425 425
  * @subpackage	template-tags
426 426
  * @category	navigation
427 427
  */
428
-if(!function_exists('lsx_navbar_header')){
429
-	function lsx_navbar_header(){ ?>
428
+if ( ! function_exists('lsx_navbar_header')) {
429
+	function lsx_navbar_header() { ?>
430 430
 	   	<div class="navbar-header" itemscope itemtype="http://schema.org/WebPage">
431 431
 	   	
432 432
 	   		<?php 
433
-	   		$nav_menu = get_theme_mod('nav_menu_locations',false);
433
+	   		$nav_menu = get_theme_mod('nav_menu_locations', false);
434 434
 			//print_r(get_nav_menu_locations());
435 435
 
436
-	   		if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?>
436
+	   		if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?>
437 437
 		   		<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".primary-navbar">
438
-		        	<span class="sr-only"><?php esc_html_e( 'Toggle navigation', 'lsx' ); ?></span>
438
+		        	<span class="sr-only"><?php esc_html_e('Toggle navigation', 'lsx'); ?></span>
439 439
 		        	<span class="icon-bar"></span>
440 440
 		        	<span class="icon-bar"></span>
441 441
 		        	<span class="icon-bar"></span>
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 	<?php }
448 448
 }
449 449
 //the if statement is for backwards compatability with previous versions of the theme.
450
-add_action('lsx_nav_before','lsx_navbar_header');
450
+add_action('lsx_nav_before', 'lsx_navbar_header');
451 451
 
452 452
 /**
453 453
  * Outputs the Nav Menu
@@ -456,16 +456,16 @@  discard block
 block discarded – undo
456 456
  * @subpackage	template-tags
457 457
  * @category	navigation
458 458
  */
459
-if(!function_exists('lsx_nav_menu')){
460
-	function lsx_nav_menu(){
461
-		$nav_menu = get_theme_mod('nav_menu_locations',false);
459
+if ( ! function_exists('lsx_nav_menu')) {
460
+	function lsx_nav_menu() {
461
+		$nav_menu = get_theme_mod('nav_menu_locations', false);
462 462
 		
463 463
 		//print_r(get_nav_menu_locations());
464 464
 
465
-	    if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?>
465
+	    if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?>
466 466
 			<nav class="primary-navbar collapse navbar-collapse">
467 467
 		    	<?php
468
-				wp_nav_menu( array(
468
+				wp_nav_menu(array(
469 469
 					'theme_location' => 'primary',
470 470
 					'menu' => $nav_menu['primary'],
471 471
 					'depth' => 3,
@@ -475,9 +475,9 @@  discard block
 block discarded – undo
475 475
 				);
476 476
 				?>
477 477
 		   		</nav>
478
-	    <?php } elseif(is_customize_preview()) { ?>
478
+	    <?php } elseif (is_customize_preview()) { ?>
479 479
 	    		<nav class="primary-navbar collapse navbar-collapse">
480
-	    			<div class="alert alert-info" role="alert"><?php esc_html_e( 'Create a menu and assign it here via the "Navigation" panel.', 'lsx' );?></div>
480
+	    			<div class="alert alert-info" role="alert"><?php esc_html_e('Create a menu and assign it here via the "Navigation" panel.', 'lsx'); ?></div>
481 481
 	    		</nav>
482 482
 	    </div>
483 483
 	  	<?php }
@@ -491,9 +491,9 @@  discard block
 block discarded – undo
491 491
  * @subpackage	template-tags
492 492
  * @category	sitemap
493 493
  */
494
-function lsx_sitemap_pages(){
494
+function lsx_sitemap_pages() {
495 495
 	$posts_per_page = get_option('posts_per_page');
496
-	if(false == $posts_per_page){
496
+	if (false == $posts_per_page) {
497 497
 		$posts_per_page = 10;
498 498
 	}
499 499
 	
@@ -504,13 +504,13 @@  discard block
 block discarded – undo
504 504
 		'post_type'		=>	'page',
505 505
 	);
506 506
 	$pages = new WP_Query($page_args);
507
-	if($pages->have_posts()){
507
+	if ($pages->have_posts()) {
508 508
 
509
-		echo '<h2>' . esc_html__( 'Pages', 'lsx' ) . '</h2>';
509
+		echo '<h2>' . esc_html__('Pages', 'lsx') . '</h2>';
510 510
 
511 511
 		echo '<ul>';
512
-		while($pages->have_posts()){ $pages->the_post();
513
-			echo '<li class="page_item page-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>';
512
+		while ($pages->have_posts()) { $pages->the_post();
513
+			echo '<li class="page_item page-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>';
514 514
 		}
515 515
 		echo '</ul>';
516 516
 		
@@ -525,10 +525,10 @@  discard block
 block discarded – undo
525 525
  * @subpackage	template-tags
526 526
  * @category	sitemap
527 527
  */
528
-function lsx_sitemap_custom_post_type(){
528
+function lsx_sitemap_custom_post_type() {
529 529
 	
530 530
 	$posts_per_page = get_option('posts_per_page');
531
-	if(false == $posts_per_page){
531
+	if (false == $posts_per_page) {
532 532
 		$posts_per_page = 10;
533 533
 	}
534 534
 	
@@ -536,8 +536,8 @@  discard block
 block discarded – undo
536 536
 			'public'				=> true,
537 537
 			'_builtin' 				=> false
538 538
 	);
539
-	$post_types = get_post_types($args , 'names');
540
-	foreach($post_types as $post_type){	
539
+	$post_types = get_post_types($args, 'names');
540
+	foreach ($post_types as $post_type) {	
541 541
 
542 542
 		$post_type_args = array(
543 543
 				'post_type'		=>	'page',
@@ -548,19 +548,19 @@  discard block
 block discarded – undo
548 548
 		$post_type_items = new WP_Query($post_type_args);
549 549
 		
550 550
 		$post_type_object = get_post_type_object($post_type);
551
-		if(null != $post_type_object){
551
+		if (null != $post_type_object) {
552 552
 			$title = $post_type_object->labels->name;
553
-		}else{
553
+		} else {
554 554
 			$title = ucwords($post_type);
555 555
 		}
556 556
 		
557
-		if($post_type_items->have_posts()){
557
+		if ($post_type_items->have_posts()) {
558 558
 	
559
-			echo '<h2>' . esc_html( $title ) . '</h2>';
559
+			echo '<h2>' . esc_html($title) . '</h2>';
560 560
 	
561 561
 			echo '<ul>';
562
-			while($post_type_items->have_posts()){ $post_type_items->the_post();
563
-				echo '<li class="' . esc_attr( get_post_type() ) . '_item ' . esc_attr( get_post_type() ) . '-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>';
562
+			while ($post_type_items->have_posts()) { $post_type_items->the_post();
563
+				echo '<li class="' . esc_attr(get_post_type()) . '_item ' . esc_attr(get_post_type()) . '-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>';
564 564
 			}
565 565
 			echo '</ul>';
566 566
 	
@@ -576,20 +576,20 @@  discard block
 block discarded – undo
576 576
  * @subpackage	template-tags
577 577
  * @category	sitemap
578 578
  */
579
-function lsx_sitemap_taxonomy_clouds(){
579
+function lsx_sitemap_taxonomy_clouds() {
580 580
 
581
-		$taxonomy_args =  array(
581
+		$taxonomy_args = array(
582 582
 			'public'				=> true,
583 583
 			'_builtin' 				=> false
584 584
 		);
585 585
 		$taxonomies = get_taxonomies($taxonomy_args);
586
-		if(!empty($taxonomies)){
587
-			foreach($taxonomies as $taxonomy_id => $taxonomy) {
586
+		if ( ! empty($taxonomies)) {
587
+			foreach ($taxonomies as $taxonomy_id => $taxonomy) {
588 588
 
589
-				$tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id,'echo'=>false));
590
-				if(null != $tag_cloud){
591
-					echo '<h2>' . esc_html( $taxonomy ) . '</h2>';
592
-					echo '<aside id="' . esc_attr( $taxonomy_id ) . '" class="widget widget_' . esc_attr( $taxonomy_id ) . '">' . esc_html( $tag_cloud ) . '</aside>';
589
+				$tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id, 'echo'=>false));
590
+				if (null != $tag_cloud) {
591
+					echo '<h2>' . esc_html($taxonomy) . '</h2>';
592
+					echo '<aside id="' . esc_attr($taxonomy_id) . '" class="widget widget_' . esc_attr($taxonomy_id) . '">' . esc_html($tag_cloud) . '</aside>';
593 593
 		        }
594 594
 	        }
595 595
         } 
@@ -602,15 +602,15 @@  discard block
 block discarded – undo
602 602
  * @subpackage	hooks
603 603
  * @category	forms
604 604
  */
605
-add_action( 'lsx_footer_before', 'lsx_footer_subscription_cta', 10 );
605
+add_action('lsx_footer_before', 'lsx_footer_subscription_cta', 10);
606 606
 function lsx_footer_subscription_cta() {
607
-	if(!function_exists('lsx_is_form_enabled')){ return; }
607
+	if ( ! function_exists('lsx_is_form_enabled')) { return; }
608 608
 	$subscribe_form_id = lsx_is_form_enabled('subscribe');
609
-	if(false == $subscribe_form_id) { return; }
609
+	if (false == $subscribe_form_id) { return; }
610 610
 
611 611
 	//add Caldera Forms Fields Scripts
612
-	if( defined( 'CFCORE_VER' ) ){
613
-		wp_enqueue_script( 'cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER );
612
+	if (defined('CFCORE_VER')) {
613
+		wp_enqueue_script('cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER);
614 614
 	}
615 615
 
616 616
 	?>
@@ -618,8 +618,8 @@  discard block
 block discarded – undo
618 618
 		<div class="container">
619 619
 			<div class="row">
620 620
 				<div class="col-md-12">
621
-					<h2><?php esc_html_e( 'Subscribe to Our Newsletter', 'lsx' ); ?></h2>
622
-					<?php echo do_shortcode( '[caldera_form id="'.$subscribe_form_id.'"]' ); ?>
621
+					<h2><?php esc_html_e('Subscribe to Our Newsletter', 'lsx'); ?></h2>
622
+					<?php echo do_shortcode('[caldera_form id="' . $subscribe_form_id . '"]'); ?>
623 623
 				</div>
624 624
 			</div>
625 625
 		</div>
@@ -634,14 +634,14 @@  discard block
 block discarded – undo
634 634
  * @subpackage	hooks
635 635
  * @category	menu
636 636
  */
637
-add_action( 'lsx_header_top', 'lsx_add_top_menu' );
637
+add_action('lsx_header_top', 'lsx_add_top_menu');
638 638
 function lsx_add_top_menu() {
639 639
 	if (has_nav_menu('top-menu')) { ?>
640 640
 		<div id="top-menu" class="<?php lsx_top_menu_classes(); ?>">
641 641
 			<div class="container">
642 642
 				<nav class="top-menu">
643 643
 		    		<?php
644
-		    			wp_nav_menu( array(
644
+		    			wp_nav_menu(array(
645 645
 							'theme_location' => 'top-menu',
646 646
 							'walker' => new Lsx_Bootstrap_Navwalker())
647 647
 						);
@@ -659,24 +659,24 @@  discard block
 block discarded – undo
659 659
  * @subpackage	template-tag
660 660
  * @category 	forms
661 661
  */
662
-if ( class_exists('Caldera_Forms') && !function_exists( 'lsx_is_form_enabled' ) ) {
662
+if (class_exists('Caldera_Forms') && ! function_exists('lsx_is_form_enabled')) {
663 663
 	function lsx_is_form_enabled($slug = false) {
664
-		if(false == $slug){ return false; }
664
+		if (false == $slug) { return false; }
665 665
 	
666 666
 		$match = false;
667
-		$forms = get_option( '_caldera_forms' , false );
668
-		if(false !== $forms ) {
669
-			foreach($forms as $form_id=>$form_maybe){
670
-				if( trim(strtolower($slug)) == strtolower($form_maybe['name']) ){
667
+		$forms = get_option('_caldera_forms', false);
668
+		if (false !== $forms) {
669
+			foreach ($forms as $form_id=>$form_maybe) {
670
+				if (trim(strtolower($slug)) == strtolower($form_maybe['name'])) {
671 671
 					$match = $form_id;
672 672
 					break;
673 673
 				}
674 674
 			}
675 675
 		}
676
-		if( false === $match ){
677
-			$is_form = Caldera_Forms::get_form( strtolower( $slug ) );
678
-			if( !empty( $is_form ) ){
679
-				return strtolower( $slug );
676
+		if (false === $match) {
677
+			$is_form = Caldera_Forms::get_form(strtolower($slug));
678
+			if ( ! empty($is_form)) {
679
+				return strtolower($slug);
680 680
 			}
681 681
 		}
682 682
 	
@@ -692,10 +692,10 @@  discard block
 block discarded – undo
692 692
  * @category 	urls
693 693
  */
694 694
 function lsx_get_my_url() {
695
-	if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) )
695
+	if ( ! preg_match('/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches))
696 696
 		return false;
697 697
 
698
-	return esc_url_raw( $matches[1] );
698
+	return esc_url_raw($matches[1]);
699 699
 }
700 700
 
701 701
 /**
@@ -705,19 +705,19 @@  discard block
 block discarded – undo
705 705
  * @subpackage 	extras
706 706
  * @category 	urls
707 707
  */
708
-function lsx_get_template_part($slug,$part) {
708
+function lsx_get_template_part($slug, $part) {
709 709
 	$template = array();
710 710
 	$part = (string) $part;
711
-	if ( '' !== $part ){
711
+	if ('' !== $part) {
712 712
 		$template = "{$slug}-{$part}.php";
713
-	}else{
713
+	} else {
714 714
 		$template = "{$slug}.php";
715 715
 	}
716
-	$file_path = apply_filters('lsx_content_path',false,$slug,$part);
716
+	$file_path = apply_filters('lsx_content_path', false, $slug, $part);
717 717
 
718
-	if ( false !== $file_path && '' == locate_template( array( $template ) ) && file_exists( $file_path.$template) ) {
719
-		load_template( $file_path.$template, false );
720
-	}else{
721
-		get_template_part($slug,$part);
718
+	if (false !== $file_path && '' == locate_template(array($template)) && file_exists($file_path . $template)) {
719
+		load_template($file_path . $template, false);
720
+	} else {
721
+		get_template_part($slug, $part);
722 722
 	}
723 723
 }
724 724
\ No newline at end of file
Please login to merge, or discard this patch.
inc/comment-walker.php 1 patch
Spacing   +7 added lines, -7 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,7 +29,7 @@  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
     }?>
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
   }
41 41
 
42 42
   function end_el(&$output, $comment, $depth = 0, $args = array()) {
43
-    if (!empty($args['end-callback'])) {
43
+    if ( ! empty($args['end-callback'])) {
44 44
       call_user_func($args['end-callback'], $comment, $args, $depth);
45 45
       return;
46 46
     }
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
  * @subpackage layout
63 63
  */
64 64
 function lsx_comment_form_fields_filter($fields) {	
65
-	foreach($fields as &$field){
66
-		if(stristr('class=', $field)){
65
+	foreach ($fields as &$field) {
66
+		if (stristr('class=', $field)) {
67 67
 			$field = str_replace('class="', 'class="form-control ', $field);
68
-		}else{
68
+		} else {
69 69
 			$field = str_replace('<input', '<input class="form-control" ', $field);
70 70
 		}
71 71
 	}
72 72
 	return $fields;
73 73
 }
74
-add_filter( 'comment_form_default_fields', 'lsx_comment_form_fields_filter');
74
+add_filter('comment_form_default_fields', 'lsx_comment_form_fields_filter');
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,53 +1,53 @@  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
     $sidebar_id = $params[0]['id'];
49 49
 
50
-    if ( 'sidebar-footer' == $sidebar_id ) {
50
+    if ('sidebar-footer' == $sidebar_id) {
51 51
         $total_widgets = wp_get_sidebars_widgets();
52 52
         $sidebar_widgets = count($total_widgets[$sidebar_id]);
53 53
 
@@ -56,4 +56,4 @@  discard block
 block discarded – undo
56 56
 
57 57
     return $params;
58 58
 }
59
-add_filter( 'dynamic_sidebar_params', 'lsx_sidebar_footer_params' ); 
60 59
\ No newline at end of file
60
+add_filter('dynamic_sidebar_params', 'lsx_sidebar_footer_params'); 
61 61
\ No newline at end of file
Please login to merge, or discard this patch.
inc/extras.php 1 patch
Spacing   +95 added lines, -95 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,11 +133,11 @@  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
-				$temp_url = wp_get_attachment_image_src( $id, 'full' );
140
-				if ( array_shift( $temp_url ) === $url ) {
139
+				$temp_url = wp_get_attachment_image_src($id, 'full');
140
+				if (array_shift($temp_url) === $url) {
141 141
 					return $id;
142 142
 				}
143 143
 			}
@@ -150,8 +150,8 @@  discard block
 block discarded – undo
150 150
 		}
151 151
 		foreach ($ids as $id) {
152 152
 			$meta = wp_get_attachment_metadata($id);
153
-			foreach ( $meta['sizes'] as $size => $values ) {
154
-				if ( $values['file'] === $file && array_shift( wp_get_attachment_image_src( $id, $size ) ) === $url ) {
153
+			foreach ($meta['sizes'] as $size => $values) {
154
+				if ($values['file'] === $file && array_shift(wp_get_attachment_image_src($id, $size)) === $url) {
155 155
 					return $id;
156 156
 				}
157 157
 			}
@@ -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 ( 'lsx-thumbnail-wide' === $size || 'thumbnail' === $size ) {
204
+	if ('lsx-thumbnail-wide' === $size || 'thumbnail' === $size) {
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 208
 	} else {
209 209
 		$srcset = true;
210
-		$img = wp_get_attachment_image_srcset($post_thumbnail_id,$size);
211
-		if ( false == $img ) {
210
+		$img = wp_get_attachment_image_srcset($post_thumbnail_id, $size);
211
+		if (false == $img) {
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
-	if ( $srcset ) {
218
-		$img = '<img alt="'.get_the_title(get_the_ID()).'" class="attachment-responsive wp-post-image lsx-responsive" srcset="'.$img.'" />';
217
+	if ($srcset) {
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,13 +241,13 @@  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
-		$post_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src ) );
250
-		wp_cache_set( $image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600 );
249
+		$post_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src));
250
+		wp_cache_set($image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600);
251 251
 	}
252 252
 
253 253
 	return $post_id;
@@ -261,28 +261,28 @@  discard block
 block discarded – undo
261 261
  * @subpackage extras
262 262
  * @category banner
263 263
  */
264
-if (!function_exists('lsx_page_banner')) {
264
+if ( ! function_exists('lsx_page_banner')) {
265 265
 	function lsx_page_banner() {
266 266
 
267
-		$post_types = array('page','post');
268
-		$post_types = apply_filters('lsx_allowed_post_type_banners',$post_types);	
267
+		$post_types = array('page', 'post');
268
+		$post_types = apply_filters('lsx_allowed_post_type_banners', $post_types);	
269 269
 		
270
-		if ( (is_singular($post_types) && has_post_thumbnail())
271
-		 || (is_singular('jetpack-portfolio')) ) { ?>
270
+		if ((is_singular($post_types) && has_post_thumbnail())
271
+		 || (is_singular('jetpack-portfolio'))) { ?>
272 272
 	        
273 273
 	        <?php 
274 274
 	        	$bg_image = '';
275
-	        	if(has_post_thumbnail()){
276
-	        		$bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),'full');
275
+	        	if (has_post_thumbnail()) {
276
+	        		$bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full');
277 277
 	        		$bg_image = $bg_image[0];
278 278
 	        	}
279 279
 	        ?>
280 280
 
281
-	   		<?php if ( ! empty( $bg_image ) ) : ?>
281
+	   		<?php if ( ! empty($bg_image)) : ?>
282 282
 	        
283 283
 	        <div class="page-banner-wrap">
284 284
 		        <div class="page-banner">
285
-		        	<div class="page-banner-image" style="background-image:url(<?php echo esc_attr( $bg_image ); ?>);"></div>
285
+		        	<div class="page-banner-image" style="background-image:url(<?php echo esc_attr($bg_image); ?>);"></div>
286 286
 
287 287
 		        	<div class="container">
288 288
 			            <header class="page-header">
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 	    <?php } 
299 299
 	}
300 300
 }
301
-add_action( 'lsx_header_after', 'lsx_page_banner' );
301
+add_action('lsx_header_after', 'lsx_page_banner');
302 302
 
303 303
 
304 304
 /**
@@ -308,43 +308,43 @@  discard block
 block discarded – undo
308 308
  * @subpackage extras
309 309
  * @category mobile
310 310
  */
311
-function lsx_allow_sms_protocol( $protocols ) {
311
+function lsx_allow_sms_protocol($protocols) {
312 312
     $protocols[] = 'sms';
313 313
     return $protocols;
314 314
 }
315
-add_filter( 'kses_allowed_protocols', 'lsx_allow_sms_protocol' );
315
+add_filter('kses_allowed_protocols', 'lsx_allow_sms_protocol');
316 316
 
317 317
 
318 318
 /**
319 319
  * Adding browser and user-agent classes to body
320 320
  */
321 321
 function mv_browser_body_class($classes) {
322
-		$http_user_agent = sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) );
323
-		$http_user_agent = ! empty( $http_user_agent ) ? $http_user_agent : '';
322
+		$http_user_agent = sanitize_text_field(wp_unslash($_SERVER['HTTP_USER_AGENT']));
323
+		$http_user_agent = ! empty($http_user_agent) ? $http_user_agent : '';
324 324
 
325 325
         global $is_lynx, $is_gecko, $is_ie, $is_opera, $is_ns4, $is_safari, $is_chrome, $is_iphone;
326
-        if($is_lynx) $classes[] = 'lynx';
327
-        elseif($is_gecko) $classes[] = 'gecko';
328
-        elseif($is_opera) $classes[] = 'opera';
329
-        elseif($is_ns4) $classes[] = 'ns4';
330
-        elseif($is_safari) $classes[] = 'safari';
331
-        elseif($is_chrome) $classes[] = 'chrome';
332
-        elseif($is_ie) {
326
+        if ($is_lynx) $classes[] = 'lynx';
327
+        elseif ($is_gecko) $classes[] = 'gecko';
328
+        elseif ($is_opera) $classes[] = 'opera';
329
+        elseif ($is_ns4) $classes[] = 'ns4';
330
+        elseif ($is_safari) $classes[] = 'safari';
331
+        elseif ($is_chrome) $classes[] = 'chrome';
332
+        elseif ($is_ie) {
333 333
                 $classes[] = 'ie';
334
-                if(preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $http_user_agent, $browser_version))
335
-                $classes[] = 'ie'.$browser_version[1];
334
+                if (preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $http_user_agent, $browser_version))
335
+                $classes[] = 'ie' . $browser_version[1];
336 336
         } else $classes[] = 'unknown';
337
-        if($is_iphone) $classes[] = 'iphone';
338
-        if ( stristr( $http_user_agent, "mac") ) {
337
+        if ($is_iphone) $classes[] = 'iphone';
338
+        if (stristr($http_user_agent, "mac")) {
339 339
                  $classes[] = 'osx';
340
-           } elseif ( stristr( $http_user_agent, "linux") ) {
340
+           } elseif (stristr($http_user_agent, "linux")) {
341 341
                  $classes[] = 'linux';
342
-           } elseif ( stristr( $http_user_agent, "windows") ) {
342
+           } elseif (stristr($http_user_agent, "windows")) {
343 343
                  $classes[] = 'windows';
344 344
            }
345 345
         return $classes;
346 346
 }
347
-add_filter('body_class','mv_browser_body_class');
347
+add_filter('body_class', 'mv_browser_body_class');
348 348
 
349 349
 
350 350
 /**
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
  * @param		$form		Object
358 358
  * @return		String
359 359
  */
360
-function lsx_form_submit_button($button, $form){
360
+function lsx_form_submit_button($button, $form) {
361 361
 	return "<button class='btn btn-primary' id='gform_submit_button_{$form["id"]}'><span>Submit</span></button>";
362 362
 }
363 363
 add_filter("gform_submit_button", "lsx_form_submit_button", 10, 2);
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 	//return ' ... <a class="moretag" href="'. get_permalink($post->ID) . '">'.__('Continue reading','lsx').'</a>';
372 372
 	return '...';
373 373
 }
374
-add_filter( 'excerpt_more', 'lsx_excerpt_more' );
374
+add_filter('excerpt_more', 'lsx_excerpt_more');
375 375
 
376 376
 
377 377
 /**
@@ -380,44 +380,44 @@  discard block
 block discarded – undo
380 380
 function lsx_the_excerpt_filter($excerpt) {
381 381
 	$show_full_content = has_post_format(apply_filters('lsx_the_excerpt_filter_post_types', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio')));
382 382
 	
383
-	if (!$show_full_content) {
384
-		if ('' !== $excerpt  && !stristr($excerpt, 'moretag')) {
385
-			$pagination = wp_link_pages( array(
383
+	if ( ! $show_full_content) {
384
+		if ('' !== $excerpt && ! stristr($excerpt, 'moretag')) {
385
+			$pagination = wp_link_pages(array(
386 386
 							'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
387 387
 							'after' => '</div></div>',
388 388
 							'link_before' => '<span>',
389 389
 							'link_after' => '</span>',
390 390
 							'echo' => 0
391
-						) );
391
+						));
392 392
 
393
-			if ( ! empty( $pagination ) ) {
393
+			if ( ! empty($pagination)) {
394 394
 				$excerpt .= $pagination;
395 395
 			}
396 396
 			else {
397
-				$excerpt .= '<p><a class="moretag" href="'.get_permalink().'">'.__('Continue reading','lsx').'</a></p>';
397
+				$excerpt .= '<p><a class="moretag" href="' . get_permalink() . '">' . __('Continue reading', 'lsx') . '</a></p>';
398 398
 			}
399 399
 		}
400 400
 	}
401 401
 
402 402
 	return $excerpt;
403 403
 }
404
-add_filter( 'the_excerpt', 'lsx_the_excerpt_filter' , 1 , 20 );
404
+add_filter('the_excerpt', 'lsx_the_excerpt_filter', 1, 20);
405 405
 
406 406
 
407 407
 /**
408 408
  * Allow HTML tags in excerpt
409 409
  */
410
-if ( ! function_exists( 'wpse_custom_wp_trim_excerpt' ) ) {
410
+if ( ! function_exists('wpse_custom_wp_trim_excerpt')) {
411 411
 	function wpse_custom_wp_trim_excerpt($wpse_excerpt) {
412 412
 		global $post;
413 413
 		$raw_excerpt = $wpse_excerpt;
414 414
 
415
-		if ( '' == $wpse_excerpt ) {
415
+		if ('' == $wpse_excerpt) {
416 416
 			$wpse_excerpt = get_the_content('');
417 417
 			$show_full_content = has_post_format(array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio'));
418 418
 
419
-			if (!$show_full_content) {
420
-				$wpse_excerpt = strip_shortcodes( $wpse_excerpt );
419
+			if ( ! $show_full_content) {
420
+				$wpse_excerpt = strip_shortcodes($wpse_excerpt);
421 421
 				$wpse_excerpt = apply_filters('the_content', $wpse_excerpt);
422 422
 				$wpse_excerpt = str_replace(']]>', ']]>', $wpse_excerpt);
423 423
 				//$wpse_excerpt = strip_tags($wpse_excerpt, '<blockquote>,<p>');
@@ -445,12 +445,12 @@  discard block
 block discarded – undo
445 445
 				$wpse_excerpt = trim(force_balance_tags($excerpt_output));
446 446
 
447 447
 				if ($has_more) {
448
-					$excerpt_end = '<a class="moretag" href="'.get_permalink().'">'.__('More','lsx').'</a>';
448
+					$excerpt_end = '<a class="moretag" href="' . get_permalink() . '">' . __('More', 'lsx') . '</a>';
449 449
 					$excerpt_end = apply_filters('excerpt_more', ' ' . $excerpt_end); 
450 450
 
451 451
 					$pos = strrpos($wpse_excerpt, '</');
452 452
 
453
-					if ( false !== $pos ) {
453
+					if (false !== $pos) {
454 454
 						// Inside last HTML tag
455 455
 						$wpse_excerpt = substr_replace($wpse_excerpt, $excerpt_end, $pos, 0); /* Add read more next to last word */
456 456
 					} else {
@@ -473,4 +473,4 @@  discard block
 block discarded – undo
473 473
 }
474 474
 remove_filter('get_the_excerpt', 'wp_trim_excerpt');
475 475
 add_filter('get_the_excerpt', 'wpse_custom_wp_trim_excerpt');
476
-remove_filter( 'the_excerpt', 'wpautop' );
476
+remove_filter('the_excerpt', 'wpautop');
Please login to merge, or discard this patch.
inc/layout.php 1 patch
Spacing   +46 added lines, -46 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 ( 'main' == $class ) {
37
+	if ('main' == $class) {
38 38
 		return $main_class;
39 39
 	}
40 40
 
41
-	if ( 'sidebar' == $class ) {
41
+	if ('sidebar' == $class) {
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,15 +91,15 @@  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
-	echo esc_attr( $classes );
102
+	echo esc_attr($classes);
103 103
 }
104 104
 
105 105
 /**
@@ -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
-	echo esc_attr( $classes );
125
+	echo esc_attr($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);
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 		?>
176 176
 		<header class="archive-header">
177 177
 			<h1 class="archive-title">
178
-				<i class="format-link fa fa-<?php echo esc_attr( $format ) ?>"></i>
178
+				<i class="format-link fa fa-<?php echo esc_attr($format) ?>"></i>
179 179
 				<span><?php the_title(); ?></span>
180 180
 			</h1>
181 181
 		</header>
@@ -189,25 +189,25 @@  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( esc_html__( 'Search Results for: %s', 'lsx' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
192
+			<h1 class="archive-title"><?php printf(esc_html__('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( esc_html__( 'Author: %s', 'lsx' ), get_the_author() ); ?>
199
+				<?php printf(esc_html__('Author: %s', 'lsx'), get_the_author()); ?>
200 200
 			</h1>
201 201
 
202 202
 			<?php if (get_the_author_meta('description')) { ?>
203
-			    <p class="author-desc"><?php echo esc_html( get_the_author_meta( 'description' ) ) ?></p>
203
+			    <p class="author-desc"><?php echo esc_html(get_the_author_meta('description')) ?></p>
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
-			<h1 class="archive-title"><?php esc_html_e( 'Shop', 'lsx' ); ?></h1>
210
+			<h1 class="archive-title"><?php esc_html_e('Shop', 'lsx'); ?></h1>
211 211
 			<?php echo term_description(); ?>
212 212
 		</header>
213 213
 		<?php
@@ -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(); ?>
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
 	if (in_array('blog', $classes)) { ?>
242 242
 		<header class="archive-header">
243
-			<h1 class="archive-title"><?php esc_html_e( 'Blog', 'lsx' ); ?></h1>
243
+			<h1 class="archive-title"><?php esc_html_e('Blog', 'lsx'); ?></h1>
244 244
 		</header>
245 245
 	<?php }
246 246
 }
@@ -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.