Passed
Push — master ( 0d8b3d...7c953a )
by Warwick
01:54
created
includes/extras.php 1 patch
Spacing   +160 added lines, -160 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @subpackage extras
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
@@ -16,10 +16,10 @@  discard block
 block discarded – undo
16 16
  * @package    lsx
17 17
  * @subpackage extras
18 18
  */
19
-add_filter( 'widget_text', 'shortcode_unautop' );
20
-add_filter( 'widget_text', 'do_shortcode' );
19
+add_filter('widget_text', 'shortcode_unautop');
20
+add_filter('widget_text', 'do_shortcode');
21 21
 
22
-if ( ! function_exists( 'lsx_kses_allowed_html' ) ) :
22
+if ( ! function_exists('lsx_kses_allowed_html')) :
23 23
 
24 24
 	/**
25 25
 	 * Enable extra attributes (srcset, sizes) in img tag.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @package    lsx
28 28
 	 * @subpackage extras
29 29
 	 */
30
-	function lsx_kses_allowed_html( $allowedtags, $context ) {
30
+	function lsx_kses_allowed_html($allowedtags, $context) {
31 31
 		$allowedtags['img']['srcset'] = true;
32 32
 		$allowedtags['img']['sizes']  = true;
33 33
 
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 
43 43
 endif;
44 44
 
45
-add_filter( 'wp_kses_allowed_html', 'lsx_kses_allowed_html', 10, 2 );
45
+add_filter('wp_kses_allowed_html', 'lsx_kses_allowed_html', 10, 2);
46 46
 
47
-if ( ! function_exists( 'lsx_body_class' ) ) :
47
+if ( ! function_exists('lsx_body_class')) :
48 48
 
49 49
 	/**
50 50
 	 * Add and remove body_class() classes.
@@ -52,44 +52,44 @@  discard block
 block discarded – undo
52 52
 	 * @package    lsx
53 53
 	 * @subpackage extras
54 54
 	 */
55
-	function lsx_body_class( $classes ) {
55
+	function lsx_body_class($classes) {
56 56
 		global $post;
57 57
 
58
-		$header_layout = get_theme_mod( 'lsx_header_layout', 'inline' );
58
+		$header_layout = get_theme_mod('lsx_header_layout', 'inline');
59 59
 		$classes[]     = 'header-' . $header_layout;
60 60
 
61
-		if ( isset( $post ) ) {
61
+		if (isset($post)) {
62 62
 			$classes[] = $post->post_name;
63 63
 		}
64 64
 
65
-		if ( ! class_exists( 'LSX_Banners' ) || ! empty( apply_filters( 'lsx_banner_plugin_disable', false ) ) ) {
66
-			$post_types = array( 'page', 'post' );
67
-			$post_types = apply_filters( 'lsx_allowed_post_type_banners', $post_types );
65
+		if ( ! class_exists('LSX_Banners') || ! empty(apply_filters('lsx_banner_plugin_disable', false))) {
66
+			$post_types = array('page', 'post');
67
+			$post_types = apply_filters('lsx_allowed_post_type_banners', $post_types);
68 68
 
69
-			if ( is_singular( $post_types ) && has_post_thumbnail() ) {
69
+			if (is_singular($post_types) && has_post_thumbnail()) {
70 70
 				$classes[] = 'page-has-banner';
71 71
 			}
72 72
 		}
73 73
 
74
-		if ( has_nav_menu( 'top-menu' ) || has_nav_menu( 'top-menu-left' ) ) {
74
+		if (has_nav_menu('top-menu') || has_nav_menu('top-menu-left')) {
75 75
 			$classes[] = 'has-top-menu';
76 76
 		}
77 77
 
78
-		$fixed_header = get_theme_mod( 'lsx_header_fixed', false );
78
+		$fixed_header = get_theme_mod('lsx_header_fixed', false);
79 79
 
80
-		if ( false !== $fixed_header ) {
80
+		if (false !== $fixed_header) {
81 81
 			$classes[] = 'top-menu-fixed';
82 82
 		}
83 83
 
84
-		$search_form = get_theme_mod( 'lsx_header_search', false );
84
+		$search_form = get_theme_mod('lsx_header_search', false);
85 85
 
86
-		if ( false !== $search_form ) {
86
+		if (false !== $search_form) {
87 87
 			$classes[] = 'has-header-search';
88 88
 		}
89 89
 
90
-		$preloader_content = get_theme_mod( 'lsx_preloader_content_status', false );
90
+		$preloader_content = get_theme_mod('lsx_preloader_content_status', false);
91 91
 
92
-		if ( false !== $preloader_content ) {
92
+		if (false !== $preloader_content) {
93 93
 			$classes[] = 'preloader-content-enable';
94 94
 		}
95 95
 
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 
99 99
 endif;
100 100
 
101
-add_filter( 'body_class', 'lsx_body_class' );
101
+add_filter('body_class', 'lsx_body_class');
102 102
 
103
-if ( ! function_exists( 'lsx_embed_wrap' ) ) :
103
+if ( ! function_exists('lsx_embed_wrap')) :
104 104
 
105 105
 	/**
106 106
 	 * Wrap embedded media as suggested by Readability.
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 	 * @link https://gist.github.com/965956
112 112
 	 * @link http://www.readability.com/publishers/guidelines#publisher
113 113
 	 */
114
-	function lsx_embed_wrap( $cache, $url, $attr = '', $post_id = '' ) {
115
-		if ( false !== strpos( $cache, '<iframe' ) ) {
114
+	function lsx_embed_wrap($cache, $url, $attr = '', $post_id = '') {
115
+		if (false !== strpos($cache, '<iframe')) {
116 116
 			return '<div class="entry-content-asset">' . $cache . '</div>';
117 117
 		}
118 118
 
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
 
122 122
 endif;
123 123
 
124
-add_filter( 'embed_oembed_html', 'lsx_embed_wrap', 10, 4 );
124
+add_filter('embed_oembed_html', 'lsx_embed_wrap', 10, 4);
125 125
 
126
-if ( ! function_exists( 'lsx_remove_self_closing_tags' ) ) :
126
+if ( ! function_exists('lsx_remove_self_closing_tags')) :
127 127
 
128 128
 	/**
129 129
 	 * Remove unnecessary self-closing tags.
@@ -131,17 +131,17 @@  discard block
 block discarded – undo
131 131
 	 * @package    lsx
132 132
 	 * @subpackage extras
133 133
 	 */
134
-	function lsx_remove_self_closing_tags( $input ) {
135
-		return str_replace( ' />', '>', $input );
134
+	function lsx_remove_self_closing_tags($input) {
135
+		return str_replace(' />', '>', $input);
136 136
 	}
137 137
 
138 138
 endif;
139 139
 
140
-add_filter( 'get_avatar', 'lsx_remove_self_closing_tags' ); // <img />
141
-add_filter( 'comment_id_fields', 'lsx_remove_self_closing_tags' ); // <input />
142
-add_filter( 'post_thumbnail_html', 'lsx_remove_self_closing_tags' ); // <img />
140
+add_filter('get_avatar', 'lsx_remove_self_closing_tags'); // <img />
141
+add_filter('comment_id_fields', 'lsx_remove_self_closing_tags'); // <input />
142
+add_filter('post_thumbnail_html', 'lsx_remove_self_closing_tags'); // <img />
143 143
 
144
-if ( ! function_exists( 'lsx_is_element_empty' ) ) :
144
+if ( ! function_exists('lsx_is_element_empty')) :
145 145
 
146 146
 	/**
147 147
 	 * Checks if a Nav $element is empty or not.
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
 	 * @package    lsx
150 150
 	 * @subpackage extras
151 151
 	 */
152
-	function lsx_is_element_empty( $element ) {
153
-		$element = trim( $element );
154
-		return empty( $element ) ? false : true;
152
+	function lsx_is_element_empty($element) {
153
+		$element = trim($element);
154
+		return empty($element) ? false : true;
155 155
 	}
156 156
 
157 157
 endif;
158 158
 
159
-if ( ! function_exists( 'lsx_get_thumbnail' ) ) :
159
+if ( ! function_exists('lsx_get_thumbnail')) :
160 160
 
161 161
 	/**
162 162
 	 * return the responsive images.
@@ -164,44 +164,44 @@  discard block
 block discarded – undo
164 164
 	 * @package    lsx
165 165
 	 * @subpackage extras
166 166
 	 */
167
-	function lsx_get_thumbnail( $size, $image_src = false ) {
168
-		if ( false === $image_src ) {
167
+	function lsx_get_thumbnail($size, $image_src = false) {
168
+		if (false === $image_src) {
169 169
 			$post_id           = get_the_ID();
170
-			$post_thumbnail_id = get_post_thumbnail_id( $post_id );
171
-		} elseif ( false !== $image_src ) {
172
-			if ( is_numeric( $image_src ) ) {
170
+			$post_thumbnail_id = get_post_thumbnail_id($post_id);
171
+		} elseif (false !== $image_src) {
172
+			if (is_numeric($image_src)) {
173 173
 				$post_thumbnail_id = $image_src;
174 174
 			} else {
175
-				$post_thumbnail_id = lsx_get_attachment_id_from_src( $image_src );
175
+				$post_thumbnail_id = lsx_get_attachment_id_from_src($image_src);
176 176
 			}
177 177
 		}
178 178
 
179
-		$size = apply_filters( 'lsx_thumbnail_size', $size );
179
+		$size = apply_filters('lsx_thumbnail_size', $size);
180 180
 		$img  = false;
181 181
 
182
-		if ( 'lsx-thumbnail-single' === $size || 'lsx-thumbnail-wide' === $size || 'lsx-thumbnail-square' === $size || 'thumbnail' === $size ) {
182
+		if ('lsx-thumbnail-single' === $size || 'lsx-thumbnail-wide' === $size || 'lsx-thumbnail-square' === $size || 'thumbnail' === $size) {
183 183
 			$srcset = false;
184
-			$img    = wp_get_attachment_image_src( $post_thumbnail_id, $size );
184
+			$img    = wp_get_attachment_image_src($post_thumbnail_id, $size);
185 185
 			$img    = $img[0];
186 186
 		} else {
187 187
 			$srcset = true;
188
-			$img    = wp_get_attachment_image_srcset( $post_thumbnail_id, $size );
188
+			$img    = wp_get_attachment_image_srcset($post_thumbnail_id, $size);
189 189
 
190
-			if ( empty( $img ) ) {
190
+			if (empty($img)) {
191 191
 				$srcset = false;
192
-				$img    = wp_get_attachment_image_src( $post_thumbnail_id, $size );
192
+				$img    = wp_get_attachment_image_src($post_thumbnail_id, $size);
193 193
 				$img    = $img[0];
194 194
 			}
195 195
 		}
196 196
 
197
-		if ( ! empty( $img ) ) {
198
-			if ( $srcset ) {
199
-				$img = '<img alt="' . the_title_attribute( 'echo=0' ) . '" class="attachment-responsive wp-post-image lsx-responsive" srcset="' . esc_attr( $img ) . '" />';
197
+		if ( ! empty($img)) {
198
+			if ($srcset) {
199
+				$img = '<img alt="' . the_title_attribute('echo=0') . '" class="attachment-responsive wp-post-image lsx-responsive" srcset="' . esc_attr($img) . '" />';
200 200
 			} else {
201
-				$img = '<img alt="' . the_title_attribute( 'echo=0' ) . '" class="attachment-responsive wp-post-image lsx-responsive" src="' . esc_url( $img ) . '" />';
201
+				$img = '<img alt="' . the_title_attribute('echo=0') . '" class="attachment-responsive wp-post-image lsx-responsive" src="' . esc_url($img) . '" />';
202 202
 			}
203 203
 
204
-			$img = apply_filters( 'lsx_lazyload_filter_images', $img );
204
+			$img = apply_filters('lsx_lazyload_filter_images', $img);
205 205
 		}
206 206
 
207 207
 		return $img;
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 
210 210
 endif;
211 211
 
212
-if ( ! function_exists( 'lsx_thumbnail' ) ) :
212
+if ( ! function_exists('lsx_thumbnail')) :
213 213
 
214 214
 	/**
215 215
 	 * Output the Resonsive Images.
@@ -217,13 +217,13 @@  discard block
 block discarded – undo
217 217
 	 * @package    lsx
218 218
 	 * @subpackage extras
219 219
 	 */
220
-	function lsx_thumbnail( $size = 'thumbnail', $image_src = false ) {
221
-		echo wp_kses_post( lsx_get_thumbnail( $size, $image_src ) );
220
+	function lsx_thumbnail($size = 'thumbnail', $image_src = false) {
221
+		echo wp_kses_post(lsx_get_thumbnail($size, $image_src));
222 222
 	}
223 223
 
224 224
 endif;
225 225
 
226
-if ( ! function_exists( 'lsx_get_attachment_id_from_src' ) ) :
226
+if ( ! function_exists('lsx_get_attachment_id_from_src')) :
227 227
 
228 228
 	/**
229 229
 	 * Gets the attachments ID from the src.
@@ -231,13 +231,13 @@  discard block
 block discarded – undo
231 231
 	 * @package    lsx
232 232
 	 * @subpackage extras
233 233
 	 */
234
-	function lsx_get_attachment_id_from_src( $image_src ) {
235
-		$post_id = wp_cache_get( $image_src, 'lsx_get_attachment_id_from_src' );
234
+	function lsx_get_attachment_id_from_src($image_src) {
235
+		$post_id = wp_cache_get($image_src, 'lsx_get_attachment_id_from_src');
236 236
 
237
-		if ( false === $post_id ) {
237
+		if (false === $post_id) {
238 238
 			global $wpdb;
239
-			$post_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src ) );
240
-			wp_cache_set( $image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600 );
239
+			$post_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src));
240
+			wp_cache_set($image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600);
241 241
 		}
242 242
 
243 243
 		return $post_id;
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 
246 246
 endif;
247 247
 
248
-if ( ! function_exists( 'lsx_page_banner' ) ) :
248
+if ( ! function_exists('lsx_page_banner')) :
249 249
 
250 250
 	/**
251 251
 	 * Add Featured Image as Banner on Single Pages.
@@ -254,28 +254,28 @@  discard block
 block discarded – undo
254 254
 	 * @subpackage extras
255 255
 	 */
256 256
 	function lsx_page_banner() {
257
-		if ( true === apply_filters( 'lsx_page_banner_disable', false ) ) {
257
+		if (true === apply_filters('lsx_page_banner_disable', false)) {
258 258
 			return;
259 259
 		}
260 260
 
261
-		$post_types = array( 'page', 'post' );
262
-		$post_types = apply_filters( 'lsx_allowed_post_type_banners', $post_types );
261
+		$post_types = array('page', 'post');
262
+		$post_types = apply_filters('lsx_allowed_post_type_banners', $post_types);
263 263
 
264
-		if ( is_singular( $post_types ) && has_post_thumbnail() ) :
264
+		if (is_singular($post_types) && has_post_thumbnail()) :
265 265
 			$bg_image = '';
266 266
 
267
-			if ( has_post_thumbnail() ) {
268
-				$bg_image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' );
267
+			if (has_post_thumbnail()) {
268
+				$bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full');
269 269
 				$bg_image = $bg_image[0];
270 270
 			}
271 271
 
272
-			if ( ! empty( $bg_image ) ) :
272
+			if ( ! empty($bg_image)) :
273 273
 				?>
274 274
 					<div class="page-banner-wrap">
275 275
 						<div class="page-banner">
276 276
 							<?php lsx_banner_inner_top(); ?>
277 277
 
278
-							<div class="page-banner-image" style="background-image:url(<?php echo esc_attr( $bg_image ); ?>);"></div>
278
+							<div class="page-banner-image" style="background-image:url(<?php echo esc_attr($bg_image); ?>);"></div>
279 279
 
280 280
 							<div class="container">
281 281
 								<header class="page-header">
@@ -294,11 +294,11 @@  discard block
 block discarded – undo
294 294
 
295 295
 endif;
296 296
 
297
-add_filter( 'lsx_banner_disable', 'lsx_disable_banner_for_blocks' );
298
-add_filter( 'lsx_global_header_disable', 'lsx_disable_banner_for_blocks' );
297
+add_filter('lsx_banner_disable', 'lsx_disable_banner_for_blocks');
298
+add_filter('lsx_global_header_disable', 'lsx_disable_banner_for_blocks');
299 299
 
300 300
 
301
-if ( ! function_exists( 'lsx_disable_banner_for_blocks' ) ) :
301
+if ( ! function_exists('lsx_disable_banner_for_blocks')) :
302 302
 
303 303
 	/**
304 304
 	 * Disable the Banner if the page is using Blocks
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 	 * @param  $disable boolean
310 310
 	 * @return boolean
311 311
 	 */
312
-	function lsx_disable_banner_for_blocks( $disable ) {
313
-		if ( function_exists( 'has_blocks' ) && has_blocks() ) {
312
+	function lsx_disable_banner_for_blocks($disable) {
313
+		if (function_exists('has_blocks') && has_blocks()) {
314 314
 			$disable = true;
315 315
 		}
316 316
 		return $disable;
@@ -318,9 +318,9 @@  discard block
 block discarded – undo
318 318
 
319 319
 endif;
320 320
 
321
-add_action( 'lsx_header_after', 'lsx_page_banner' );
321
+add_action('lsx_header_after', 'lsx_page_banner');
322 322
 
323
-if ( ! function_exists( 'lsx_form_submit_button' ) ) :
323
+if ( ! function_exists('lsx_form_submit_button')) :
324 324
 
325 325
 	/**
326 326
 	 * filter the Gravity Forms button type.
@@ -332,15 +332,15 @@  discard block
 block discarded – undo
332 332
 	 * @param  $form   Object
333 333
 	 * @return String
334 334
 	 */
335
-	function lsx_form_submit_button( $button, $form ) {
335
+	function lsx_form_submit_button($button, $form) {
336 336
 		return "<button class='btn btn-primary' id='gform_submit_button_{$form["id"]}'><span>Submit</span></button>";
337 337
 	}
338 338
 
339 339
 endif;
340 340
 
341
-add_filter( 'gform_submit_button', 'lsx_form_submit_button', 10, 2 );
341
+add_filter('gform_submit_button', 'lsx_form_submit_button', 10, 2);
342 342
 
343
-if ( ! function_exists( 'lsx_excerpt_more' ) ) :
343
+if ( ! function_exists('lsx_excerpt_more')) :
344 344
 
345 345
 	/**
346 346
 	 * Replaces the excerpt "more" text by a link.
@@ -348,15 +348,15 @@  discard block
 block discarded – undo
348 348
 	 * @package    lsx
349 349
 	 * @subpackage extras
350 350
 	 */
351
-	function lsx_excerpt_more( $more ) {
351
+	function lsx_excerpt_more($more) {
352 352
 		return '...';
353 353
 	}
354 354
 
355 355
 endif;
356 356
 
357
-add_filter( 'excerpt_more', 'lsx_excerpt_more' );
357
+add_filter('excerpt_more', 'lsx_excerpt_more');
358 358
 
359
-if ( ! function_exists( 'lsx_the_excerpt_filter' ) ) :
359
+if ( ! function_exists('lsx_the_excerpt_filter')) :
360 360
 
361 361
 	/**
362 362
 	 * Add a continue reading link to the excerpt.
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 	 * @package    lsx
365 365
 	 * @subpackage extras
366 366
 	 */
367
-	function lsx_the_excerpt_filter( $excerpt ) {
367
+	function lsx_the_excerpt_filter($excerpt) {
368 368
 
369 369
 		$post_formats = array(
370 370
 			'aside'   => 'aside',
@@ -377,23 +377,23 @@  discard block
 block discarded – undo
377 377
 			'audio'   => 'audio',
378 378
 		);
379 379
 
380
-		$show_full_content = has_post_format( apply_filters( 'lsx_the_excerpt_filter_post_types', $post_formats ) );
380
+		$show_full_content = has_post_format(apply_filters('lsx_the_excerpt_filter_post_types', $post_formats));
381 381
 
382
-		if ( ! $show_full_content ) {
383
-			if ( '' !== $excerpt && ! stristr( $excerpt, 'moretag' ) ) {
384
-				$pagination = wp_link_pages( array(
382
+		if ( ! $show_full_content) {
383
+			if ('' !== $excerpt && ! stristr($excerpt, 'moretag')) {
384
+				$pagination = wp_link_pages(array(
385 385
 					'before'      => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
386 386
 					'after'       => '</div></div>',
387 387
 					'link_before' => '<span>',
388 388
 					'link_after'  => '</span>',
389 389
 					'echo'        => 0,
390
-				) );
390
+				));
391 391
 
392
-				if ( ! empty( $pagination ) ) {
392
+				if ( ! empty($pagination)) {
393 393
 					$excerpt .= $pagination;
394 394
 				} else {
395
-					$excerpt_more = '<p><a class="moretag" href="' . esc_url( get_permalink() ) . '">' . esc_html__( 'Continue reading', 'lsx' ) . '</a></p>';
396
-					$excerpt     .= apply_filters( 'excerpt_more_p', $excerpt_more );
395
+					$excerpt_more = '<p><a class="moretag" href="' . esc_url(get_permalink()) . '">' . esc_html__('Continue reading', 'lsx') . '</a></p>';
396
+					$excerpt     .= apply_filters('excerpt_more_p', $excerpt_more);
397 397
 				}
398 398
 			}
399 399
 		}
@@ -403,9 +403,9 @@  discard block
 block discarded – undo
403 403
 
404 404
 endif;
405 405
 
406
-add_filter( 'the_excerpt', 'lsx_the_excerpt_filter', 1, 20 );
406
+add_filter('the_excerpt', 'lsx_the_excerpt_filter', 1, 20);
407 407
 
408
-if ( ! function_exists( 'lsx_custom_wp_trim_excerpt' ) ) :
408
+if ( ! function_exists('lsx_custom_wp_trim_excerpt')) :
409 409
 
410 410
 	/**
411 411
 	 * Allow HTML tags in excerpt.
@@ -413,12 +413,12 @@  discard block
 block discarded – undo
413 413
 	 * @package    lsx
414 414
 	 * @subpackage extras
415 415
 	 */
416
-	function lsx_custom_wp_trim_excerpt( $wpse_excerpt ) {
416
+	function lsx_custom_wp_trim_excerpt($wpse_excerpt) {
417 417
 		global $post;
418 418
 		$raw_excerpt = $wpse_excerpt;
419 419
 
420
-		if ( empty( $wpse_excerpt ) ) {
421
-			$wpse_excerpt = get_the_content( '' );
420
+		if (empty($wpse_excerpt)) {
421
+			$wpse_excerpt = get_the_content('');
422 422
 
423 423
 			$post_formats = array(
424 424
 				'aside'   => 'aside',
@@ -431,27 +431,27 @@  discard block
 block discarded – undo
431 431
 				'audio'   => 'audio',
432 432
 			);
433 433
 
434
-			$show_full_content = has_post_format( apply_filters( 'lsx_excerpt_read_more_post_formats', $post_formats ) );
434
+			$show_full_content = has_post_format(apply_filters('lsx_excerpt_read_more_post_formats', $post_formats));
435 435
 
436
-			if ( ! $show_full_content ) {
437
-				$wpse_excerpt = strip_shortcodes( $wpse_excerpt );
438
-				$wpse_excerpt = apply_filters( 'the_content', $wpse_excerpt );
439
-				$wpse_excerpt = str_replace( ']]>', ']]>', $wpse_excerpt );
440
-				$wpse_excerpt = strip_tags( $wpse_excerpt, apply_filters( 'excerpt_strip_tags', '<h1>,<h2>,<h3>,<h4>,<h5>,<h6>,<a>,<button>,<blockquote>,<p>,<br>,<b>,<strong>,<i>,<u>,<ul>,<ol>,<li>,<span>,<div>' ) );
436
+			if ( ! $show_full_content) {
437
+				$wpse_excerpt = strip_shortcodes($wpse_excerpt);
438
+				$wpse_excerpt = apply_filters('the_content', $wpse_excerpt);
439
+				$wpse_excerpt = str_replace(']]>', ']]>', $wpse_excerpt);
440
+				$wpse_excerpt = strip_tags($wpse_excerpt, apply_filters('excerpt_strip_tags', '<h1>,<h2>,<h3>,<h4>,<h5>,<h6>,<a>,<button>,<blockquote>,<p>,<br>,<b>,<strong>,<i>,<u>,<ul>,<ol>,<li>,<span>,<div>'));
441 441
 
442 442
 				$excerpt_word_count = 50;
443
-				$excerpt_word_count = apply_filters( 'excerpt_length', $excerpt_word_count );
443
+				$excerpt_word_count = apply_filters('excerpt_length', $excerpt_word_count);
444 444
 
445 445
 				$tokens         = array();
446 446
 				$excerpt_output = '';
447 447
 				$has_more       = false;
448 448
 				$count          = 0;
449 449
 
450
-				preg_match_all( '/(<[^>]+>|[^<>\s]+)\s*/u', $wpse_excerpt, $tokens );
450
+				preg_match_all('/(<[^>]+>|[^<>\s]+)\s*/u', $wpse_excerpt, $tokens);
451 451
 
452
-				foreach ( $tokens[0] as $token ) {
453
-					if ( $count >= $excerpt_word_count ) {
454
-						$excerpt_output .= trim( $token );
452
+				foreach ($tokens[0] as $token) {
453
+					if ($count >= $excerpt_word_count) {
454
+						$excerpt_output .= trim($token);
455 455
 						$has_more        = true;
456 456
 						break;
457 457
 					}
@@ -460,41 +460,41 @@  discard block
 block discarded – undo
460 460
 					$excerpt_output .= $token;
461 461
 				}
462 462
 
463
-				$wpse_excerpt = trim( force_balance_tags( $excerpt_output ) );
463
+				$wpse_excerpt = trim(force_balance_tags($excerpt_output));
464 464
 
465
-				if ( $has_more ) {
466
-					$excerpt_end = '<a class="moretag" href="' . esc_url( get_permalink() ) . '">' . esc_html__( 'More', 'lsx' ) . '</a>';
467
-					$excerpt_end = apply_filters( 'excerpt_more', ' ' . $excerpt_end );
465
+				if ($has_more) {
466
+					$excerpt_end = '<a class="moretag" href="' . esc_url(get_permalink()) . '">' . esc_html__('More', 'lsx') . '</a>';
467
+					$excerpt_end = apply_filters('excerpt_more', ' ' . $excerpt_end);
468 468
 
469
-					$pos = strrpos( $wpse_excerpt, '</' );
469
+					$pos = strrpos($wpse_excerpt, '</');
470 470
 
471
-					if ( false !== $pos ) {
471
+					if (false !== $pos) {
472 472
 						// Inside last HTML tag.
473
-						$wpse_excerpt = substr_replace( $wpse_excerpt, $excerpt_end, $pos, 0 ); /* Add read more next to last word */
473
+						$wpse_excerpt = substr_replace($wpse_excerpt, $excerpt_end, $pos, 0); /* Add read more next to last word */
474 474
 					} else {
475 475
 						// After the content.
476 476
 						$wpse_excerpt .= $excerpt_end; /*Add read more in new paragraph */
477 477
 					}
478 478
 				}
479 479
 			} else {
480
-				$wpse_excerpt = apply_filters( 'the_content', $wpse_excerpt );
481
-				$wpse_excerpt = str_replace( ']]>', ']]>', $wpse_excerpt );
480
+				$wpse_excerpt = apply_filters('the_content', $wpse_excerpt);
481
+				$wpse_excerpt = str_replace(']]>', ']]>', $wpse_excerpt);
482 482
 				//$wpse_excerpt = strip_tags( $wpse_excerpt, '<blockquote>,<p>' );
483
-				$wpse_excerpt = trim( force_balance_tags( $wpse_excerpt ) );
483
+				$wpse_excerpt = trim(force_balance_tags($wpse_excerpt));
484 484
 			}
485 485
 
486 486
 			return $wpse_excerpt;
487 487
 		}
488 488
 
489
-		return apply_filters( 'lsx_custom_wp_trim_excerpt', $wpse_excerpt, $raw_excerpt );
489
+		return apply_filters('lsx_custom_wp_trim_excerpt', $wpse_excerpt, $raw_excerpt);
490 490
 	}
491 491
 
492 492
 endif;
493 493
 
494
-remove_filter( 'get_the_excerpt', 'wp_trim_excerpt' );
495
-add_filter( 'get_the_excerpt', 'lsx_custom_wp_trim_excerpt' );
494
+remove_filter('get_the_excerpt', 'wp_trim_excerpt');
495
+add_filter('get_the_excerpt', 'lsx_custom_wp_trim_excerpt');
496 496
 
497
-if ( ! function_exists( 'lsx_full_width_widget_classes' ) ) :
497
+if ( ! function_exists('lsx_full_width_widget_classes')) :
498 498
 
499 499
 	/**
500 500
 	 * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget.
@@ -502,8 +502,8 @@  discard block
 block discarded – undo
502 502
 	 * @package    lsx
503 503
 	 * @subpackage extras
504 504
 	 */
505
-	function lsx_full_width_widget_classes( $params ) {
506
-		if ( is_admin() ) {
505
+	function lsx_full_width_widget_classes($params) {
506
+		if (is_admin()) {
507 507
 			return $params;
508 508
 		}
509 509
 
@@ -512,9 +512,9 @@  discard block
 block discarded – undo
512 512
 		$widget_id   = $params[0]['widget_id'];
513 513
 		$widget_name = $params[0]['widget_name'];
514 514
 
515
-		if ( 'Text' === $widget_name ) {
516
-			$wp_registered_widgets[ $widget_id ]['original_callback'] = $wp_registered_widgets[ $widget_id ]['callback'];
517
-			$wp_registered_widgets[ $widget_id ]['callback'] = 'lsx_full_width_widget_custom_callback';
515
+		if ('Text' === $widget_name) {
516
+			$wp_registered_widgets[$widget_id]['original_callback'] = $wp_registered_widgets[$widget_id]['callback'];
517
+			$wp_registered_widgets[$widget_id]['callback'] = 'lsx_full_width_widget_custom_callback';
518 518
 		}
519 519
 
520 520
 		return $params;
@@ -522,9 +522,9 @@  discard block
 block discarded – undo
522 522
 
523 523
 endif;
524 524
 
525
-add_filter( 'dynamic_sidebar_params', 'lsx_full_width_widget_classes' );
525
+add_filter('dynamic_sidebar_params', 'lsx_full_width_widget_classes');
526 526
 
527
-if ( ! function_exists( 'lsx_full_width_widget_custom_callback' ) ) :
527
+if ( ! function_exists('lsx_full_width_widget_custom_callback')) :
528 528
 
529 529
 	/**
530 530
 	 * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget.
@@ -538,25 +538,25 @@  discard block
 block discarded – undo
538 538
 		$original_callback_params = func_get_args();
539 539
 		$widget_id = $original_callback_params[0]['widget_id'];
540 540
 
541
-		$original_callback = $wp_registered_widgets[ $widget_id ]['original_callback'];
542
-		$wp_registered_widgets[ $widget_id ]['callback'] = $original_callback;
541
+		$original_callback = $wp_registered_widgets[$widget_id]['original_callback'];
542
+		$wp_registered_widgets[$widget_id]['callback'] = $original_callback;
543 543
 
544
-		$widget_id_base = $wp_registered_widgets[ $widget_id ]['callback'][0]->id_base;
544
+		$widget_id_base = $wp_registered_widgets[$widget_id]['callback'][0]->id_base;
545 545
 
546 546
 		$widget_classname = '';
547 547
 
548
-		if ( is_callable( $original_callback ) ) {
548
+		if (is_callable($original_callback)) {
549 549
 			ob_start();
550
-			call_user_func_array( $original_callback, $original_callback_params );
550
+			call_user_func_array($original_callback, $original_callback_params);
551 551
 			$widget_output = ob_get_clean();
552 552
 
553
-			echo wp_kses_post( apply_filters( 'lsx_widget_output', $widget_output, $widget_id_base, $widget_classname, $widget_id ) );
553
+			echo wp_kses_post(apply_filters('lsx_widget_output', $widget_output, $widget_id_base, $widget_classname, $widget_id));
554 554
 		}
555 555
 	}
556 556
 
557 557
 endif;
558 558
 
559
-if ( ! function_exists( 'lsx_full_width_widget_output' ) ) :
559
+if ( ! function_exists('lsx_full_width_widget_output')) :
560 560
 
561 561
 	/**
562 562
 	 * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget.
@@ -564,12 +564,12 @@  discard block
 block discarded – undo
564 564
 	 * @package    lsx
565 565
 	 * @subpackage extras
566 566
 	 */
567
-	function lsx_full_width_widget_output( $widget_output, $widget_id_base, $widget_id ) {
568
-		if ( 'text' === $widget_id_base ) {
569
-			if ( false !== strpos( $widget_output, '<div class="lsx-full-width-alt">' ) ) {
570
-				$widget_output = str_replace( 'class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width_alt"', $widget_output );
571
-			} elseif ( false !== strpos( $widget_output, '<div class="lsx-full-width">' ) ) {
572
-				$widget_output = str_replace( 'class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width"', $widget_output );
567
+	function lsx_full_width_widget_output($widget_output, $widget_id_base, $widget_id) {
568
+		if ('text' === $widget_id_base) {
569
+			if (false !== strpos($widget_output, '<div class="lsx-full-width-alt">')) {
570
+				$widget_output = str_replace('class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width_alt"', $widget_output);
571
+			} elseif (false !== strpos($widget_output, '<div class="lsx-full-width">')) {
572
+				$widget_output = str_replace('class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width"', $widget_output);
573 573
 			}
574 574
 		}
575 575
 
@@ -578,13 +578,13 @@  discard block
 block discarded – undo
578 578
 
579 579
 endif;
580 580
 
581
-add_filter( 'lsx_widget_output', 'lsx_full_width_widget_output', 10, 3 );
581
+add_filter('lsx_widget_output', 'lsx_full_width_widget_output', 10, 3);
582 582
 
583 583
 /**
584 584
  * Check if the content has a restricted post format that needs to show a full excerpt.
585 585
  */
586 586
 function lsx_post_format_force_content_on_list() {
587
-	$post_formats = apply_filters( 'lsx_post_format_force_content_on_list',
587
+	$post_formats = apply_filters('lsx_post_format_force_content_on_list',
588 588
 		array(
589 589
 			'video' => 'video',
590 590
 			'audio' => 'audio',
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 		)
594 594
 	);
595 595
 	$return = false;
596
-	if ( ! has_post_format( $post_formats ) ) {
596
+	if ( ! has_post_format($post_formats)) {
597 597
 		$return = true;
598 598
 	}
599 599
 	return $return;
@@ -602,37 +602,37 @@  discard block
 block discarded – undo
602 602
 /**
603 603
  * Remove the Hentry Class Every
604 604
  */
605
-function lsx_remove_hentry( $classes ) {
606
-	if ( 'post' !== get_post_type() ) {
607
-		$classes = array_diff( $classes, array( 'hentry' ) );
605
+function lsx_remove_hentry($classes) {
606
+	if ('post' !== get_post_type()) {
607
+		$classes = array_diff($classes, array('hentry'));
608 608
 	}
609 609
 	return $classes;
610 610
 }
611
-add_filter( 'post_class','lsx_remove_hentry' );
611
+add_filter('post_class', 'lsx_remove_hentry');
612 612
 
613 613
 /**
614 614
  * Strip Excerpts.
615 615
  *
616 616
  */
617
-function lsx_strip_excerpt( $content ) {
618
-	if ( is_search() || is_archive() || ( is_blog_installed() && ! is_single() && ! is_page() ) ) {
619
-		$content = strip_shortcodes( $content );
620
-		$content = str_replace( ']]>', ']]&gt;', $content );
621
-		$content = strip_tags( $content );
617
+function lsx_strip_excerpt($content) {
618
+	if (is_search() || is_archive() || (is_blog_installed() && ! is_single() && ! is_page())) {
619
+		$content = strip_shortcodes($content);
620
+		$content = str_replace(']]>', ']]&gt;', $content);
621
+		$content = strip_tags($content);
622 622
 	}
623 623
 	return $content;
624 624
 }
625
-add_filter( 'the_content', 'lsx_strip_excerpt' );
625
+add_filter('the_content', 'lsx_strip_excerpt');
626 626
 
627 627
 /**
628 628
  * Disable Gutenberg for LSX Custom Post Tpes.
629 629
  *
630 630
  */
631
-function lsx_disable_gutenberg_product_type( $is_enabled, $post_type ) {
632
-	if ( 'testimonial' === $post_type || 'team' === $post_type || 'project' === $post_type ) {
631
+function lsx_disable_gutenberg_product_type($is_enabled, $post_type) {
632
+	if ('testimonial' === $post_type || 'team' === $post_type || 'project' === $post_type) {
633 633
 		return false;
634 634
 	}
635 635
 
636 636
 	return $is_enabled;
637 637
 }
638
-add_filter( 'gutenberg_add_edit_link_for_post_type', 'lsx_disable_gutenberg_product_type', 10, 2 );
638
+add_filter('gutenberg_add_edit_link_for_post_type', 'lsx_disable_gutenberg_product_type', 10, 2);
Please login to merge, or discard this patch.
includes/layout.php 1 patch
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  * @subpackage layout
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13
-if ( ! function_exists( 'lsx_layout_selector' ) ) :
13
+if ( ! function_exists('lsx_layout_selector')) :
14 14
 
15 15
 	/**
16 16
 	 * Layout selector.
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
 	 * @package    lsx
19 19
 	 * @subpackage layout
20 20
 	 */
21
-	function lsx_layout_selector( $class, $area = 'site' ) {
21
+	function lsx_layout_selector($class, $area = 'site') {
22 22
 		$return_class = '';
23
-		$layout       = get_theme_mod( 'lsx_layout', '2cr' );
24
-		$layout       = apply_filters( 'lsx_layout', $layout );
23
+		$layout       = get_theme_mod('lsx_layout', '2cr');
24
+		$layout       = apply_filters('lsx_layout', $layout);
25 25
 		$default_size = 'sm';
26
-		$size         = apply_filters( 'lsx_bootstrap_column_size', $default_size );
26
+		$size         = apply_filters('lsx_bootstrap_column_size', $default_size);
27 27
 
28
-		switch ( $layout ) {
28
+		switch ($layout) {
29 29
 			case '1c':
30 30
 				$main_class    = 'col-' . $size . '-12';
31 31
 				$sidebar_class = 'col-' . $size . '-12';
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 				break;
45 45
 		}
46 46
 
47
-		if ( 'main' === $class ) {
48
-			$return_class = apply_filters( 'lsx_layout_selector', $main_class, $class, $layout, $size );
47
+		if ('main' === $class) {
48
+			$return_class = apply_filters('lsx_layout_selector', $main_class, $class, $layout, $size);
49 49
 		}
50 50
 
51
-		if ( 'sidebar' === $class ) {
52
-			$return_class = apply_filters( 'lsx_layout_selector', $sidebar_class, $class, $layout, $size );
51
+		if ('sidebar' === $class) {
52
+			$return_class = apply_filters('lsx_layout_selector', $sidebar_class, $class, $layout, $size);
53 53
 		}
54 54
 
55 55
 		return $return_class;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 endif;
59 59
 
60
-if ( ! function_exists( 'lsx_main_class' ) ) :
60
+if ( ! function_exists('lsx_main_class')) :
61 61
 
62 62
 	/**
63 63
 	 * .main classes.
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
 	 * @subpackage layout
67 67
 	 */
68 68
 	function lsx_main_class() {
69
-		return lsx_layout_selector( 'main' );
69
+		return lsx_layout_selector('main');
70 70
 	}
71 71
 
72 72
 endif;
73 73
 
74
-if ( ! function_exists( 'lsx_sidebar_class' ) ) :
74
+if ( ! function_exists('lsx_sidebar_class')) :
75 75
 
76 76
 	/**
77 77
 	 * .sidebar classes.
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
 	 * @subpackage layout
81 81
 	 */
82 82
 	function lsx_sidebar_class() {
83
-		return lsx_layout_selector( 'sidebar' );
83
+		return lsx_layout_selector('sidebar');
84 84
 	}
85 85
 
86 86
 endif;
87 87
 
88
-if ( ! function_exists( 'lsx_header_classes' ) ) :
88
+if ( ! function_exists('lsx_header_classes')) :
89 89
 
90 90
 	/**
91 91
 	 * Output the classes for the header.
@@ -93,19 +93,19 @@  discard block
 block discarded – undo
93 93
 	 * @package    lsx
94 94
 	 * @subpackage layout
95 95
 	 */
96
-	function lsx_header_classes( $additional = false ) {
96
+	function lsx_header_classes($additional = false) {
97 97
 		$classes = 'banner navbar navbar-default';
98 98
 
99
-		if ( false !== $additional ) {
99
+		if (false !== $additional) {
100 100
 			$classes .= ' ' . $additional;
101 101
 		}
102 102
 
103
-		echo esc_attr( $classes );
103
+		echo esc_attr($classes);
104 104
 	}
105 105
 
106 106
 endif;
107 107
 
108
-if ( ! function_exists( 'lsx_top_menu_classes' ) ) :
108
+if ( ! function_exists('lsx_top_menu_classes')) :
109 109
 
110 110
 	/**
111 111
 	 * Output the classes for the top-menu.
@@ -113,19 +113,19 @@  discard block
 block discarded – undo
113 113
 	 * @package    lsx
114 114
 	 * @subpackage layout
115 115
 	 */
116
-	function lsx_top_menu_classes( $additional = false ) {
116
+	function lsx_top_menu_classes($additional = false) {
117 117
 		$classes = 'top-menu-default';
118 118
 
119
-		if ( false !== $additional ) {
119
+		if (false !== $additional) {
120 120
 			$classes .= ' ' . $additional;
121 121
 		}
122 122
 
123
-		echo esc_attr( $classes );
123
+		echo esc_attr($classes);
124 124
 	}
125 125
 
126 126
 endif;
127 127
 
128
-if ( ! function_exists( 'lsx_add_footer_sidebar_area' ) ) :
128
+if ( ! function_exists('lsx_add_footer_sidebar_area')) :
129 129
 
130 130
 	/**
131 131
 	 * Output the Footer CTA and/pr Footer Widgets.
@@ -134,34 +134,34 @@  discard block
 block discarded – undo
134 134
 	 * @subpackage layout
135 135
 	 */
136 136
 	function lsx_add_footer_sidebar_area() {
137
-		if ( is_active_sidebar( 'sidebar-footer-cta' ) ) : ?>
137
+		if (is_active_sidebar('sidebar-footer-cta')) : ?>
138 138
 			<div id="footer-cta">
139 139
 				<div class="container">
140 140
 					<div class="lsx-full-width">
141 141
 						<div class="lsx-hero-unit">
142
-							<?php dynamic_sidebar( 'sidebar-footer-cta' ); ?>
142
+							<?php dynamic_sidebar('sidebar-footer-cta'); ?>
143 143
 						</div>
144 144
 					</div>
145 145
 				</div>
146 146
 			</div>
147 147
 		<?php endif; ?>
148 148
 
149
-		<?php if ( is_active_sidebar( 'sidebar-footer' ) ) : ?>
149
+		<?php if (is_active_sidebar('sidebar-footer')) : ?>
150 150
 			<div id="footer-widgets">
151 151
 				<div class="container">
152 152
 					<div class="row">
153
-						<?php dynamic_sidebar( 'sidebar-footer' ); ?>
153
+						<?php dynamic_sidebar('sidebar-footer'); ?>
154 154
 					</div>
155 155
 				</div>
156 156
 			</div>
157 157
 		<?php endif;
158 158
 	}
159 159
 
160
-	add_action( 'lsx_footer_before', 'lsx_add_footer_sidebar_area' );
160
+	add_action('lsx_footer_before', 'lsx_add_footer_sidebar_area');
161 161
 
162 162
 endif;
163 163
 
164
-if ( ! function_exists( 'lsx_global_header' ) ) :
164
+if ( ! function_exists('lsx_global_header')) :
165 165
 
166 166
 	/**
167 167
 	 * Displays the global header.
@@ -170,21 +170,21 @@  discard block
 block discarded – undo
170 170
 	 * @subpackage layout
171 171
 	 */
172 172
 	function lsx_global_header() {
173
-		$show_on_front  = get_option( 'show_on_front' );
173
+		$show_on_front  = get_option('show_on_front');
174 174
 		$queried_object = get_queried_object();
175 175
 		$default_size   = 'sm';
176
-		$size           = apply_filters( 'lsx_bootstrap_column_size', $default_size );
176
+		$size           = apply_filters('lsx_bootstrap_column_size', $default_size);
177 177
 
178
-		if ( true === apply_filters( 'lsx_global_header_disable', false ) ) :
178
+		if (true === apply_filters('lsx_global_header_disable', false)) :
179 179
 			// Display only the breadcrumbs
180 180
 			?>
181
-			<div class="archive-header-wrapper col-<?php echo esc_attr( $size ); ?>-12">
181
+			<div class="archive-header-wrapper col-<?php echo esc_attr($size); ?>-12">
182 182
 				<?php lsx_global_header_inner_bottom(); ?>
183 183
 			</div>
184 184
 			<?php
185
-		elseif ( is_page() && ( 'page' !== $show_on_front || ! is_front_page() ) ) :
185
+		elseif (is_page() && ('page' !== $show_on_front || ! is_front_page())) :
186 186
 			?>
187
-			<div class="archive-header-wrapper col-<?php echo esc_attr( $size ); ?>-12">
187
+			<div class="archive-header-wrapper col-<?php echo esc_attr($size); ?>-12">
188 188
 				<?php lsx_global_header_inner_bottom(); ?>
189 189
 				<header class="archive-header">
190 190
 					<h1 class="archive-title"><?php the_title(); ?></h1>
@@ -192,9 +192,9 @@  discard block
 block discarded – undo
192 192
 
193 193
 			</div>
194 194
 			<?php
195
-		elseif ( is_single() && ! is_singular( 'post' ) ) :
195
+		elseif (is_single() && ! is_singular('post')) :
196 196
 			?>
197
-			<div class="archive-header-wrapper col-<?php echo esc_attr( $size ); ?>-12">
197
+			<div class="archive-header-wrapper col-<?php echo esc_attr($size); ?>-12">
198 198
 				<?php lsx_global_header_inner_bottom(); ?>
199 199
 				<header class="archive-header">
200 200
 					<h1 class="archive-title"><?php the_title(); ?></h1>
@@ -202,16 +202,16 @@  discard block
 block discarded – undo
202 202
 
203 203
 			</div>
204 204
 			<?php
205
-		elseif ( is_search() ) :
205
+		elseif (is_search()) :
206 206
 			?>
207
-			<div class="archive-header-wrapper col-<?php echo esc_attr( $size ); ?>-12">
207
+			<div class="archive-header-wrapper col-<?php echo esc_attr($size); ?>-12">
208 208
 				<?php lsx_global_header_inner_bottom(); ?>
209 209
 				<header class="archive-header">
210 210
 					<h1 class="archive-title">
211 211
 						<?php
212 212
 							printf(
213 213
 								/* Translators: %s: search term/query */
214
-								esc_html__( 'Search Results for: %s', 'lsx' ),
214
+								esc_html__('Search Results for: %s', 'lsx'),
215 215
 								'<span>' . get_search_query() . '</span>'
216 216
 							);
217 217
 						?>
@@ -220,12 +220,12 @@  discard block
 block discarded – undo
220 220
 
221 221
 			</div>
222 222
 			<?php
223
-		elseif ( is_author() ) :
223
+		elseif (is_author()) :
224 224
 			$author = get_the_author();
225
-			$author_avatar = get_avatar( get_the_author_meta( 'ID' ), 256 );
225
+			$author_avatar = get_avatar(get_the_author_meta('ID'), 256);
226 226
 			$author_bio = get_the_archive_description();
227 227
 			?>
228
-			<div class="archive-header-wrapper col-<?php echo esc_attr( $size ); ?>-12">
228
+			<div class="archive-header-wrapper col-<?php echo esc_attr($size); ?>-12">
229 229
 				<?php lsx_global_header_inner_bottom(); ?>
230 230
 				<header class="archive-header">
231 231
 					<h1 class="archive-title"><?php the_archive_title(); ?></h1>
@@ -233,14 +233,14 @@  discard block
 block discarded – undo
233 233
 
234 234
 			</div>
235 235
 			<?php
236
-		elseif ( is_archive() ) :
236
+		elseif (is_archive()) :
237 237
 			?>
238
-			<div class="archive-header-wrapper col-<?php echo esc_attr( $size ); ?>-12">
238
+			<div class="archive-header-wrapper col-<?php echo esc_attr($size); ?>-12">
239 239
 				<?php lsx_global_header_inner_bottom(); ?>
240 240
 				<header class="archive-header">
241 241
 					<h1 class="archive-title">
242
-						<?php if ( has_post_format() && ! is_category() && ! is_tag() && ! is_date() && ! is_tax( 'post_format' ) ) { ?>
243
-							<?php the_archive_title( esc_html__( 'Type:', 'lsx' ) ); ?>
242
+						<?php if (has_post_format() && ! is_category() && ! is_tag() && ! is_date() && ! is_tax('post_format')) { ?>
243
+							<?php the_archive_title(esc_html__('Type:', 'lsx')); ?>
244 244
 						<?php } else { ?>
245 245
 							<?php the_archive_title(); ?>
246 246
 						<?php } ?>
@@ -250,31 +250,31 @@  discard block
 block discarded – undo
250 250
 				</header>
251 251
 			</div>
252 252
 			<?php
253
-		elseif ( 'page' === $show_on_front && (int) get_option( 'page_for_posts' ) === $queried_object->ID ) :
253
+		elseif ('page' === $show_on_front && (int) get_option('page_for_posts') === $queried_object->ID) :
254 254
 			?>
255
-			<div class="archive-header-wrapper col-<?php echo esc_attr( $size ); ?>-12">
255
+			<div class="archive-header-wrapper col-<?php echo esc_attr($size); ?>-12">
256 256
 				<?php lsx_global_header_inner_bottom(); ?>
257 257
 				<header class="archive-header">
258
-					<h1 class="archive-title"><?php esc_html_e( 'Blog', 'lsx' ); ?></h1>
258
+					<h1 class="archive-title"><?php esc_html_e('Blog', 'lsx'); ?></h1>
259 259
 				</header>
260 260
 
261 261
 			</div>
262 262
 			<?php
263
-		elseif ( ! is_singular( 'post' ) ) :
263
+		elseif ( ! is_singular('post')) :
264 264
 			// Display only the breadcrumbs
265 265
 			?>
266
-			<div class="archive-header-wrapper col-<?php echo esc_attr( $size ); ?>-12">
266
+			<div class="archive-header-wrapper col-<?php echo esc_attr($size); ?>-12">
267 267
 				<?php lsx_global_header_inner_bottom(); ?>
268 268
 			</div>
269 269
 			<?php
270 270
 		endif;
271 271
 	}
272 272
 
273
-	add_action( 'lsx_content_wrap_before', 'lsx_global_header' );
273
+	add_action('lsx_content_wrap_before', 'lsx_global_header');
274 274
 
275 275
 endif;
276 276
 
277
-if ( ! function_exists( 'lsx_author_extra_info' ) ) :
277
+if ( ! function_exists('lsx_author_extra_info')) :
278 278
 
279 279
 	/**
280 280
 	 * Displays the author extra info.
@@ -284,57 +284,57 @@  discard block
 block discarded – undo
284 284
 	 */
285 285
 	function lsx_author_extra_info() {
286 286
 		$default_size   = 'sm';
287
-		$size           = apply_filters( 'lsx_bootstrap_column_size', $default_size );
287
+		$size           = apply_filters('lsx_bootstrap_column_size', $default_size);
288 288
 
289
-		if ( is_author() ) :
290
-			$author_id         = get_the_author_meta( 'ID' );
289
+		if (is_author()) :
290
+			$author_id         = get_the_author_meta('ID');
291 291
 			$author            = get_the_author();
292
-			$author_avatar     = get_avatar( $author_id, 256 );
292
+			$author_avatar     = get_avatar($author_id, 256);
293 293
 			$author_bio        = get_the_archive_description();
294
-			$author_url        = get_the_author_meta( 'url', $author_id );
295
-			$author_email      = get_the_author_meta( 'email', $author_id );
296
-			$author_facebook   = get_the_author_meta( 'facebook', $author_id );
297
-			$author_twitter    = get_the_author_meta( 'twitter', $author_id );
298
-			$author_googleplus = get_the_author_meta( 'googleplus', $author_id );
294
+			$author_url        = get_the_author_meta('url', $author_id);
295
+			$author_email      = get_the_author_meta('email', $author_id);
296
+			$author_facebook   = get_the_author_meta('facebook', $author_id);
297
+			$author_twitter    = get_the_author_meta('twitter', $author_id);
298
+			$author_googleplus = get_the_author_meta('googleplus', $author_id);
299 299
 			?>
300
-			<div class="col-<?php echo esc_attr( $size ); ?>-12">
300
+			<div class="col-<?php echo esc_attr($size); ?>-12">
301 301
 				<div class="archive-author-data">
302
-					<figure class="archive-author-avatar"><?php echo wp_kses_post( $author_avatar ); ?></figure>
302
+					<figure class="archive-author-avatar"><?php echo wp_kses_post($author_avatar); ?></figure>
303 303
 
304
-					<?php if ( ! empty( $author_url ) || ! empty( $author_email ) || ! empty( $author_facebook ) || ! empty( $author_twitter ) || ! empty( $author_googleplus ) ) : ?>
304
+					<?php if ( ! empty($author_url) || ! empty($author_email) || ! empty($author_facebook) || ! empty($author_twitter) || ! empty($author_googleplus)) : ?>
305 305
 						<div class="archive-author-social-links">
306
-							<?php if ( ! empty( $author_url ) ) : ?>
307
-								<a href="<?php echo esc_url( $author_url ); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-url"><i class="fa fa-link" aria-hidden="true"></i></a>
306
+							<?php if ( ! empty($author_url)) : ?>
307
+								<a href="<?php echo esc_url($author_url); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-url"><i class="fa fa-link" aria-hidden="true"></i></a>
308 308
 							<?php endif; ?>
309 309
 
310
-							<?php if ( ! empty( $author_email ) ) : ?>
311
-								<a href="mailto:<?php echo esc_attr( $author_email ); ?>" class="archive-author-social-link archive-author-social-link-email"><i class="fa fa-envelope" aria-hidden="true"></i></a>
310
+							<?php if ( ! empty($author_email)) : ?>
311
+								<a href="mailto:<?php echo esc_attr($author_email); ?>" class="archive-author-social-link archive-author-social-link-email"><i class="fa fa-envelope" aria-hidden="true"></i></a>
312 312
 							<?php endif; ?>
313 313
 
314
-							<?php if ( ! empty( $author_facebook ) ) : ?>
315
-								<a href="<?php echo esc_url( $author_facebook ); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-facebook"><i class="fa fa-facebook" aria-hidden="true"></i></a>
314
+							<?php if ( ! empty($author_facebook)) : ?>
315
+								<a href="<?php echo esc_url($author_facebook); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-facebook"><i class="fa fa-facebook" aria-hidden="true"></i></a>
316 316
 							<?php endif; ?>
317 317
 
318
-							<?php if ( ! empty( $author_twitter ) ) : ?>
319
-								<a href="https://twitter.com/<?php echo esc_attr( $author_twitter ); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a>
318
+							<?php if ( ! empty($author_twitter)) : ?>
319
+								<a href="https://twitter.com/<?php echo esc_attr($author_twitter); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a>
320 320
 							<?php endif; ?>
321 321
 
322
-							<?php if ( ! empty( $author_googleplus ) ) : ?>
323
-								<a href="<?php echo esc_url( $author_googleplus ); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-googleplus"><i class="fa fa-google-plus" aria-hidden="true"></i></a>
322
+							<?php if ( ! empty($author_googleplus)) : ?>
323
+								<a href="<?php echo esc_url($author_googleplus); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-googleplus"><i class="fa fa-google-plus" aria-hidden="true"></i></a>
324 324
 							<?php endif; ?>
325 325
 						</div>
326 326
 					<?php endif; ?>
327 327
 
328
-					<?php if ( ! empty( $author_bio ) ) : ?>
329
-						<h2 class="archive-author-title text-center"><?php esc_html_e( 'About the author', 'lsx' ); ?></h2>
330
-						<p class="archive-author-bio"><?php echo wp_kses_post( $author_bio ); ?></p>
328
+					<?php if ( ! empty($author_bio)) : ?>
329
+						<h2 class="archive-author-title text-center"><?php esc_html_e('About the author', 'lsx'); ?></h2>
330
+						<p class="archive-author-bio"><?php echo wp_kses_post($author_bio); ?></p>
331 331
 					<?php endif; ?>
332 332
 
333 333
 					<h2 class="archive-author-posts text-center">
334 334
 						<?php
335
-						if ( '' !== $author ) {
336
-							esc_html_e( 'All posts by ', 'lsx' );
337
-							esc_html( $author );
335
+						if ('' !== $author) {
336
+							esc_html_e('All posts by ', 'lsx');
337
+							esc_html($author);
338 338
 						}
339 339
 						?>
340 340
 					</h2>
@@ -344,11 +344,11 @@  discard block
 block discarded – undo
344 344
 		endif;
345 345
 	}
346 346
 
347
-	add_action( 'lsx_content_wrap_before', 'lsx_author_extra_info', 11 );
347
+	add_action('lsx_content_wrap_before', 'lsx_author_extra_info', 11);
348 348
 
349 349
 endif;
350 350
 
351
-if ( ! function_exists( 'lsx_post_header' ) ) :
351
+if ( ! function_exists('lsx_post_header')) :
352 352
 
353 353
 	/**
354 354
 	 * Displays the post header.
@@ -358,21 +358,21 @@  discard block
 block discarded – undo
358 358
 	 */
359 359
 	function lsx_post_header() {
360 360
 		$default_size  = 'sm';
361
-		$size          = apply_filters( 'lsx_bootstrap_column_size', $default_size );
361
+		$size          = apply_filters('lsx_bootstrap_column_size', $default_size);
362 362
 
363
-		if ( is_singular( 'post' ) ) :
363
+		if (is_singular('post')) :
364 364
 			$format = get_post_format();
365 365
 
366
-			if ( false === $format ) {
366
+			if (false === $format) {
367 367
 				$format = 'standard';
368 368
 			}
369 369
 
370
-			$format = lsx_translate_format_to_fontawesome( $format );
370
+			$format = lsx_translate_format_to_fontawesome($format);
371 371
 			?>
372
-			<div class="archive-header-wrapper col-<?php echo esc_attr( $size ); ?>-12">
372
+			<div class="archive-header-wrapper col-<?php echo esc_attr($size); ?>-12">
373 373
 				<header class="archive-header">
374 374
 					<h1 class="archive-title">
375
-						<i class="format-link fa fa-<?php echo esc_attr( $format ); ?>"></i>
375
+						<i class="format-link fa fa-<?php echo esc_attr($format); ?>"></i>
376 376
 						<span><?php the_title(); ?></span>
377 377
 					</h1>
378 378
 				</header>
@@ -381,11 +381,11 @@  discard block
 block discarded – undo
381 381
 		endif;
382 382
 	}
383 383
 
384
-	add_action( 'lsx_entry_top', 'lsx_post_header' );
384
+	add_action('lsx_entry_top', 'lsx_post_header');
385 385
 
386 386
 endif;
387 387
 
388
-if ( ! function_exists( 'lsx_add_viewport_meta_tag' ) ) :
388
+if ( ! function_exists('lsx_add_viewport_meta_tag')) :
389 389
 
390 390
 	/**
391 391
 	 * Add Viewport Meta Tag to head.
@@ -399,11 +399,11 @@  discard block
 block discarded – undo
399 399
 		<?php
400 400
 	}
401 401
 
402
-	add_action( 'wp_head', 'lsx_add_viewport_meta_tag' );
402
+	add_action('wp_head', 'lsx_add_viewport_meta_tag');
403 403
 
404 404
 endif;
405 405
 
406
-if ( ! function_exists( 'lsx_header_search_form' ) ) :
406
+if ( ! function_exists('lsx_header_search_form')) :
407 407
 
408 408
 	/**
409 409
 	 * Add a search form to just above the nav menu.
@@ -412,13 +412,13 @@  discard block
 block discarded – undo
412 412
 	 * @subpackage layout
413 413
 	 */
414 414
 	function lsx_header_search_form() {
415
-		$search_form = get_theme_mod( 'lsx_header_search', false );
415
+		$search_form = get_theme_mod('lsx_header_search', false);
416 416
 
417
-		if ( false !== $search_form || is_customize_preview() ) {
418
-			get_search_form( true );
417
+		if (false !== $search_form || is_customize_preview()) {
418
+			get_search_form(true);
419 419
 		}
420 420
 	}
421 421
 
422
-	add_action( 'lsx_nav_before', 'lsx_header_search_form', 0 );
422
+	add_action('lsx_nav_before', 'lsx_header_search_form', 0);
423 423
 
424 424
 endif;
Please login to merge, or discard this patch.