Completed
Push — master ( bf2bbf...a32fd1 )
by Fernando
02:51
created
sidebar.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 // Allow Plugins and themes to disable the sidebar incase of very customized layouts.
9
-$sidebar_enabled = apply_filters('lsx_sidebar_enable',true);
10
-if(true !== $sidebar_enabled){return true;}
9
+$sidebar_enabled = apply_filters('lsx_sidebar_enable', true);
10
+if (true !== $sidebar_enabled) {return true; }
11 11
 ?>
12 12
 <?php
13 13
 	$show_on_front = get_option('show_on_front');
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 		$sidebar = 'home';
18 18
 	} else {
19 19
 
20
-		$layout = get_theme_mod('lsx_layout','2cr');
21
-		$layout = apply_filters( 'lsx_layout', $layout );
20
+		$layout = get_theme_mod('lsx_layout', '2cr');
21
+		$layout = apply_filters('lsx_layout', $layout);
22 22
 		
23
-		if('posts' == $show_on_front && is_home()){
23
+		if ('posts' == $show_on_front && is_home()) {
24 24
 			$sidebar = 'home';
25
-		}else{
25
+		} else {
26 26
 			$sidebar = 'sidebar-1';
27 27
 		}
28 28
 	}
29
-	if ( '1c' !== $layout ) : ?>
29
+	if ('1c' !== $layout) : ?>
30 30
 
31 31
 	<?php lsx_sidebars_before(); ?>
32 32
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	
35 35
 		<div id="secondary" class="widget-area <?php echo esc_attr(lsx_home_sidebar_class()); ?>" role="complementary">
36 36
 		
37
-	<?php elseif ( is_page_template('page-templates/template-blog.php') ) : ?>
37
+	<?php elseif (is_page_template('page-templates/template-blog.php')) : ?>
38 38
 	
39 39
 		<div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary">
40 40
 		
@@ -42,25 +42,25 @@  discard block
 block discarded – undo
42 42
 	
43 43
 		<div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary">
44 44
 		
45
-	<?php endif ; ?>
45
+	<?php endif; ?>
46 46
 
47 47
 		<?php lsx_sidebar_top(); ?>
48 48
 
49
-		<?php if ( ! dynamic_sidebar( $sidebar ) ) : ?>
49
+		<?php if ( ! dynamic_sidebar($sidebar)) : ?>
50 50
 
51 51
 			<aside id="search" class="widget widget_search">
52 52
 				<?php get_search_form(); ?>
53 53
 			</aside>
54 54
 
55 55
 			<aside id="archives" class="widget">
56
-				<h1 class="widget-title"><?php esc_attr_e( 'Archives', 'lsx' ); ?></h1>
56
+				<h1 class="widget-title"><?php esc_attr_e('Archives', 'lsx'); ?></h1>
57 57
 				<ul>
58
-					<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
58
+					<?php wp_get_archives(array('type' => 'monthly')); ?>
59 59
 				</ul>
60 60
 			</aside>
61 61
 
62 62
 			<aside id="meta" class="widget">
63
-				<h1 class="widget-title"><?php esc_attr_e( 'Meta', 'lsx' ); ?></h1>
63
+				<h1 class="widget-title"><?php esc_attr_e('Meta', 'lsx'); ?></h1>
64 64
 				<ul>
65 65
 					<?php wp_register(); ?>
66 66
 					<li><?php wp_loginout(); ?></li>
Please login to merge, or discard this patch.
comment.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,24 +1,24 @@
 block discarded – undo
1 1
 <?php 
2
-	if ( isset( $GLOBALS['comment_depth'] ) ) {
3
-		$depth = intval( $GLOBALS['comment_depth'] );
2
+	if (isset($GLOBALS['comment_depth'])) {
3
+		$depth = intval($GLOBALS['comment_depth']);
4 4
 	} else {
5 5
 		$depth = 1;
6 6
 	}
7 7
 
8
-	$max_depth = intval( get_option( 'thread_comments_depth' ) );
8
+	$max_depth = intval(get_option('thread_comments_depth'));
9 9
 ?>
10 10
 
11 11
 <?php echo get_avatar($comment, '64'); ?>
12 12
 <div class="media-body">
13 13
   <h4 class="media-heading"><?php echo get_comment_author_link(); ?></h4>
14
-  <time datetime="<?php echo comment_date('c'); ?>"><a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>"><?php printf(esc_html__('%1$s on %2$s', 'lsx'), get_comment_date(),  get_comment_time()); ?></a></time>
14
+  <time datetime="<?php echo comment_date('c'); ?>"><a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>"><?php printf(esc_html__('%1$s on %2$s', 'lsx'), get_comment_date(), get_comment_time()); ?></a></time>
15 15
   <?php edit_comment_link(esc_html__('(Edit)', 'lsx'), '', ''); ?>
16 16
   
17
-  <?php if ( '0' == $comment->comment_approved ) : ?>
17
+  <?php if ('0' == $comment->comment_approved) : ?>
18 18
   <div class="alert alert-info">
19 19
     <?php esc_html_e('Your comment is awaiting moderation.', 'lsx'); ?>
20 20
   </div>
21 21
 <?php endif; ?>
22 22
 
23 23
 <?php comment_text(); ?>
24
-<?php comment_reply_link( array( 'depth' => $depth, 'max_depth' => $max_depth ) );
25 24
\ No newline at end of file
25
+<?php comment_reply_link(array('depth' => $depth, 'max_depth' => $max_depth));
26 26
\ No newline at end of file
Please login to merge, or discard this patch.
inc/jetpack.php 1 patch
Spacing   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
  */
20 20
 function lsx_allowed_related_post_types($allowed_post_types) {
21 21
 	$allowed_post_types[] = 'jetpack-portfolio';
22
-	foreach($allowed_post_types as $key => $value){
23
-		if('page' == $value){
22
+	foreach ($allowed_post_types as $key => $value) {
23
+		if ('page' == $value) {
24 24
 			unset($allowed_post_types[$key]);
25 25
 		}
26 26
 	}
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
  * @category site-logo
36 36
  */
37 37
 
38
-function lsx_site_logo_title_tag( $html) {
38
+function lsx_site_logo_title_tag($html) {
39 39
 
40
-	$html = str_replace('<a', '<a title="'.get_bloginfo('name').'" ', $html);
40
+	$html = str_replace('<a', '<a title="' . get_bloginfo('name') . '" ', $html);
41 41
 	return $html;
42 42
 }
43
-add_filter( 'jetpack_the_site_logo', 'lsx_site_logo_title_tag');
43
+add_filter('jetpack_the_site_logo', 'lsx_site_logo_title_tag');
44 44
 
45 45
 
46 46
 /*
@@ -54,19 +54,19 @@  discard block
 block discarded – undo
54 54
  * @subpackage jetpack
55 55
  * @category portfolio
56 56
  */
57
-function lsx_portfolio_infinite_scroll(){
58
-	global $_wp_theme_features,$wp_query;
57
+function lsx_portfolio_infinite_scroll() {
58
+	global $_wp_theme_features, $wp_query;
59 59
 
60
-	if(is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag')){
60
+	if (is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag')) {
61 61
 		
62
-		if(class_exists('The_Neverending_Home_Page')){
62
+		if (class_exists('The_Neverending_Home_Page')) {
63 63
 			$_wp_theme_features['infinite-scroll'][0]['container'] = 'portfolio-infinite-scroll-wrapper';
64 64
 			$_wp_theme_features['infinite-scroll'][0]['posts_per_page'] = 99;
65 65
 		}
66 66
 	}
67 67
 
68 68
 }
69
-add_action('wp_head','lsx_portfolio_infinite_scroll',1000);
69
+add_action('wp_head', 'lsx_portfolio_infinite_scroll', 1000);
70 70
 
71 71
 /**
72 72
  * Disables the infinite scroll on the portfolio archive
@@ -75,13 +75,13 @@  discard block
 block discarded – undo
75 75
  * @subpackage jetpack
76 76
  * @category portfolio
77 77
  */
78
-function lsx_portfolio_infinite_scroll_disable($supported){
79
-	if(is_post_type_archive('jetpack-portfolio')){
78
+function lsx_portfolio_infinite_scroll_disable($supported) {
79
+	if (is_post_type_archive('jetpack-portfolio')) {
80 80
 		$supported = false;
81 81
 	}
82 82
 	return $supported;
83 83
 }
84
-add_filter( 'infinite_scroll_archive_supported', 'lsx_portfolio_infinite_scroll_disable', 1, 10 );
84
+add_filter('infinite_scroll_archive_supported', 'lsx_portfolio_infinite_scroll_disable', 1, 10);
85 85
 
86 86
 /**
87 87
  * Set the Portfolio to 9 posts per page
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
  * @subpackage jetpack
91 91
  * @category portfolio
92 92
 */
93
-function lsx_portfolio_archive_pagination( $query ) {
94
-	if(!is_admin()){
95
-		if ( $query->is_post_type_archive(array('jetpack-portfolio')) && $query->is_main_query() && class_exists('The_Neverending_Home_Page')) {
96
-			$query->set( 'posts_per_page', -1 );
93
+function lsx_portfolio_archive_pagination($query) {
94
+	if ( ! is_admin()) {
95
+		if ($query->is_post_type_archive(array('jetpack-portfolio')) && $query->is_main_query() && class_exists('The_Neverending_Home_Page')) {
96
+			$query->set('posts_per_page', -1);
97 97
 		}
98 98
 	}
99 99
 }
100
-add_action( 'pre_get_posts', 'lsx_portfolio_archive_pagination' , 100 );
100
+add_action('pre_get_posts', 'lsx_portfolio_archive_pagination', 100);
101 101
 
102 102
 /**
103 103
  * Remove the related posts from below the content area.
@@ -107,13 +107,13 @@  discard block
 block discarded – undo
107 107
  * @category portfolio
108 108
  */
109 109
 function lsx_remove_portfolio_related_posts() {
110
-	if ( is_single() && 'jetpack-portfolio' == get_post_type() && class_exists( 'Jetpack_RelatedPosts' ) ) {
110
+	if (is_single() && 'jetpack-portfolio' == get_post_type() && class_exists('Jetpack_RelatedPosts')) {
111 111
 		$jprp = Jetpack_RelatedPosts::init();
112
-		$callback = array( $jprp, 'filter_add_target_to_dom' );
113
-		remove_filter( 'the_content', $callback, 40 );
112
+		$callback = array($jprp, 'filter_add_target_to_dom');
113
+		remove_filter('the_content', $callback, 40);
114 114
 	}
115 115
 }
116
-add_filter( 'wp', 'lsx_remove_portfolio_related_posts', 20 );
116
+add_filter('wp', 'lsx_remove_portfolio_related_posts', 20);
117 117
 
118 118
 /**
119 119
  * Remove the related posts from below the content area.
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
  * @category portfolio
124 124
  */
125 125
 function lsx_remove_single_related_posts() {
126
-    if ( is_single() && class_exists( 'Jetpack_RelatedPosts' ) ) {
126
+    if (is_single() && class_exists('Jetpack_RelatedPosts')) {
127 127
         $jprp = Jetpack_RelatedPosts::init();
128
-        $callback = array( $jprp, 'filter_add_target_to_dom' );
129
-        remove_filter( 'the_content', $callback, 40 );
128
+        $callback = array($jprp, 'filter_add_target_to_dom');
129
+        remove_filter('the_content', $callback, 40);
130 130
     }
131 131
 }
132
-add_filter( 'wp', 'lsx_remove_single_related_posts', 20 );
132
+add_filter('wp', 'lsx_remove_single_related_posts', 20);
133 133
 
134 134
 /**
135 135
  * A template tag to call the Portfolios Related posts
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
  * @subpackage jetpack
139 139
  * @category portfolio
140 140
  */
141
-function lsx_portfolio_related_posts(){
142
-	if(class_exists('Jetpack_RelatedPosts')){ ?>
141
+function lsx_portfolio_related_posts() {
142
+	if (class_exists('Jetpack_RelatedPosts')) { ?>
143 143
 		<div class="row">
144 144
 			<div class="col-md-12">
145 145
 				<?php echo do_shortcode('[jetpack-related-posts]'); ?>
@@ -156,16 +156,16 @@  discard block
 block discarded – undo
156 156
  * @category portfolio
157 157
  */
158 158
 function lsx_portfolio_remove_share() {
159
-	if ( ( is_single() && 'jetpack-portfolio' == get_post_type() ) || is_page_template( 'page-templates/template-portfolio.php' ) ) {
160
-		remove_filter( 'the_content', 'sharing_display',19 );
161
-		remove_filter( 'the_excerpt', 'sharing_display',19 );
159
+	if ((is_single() && 'jetpack-portfolio' == get_post_type()) || is_page_template('page-templates/template-portfolio.php')) {
160
+		remove_filter('the_content', 'sharing_display', 19);
161
+		remove_filter('the_excerpt', 'sharing_display', 19);
162 162
 
163
-		if ( class_exists( 'Jetpack_Likes' ) ) {
164
-			remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );
163
+		if (class_exists('Jetpack_Likes')) {
164
+			remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
165 165
 		}
166 166
 	}
167 167
 }
168
-add_action( 'loop_start', 'lsx_portfolio_remove_share' );
168
+add_action('loop_start', 'lsx_portfolio_remove_share');
169 169
 
170 170
 /**
171 171
  * Remove the sharing from single
@@ -175,16 +175,16 @@  discard block
 block discarded – undo
175 175
  * @category post
176 176
  */
177 177
 function lsx_single_remove_share() {
178
-	if ( is_single() ) {
179
-		remove_filter( 'the_content', 'sharing_display',19 );
180
-		remove_filter( 'the_excerpt', 'sharing_display',19 );
178
+	if (is_single()) {
179
+		remove_filter('the_content', 'sharing_display', 19);
180
+		remove_filter('the_excerpt', 'sharing_display', 19);
181 181
 
182
-		if ( class_exists( 'Jetpack_Likes' ) ) {
183
-			remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );
182
+		if (class_exists('Jetpack_Likes')) {
183
+			remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
184 184
 		}
185 185
 	}
186 186
 }
187
-add_action( 'loop_start', 'lsx_single_remove_share' );
187
+add_action('loop_start', 'lsx_single_remove_share');
188 188
 
189 189
 /**
190 190
  * Redirect the template archive to our one
@@ -193,18 +193,18 @@  discard block
 block discarded – undo
193 193
  * @subpackage jetpack
194 194
  * @category portfolio
195 195
 */
196
-function lsx_portfolio_taxonomy_template( $template ) {
196
+function lsx_portfolio_taxonomy_template($template) {
197 197
 
198
-	if ( is_tax(array('jetpack-portfolio-type','jetpack-portfolio-tag'))  ) {
199
-		$new_template = locate_template( array( 'archive-jetpack-portfolio.php' ) );
200
-		if ( '' != $new_template ) {
201
-			return $new_template ;
198
+	if (is_tax(array('jetpack-portfolio-type', 'jetpack-portfolio-tag'))) {
199
+		$new_template = locate_template(array('archive-jetpack-portfolio.php'));
200
+		if ('' != $new_template) {
201
+			return $new_template;
202 202
 		}
203 203
 	}
204 204
 
205 205
 	return $template;
206 206
 }
207
-add_filter( 'template_include', 'lsx_portfolio_taxonomy_template', 99 );
207
+add_filter('template_include', 'lsx_portfolio_taxonomy_template', 99);
208 208
 
209 209
 
210 210
 /**
@@ -214,43 +214,43 @@  discard block
 block discarded – undo
214 214
  * @subpackage jetpack
215 215
  * @category portfolio
216 216
  */
217
-add_action( 'add_meta_boxes', 'lsx_add_portfolio_post_meta_boxes' );
218
-add_action( 'save_post', 'lsx_save_portfolio_post_meta', 100, 2 );
217
+add_action('add_meta_boxes', 'lsx_add_portfolio_post_meta_boxes');
218
+add_action('save_post', 'lsx_save_portfolio_post_meta', 100, 2);
219 219
 
220
-function lsx_save_portfolio_post_meta( $post_id, $post ) {
221
-	if ( 'jetpack-portfolio' != $post->post_type ) {
220
+function lsx_save_portfolio_post_meta($post_id, $post) {
221
+	if ('jetpack-portfolio' != $post->post_type) {
222 222
 		return;
223 223
 	}
224 224
 
225
-	if ( ! isset( $_POST['lsx-website'] ) && ! isset( $_POST['lsx-client'] ) ) {
225
+	if ( ! isset($_POST['lsx-website']) && ! isset($_POST['lsx-client'])) {
226 226
 		return;
227 227
 	}
228 228
 
229
-	$post_type = get_post_type_object( $post->post_type );
229
+	$post_type = get_post_type_object($post->post_type);
230 230
 
231
-	if ( ! current_user_can( $post_type->cap->edit_post, $post_id ) ) {
231
+	if ( ! current_user_can($post_type->cap->edit_post, $post_id)) {
232 232
 		return;
233 233
 	}
234 234
 
235
-	check_admin_referer( 'lsx_save_portfolio', '_lsx_client_nonce' );
236
-	check_admin_referer( 'lsx_save_portfolio', '_lsx_website_nonce' );
235
+	check_admin_referer('lsx_save_portfolio', '_lsx_client_nonce');
236
+	check_admin_referer('lsx_save_portfolio', '_lsx_website_nonce');
237 237
 
238
-	$meta_keys = array('lsx-website','lsx-client');
238
+	$meta_keys = array('lsx-website', 'lsx-client');
239 239
 
240
-	foreach($meta_keys as $meta_key){
241
-		$new_meta_value = sanitize_text_field( wp_unslash( $_POST[$meta_key] ) );
242
-		$new_meta_value = ! empty( $new_meta_value ) ? $new_meta_value : '';
240
+	foreach ($meta_keys as $meta_key) {
241
+		$new_meta_value = sanitize_text_field(wp_unslash($_POST[$meta_key]));
242
+		$new_meta_value = ! empty($new_meta_value) ? $new_meta_value : '';
243 243
 
244
-		$meta_value = get_post_meta( $post_id, $meta_key, true );
244
+		$meta_value = get_post_meta($post_id, $meta_key, true);
245 245
 
246
-		if ( $new_meta_value && '' == $meta_value )
247
-			add_post_meta( $post_id, $meta_key, $new_meta_value, true );
246
+		if ($new_meta_value && '' == $meta_value)
247
+			add_post_meta($post_id, $meta_key, $new_meta_value, true);
248 248
 
249
-		elseif ( $new_meta_value && $new_meta_value != $meta_value )
250
-		update_post_meta( $post_id, $meta_key, $new_meta_value );
249
+		elseif ($new_meta_value && $new_meta_value != $meta_value)
250
+		update_post_meta($post_id, $meta_key, $new_meta_value);
251 251
 
252
-		elseif ( '' == $new_meta_value && $meta_value )
253
-		delete_post_meta( $post_id, $meta_key, $meta_value );
252
+		elseif ('' == $new_meta_value && $meta_value)
253
+		delete_post_meta($post_id, $meta_key, $meta_value);
254 254
 	}
255 255
 }
256 256
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
 	add_meta_box(
260 260
 	'lsx_client_meta_box',
261
-	esc_html__( 'Client', 'lsx' ),
261
+	esc_html__('Client', 'lsx'),
262 262
 	'lsx_client_meta_box',
263 263
 	'jetpack-portfolio',
264 264
 	'side',
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 
268 268
 	add_meta_box(
269 269
 	'lsx_website_meta_box',
270
-	esc_html__( 'Website', 'lsx' ),
270
+	esc_html__('Website', 'lsx'),
271 271
 	'lsx_website_meta_box',
272 272
 	'jetpack-portfolio',
273 273
 	'side',
@@ -275,25 +275,25 @@  discard block
 block discarded – undo
275 275
 			);
276 276
 }
277 277
 
278
-function lsx_client_meta_box( $object, $box ) { ?>
278
+function lsx_client_meta_box($object, $box) { ?>
279 279
 
280
-  <?php wp_nonce_field( 'lsx_save_portfolio', '_lsx_client_nonce' ); ?>
280
+  <?php wp_nonce_field('lsx_save_portfolio', '_lsx_client_nonce'); ?>
281 281
 
282 282
   <p>
283
-    <input class="widefat" type="text" name="lsx-client" id="lsx-client" value="<?php echo esc_attr( get_post_meta( $object->ID, 'lsx-client', true ) ); ?>" size="30" />
283
+    <input class="widefat" type="text" name="lsx-client" id="lsx-client" value="<?php echo esc_attr(get_post_meta($object->ID, 'lsx-client', true)); ?>" size="30" />
284 284
     <br /><br />
285
-    <label for="lsx-client"><?php esc_html_e( 'Enter the name of the project client', 'lsx' ); ?></label>
285
+    <label for="lsx-client"><?php esc_html_e('Enter the name of the project client', 'lsx'); ?></label>
286 286
   </p>
287 287
 <?php }
288 288
 
289
-function lsx_website_meta_box( $object, $box ) { ?>
289
+function lsx_website_meta_box($object, $box) { ?>
290 290
 
291
-  <?php wp_nonce_field( 'lsx_save_portfolio', '_lsx_website_nonce' ); ?>
291
+  <?php wp_nonce_field('lsx_save_portfolio', '_lsx_website_nonce'); ?>
292 292
 
293 293
   <p>
294
-    <input class="widefat" type="text" name="lsx-website" id="lsx-website" value="<?php echo esc_attr( get_post_meta( $object->ID, 'lsx-website', true ) ); ?>" size="30" />
294
+    <input class="widefat" type="text" name="lsx-website" id="lsx-website" value="<?php echo esc_attr(get_post_meta($object->ID, 'lsx-website', true)); ?>" size="30" />
295 295
     <br /><br />
296
-    <label for="lsx-website"><?php esc_html_e( 'Enter the URL of the project website', 'lsx' ); ?></label>
296
+    <label for="lsx-website"><?php esc_html_e('Enter the URL of the project website', 'lsx'); ?></label>
297 297
   </p>
298 298
 <?php }
299 299
 
@@ -306,18 +306,18 @@  discard block
 block discarded – undo
306 306
  * @category portfolio
307 307
  */   
308 308
 
309
-function lsx_portfolio_sorter(){ ?>
309
+function lsx_portfolio_sorter() { ?>
310 310
 	<ul id="filterNav" class="clearfix">
311
-		<li class="allBtn"><a href="#" data-filter="*" class="selected"><?php esc_html_e( 'All', 'lsx' ); ?></a></li>
311
+		<li class="allBtn"><a href="#" data-filter="*" class="selected"><?php esc_html_e('All', 'lsx'); ?></a></li>
312 312
 		<?php 
313 313
 		$types = get_terms('jetpack-portfolio-type');
314 314
 		
315
-		if(is_array($types)){
315
+		if (is_array($types)) {
316 316
 			foreach ($types as $type) {
317
-				$content = '<li><a href="#" data-filter=".'.$type->slug.'">';
317
+				$content = '<li><a href="#" data-filter=".' . $type->slug . '">';
318 318
 		    	$content .= $type->name;					
319 319
 				$content .= '</a></li>';
320
-				echo wp_kses_post( $content );
320
+				echo wp_kses_post($content);
321 321
 				echo "\n";
322 322
 			}
323 323
 		}?>
@@ -332,18 +332,18 @@  discard block
 block discarded – undo
332 332
  * @category portfolio
333 333
  */
334 334
 
335
-function lsx_portfolio_naviagtion_labels($labels){ 
335
+function lsx_portfolio_naviagtion_labels($labels) { 
336 336
 	
337
-	if(is_post_type_archive('jetpack-portfolio')){
337
+	if (is_post_type_archive('jetpack-portfolio')) {
338 338
 		$labels = array(
339
-				'next' 		=> '<span class="meta-nav">&larr;</span> '.__( 'Older', 'lsx' ),
340
-				'previous' 	=> __( 'Newer', 'lsx' ).' <span class="meta-nav">&rarr;</span>',
341
-				'title' 	=> __( 'Portfolio navigation', 'lsx' )
339
+				'next' 		=> '<span class="meta-nav">&larr;</span> ' . __('Older', 'lsx'),
340
+				'previous' 	=> __('Newer', 'lsx') . ' <span class="meta-nav">&rarr;</span>',
341
+				'title' 	=> __('Portfolio navigation', 'lsx')
342 342
 		);
343 343
 	}
344 344
 	return $labels;
345 345
 }
346
-add_filter('lsx_post_navigation_labels','lsx_portfolio_naviagtion_labels',1,10);
346
+add_filter('lsx_post_navigation_labels', 'lsx_portfolio_naviagtion_labels', 1, 10);
347 347
 
348 348
 
349 349
 /*
@@ -357,11 +357,11 @@  discard block
 block discarded – undo
357 357
  * @subpackage jetpack
358 358
  * @category related-posts
359 359
  */
360
-function lsx_remove_related_post_context(){
361
-	add_filter( 'jetpack_relatedposts_filter_post_context', '__return_empty_string' );
362
-	add_filter( 'rest_api_allowed_post_types', 'lsx_allowed_related_post_types' );
360
+function lsx_remove_related_post_context() {
361
+	add_filter('jetpack_relatedposts_filter_post_context', '__return_empty_string');
362
+	add_filter('rest_api_allowed_post_types', 'lsx_allowed_related_post_types');
363 363
 }
364
-add_action('init','lsx_remove_related_post_context',20);
364
+add_action('init', 'lsx_remove_related_post_context', 20);
365 365
 
366 366
 
367 367
 /*
@@ -378,13 +378,13 @@  discard block
 block discarded – undo
378 378
 	$infinite_scroll_args = array(
379 379
 			'container' => 'main',
380 380
 			'type' => 'click',
381
-			'posts_per_page' => get_option('posts_per_page',10),
381
+			'posts_per_page' => get_option('posts_per_page', 10),
382 382
 			'render'    => 'lsx_infinite_scroll_render'
383 383
 	);
384 384
 
385
-	add_theme_support( 'infinite-scroll', $infinite_scroll_args );
385
+	add_theme_support('infinite-scroll', $infinite_scroll_args);
386 386
 }
387
-add_action( 'after_setup_theme', 'lsx_jetpack_infinite_scroll_after_setup' );
387
+add_action('after_setup_theme', 'lsx_jetpack_infinite_scroll_after_setup');
388 388
 
389 389
 /**
390 390
  * Set the code to be rendered on for calling posts,
@@ -397,13 +397,13 @@  discard block
 block discarded – undo
397 397
  function lsx_infinite_scroll_render() {
398 398
 	global $wp_query;
399 399
 	
400
-	while(have_posts()){
400
+	while (have_posts()) {
401 401
 		the_post();
402 402
 		
403
-		if('jetpack-portfolio' == get_post_type()){
404
-			get_template_part( 'content', 'portfolio' );
405
-		}else{
406
-			get_template_part( 'content', get_post_type() );
403
+		if ('jetpack-portfolio' == get_post_type()) {
404
+			get_template_part('content', 'portfolio');
405
+		} else {
406
+			get_template_part('content', get_post_type());
407 407
 		}
408 408
 	}
409 409
  }
@@ -415,8 +415,8 @@  discard block
 block discarded – undo
415 415
  * @subpackage jetpack
416 416
  * @category related posts
417 417
  */
418
-function lsx_related_posts_headline( $headline ) {
419
-	$headline = sprintf( '<h3 class="jp-relatedposts-headline"><em>%s</em></h3>', esc_html( 'Related Posts' ) );
418
+function lsx_related_posts_headline($headline) {
419
+	$headline = sprintf('<h3 class="jp-relatedposts-headline"><em>%s</em></h3>', esc_html('Related Posts'));
420 420
 	return $headline;
421 421
 }
422
-add_filter( 'jetpack_relatedposts_filter_headline', 'lsx_related_posts_headline' );
422
+add_filter('jetpack_relatedposts_filter_headline', 'lsx_related_posts_headline');
Please login to merge, or discard this patch.
inc/config.php 1 patch
Spacing   +42 added lines, -42 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
  * Theme Configuration File
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * @package lsx
9 9
  */
10 10
 
11
-if ( ! function_exists( 'lsx_setup' ) ) :
11
+if ( ! function_exists('lsx_setup')) :
12 12
 /**
13 13
  * Sets up theme defaults and registers support for various WordPress features.
14 14
  *
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 function lsx_setup() {
20 20
 	global $content_width;
21 21
 	
22
-	load_theme_textdomain( 'lsx', get_template_directory() . '/languages' );
22
+	load_theme_textdomain('lsx', get_template_directory() . '/languages');
23 23
 
24 24
 	$args = array(
25 25
 			'header-text' => array(
@@ -28,51 +28,51 @@  discard block
 block discarded – undo
28 28
 			),
29 29
 			'size' => 'medium',
30 30
 	);
31
-	add_theme_support( 'site-logo', $args );
31
+	add_theme_support('site-logo', $args);
32 32
 	
33
-	add_theme_support( 'custom-logo', array(
33
+	add_theme_support('custom-logo', array(
34 34
 			'height'      => 50,
35 35
 			'width'       => 150,
36 36
 			'flex-width' => true,
37 37
 			'flex-height' => true,
38
-	) );
38
+	));
39 39
 
40
-	add_theme_support( 'custom-background' );
41
-	add_theme_support( 'automatic-feed-links' );
42
-	add_theme_support( 'title-tag' );
43
-	add_theme_support( 'post-thumbnails' );
44
-	add_theme_support( 'post-formats', array('image', 'video', 'gallery', 'audio', 'link', 'quote', 'aside') );
40
+	add_theme_support('custom-background');
41
+	add_theme_support('automatic-feed-links');
42
+	add_theme_support('title-tag');
43
+	add_theme_support('post-thumbnails');
44
+	add_theme_support('post-formats', array('image', 'video', 'gallery', 'audio', 'link', 'quote', 'aside'));
45 45
 
46 46
 	// This theme uses wp_nav_menu() in one location.
47
-	register_nav_menus( array(
48
-		'primary' => __( 'Primary Menu', 'lsx' ),
49
-		'top-menu'=> __( 'Top Menu' , 'lsx' ),
50
-		'social'=> __( 'Social Menu' , 'lsx' ),
51
-		'footer'=> __( 'Footer Menu' , 'lsx' )
52
-	) );	
47
+	register_nav_menus(array(
48
+		'primary' => __('Primary Menu', 'lsx'),
49
+		'top-menu'=> __('Top Menu', 'lsx'),
50
+		'social'=> __('Social Menu', 'lsx'),
51
+		'footer'=> __('Footer Menu', 'lsx')
52
+	));	
53 53
 
54 54
 	//Set the content width
55 55
 	$content_width = 1140;
56 56
 	
57
-	add_editor_style( get_template_directory_uri() . '/css/editor-style.css' );	
58
-	add_theme_support( 'html5', array( 'caption' ) );
57
+	add_editor_style(get_template_directory_uri() . '/css/editor-style.css');	
58
+	add_theme_support('html5', array('caption'));
59 59
 
60
-	add_theme_support( 'woocommerce' );	
61
-	add_theme_support( 'sensei' );
60
+	add_theme_support('woocommerce');	
61
+	add_theme_support('sensei');
62 62
 }
63 63
 endif; // lsx_setup
64
-add_action( 'after_setup_theme', 'lsx_setup' );
64
+add_action('after_setup_theme', 'lsx_setup');
65 65
 
66 66
 /**
67 67
  * Removes the "Custom Fields" meta box.
68 68
  */
69 69
 function lsx_remove_meta_boxes() {
70 70
 	$post_types = get_post_types();
71
-	foreach($post_types as $post_type){
72
-		remove_meta_box( 'postcustom' , $post_type , 'normal' ); 
71
+	foreach ($post_types as $post_type) {
72
+		remove_meta_box('postcustom', $post_type, 'normal'); 
73 73
 	}
74 74
 }
75
-add_action( 'admin_menu' , 'lsx_remove_meta_boxes' );
75
+add_action('admin_menu', 'lsx_remove_meta_boxes');
76 76
 
77 77
 /**
78 78
  * Overwrite the $content_width var, based on the layout of the page.
@@ -84,33 +84,33 @@  discard block
 block discarded – undo
84 84
 function lsx_process_content_width() {
85 85
 	global $content_width;
86 86
 
87
-	if(
87
+	if (
88 88
 		is_page_template('page-templates/template-portfolio.php') ||
89 89
 		is_page_template('page-templates/template-front-page.php') ||
90 90
 		is_page_template('page-templates/template-full-width.php') ||
91 91
 		is_post_type_archive('jetpack-portfolio') ||
92
-		is_tax(array('jetpack-portfolio-type','jetpack-portfolio-tag')) ||
92
+		is_tax(array('jetpack-portfolio-type', 'jetpack-portfolio-tag')) ||
93 93
 		is_singular('jetpack-portfolio')
94
-	){
94
+	) {
95 95
 		$content_width = 1140;
96 96
 	}
97 97
 }
98
-add_action('wp_head','lsx_process_content_width');
98
+add_action('wp_head', 'lsx_process_content_width');
99 99
 
100 100
 /**
101 101
  * Disable the comments form by default for the page post type.
102 102
  * @package	lsx
103 103
  * @subpackage config
104 104
  */
105
-function lsx_page_comments_off( $data ) {
106
-	if ( 'page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__( 'Auto Draft', 'lsx' ) == $data['post_title'] ) {
105
+function lsx_page_comments_off($data) {
106
+	if ('page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__('Auto Draft', 'lsx') == $data['post_title']) {
107 107
 		$data['comment_status'] = 0;
108 108
 		$data['ping_status'] = 0;
109 109
 	}
110 110
 
111 111
 	return $data;
112 112
 }
113
-add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' );
113
+add_filter('wp_insert_post_data', 'lsx_page_comments_off');
114 114
 
115 115
 /**
116 116
  * Disable the comments form by default for the page post type.
@@ -118,14 +118,14 @@  discard block
 block discarded – undo
118 118
  * @subpackage config
119 119
  */
120 120
 function lsx_is_legacy($data) {
121
-	if ( 'page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__( 'Auto Draft', 'lsx' ) == $data['post_title'] ) {
121
+	if ('page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__('Auto Draft', 'lsx') == $data['post_title']) {
122 122
 		$data['comment_status'] = 0;
123 123
 		$data['ping_status'] = 0;
124 124
 	}
125 125
 
126 126
 	return $data;
127 127
 }
128
-add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' );
128
+add_filter('wp_insert_post_data', 'lsx_page_comments_off');
129 129
 
130 130
 /**
131 131
  * Run the init command
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
  * @subpackage config
134 134
  */
135 135
 function lsx_init() {
136
-	if(class_exists('WooCommerce')){
137
-		remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
136
+	if (class_exists('WooCommerce')) {
137
+		remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0);
138 138
 	}
139 139
 }
140
-add_action( 'init', 'lsx_init',100 );
140
+add_action('init', 'lsx_init', 100);
141 141
 
142 142
 /**
143 143
  * Run on the wp_head 
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
  */
147 147
 function lsx_wp_head() {
148 148
 
149
-	$layout = get_theme_mod('lsx_layout','2cr');
150
-	$layout = apply_filters( 'lsx_layout', $layout );
149
+	$layout = get_theme_mod('lsx_layout', '2cr');
150
+	$layout = apply_filters('lsx_layout', $layout);
151 151
 
152
-	if('1c' === $layout && (is_author() || is_search() || (is_post_type_archive(array('post','page','jetpack-portfolio')) && !is_post_type_archive('tribe_events')) || is_tag() || is_category() || is_date() || is_tax('post_format')) ){
153
-		remove_action('lsx_content_top', 'lsx_breadcrumbs', 100 );
152
+	if ('1c' === $layout && (is_author() || is_search() || (is_post_type_archive(array('post', 'page', 'jetpack-portfolio')) && ! is_post_type_archive('tribe_events')) || is_tag() || is_category() || is_date() || is_tax('post_format'))) {
153
+		remove_action('lsx_content_top', 'lsx_breadcrumbs', 100);
154 154
 	}
155 155
 }
156
-add_action( 'wp_head', 'lsx_wp_head',100 );
156
+add_action('wp_head', 'lsx_wp_head', 100);
Please login to merge, or discard this patch.
inc/extras.php 1 patch
Spacing   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  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
  * Enable extra attributes (srcset, sizes) in img tag
6 6
  */
7
-function lsx_kses_allowed_html( $allowedtags, $context ) {
7
+function lsx_kses_allowed_html($allowedtags, $context) {
8 8
 	$allowedtags['img']['srcset'] = true;
9 9
 	$allowedtags['img']['sizes'] = true;
10 10
 
11 11
 	return $allowedtags;
12 12
 }
13
-add_filter( 'wp_kses_allowed_html', 'lsx_kses_allowed_html', 10, 2 );
13
+add_filter('wp_kses_allowed_html', 'lsx_kses_allowed_html', 10, 2);
14 14
 
15 15
 /**
16 16
  * Add and remove body_class() classes
@@ -19,21 +19,21 @@  discard block
 block discarded – undo
19 19
 	/*
20 20
 	 * Add the header layout class
21 21
 	 */
22
-	$header_layout = get_theme_mod('lsx_header_layout','inline');
23
-	$classes[] = 'header-'.$header_layout;
22
+	$header_layout = get_theme_mod('lsx_header_layout', 'inline');
23
+	$classes[] = 'header-' . $header_layout;
24 24
 		
25 25
 	
26 26
   // Add post/page slug
27
-  if (is_single() || is_page() && !is_front_page()) {
27
+  if (is_single() || is_page() && ! is_front_page()) {
28 28
     $classes[] = basename(get_permalink());
29 29
   }
30 30
   
31
-  if(!class_exists('Lsx_Banners')){
32
-		$post_types = array('page','post');
33
-		$post_types = apply_filters('lsx_allowed_post_type_banners',$post_types);  
31
+  if ( ! class_exists('Lsx_Banners')) {
32
+		$post_types = array('page', 'post');
33
+		$post_types = apply_filters('lsx_allowed_post_type_banners', $post_types);  
34 34
 
35
-		if((is_singular($post_types) && has_post_thumbnail()) 
36
-		|| (is_singular('jetpack-portfolio'))){
35
+		if ((is_singular($post_types) && has_post_thumbnail()) 
36
+		|| (is_singular('jetpack-portfolio'))) {
37 37
 			$classes[] = 'page-has-banner';
38 38
 		}
39 39
 	}
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
   	$classes[] = 'has-top-menu';
43 43
   }
44 44
 
45
-	if ( get_theme_mod( 'lsx_preloader_content_status', '1' ) === '1' ) {
45
+	if (get_theme_mod('lsx_preloader_content_status', '1') === '1') {
46 46
 		$classes[] = 'preloader-content-enable';
47 47
 	}
48 48
 
@@ -66,30 +66,30 @@  discard block
 block discarded – undo
66 66
  * @param string $sep Optional separator.
67 67
  * @return string The filtered title.
68 68
  */
69
-function lsx_wp_title( $title, $sep ) {
69
+function lsx_wp_title($title, $sep) {
70 70
 	global $page, $paged;
71 71
 
72
-	if ( is_feed() ) {
72
+	if (is_feed()) {
73 73
 		return $title;
74 74
 	}
75 75
 
76 76
 	// Add the blog name
77
-	$title .= get_bloginfo( 'name' );
77
+	$title .= get_bloginfo('name');
78 78
 
79 79
 	// Add the blog description for the home/front page.
80
-	$site_description = get_bloginfo( 'description', 'display' );
81
-	if ( $site_description && ( is_home() || is_front_page() ) ) {
80
+	$site_description = get_bloginfo('description', 'display');
81
+	if ($site_description && (is_home() || is_front_page())) {
82 82
 		$title .= " $sep $site_description";
83 83
 	}
84 84
 
85 85
 	// Add a page number if necessary:
86
-	if ( $paged >= 2 || $page >= 2 ) {
87
-		$title .= " $sep " . sprintf( __( 'Page %s', 'lsx' ), max( $paged, $page ) );
86
+	if ($paged >= 2 || $page >= 2) {
87
+		$title .= " $sep " . sprintf(__('Page %s', 'lsx'), max($paged, $page));
88 88
 	}
89 89
 
90 90
 	return $title;
91 91
 }
92
-add_filter( 'wp_title', 'lsx_wp_title', 10, 2 );
92
+add_filter('wp_title', 'lsx_wp_title', 10, 2);
93 93
 
94 94
 
95 95
 /**
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
 function lsx_remove_self_closing_tags($input) {
111 111
   return str_replace(' />', '>', $input);
112 112
 }
113
-add_filter('get_avatar',          'lsx_remove_self_closing_tags'); // <img />
114
-add_filter('comment_id_fields',   'lsx_remove_self_closing_tags'); // <input />
113
+add_filter('get_avatar', 'lsx_remove_self_closing_tags'); // <img />
114
+add_filter('comment_id_fields', 'lsx_remove_self_closing_tags'); // <input />
115 115
 add_filter('post_thumbnail_html', 'lsx_remove_self_closing_tags'); // <img />
116 116
 
117 117
 
118
-if (!function_exists('lsx_get_attachment_id')) {
118
+if ( ! function_exists('lsx_get_attachment_id')) {
119 119
 	/**
120 120
 	 * Get the Attachment ID for a given image URL.
121 121
 	 *
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	function lsx_get_attachment_id($url) {
127 127
 		$dir = wp_upload_dir();
128 128
 		// baseurl never has a trailing slash
129
-		if (false === strpos($url, $dir['baseurl'].'/')) {
129
+		if (false === strpos($url, $dir['baseurl'] . '/')) {
130 130
 			// URL points to a place outside of upload directory
131 131
 			return false;
132 132
 		}
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
 		$query['meta_query'][0]['key'] = '_wp_attached_file';
145 145
 		// query attachments
146 146
 		$ids = get_posts($query);
147
-		if (!empty($ids)) {
147
+		if ( ! empty($ids)) {
148 148
 			foreach ($ids as $id) {
149 149
 				// first entry of returned array is the URL
150
-				$temp_url = wp_get_attachment_image_src( $id, 'full' );
151
-				if ( array_shift( $temp_url ) === $url ) {
150
+				$temp_url = wp_get_attachment_image_src($id, 'full');
151
+				if (array_shift($temp_url) === $url) {
152 152
 					return $id;
153 153
 				}
154 154
 			}
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
 		}
162 162
 		foreach ($ids as $id) {
163 163
 			$meta = wp_get_attachment_metadata($id);
164
-			foreach ( $meta['sizes'] as $size => $values ) {
165
-				if ( $values['file'] === $file && array_shift( wp_get_attachment_image_src( $id, $size ) ) === $url ) {
164
+			foreach ($meta['sizes'] as $size => $values) {
165
+				if ($values['file'] === $file && array_shift(wp_get_attachment_image_src($id, $size)) === $url) {
166 166
 					return $id;
167 167
 				}
168 168
 			}
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
  */
188 188
 function lsx_is_element_empty($element) {
189 189
 	$element = trim($element);
190
-	return empty($element)?false:true;
190
+	return empty($element) ? false : true;
191 191
 }
192 192
 
193 193
 
@@ -198,39 +198,39 @@  discard block
 block discarded – undo
198 198
  * @subpackage extras
199 199
  * @category thumbnails
200 200
  */
201
-function lsx_get_thumbnail($size,$image_src = false){
201
+function lsx_get_thumbnail($size, $image_src = false) {
202 202
 	
203
-	if(false === $image_src){
203
+	if (false === $image_src) {
204 204
 		$post_id = get_the_ID(); 
205
-		$post_thumbnail_id = get_post_thumbnail_id( $post_id );
206
-	}elseif(false != $image_src	){
207
-		if(is_numeric($image_src)){
205
+		$post_thumbnail_id = get_post_thumbnail_id($post_id);
206
+	}elseif (false != $image_src) {
207
+		if (is_numeric($image_src)) {
208 208
 			$post_thumbnail_id = $image_src;
209
-		}else{
209
+		} else {
210 210
 			$post_thumbnail_id = lsx_get_attachment_id_from_src($image_src);
211 211
 		}
212 212
 	}
213
-	$size = apply_filters('lsx_thumbnail_size',$size);
213
+	$size = apply_filters('lsx_thumbnail_size', $size);
214 214
 	$img = false;
215
-	if ( 'lsx-thumbnail-wide' === $size || 'thumbnail' === $size ) {
215
+	if ('lsx-thumbnail-wide' === $size || 'thumbnail' === $size) {
216 216
 		$srcset = false;
217
-		$img = wp_get_attachment_image_src($post_thumbnail_id,$size);
217
+		$img = wp_get_attachment_image_src($post_thumbnail_id, $size);
218 218
 		$img = $img[0];
219 219
 	} else {
220 220
 		$srcset = true;
221
-		$img = wp_get_attachment_image_srcset($post_thumbnail_id,$size);
222
-		if ( false == $img ) {
221
+		$img = wp_get_attachment_image_srcset($post_thumbnail_id, $size);
222
+		if (false == $img) {
223 223
 			$srcset = false;
224
-			$img = wp_get_attachment_image_src($post_thumbnail_id,$size);
224
+			$img = wp_get_attachment_image_src($post_thumbnail_id, $size);
225 225
 			$img = $img[0];
226 226
 		}
227 227
 	}
228
-	if ( $srcset ) {
229
-		$img = '<img alt="'.get_the_title(get_the_ID()).'" class="attachment-responsive wp-post-image lsx-responsive" srcset="'.$img.'" />';
228
+	if ($srcset) {
229
+		$img = '<img alt="' . get_the_title(get_the_ID()) . '" class="attachment-responsive wp-post-image lsx-responsive" srcset="' . $img . '" />';
230 230
 	} else {
231
-		$img = '<img alt="'.get_the_title(get_the_ID()).'" class="attachment-responsive wp-post-image lsx-responsive" src="'.$img.'" />';
231
+		$img = '<img alt="' . get_the_title(get_the_ID()) . '" class="attachment-responsive wp-post-image lsx-responsive" src="' . $img . '" />';
232 232
 	}
233
-	$img = apply_filters('lsx_lazyload_filter_images',$img);
233
+	$img = apply_filters('lsx_lazyload_filter_images', $img);
234 234
 	return $img;
235 235
 }
236 236
 
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
  * @subpackage extras
242 242
  * @category thumbnails
243 243
  */
244
-function lsx_thumbnail( $size = 'thumbnail', $image_src = false ) {
245
-	echo wp_kses_post( lsx_get_thumbnail( $size, $image_src ) );
244
+function lsx_thumbnail($size = 'thumbnail', $image_src = false) {
245
+	echo wp_kses_post(lsx_get_thumbnail($size, $image_src));
246 246
 }
247 247
 
248 248
 
@@ -252,13 +252,13 @@  discard block
 block discarded – undo
252 252
  * @subpackage extras
253 253
  * @category thumbnails
254 254
  */
255
-function lsx_get_attachment_id_from_src( $image_src ) {
256
-	$post_id = wp_cache_get( $image_src, 'lsx_get_attachment_id_from_src' );
255
+function lsx_get_attachment_id_from_src($image_src) {
256
+	$post_id = wp_cache_get($image_src, 'lsx_get_attachment_id_from_src');
257 257
 	
258
-	if ( false === $post_id ) {
258
+	if (false === $post_id) {
259 259
 		global $wpdb;
260
-		$post_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src ) );
261
-		wp_cache_set( $image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600 );
260
+		$post_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src));
261
+		wp_cache_set($image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600);
262 262
 	}
263 263
 
264 264
 	return $post_id;
@@ -272,28 +272,28 @@  discard block
 block discarded – undo
272 272
  * @subpackage extras
273 273
  * @category banner
274 274
  */
275
-if (!function_exists('lsx_page_banner')) {
275
+if ( ! function_exists('lsx_page_banner')) {
276 276
 	function lsx_page_banner() {
277 277
 
278
-		$post_types = array('page','post');
279
-		$post_types = apply_filters('lsx_allowed_post_type_banners',$post_types);	
278
+		$post_types = array('page', 'post');
279
+		$post_types = apply_filters('lsx_allowed_post_type_banners', $post_types);	
280 280
 		
281
-		if ( (is_singular($post_types) && has_post_thumbnail())
282
-		 || (is_singular('jetpack-portfolio')) ) { ?>
281
+		if ((is_singular($post_types) && has_post_thumbnail())
282
+		 || (is_singular('jetpack-portfolio'))) { ?>
283 283
 	        
284 284
 	        <?php 
285 285
 	        	$bg_image = '';
286
-	        	if(has_post_thumbnail()){
287
-	        		$bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),'full');
286
+	        	if (has_post_thumbnail()) {
287
+	        		$bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full');
288 288
 	        		$bg_image = $bg_image[0];
289 289
 	        	}
290 290
 	        ?>
291 291
 
292
-	   		<?php if ( ! empty( $bg_image ) ) : ?>
292
+	   		<?php if ( ! empty($bg_image)) : ?>
293 293
 	        
294 294
 	        <div class="page-banner-wrap">
295 295
 		        <div class="page-banner">
296
-		        	<div class="page-banner-image" style="background-image:url(<?php echo esc_attr( $bg_image ); ?>);"></div>
296
+		        	<div class="page-banner-image" style="background-image:url(<?php echo esc_attr($bg_image); ?>);"></div>
297 297
 
298 298
 		        	<div class="container">
299 299
 			            <header class="page-header">
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 	    <?php } 
310 310
 	}
311 311
 }
312
-add_action( 'lsx_header_after', 'lsx_page_banner' );
312
+add_action('lsx_header_after', 'lsx_page_banner');
313 313
 
314 314
 
315 315
 /**
@@ -319,43 +319,43 @@  discard block
 block discarded – undo
319 319
  * @subpackage extras
320 320
  * @category mobile
321 321
  */
322
-function lsx_allow_sms_protocol( $protocols ) {
322
+function lsx_allow_sms_protocol($protocols) {
323 323
     $protocols[] = 'sms';
324 324
     return $protocols;
325 325
 }
326
-add_filter( 'kses_allowed_protocols', 'lsx_allow_sms_protocol' );
326
+add_filter('kses_allowed_protocols', 'lsx_allow_sms_protocol');
327 327
 
328 328
 
329 329
 /**
330 330
  * Adding browser and user-agent classes to body
331 331
  */
332 332
 function mv_browser_body_class($classes) {
333
-		$http_user_agent = sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) );
334
-		$http_user_agent = ! empty( $http_user_agent ) ? $http_user_agent : '';
333
+		$http_user_agent = sanitize_text_field(wp_unslash($_SERVER['HTTP_USER_AGENT']));
334
+		$http_user_agent = ! empty($http_user_agent) ? $http_user_agent : '';
335 335
 
336 336
         global $is_lynx, $is_gecko, $is_ie, $is_opera, $is_ns4, $is_safari, $is_chrome, $is_iphone;
337
-        if($is_lynx) $classes[] = 'lynx';
338
-        elseif($is_gecko) $classes[] = 'gecko';
339
-        elseif($is_opera) $classes[] = 'opera';
340
-        elseif($is_ns4) $classes[] = 'ns4';
341
-        elseif($is_safari) $classes[] = 'safari';
342
-        elseif($is_chrome) $classes[] = 'chrome';
343
-        elseif($is_ie) {
337
+        if ($is_lynx) $classes[] = 'lynx';
338
+        elseif ($is_gecko) $classes[] = 'gecko';
339
+        elseif ($is_opera) $classes[] = 'opera';
340
+        elseif ($is_ns4) $classes[] = 'ns4';
341
+        elseif ($is_safari) $classes[] = 'safari';
342
+        elseif ($is_chrome) $classes[] = 'chrome';
343
+        elseif ($is_ie) {
344 344
                 $classes[] = 'ie';
345
-                if(preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $http_user_agent, $browser_version))
346
-                $classes[] = 'ie'.$browser_version[1];
345
+                if (preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $http_user_agent, $browser_version))
346
+                $classes[] = 'ie' . $browser_version[1];
347 347
         } else $classes[] = 'unknown';
348
-        if($is_iphone) $classes[] = 'iphone';
349
-        if ( stristr( $http_user_agent, "mac") ) {
348
+        if ($is_iphone) $classes[] = 'iphone';
349
+        if (stristr($http_user_agent, "mac")) {
350 350
                  $classes[] = 'osx';
351
-           } elseif ( stristr( $http_user_agent, "linux") ) {
351
+           } elseif (stristr($http_user_agent, "linux")) {
352 352
                  $classes[] = 'linux';
353
-           } elseif ( stristr( $http_user_agent, "windows") ) {
353
+           } elseif (stristr($http_user_agent, "windows")) {
354 354
                  $classes[] = 'windows';
355 355
            }
356 356
         return $classes;
357 357
 }
358
-add_filter('body_class','mv_browser_body_class');
358
+add_filter('body_class', 'mv_browser_body_class');
359 359
 
360 360
 
361 361
 /**
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
  * @param		$form		Object
369 369
  * @return		String
370 370
  */
371
-function lsx_form_submit_button($button, $form){
371
+function lsx_form_submit_button($button, $form) {
372 372
 	return "<button class='btn btn-primary' id='gform_submit_button_{$form["id"]}'><span>Submit</span></button>";
373 373
 }
374 374
 add_filter("gform_submit_button", "lsx_form_submit_button", 10, 2);
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 	//return ' ... <a class="moretag" href="'. get_permalink($post->ID) . '">'.__('Continue reading','lsx').'</a>';
383 383
 	return '...';
384 384
 }
385
-add_filter( 'excerpt_more', 'lsx_excerpt_more' );
385
+add_filter('excerpt_more', 'lsx_excerpt_more');
386 386
 
387 387
 
388 388
 /**
@@ -391,44 +391,44 @@  discard block
 block discarded – undo
391 391
 function lsx_the_excerpt_filter($excerpt) {
392 392
 	$show_full_content = has_post_format(apply_filters('lsx_the_excerpt_filter_post_types', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio')));
393 393
 	
394
-	if (!$show_full_content) {
395
-		if ('' !== $excerpt  && !stristr($excerpt, 'moretag')) {
396
-			$pagination = wp_link_pages( array(
394
+	if ( ! $show_full_content) {
395
+		if ('' !== $excerpt && ! stristr($excerpt, 'moretag')) {
396
+			$pagination = wp_link_pages(array(
397 397
 							'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
398 398
 							'after' => '</div></div>',
399 399
 							'link_before' => '<span>',
400 400
 							'link_after' => '</span>',
401 401
 							'echo' => 0
402
-						) );
402
+						));
403 403
 
404
-			if ( ! empty( $pagination ) ) {
404
+			if ( ! empty($pagination)) {
405 405
 				$excerpt .= $pagination;
406 406
 			}
407 407
 			else {
408
-				$excerpt .= '<p><a class="moretag" href="'.get_permalink().'">'.__('Continue reading','lsx').'</a></p>';
408
+				$excerpt .= '<p><a class="moretag" href="' . get_permalink() . '">' . __('Continue reading', 'lsx') . '</a></p>';
409 409
 			}
410 410
 		}
411 411
 	}
412 412
 
413 413
 	return $excerpt;
414 414
 }
415
-add_filter( 'the_excerpt', 'lsx_the_excerpt_filter' , 1 , 20 );
415
+add_filter('the_excerpt', 'lsx_the_excerpt_filter', 1, 20);
416 416
 
417 417
 
418 418
 /**
419 419
  * Allow HTML tags in excerpt
420 420
  */
421
-if ( ! function_exists( 'wpse_custom_wp_trim_excerpt' ) ) {
421
+if ( ! function_exists('wpse_custom_wp_trim_excerpt')) {
422 422
 	function wpse_custom_wp_trim_excerpt($wpse_excerpt) {
423 423
 		global $post;
424 424
 		$raw_excerpt = $wpse_excerpt;
425 425
 
426
-		if ( '' == $wpse_excerpt ) {
426
+		if ('' == $wpse_excerpt) {
427 427
 			$wpse_excerpt = get_the_content('');
428 428
 			$show_full_content = has_post_format(array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio'));
429 429
 
430
-			if (!$show_full_content) {
431
-				$wpse_excerpt = strip_shortcodes( $wpse_excerpt );
430
+			if ( ! $show_full_content) {
431
+				$wpse_excerpt = strip_shortcodes($wpse_excerpt);
432 432
 				$wpse_excerpt = apply_filters('the_content', $wpse_excerpt);
433 433
 				$wpse_excerpt = str_replace(']]>', ']]>', $wpse_excerpt);
434 434
 				$wpse_excerpt = strip_tags($wpse_excerpt, '<blockquote>,<p>,<br>,<b>,<strong>,<i>,<u>,<ul>,<li>,<span>,<div>');
@@ -456,12 +456,12 @@  discard block
 block discarded – undo
456 456
 				$wpse_excerpt = trim(force_balance_tags($excerpt_output));
457 457
 
458 458
 				if ($has_more) {
459
-					$excerpt_end = '<a class="moretag" href="'.get_permalink().'">'.__('More','lsx').'</a>';
459
+					$excerpt_end = '<a class="moretag" href="' . get_permalink() . '">' . __('More', 'lsx') . '</a>';
460 460
 					$excerpt_end = apply_filters('excerpt_more', ' ' . $excerpt_end); 
461 461
 
462 462
 					$pos = strrpos($wpse_excerpt, '</');
463 463
 
464
-					if ( false !== $pos ) {
464
+					if (false !== $pos) {
465 465
 						// Inside last HTML tag
466 466
 						$wpse_excerpt = substr_replace($wpse_excerpt, $excerpt_end, $pos, 0); /* Add read more next to last word */
467 467
 					} else {
@@ -484,4 +484,4 @@  discard block
 block discarded – undo
484 484
 }
485 485
 remove_filter('get_the_excerpt', 'wp_trim_excerpt');
486 486
 add_filter('get_the_excerpt', 'wpse_custom_wp_trim_excerpt');
487
-remove_filter( 'the_excerpt', 'wpautop' );
487
+remove_filter('the_excerpt', 'wpautop');
Please login to merge, or discard this patch.
inc/the-events-calendar.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
  */
19 19
 
20 20
 function lsx_events_styles() {
21
-    wp_enqueue_style( 'events', get_template_directory_uri() . '/css/the-events-calendar.css', array(), LSX_VERSION );
21
+    wp_enqueue_style('events', get_template_directory_uri() . '/css/the-events-calendar.css', array(), LSX_VERSION);
22 22
 }
23
-add_action( 'wp_enqueue_scripts', 'lsx_events_styles' );
23
+add_action('wp_enqueue_scripts', 'lsx_events_styles');
24 24
 
25 25
 
26 26
 /**
@@ -32,41 +32,41 @@  discard block
 block discarded – undo
32 32
 
33 33
 function lsx_tribe_breadcrumbs($output) {
34 34
 	global $wp_query;
35
-	if( (isset($wp_query->tribe_is_event) && true === $wp_query->tribe_is_event) || (isset($wp_query->query_vars['post_type']) && !is_array($wp_query->query_vars['post_type']) && 'tribe_venue' === $wp_query->query_vars['post_type'])){
36
-		if(function_exists('woocommerce_breadcrumb')){
35
+	if ((isset($wp_query->tribe_is_event) && true === $wp_query->tribe_is_event) || (isset($wp_query->query_vars['post_type']) && ! is_array($wp_query->query_vars['post_type']) && 'tribe_venue' === $wp_query->query_vars['post_type'])) {
36
+		if (function_exists('woocommerce_breadcrumb')) {
37 37
 		 	$closing_div = '</nav>';
38 38
 
39
-		 	if( is_single()) {
40
-		 		$output = str_replace('Page','<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a>',$output);
41
-		 		if(isset($wp_query->query_vars['eventDisplay']) && 'all' === $wp_query->query_vars['eventDisplay']){
42
-		 			$output = str_replace($closing_div,get_the_title($wp_query->query_vars['post_parent']).$closing_div,$output);
43
-		 		}else{
39
+		 	if (is_single()) {
40
+		 		$output = str_replace('Page', '<a href="' . get_post_type_archive_link('tribe_events') . '">' . __('Events', 'lsx') . '</a>', $output);
41
+		 		if (isset($wp_query->query_vars['eventDisplay']) && 'all' === $wp_query->query_vars['eventDisplay']) {
42
+		 			$output = str_replace($closing_div, get_the_title($wp_query->query_vars['post_parent']) . $closing_div, $output);
43
+		 		} else {
44 44
 		 			$single_event = get_queried_object();
45
-		 			$output = str_replace($closing_div,apply_filters('the_title',$single_event->post_title).$closing_div,$output);		 			
45
+		 			$output = str_replace($closing_div, apply_filters('the_title', $single_event->post_title) . $closing_div, $output);		 			
46 46
 		 		}
47
-		 	}elseif( is_tax()) {
47
+		 	}elseif (is_tax()) {
48 48
 		 		$tax_event = get_queried_object();
49
-		 		$output = str_replace('Page','<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a>',$output);
50
-		 		$output = str_replace($closing_div,'&nbsp;/&nbsp;'.apply_filters('the_title',$tax_event->name).$closing_div,$output);
51
-		 	}else{
52
-		 		$output = str_replace('Page',__('Events','lsx'),$output);
49
+		 		$output = str_replace('Page', '<a href="' . get_post_type_archive_link('tribe_events') . '">' . __('Events', 'lsx') . '</a>', $output);
50
+		 		$output = str_replace($closing_div, '&nbsp;/&nbsp;' . apply_filters('the_title', $tax_event->name) . $closing_div, $output);
51
+		 	} else {
52
+		 		$output = str_replace('Page', __('Events', 'lsx'), $output);
53 53
 		 	}		 	
54
-		 }elseif(function_exists('yoast_breadcrumb')){
54
+		 }elseif (function_exists('yoast_breadcrumb')) {
55 55
 		 	$closing_div = '</div>';
56
-		 	$last_breadcrumb = '<span class="breadcrumb_last">'.__('Events','lsx').'</span>';
56
+		 	$last_breadcrumb = '<span class="breadcrumb_last">' . __('Events', 'lsx') . '</span>';
57 57
 		 	
58
-		 	if( is_single()) {
58
+		 	if (is_single()) {
59 59
 		 		$single_event = get_queried_object();
60
-		 		$output = str_replace($closing_div,'<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a>&nbsp;/&nbsp;'.apply_filters('the_title',$single_event->post_title),$output);
61
-		 	}elseif( is_tax()) {
60
+		 		$output = str_replace($closing_div, '<a href="' . get_post_type_archive_link('tribe_events') . '">' . __('Events', 'lsx') . '</a>&nbsp;/&nbsp;' . apply_filters('the_title', $single_event->post_title), $output);
61
+		 	}elseif (is_tax()) {
62 62
 		 		$tax_event = get_queried_object();
63
-		 		$output = str_replace($last_breadcrumb,'<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a>&nbsp;/&nbsp;'.apply_filters('the_title',$tax_event->name),$output);
63
+		 		$output = str_replace($last_breadcrumb, '<a href="' . get_post_type_archive_link('tribe_events') . '">' . __('Events', 'lsx') . '</a>&nbsp;/&nbsp;' . apply_filters('the_title', $tax_event->name), $output);
64 64
 		 		
65
-		 	}else{
66
-		 		$output = str_replace('Page',__('Events','lsx'),$output);
65
+		 	} else {
66
+		 		$output = str_replace('Page', __('Events', 'lsx'), $output);
67 67
 		 	}		 	
68 68
 		 }		
69 69
 	}
70 70
 	return $output;
71 71
 }
72
-add_filter( 'lsx_breadcrumbs', 'lsx_tribe_breadcrumbs',1,10 );
73 72
\ No newline at end of file
73
+add_filter('lsx_breadcrumbs', 'lsx_tribe_breadcrumbs', 1, 10);
74 74
\ No newline at end of file
Please login to merge, or discard this patch.
inc/customizer-header-layout.php 1 patch
Spacing   +15 added lines, -15 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'), LSX_VERSION, true );
55
+		wp_enqueue_script('lsx-header-layout-control', get_template_directory_uri() . '/js/customizer-header-layout.js', array('jquery'), LSX_VERSION, true);
56 56
 	}
57 57
 
58 58
 	/**
@@ -62,30 +62,30 @@  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 ) ) { ?>
75
-				<span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
74
+			if ( ! empty($this->description)) { ?>
75
+				<span class="description customize-control-description"><?php echo esc_html($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;'. esc_attr( $sel ) .'" src="' . esc_attr( get_template_directory_uri() ) .'/img/header-' . esc_attr( $layout ) . '.png" data-option="' . esc_attr( $layout ) . '">';
84
+				echo '<img class="header-layout-button" style="padding:2px;' . esc_attr($sel) . '" src="' . esc_attr(get_template_directory_uri()) . '/img/header-' . esc_attr($layout) . '.png" data-option="' . esc_attr($layout) . '">';
85 85
 			}
86 86
 
87 87
 			?>
88
-			<input <?php $this->link(); ?> class="selected-header-layout <?php echo esc_attr( $class ); ?>" id="<?php echo esc_attr( $post_id ); ?>" type="hidden" value="<?php echo esc_attr( $value ); ?>" <?php $this->input_attrs(); ?>>
88
+			<input <?php $this->link(); ?> class="selected-header-layout <?php echo esc_attr($class); ?>" id="<?php echo esc_attr($post_id); ?>" type="hidden" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>>
89 89
 			</div>
90 90
 		</label>
91 91
 	<?php
Please login to merge, or discard this patch.
inc/customizer.php 1 patch
Spacing   +43 added lines, -43 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' ), LSX_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'), LSX_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,38 +60,38 @@  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 96
 
97 97
 		/**
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 		 *
100 100
 		 * @since     1.0.0
101 101
 		 */		
102
-		private function add_panel( $slug, $args, $wp_customize ) {
102
+		private function add_panel($slug, $args, $wp_customize) {
103 103
 			$default_args = array(
104 104
 				'title' 		=> null,
105 105
 				'description' 	=> null,
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
 			$wp_customize->add_panel(
109 109
 				$slug,
110
-				array_merge( $default_args, $args )
110
+				array_merge($default_args, $args)
111 111
 			);
112 112
 		}
113 113
 
@@ -116,14 +116,14 @@  discard block
 block discarded – undo
116 116
 		 *
117 117
 		 * @since     1.0.0
118 118
 		 */		
119
-		private function add_section( $slug, $args, $wp_customize ) {
119
+		private function add_section($slug, $args, $wp_customize) {
120 120
 			$default_args = array(
121 121
 				'capability' => 'edit_theme_options', //Capability needed to tweak
122 122
 				'description' => null, //Descriptive tooltip
123 123
 			);
124 124
 
125
-			$wp_customize->add_section( $slug, 
126
-				array_merge( $default_args, $args )
125
+			$wp_customize->add_section($slug, 
126
+				array_merge($default_args, $args)
127 127
 			);
128 128
 		}
129 129
 
@@ -132,15 +132,15 @@  discard block
 block discarded – undo
132 132
 		 *
133 133
 		 * @since     1.0.0
134 134
 		 */		
135
-		private function add_setting( $slug, $args, $wp_customize ) {
136
-			$wp_customize->add_setting( $slug, //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record
137
-				array_merge( array(
135
+		private function add_setting($slug, $args, $wp_customize) {
136
+			$wp_customize->add_setting($slug, //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record
137
+				array_merge(array(
138 138
 					'default' 			=> null, //Default setting/value to save
139 139
 					'type' 				=> 'theme_mod', //Is this an 'option' or a 'theme_mod'?
140 140
 					'capability'		=> 'edit_theme_options', //Optional. Special permissions for accessing this setting.
141 141
 					'transport' 		=> 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)?
142 142
 					'sanitize_callback'	=> 'lsx_sanitize_choices'
143
-				), $args )
143
+				), $args)
144 144
 			);
145 145
 		}
146 146
 
@@ -149,28 +149,28 @@  discard block
 block discarded – undo
149 149
 		 *
150 150
 		 * @since     1.0.0
151 151
 		 */		
152
-		private function add_control( $slug, $args, $wp_customize ) {
152
+		private function add_control($slug, $args, $wp_customize) {
153 153
 			$default_args = array(
154 154
 
155 155
 			);
156 156
 
157
-			if( isset( $args['control'] ) && class_exists( $args['control'] )){
157
+			if (isset($args['control']) && class_exists($args['control'])) {
158 158
 				
159 159
 				$control_class = $args['control'];
160
-				unset( $args['control'] );
160
+				unset($args['control']);
161 161
 
162
-				$control = new $control_class( $wp_customize, $slug, array_merge( $default_args, $args ) );
163
-				$wp_customize->add_control( $control );
162
+				$control = new $control_class($wp_customize, $slug, array_merge($default_args, $args));
163
+				$wp_customize->add_control($control);
164 164
 			
165
-			}else{
165
+			} else {
166 166
 				
167
-				if( isset( $args['control'] ) ){
168
-					unset( $args['control'] );
167
+				if (isset($args['control'])) {
168
+					unset($args['control']);
169 169
 				}
170 170
 
171 171
 				$wp_customize->add_control(
172 172
 					$slug,
173
-					array_merge( $default_args, $args )
173
+					array_merge($default_args, $args)
174 174
 				);
175 175
 			}
176 176
 		}
Please login to merge, or discard this patch.
inc/sensei.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -12,26 +12,26 @@  discard block
 block discarded – undo
12 12
  * Hooks
13 13
  */
14 14
 
15
-remove_action( 'sensei_before_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper' ), 10 );
16
-remove_action( 'sensei_after_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper_end' ), 10 );
15
+remove_action('sensei_before_main_content', array($woothemes_sensei->frontend, 'sensei_output_content_wrapper'), 10);
16
+remove_action('sensei_after_main_content', array($woothemes_sensei->frontend, 'sensei_output_content_wrapper_end'), 10);
17 17
 
18 18
 add_action('sensei_before_main_content', 'lsx_sensei_before_content', 10);
19 19
 add_action('sensei_after_main_content', 'lsx_sensei_after_content', 10);
20 20
 
21 21
 //Switching the course filters and the headers around
22
-remove_action('sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 10, 0 );
23
-remove_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_sorting' ) );
24
-remove_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_filters' ) );
25
-add_action('sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 11, 0 );
26
-add_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_sorting' ),12 );
27
-add_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_filters' ),12 );
22
+remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 10, 0);
23
+remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting'));
24
+remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters'));
25
+add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 11, 0);
26
+add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting'), 12);
27
+add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters'), 12);
28 28
 
29 29
 // Moving course image up in DOM
30
-remove_action('sensei_course_content_inside_before', array( Sensei()->course, 'course_image' ) ,10, 1 );
31
-add_action('sensei_course_content_inside_before', array( Sensei()->course, 'course_image' ) ,1, 1 );
30
+remove_action('sensei_course_content_inside_before', array(Sensei()->course, 'course_image'), 10, 1);
31
+add_action('sensei_course_content_inside_before', array(Sensei()->course, 'course_image'), 1, 1);
32 32
 
33
-remove_action( 'sensei_single_course_content_inside_before', array( Sensei()->course , 'course_image'), 20 );
34
-add_action( 'sensei_single_course_content_inside_before', array( Sensei()->course , 'course_image'), 12 );
33
+remove_action('sensei_single_course_content_inside_before', array(Sensei()->course, 'course_image'), 20);
34
+add_action('sensei_single_course_content_inside_before', array(Sensei()->course, 'course_image'), 12);
35 35
 
36 36
 /**
37 37
  * Adds the top and primary divs for the layout.
@@ -39,22 +39,22 @@  discard block
 block discarded – undo
39 39
  * @subpackage sensei
40 40
  * @category 	layout
41 41
  */
42
-function lsx_sensei_wp_head(){
42
+function lsx_sensei_wp_head() {
43 43
 
44
-	$layout = get_theme_mod('lsx_layout','2cr');
45
-	$layout = apply_filters( 'lsx_layout', $layout );
44
+	$layout = get_theme_mod('lsx_layout', '2cr');
45
+	$layout = apply_filters('lsx_layout', $layout);
46 46
 
47
-	if('1c' === $layout && is_post_type_archive(array('course','lesson'))) {
48
-		add_action('sensei_archive_before_course_loop', 'lsx_breadcrumbs', 11 );
47
+	if ('1c' === $layout && is_post_type_archive(array('course', 'lesson'))) {
48
+		add_action('sensei_archive_before_course_loop', 'lsx_breadcrumbs', 11);
49 49
 	}
50 50
 	
51
-	if('1c' === $layout && is_tax(array('module','course-category'))) {
51
+	if ('1c' === $layout && is_tax(array('module', 'course-category'))) {
52 52
 		remove_action('lsx_content_top', 'lsx_breadcrumbs');
53
-		add_action( 'sensei_loop_course_before', 'lsx_breadcrumbs', 80 , 1 );
53
+		add_action('sensei_loop_course_before', 'lsx_breadcrumbs', 80, 1);
54 54
 		
55
-		if(is_tax('module')){
56
-			remove_action( 'sensei_content_lesson_inside_before', array( 'Sensei_Lesson', 'the_lesson_meta' ), 20 );
57
-			add_action( 'sensei_content_lesson_inside_before', array( 'Sensei_Lesson', 'the_lesson_meta' ), 40 );
55
+		if (is_tax('module')) {
56
+			remove_action('sensei_content_lesson_inside_before', array('Sensei_Lesson', 'the_lesson_meta'), 20);
57
+			add_action('sensei_content_lesson_inside_before', array('Sensei_Lesson', 'the_lesson_meta'), 40);
58 58
 			
59 59
 			remove_action('sensei_content_lesson_inside_before', array('Sensei_Core_Modules', 'module_archive_description'), 11);
60 60
 		}
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
  * @subpackage sensei
74 74
  * @category 	layout
75 75
  */
76
-function lsx_sensei_before_content(){ ?>
76
+function lsx_sensei_before_content() { ?>
77 77
 	<?php lsx_content_wrap_before(); ?>
78 78
 
79
-	<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
79
+	<div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>">
80 80
 
81 81
 		<?php lsx_content_before(); ?>
82 82
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
  * @subpackage sensei
93 93
  * @category 	layout
94 94
  */
95
-function lsx_sensei_after_content(){ ?>
95
+function lsx_sensei_after_content() { ?>
96 96
 		<?php lsx_content_bottom(); ?>
97 97
 
98 98
 		</main><!-- #main -->
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
  * @subpackage sensei
117 117
  * @category redirect
118 118
  */
119
-add_filter( 'sensei_disable_styles', '__return_true' );
119
+add_filter('sensei_disable_styles', '__return_true');
120 120
 
121 121
 /**
122 122
  * Includes the sensei specific styles.
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
  * @category styles
126 126
  */
127 127
 function lsx_sensei_styles() {
128
-    wp_enqueue_style( 'sensei', get_template_directory_uri() . '/css/sensei.css', array(), LSX_VERSION );
128
+    wp_enqueue_style('sensei', get_template_directory_uri() . '/css/sensei.css', array(), LSX_VERSION);
129 129
 }
130
-add_action( 'wp_enqueue_scripts', 'lsx_sensei_styles' );
130
+add_action('wp_enqueue_scripts', 'lsx_sensei_styles');
131 131
 
132 132
 /**
133 133
  * Redirects Lessons Archive to Courses Overview
@@ -135,13 +135,13 @@  discard block
 block discarded – undo
135 135
  * @subpackage woocommerce
136 136
  * @category 	styles
137 137
  */
138
-function lsx_sensei_redirect_to_home( $query ){
139
-    if(!is_admin() && is_post_type_archive( 'lesson' ) ) {
140
-         wp_redirect( home_url() . '/courses-overview' );
138
+function lsx_sensei_redirect_to_home($query) {
139
+    if ( ! is_admin() && is_post_type_archive('lesson')) {
140
+         wp_redirect(home_url() . '/courses-overview');
141 141
          exit;
142 142
      }
143 143
 }
144
-add_action( 'parse_query', 'lsx_sensei_redirect_to_home' );
144
+add_action('parse_query', 'lsx_sensei_redirect_to_home');
145 145
 
146 146
 /**
147 147
  * Filters the archive title
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
  * @subpackage woocommerce
150 150
  * @category 	styles
151 151
  */
152
-function lsx_sensei_category_title( $html,$term_id ){
153
-	$html = str_replace('h2','h1',$html);
154
-	$html = str_replace('sensei-category-title','archive-title',$html);
152
+function lsx_sensei_category_title($html, $term_id) {
153
+	$html = str_replace('h2', 'h1', $html);
154
+	$html = str_replace('sensei-category-title', 'archive-title', $html);
155 155
 	
156
-	return '<header class="archive-header">'.$html.'</header>';
156
+	return '<header class="archive-header">' . $html . '</header>';
157 157
 }
158
-add_filter( 'course_category_title', 'lsx_sensei_category_title',1,10 );
159 158
\ No newline at end of file
159
+add_filter('course_category_title', 'lsx_sensei_category_title', 1, 10);
160 160
\ No newline at end of file
Please login to merge, or discard this patch.