Completed
Push — master ( a7a38c...d582e6 )
by Warwick
03:03 queued 16s
created
includes/extras.php 1 patch
Spacing   +155 added lines, -155 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,55 +52,55 @@  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 ( function_exists( 'tour_operator' ) ) {
75
-			$post_types = array( 'page', 'post' );
74
+		if (function_exists('tour_operator')) {
75
+			$post_types = array('page', 'post');
76 76
 
77 77
 			$classes[] = 'to-active';
78 78
 		}
79 79
 
80
-		if ( has_nav_menu( 'top-menu' ) || has_nav_menu( 'top-menu-left' ) ) {
80
+		if (has_nav_menu('top-menu') || has_nav_menu('top-menu-left')) {
81 81
 			$classes[] = 'has-top-menu';
82 82
 		}
83 83
 
84
-		$fixed_header = get_theme_mod( 'lsx_header_fixed', false );
84
+		$fixed_header = get_theme_mod('lsx_header_fixed', false);
85 85
 
86
-		if ( false !== $fixed_header ) {
86
+		if (false !== $fixed_header) {
87 87
 			$classes[] = 'top-menu-fixed';
88 88
 		}
89 89
 
90
-		$search_form  = get_theme_mod( 'lsx_header_search', false );
90
+		$search_form = get_theme_mod('lsx_header_search', false);
91 91
 
92
-		if ( false !== $search_form ) {
92
+		if (false !== $search_form) {
93 93
 			$classes[] = 'has-header-search';
94 94
 		}
95 95
 
96
-		$preloader_content  = get_theme_mod( 'lsx_preloader_content_status', false );
96
+		$preloader_content = get_theme_mod('lsx_preloader_content_status', false);
97 97
 
98
-		if ( false !== $preloader_content ) {
98
+		if (false !== $preloader_content) {
99 99
 			$classes[] = 'preloader-content-enable';
100 100
 		}
101 101
 
102
-		$register_enabled = get_option( 'users_can_register', false );
103
-		if ( ( $register_enabled ) && is_page( 'my-account' ) && is_singular() ) {
102
+		$register_enabled = get_option('users_can_register', false);
103
+		if (($register_enabled) && is_page('my-account') && is_singular()) {
104 104
 			$classes[] = 'register-enabled';
105 105
 		}
106 106
 
@@ -109,9 +109,9 @@  discard block
 block discarded – undo
109 109
 
110 110
 endif;
111 111
 
112
-add_filter( 'body_class', 'lsx_body_class' );
112
+add_filter('body_class', 'lsx_body_class');
113 113
 
114
-if ( ! function_exists( 'lsx_embed_wrap' ) ) :
114
+if ( ! function_exists('lsx_embed_wrap')) :
115 115
 
116 116
 	/**
117 117
 	 * Wrap embedded media as suggested by Readability.
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
 	 * @link https://gist.github.com/965956
123 123
 	 * @link http://www.readability.com/publishers/guidelines#publisher
124 124
 	 */
125
-	function lsx_embed_wrap( $cache, $url, $attr = '', $post_id = '' ) {
126
-		if ( false !== strpos( $cache, '<iframe' ) ) {
125
+	function lsx_embed_wrap($cache, $url, $attr = '', $post_id = '') {
126
+		if (false !== strpos($cache, '<iframe')) {
127 127
 			return '<div class="entry-content-asset">' . $cache . '</div>';
128 128
 		}
129 129
 
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
 
133 133
 endif;
134 134
 
135
-add_filter( 'embed_oembed_html', 'lsx_embed_wrap', 10, 4 );
135
+add_filter('embed_oembed_html', 'lsx_embed_wrap', 10, 4);
136 136
 
137
-if ( ! function_exists( 'lsx_remove_self_closing_tags' ) ) :
137
+if ( ! function_exists('lsx_remove_self_closing_tags')) :
138 138
 
139 139
 	/**
140 140
 	 * Remove unnecessary self-closing tags.
@@ -142,17 +142,17 @@  discard block
 block discarded – undo
142 142
 	 * @package    lsx
143 143
 	 * @subpackage extras
144 144
 	 */
145
-	function lsx_remove_self_closing_tags( $input ) {
146
-		return str_replace( ' />', '>', $input );
145
+	function lsx_remove_self_closing_tags($input) {
146
+		return str_replace(' />', '>', $input);
147 147
 	}
148 148
 
149 149
 endif;
150 150
 
151
-add_filter( 'get_avatar',          'lsx_remove_self_closing_tags' ); // <img />
152
-add_filter( 'comment_id_fields',   'lsx_remove_self_closing_tags' ); // <input />
153
-add_filter( 'post_thumbnail_html', 'lsx_remove_self_closing_tags' ); // <img />
151
+add_filter('get_avatar', 'lsx_remove_self_closing_tags'); // <img />
152
+add_filter('comment_id_fields', 'lsx_remove_self_closing_tags'); // <input />
153
+add_filter('post_thumbnail_html', 'lsx_remove_self_closing_tags'); // <img />
154 154
 
155
-if ( ! function_exists( 'lsx_is_element_empty' ) ) :
155
+if ( ! function_exists('lsx_is_element_empty')) :
156 156
 
157 157
 	/**
158 158
 	 * Checks if a Nav $element is empty or not.
@@ -160,14 +160,14 @@  discard block
 block discarded – undo
160 160
 	 * @package    lsx
161 161
 	 * @subpackage extras
162 162
 	 */
163
-	function lsx_is_element_empty( $element ) {
164
-		$element = trim( $element );
165
-		return empty( $element ) ? false : true;
163
+	function lsx_is_element_empty($element) {
164
+		$element = trim($element);
165
+		return empty($element) ? false : true;
166 166
 	}
167 167
 
168 168
 endif;
169 169
 
170
-if ( ! function_exists( 'lsx_get_thumbnail' ) ) :
170
+if ( ! function_exists('lsx_get_thumbnail')) :
171 171
 
172 172
 	/**
173 173
 	 * return the responsive images.
@@ -175,55 +175,55 @@  discard block
 block discarded – undo
175 175
 	 * @package    lsx
176 176
 	 * @subpackage extras
177 177
 	 */
178
-	function lsx_get_thumbnail( $size, $image_src = false ) {
179
-		if ( false === $image_src ) {
178
+	function lsx_get_thumbnail($size, $image_src = false) {
179
+		if (false === $image_src) {
180 180
 			$post_id           = get_the_ID();
181
-			$post_thumbnail_id = get_post_thumbnail_id( $post_id );
182
-		} elseif ( false !== $image_src ) {
183
-			if ( is_numeric( $image_src ) ) {
181
+			$post_thumbnail_id = get_post_thumbnail_id($post_id);
182
+		} elseif (false !== $image_src) {
183
+			if (is_numeric($image_src)) {
184 184
 				$post_thumbnail_id = $image_src;
185 185
 			} else {
186
-				$post_thumbnail_id = lsx_get_attachment_id_from_src( $image_src );
186
+				$post_thumbnail_id = lsx_get_attachment_id_from_src($image_src);
187 187
 			}
188 188
 		}
189 189
 
190
-		$size = apply_filters( 'lsx_thumbnail_size', $size );
190
+		$size = apply_filters('lsx_thumbnail_size', $size);
191 191
 		$img       = '';
192 192
 		$lazy_img  = '';
193 193
 		$image_url = '';
194 194
 
195
-		if ( 'lsx-thumbnail-single' === $size || 'lsx-thumbnail-wide' === $size || 'lsx-thumbnail-square' === $size || 'thumbnail' === $size ) {
195
+		if ('lsx-thumbnail-single' === $size || 'lsx-thumbnail-wide' === $size || 'lsx-thumbnail-square' === $size || 'thumbnail' === $size) {
196 196
 			$srcset = false;
197
-			$img    = get_the_post_thumbnail_url( get_the_ID(), 'lsx-thumbnail-wide' );
197
+			$img    = get_the_post_thumbnail_url(get_the_ID(), 'lsx-thumbnail-wide');
198 198
 		} else {
199 199
 			$srcset = true;
200
-			$img = wp_get_attachment_image_srcset( $post_thumbnail_id, $size );
200
+			$img = wp_get_attachment_image_srcset($post_thumbnail_id, $size);
201 201
 
202
-			$temp_lazy = wp_get_attachment_image_src( $post_thumbnail_id, $size );
203
-			if ( ! empty( $temp_lazy ) ) {
202
+			$temp_lazy = wp_get_attachment_image_src($post_thumbnail_id, $size);
203
+			if ( ! empty($temp_lazy)) {
204 204
 				$lazy_img = $temp_lazy[0];
205 205
 			}
206 206
 
207
-			if ( empty( $img ) ) {
207
+			if (empty($img)) {
208 208
 				$srcset = false;
209
-				if ( ! empty( $lazy_img ) ) {
209
+				if ( ! empty($lazy_img)) {
210 210
 					$img = $lazy_img;
211 211
 				}
212 212
 			}
213 213
 		}
214 214
 
215
-		if ( '' !== $img ) {
215
+		if ('' !== $img) {
216 216
 			$image_url = $img;
217
-			$img = '<img alt="' . the_title_attribute( 'echo=0' ) . '" class="attachment-responsive wp-post-image lsx-responsive" ';
218
-			if ( $srcset ) {
219
-				$img .= 'srcset="' . esc_attr( $image_url ) . '" ';
217
+			$img = '<img alt="' . the_title_attribute('echo=0') . '" class="attachment-responsive wp-post-image lsx-responsive" ';
218
+			if ($srcset) {
219
+				$img .= 'srcset="' . esc_attr($image_url) . '" ';
220 220
 			} else {
221
-				$img .= 'src="' . esc_url( $image_url ) . '" ';
221
+				$img .= 'src="' . esc_url($image_url) . '" ';
222 222
 			}
223 223
 			$img .= '/>';
224 224
 
225
-			$img = apply_filters( 'lsx_lazyload_filter_images', $img );
226
-			$img = apply_filters( 'lsx_lazyload_slider_images', $img, $post_thumbnail_id, $size, $srcset, $image_url );
225
+			$img = apply_filters('lsx_lazyload_filter_images', $img);
226
+			$img = apply_filters('lsx_lazyload_slider_images', $img, $post_thumbnail_id, $size, $srcset, $image_url);
227 227
 		}
228 228
 
229 229
 		return $img;
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
 endif;
233 233
 
234
-if ( ! function_exists( 'lsx_thumbnail' ) ) :
234
+if ( ! function_exists('lsx_thumbnail')) :
235 235
 
236 236
 	/**
237 237
 	 * Output the Resonsive Images.
@@ -239,13 +239,13 @@  discard block
 block discarded – undo
239 239
 	 * @package    lsx
240 240
 	 * @subpackage extras
241 241
 	 */
242
-	function lsx_thumbnail( $size = 'thumbnail', $image_src = false ) {
243
-		echo wp_kses_post( lsx_get_thumbnail( $size, $image_src ) );
242
+	function lsx_thumbnail($size = 'thumbnail', $image_src = false) {
243
+		echo wp_kses_post(lsx_get_thumbnail($size, $image_src));
244 244
 	}
245 245
 
246 246
 endif;
247 247
 
248
-if ( ! function_exists( 'lsx_get_attachment_id_from_src' ) ) :
248
+if ( ! function_exists('lsx_get_attachment_id_from_src')) :
249 249
 
250 250
 	/**
251 251
 	 * Gets the attachments ID from the src.
@@ -253,13 +253,13 @@  discard block
 block discarded – undo
253 253
 	 * @package    lsx
254 254
 	 * @subpackage extras
255 255
 	 */
256
-	function lsx_get_attachment_id_from_src( $image_src ) {
257
-		$post_id = wp_cache_get( $image_src, 'lsx_get_attachment_id_from_src' );
256
+	function lsx_get_attachment_id_from_src($image_src) {
257
+		$post_id = wp_cache_get($image_src, 'lsx_get_attachment_id_from_src');
258 258
 
259
-		if ( false === $post_id ) {
259
+		if (false === $post_id) {
260 260
 			global $wpdb;
261
-			$post_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src ) );
262
-			wp_cache_set( $image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600 );
261
+			$post_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src));
262
+			wp_cache_set($image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600);
263 263
 		}
264 264
 
265 265
 		return $post_id;
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 
268 268
 endif;
269 269
 
270
-if ( ! function_exists( 'lsx_page_banner' ) ) :
270
+if ( ! function_exists('lsx_page_banner')) :
271 271
 
272 272
 	/**
273 273
 	 * Add Featured Image as Banner on Single Pages.
@@ -276,30 +276,30 @@  discard block
 block discarded – undo
276 276
 	 * @subpackage extras
277 277
 	 */
278 278
 	function lsx_page_banner() {
279
-		if ( true === apply_filters( 'lsx_page_banner_disable', false ) ) {
279
+		if (true === apply_filters('lsx_page_banner_disable', false)) {
280 280
 			return;
281 281
 		}
282 282
 
283
-		$post_types = array( 'page', 'post' );
284
-		$post_types = apply_filters( 'lsx_allowed_post_type_banners', $post_types );
283
+		$post_types = array('page', 'post');
284
+		$post_types = apply_filters('lsx_allowed_post_type_banners', $post_types);
285 285
 
286
-		if ( is_singular( $post_types ) && has_post_thumbnail() ) :
286
+		if (is_singular($post_types) && has_post_thumbnail()) :
287 287
 			$bg_image = '';
288 288
 
289
-			if ( has_post_thumbnail() ) {
290
-				$temp_bg_image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' );
291
-				if ( ! empty( $temp_bg_image ) ) {
289
+			if (has_post_thumbnail()) {
290
+				$temp_bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full');
291
+				if ( ! empty($temp_bg_image)) {
292 292
 					$bg_image = $temp_bg_image[0];
293 293
 				}
294 294
 			}
295 295
 
296
-			if ( '' !== $bg_image ) :
296
+			if ('' !== $bg_image) :
297 297
 				?>
298 298
 					<div class="page-banner-wrap">
299 299
 						<div class="page-banner">
300 300
 							<?php lsx_banner_inner_top(); ?>
301 301
 
302
-							<div class="page-banner-image" style="background-image:url(<?php echo esc_attr( $bg_image ); ?>);"></div>
302
+							<div class="page-banner-image" style="background-image:url(<?php echo esc_attr($bg_image); ?>);"></div>
303 303
 
304 304
 							<div class="container">
305 305
 								<header class="page-header">
@@ -318,11 +318,11 @@  discard block
 block discarded – undo
318 318
 
319 319
 endif;
320 320
 
321
-add_filter( 'lsx_banner_disable', 'lsx_disable_banner_for_blocks' );
322
-add_filter( 'lsx_global_header_disable', 'lsx_disable_banner_for_blocks' );
321
+add_filter('lsx_banner_disable', 'lsx_disable_banner_for_blocks');
322
+add_filter('lsx_global_header_disable', 'lsx_disable_banner_for_blocks');
323 323
 
324 324
 
325
-if ( ! function_exists( 'lsx_disable_banner_for_blocks' ) ) :
325
+if ( ! function_exists('lsx_disable_banner_for_blocks')) :
326 326
 
327 327
 	/**
328 328
 	 * Disable the Banner if the page is using Blocks
@@ -333,15 +333,15 @@  discard block
 block discarded – undo
333 333
 	 * @param  $disable boolean
334 334
 	 * @return boolean
335 335
 	 */
336
-	function lsx_disable_banner_for_blocks( $disable ) {
336
+	function lsx_disable_banner_for_blocks($disable) {
337 337
 		$queried_object = get_queried_object_id();
338
-		$show_on_front  = get_option( 'show_on_front' );
338
+		$show_on_front  = get_option('show_on_front');
339 339
 
340
-		if ( 'page' === $show_on_front && (int) get_option( 'page_for_posts' ) === $queried_object ) {
340
+		if ('page' === $show_on_front && (int) get_option('page_for_posts') === $queried_object) {
341 341
 			return $disable;
342 342
 		}
343 343
 
344
-		if ( function_exists( 'has_blocks' ) && has_blocks() && ( ! is_archive() ) ) {
344
+		if (function_exists('has_blocks') && has_blocks() && ( ! is_archive())) {
345 345
 			$disable = true;
346 346
 		}
347 347
 		return $disable;
@@ -349,9 +349,9 @@  discard block
 block discarded – undo
349 349
 
350 350
 endif;
351 351
 
352
-add_action( 'lsx_header_after', 'lsx_page_banner' );
352
+add_action('lsx_header_after', 'lsx_page_banner');
353 353
 
354
-if ( ! function_exists( 'lsx_form_submit_button' ) ) :
354
+if ( ! function_exists('lsx_form_submit_button')) :
355 355
 
356 356
 	/**
357 357
 	 * filter the Gravity Forms button type.
@@ -363,15 +363,15 @@  discard block
 block discarded – undo
363 363
 	 * @param  $form   Object
364 364
 	 * @return String
365 365
 	 */
366
-	function lsx_form_submit_button( $button, $form ) {
366
+	function lsx_form_submit_button($button, $form) {
367 367
 		return "<button class='btn btn-primary' id='gform_submit_button_{$form["id"]}'><span>Submit</span></button>";
368 368
 	}
369 369
 
370 370
 endif;
371 371
 
372
-add_filter( 'gform_submit_button', 'lsx_form_submit_button', 10, 2 );
372
+add_filter('gform_submit_button', 'lsx_form_submit_button', 10, 2);
373 373
 
374
-if ( ! function_exists( 'lsx_excerpt_more' ) ) :
374
+if ( ! function_exists('lsx_excerpt_more')) :
375 375
 
376 376
 	/**
377 377
 	 * Replaces the excerpt "more" text by a link.
@@ -379,15 +379,15 @@  discard block
 block discarded – undo
379 379
 	 * @package    lsx
380 380
 	 * @subpackage extras
381 381
 	 */
382
-	function lsx_excerpt_more( $more ) {
382
+	function lsx_excerpt_more($more) {
383 383
 		return '...';
384 384
 	}
385 385
 
386 386
 endif;
387 387
 
388
-add_filter( 'excerpt_more', 'lsx_excerpt_more' );
388
+add_filter('excerpt_more', 'lsx_excerpt_more');
389 389
 
390
-if ( ! function_exists( 'lsx_the_excerpt_filter' ) ) :
390
+if ( ! function_exists('lsx_the_excerpt_filter')) :
391 391
 
392 392
 	/**
393 393
 	 * Add a continue reading link to the excerpt.
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 	 * @package    lsx
396 396
 	 * @subpackage extras
397 397
 	 */
398
-	function lsx_the_excerpt_filter( $excerpt ) {
398
+	function lsx_the_excerpt_filter($excerpt) {
399 399
 
400 400
 		$post_formats = array(
401 401
 			'aside'   => 'aside',
@@ -408,23 +408,23 @@  discard block
 block discarded – undo
408 408
 			'audio'   => 'audio',
409 409
 		);
410 410
 
411
-		$show_full_content = has_post_format( apply_filters( 'lsx_the_excerpt_filter_post_types', $post_formats ) );
411
+		$show_full_content = has_post_format(apply_filters('lsx_the_excerpt_filter_post_types', $post_formats));
412 412
 
413
-		if ( ! $show_full_content ) {
414
-			if ( '' !== $excerpt && ! stristr( $excerpt, 'moretag' ) ) {
415
-				$pagination = wp_link_pages( array(
413
+		if ( ! $show_full_content) {
414
+			if ('' !== $excerpt && ! stristr($excerpt, 'moretag')) {
415
+				$pagination = wp_link_pages(array(
416 416
 					'before'      => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
417 417
 					'after'       => '</div></div>',
418 418
 					'link_before' => '<span>',
419 419
 					'link_after'  => '</span>',
420 420
 					'echo'        => 0,
421
-				) );
421
+				));
422 422
 
423
-				if ( ! empty( $pagination ) ) {
423
+				if ( ! empty($pagination)) {
424 424
 					$excerpt .= $pagination;
425 425
 				} else {
426
-					$excerpt_more = '<p><a class="moretag" href="' . esc_url( get_permalink() ) . '">' . esc_html__( 'Read More', 'lsx' ) . '</a></p>';
427
-					$excerpt .= apply_filters( 'excerpt_more_p', $excerpt_more );
426
+					$excerpt_more = '<p><a class="moretag" href="' . esc_url(get_permalink()) . '">' . esc_html__('Read More', 'lsx') . '</a></p>';
427
+					$excerpt .= apply_filters('excerpt_more_p', $excerpt_more);
428 428
 				}
429 429
 			}
430 430
 		}
@@ -434,9 +434,9 @@  discard block
 block discarded – undo
434 434
 
435 435
 endif;
436 436
 
437
-add_filter( 'the_excerpt', 'lsx_the_excerpt_filter' , 1 , 20 );
437
+add_filter('the_excerpt', 'lsx_the_excerpt_filter', 1, 20);
438 438
 
439
-if ( ! function_exists( 'lsx_full_width_widget_classes' ) ) :
439
+if ( ! function_exists('lsx_full_width_widget_classes')) :
440 440
 
441 441
 	/**
442 442
 	 * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget.
@@ -444,8 +444,8 @@  discard block
 block discarded – undo
444 444
 	 * @package    lsx
445 445
 	 * @subpackage extras
446 446
 	 */
447
-	function lsx_full_width_widget_classes( $params ) {
448
-		if ( is_admin() ) {
447
+	function lsx_full_width_widget_classes($params) {
448
+		if (is_admin()) {
449 449
 			return $params;
450 450
 		}
451 451
 
@@ -454,9 +454,9 @@  discard block
 block discarded – undo
454 454
 		$widget_id   = $params[0]['widget_id'];
455 455
 		$widget_name = $params[0]['widget_name'];
456 456
 
457
-		if ( 'Text' === $widget_name ) {
458
-			$wp_registered_widgets[ $widget_id ]['original_callback'] = $wp_registered_widgets[ $widget_id ]['callback'];
459
-			$wp_registered_widgets[ $widget_id ]['callback'] = 'lsx_full_width_widget_custom_callback';
457
+		if ('Text' === $widget_name) {
458
+			$wp_registered_widgets[$widget_id]['original_callback'] = $wp_registered_widgets[$widget_id]['callback'];
459
+			$wp_registered_widgets[$widget_id]['callback'] = 'lsx_full_width_widget_custom_callback';
460 460
 		}
461 461
 
462 462
 		return $params;
@@ -464,9 +464,9 @@  discard block
 block discarded – undo
464 464
 
465 465
 endif;
466 466
 
467
-add_filter( 'dynamic_sidebar_params', 'lsx_full_width_widget_classes' );
467
+add_filter('dynamic_sidebar_params', 'lsx_full_width_widget_classes');
468 468
 
469
-if ( ! function_exists( 'lsx_full_width_widget_custom_callback' ) ) :
469
+if ( ! function_exists('lsx_full_width_widget_custom_callback')) :
470 470
 
471 471
 	/**
472 472
 	 * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget.
@@ -480,25 +480,25 @@  discard block
 block discarded – undo
480 480
 		$original_callback_params = func_get_args();
481 481
 		$widget_id = $original_callback_params[0]['widget_id'];
482 482
 
483
-		$original_callback = $wp_registered_widgets[ $widget_id ]['original_callback'];
484
-		$wp_registered_widgets[ $widget_id ]['callback'] = $original_callback;
483
+		$original_callback = $wp_registered_widgets[$widget_id]['original_callback'];
484
+		$wp_registered_widgets[$widget_id]['callback'] = $original_callback;
485 485
 
486
-		$widget_id_base = $wp_registered_widgets[ $widget_id ]['callback'][0]->id_base;
486
+		$widget_id_base = $wp_registered_widgets[$widget_id]['callback'][0]->id_base;
487 487
 
488 488
 		$widget_classname = '';
489 489
 
490
-		if ( is_callable( $original_callback ) ) {
490
+		if (is_callable($original_callback)) {
491 491
 			ob_start();
492
-			call_user_func_array( $original_callback, $original_callback_params );
492
+			call_user_func_array($original_callback, $original_callback_params);
493 493
 			$widget_output = ob_get_clean();
494 494
 
495
-			echo wp_kses_post( apply_filters( 'lsx_widget_output', $widget_output, $widget_id_base, $widget_classname, $widget_id ) );
495
+			echo wp_kses_post(apply_filters('lsx_widget_output', $widget_output, $widget_id_base, $widget_classname, $widget_id));
496 496
 		}
497 497
 	}
498 498
 
499 499
 endif;
500 500
 
501
-if ( ! function_exists( 'lsx_full_width_widget_output' ) ) :
501
+if ( ! function_exists('lsx_full_width_widget_output')) :
502 502
 
503 503
 	/**
504 504
 	 * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget.
@@ -506,12 +506,12 @@  discard block
 block discarded – undo
506 506
 	 * @package    lsx
507 507
 	 * @subpackage extras
508 508
 	 */
509
-	function lsx_full_width_widget_output( $widget_output, $widget_id_base, $widget_id ) {
510
-		if ( 'text' === $widget_id_base ) {
511
-			if ( false !== strpos( $widget_output, '<div class="lsx-full-width-alt">' ) ) {
512
-				$widget_output = str_replace( 'class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width_alt"', $widget_output );
513
-			} elseif ( false !== strpos( $widget_output, '<div class="lsx-full-width">' ) ) {
514
-				$widget_output = str_replace( 'class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width"', $widget_output );
509
+	function lsx_full_width_widget_output($widget_output, $widget_id_base, $widget_id) {
510
+		if ('text' === $widget_id_base) {
511
+			if (false !== strpos($widget_output, '<div class="lsx-full-width-alt">')) {
512
+				$widget_output = str_replace('class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width_alt"', $widget_output);
513
+			} elseif (false !== strpos($widget_output, '<div class="lsx-full-width">')) {
514
+				$widget_output = str_replace('class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width"', $widget_output);
515 515
 			}
516 516
 		}
517 517
 
@@ -520,13 +520,13 @@  discard block
 block discarded – undo
520 520
 
521 521
 endif;
522 522
 
523
-add_filter( 'lsx_widget_output', 'lsx_full_width_widget_output', 10, 3 );
523
+add_filter('lsx_widget_output', 'lsx_full_width_widget_output', 10, 3);
524 524
 
525 525
 /**
526 526
  * Check if the content has a restricted post format that needs to show a full excerpt.
527 527
  */
528 528
 function lsx_post_format_force_content_on_list() {
529
-	$post_formats = apply_filters( 'lsx_post_format_force_content_on_list',
529
+	$post_formats = apply_filters('lsx_post_format_force_content_on_list',
530 530
 		array(
531 531
 				'video' => 'video',
532 532
 				'audio' => 'audio',
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 			)
536 536
 	);
537 537
 	$return = false;
538
-	if ( ! has_post_format( $post_formats ) ) {
538
+	if ( ! has_post_format($post_formats)) {
539 539
 		$return = true;
540 540
 	}
541 541
 	return $return;
@@ -544,67 +544,67 @@  discard block
 block discarded – undo
544 544
 /**
545 545
  * Remove the Hentry Class Every
546 546
  */
547
-function lsx_remove_hentry( $classes ) {
548
-	if ( 'post' !== get_post_type() ) {
549
-		$classes = array_diff( $classes, array( 'hentry' ) );
547
+function lsx_remove_hentry($classes) {
548
+	if ('post' !== get_post_type()) {
549
+		$classes = array_diff($classes, array('hentry'));
550 550
 	}
551 551
 	return $classes;
552 552
 }
553
-add_filter( 'post_class','lsx_remove_hentry' );
553
+add_filter('post_class', 'lsx_remove_hentry');
554 554
 
555 555
 /**
556 556
  * Strip Excerpts.
557 557
  *
558 558
  */
559
-function lsx_strip_excerpt( $content ) {
560
-	if ( is_search() || is_archive() || ( is_blog_installed() && ! is_single() && ! is_page() ) ) {
561
-		$content = strip_shortcodes( $content );
562
-		$content = str_replace( ']]>', ']]&gt;', $content );
563
-		$content = strip_tags( $content );
559
+function lsx_strip_excerpt($content) {
560
+	if (is_search() || is_archive() || (is_blog_installed() && ! is_single() && ! is_page())) {
561
+		$content = strip_shortcodes($content);
562
+		$content = str_replace(']]>', ']]&gt;', $content);
563
+		$content = strip_tags($content);
564 564
 	}
565 565
 	return $content;
566 566
 }
567
-add_filter( 'the_content', 'lsx_strip_excerpt' );
567
+add_filter('the_content', 'lsx_strip_excerpt');
568 568
 
569 569
 /**
570 570
  * Disable Gutenberg for LSX Custom Post Tpes.
571 571
  *
572 572
  */
573
-function lsx_disable_gutenberg_product_type( $is_enabled, $post_type ) {
574
-	if ( 'testimonial' === $post_type || 'team' === $post_type || 'project' === $post_type ) {
573
+function lsx_disable_gutenberg_product_type($is_enabled, $post_type) {
574
+	if ('testimonial' === $post_type || 'team' === $post_type || 'project' === $post_type) {
575 575
 		return false;
576 576
 	}
577 577
 
578 578
 	return $is_enabled;
579 579
 }
580
-add_filter( 'gutenberg_add_edit_link_for_post_type', 'lsx_disable_gutenberg_product_type', 10, 2 );
580
+add_filter('gutenberg_add_edit_link_for_post_type', 'lsx_disable_gutenberg_product_type', 10, 2);
581 581
 
582 582
 /**
583 583
  * Add the "Blog" link to the breadcrumbs
584 584
  * @param $crumbs
585 585
  * @return array
586 586
  */
587
-function lsx_breadcrumbs_blog_link( $crumbs ) {
587
+function lsx_breadcrumbs_blog_link($crumbs) {
588 588
 
589
-	$show_on_front = get_option( 'show_on_front' );
589
+	$show_on_front = get_option('show_on_front');
590 590
 
591
-	if ( 'page' === $show_on_front && ( is_category() || is_tag() ) ) {
591
+	if ('page' === $show_on_front && (is_category() || is_tag())) {
592 592
 
593
-		$blog_page = get_option( 'page_for_posts' );
594
-		if ( false !== $blog_page && '' !== $blog_page ) {
593
+		$blog_page = get_option('page_for_posts');
594
+		if (false !== $blog_page && '' !== $blog_page) {
595 595
 
596 596
 			$new_crumbs = array();
597 597
 			$new_crumbs[0] = $crumbs[0];
598 598
 
599
-			if ( function_exists( 'woocommerce_breadcrumb' ) ) {
599
+			if (function_exists('woocommerce_breadcrumb')) {
600 600
 				$new_crumbs[1] = array(
601
-					0	=> get_the_title( $blog_page ),
602
-					1	=> get_permalink( $blog_page ),
601
+					0	=> get_the_title($blog_page),
602
+					1	=> get_permalink($blog_page),
603 603
 				);
604 604
 			} else {
605 605
 				$new_crumbs[1] = array(
606
-					'text'	=> get_the_title( $blog_page ),
607
-					'url'	=> get_permalink( $blog_page ),
606
+					'text'	=> get_the_title($blog_page),
607
+					'url'	=> get_permalink($blog_page),
608 608
 				);
609 609
 			}
610 610
 			$new_crumbs[2] = $crumbs[1];
@@ -614,5 +614,5 @@  discard block
 block discarded – undo
614 614
 	}
615 615
 	return $crumbs;
616 616
 }
617
-add_filter( 'wpseo_breadcrumb_links', 'lsx_breadcrumbs_blog_link', 30, 1 );
618
-add_filter( 'woocommerce_get_breadcrumb', 'lsx_breadcrumbs_blog_link', 30, 1 );
617
+add_filter('wpseo_breadcrumb_links', 'lsx_breadcrumbs_blog_link', 30, 1);
618
+add_filter('woocommerce_get_breadcrumb', 'lsx_breadcrumbs_blog_link', 30, 1);
Please login to merge, or discard this patch.