Passed
Push — master ( b8bd86...c2d39d )
by Warwick
04:43 queued 02:29
created
includes/layout.php 1 patch
Spacing   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -6,25 +6,25 @@  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
 	 * Layout selector.
16 16
 	 *
17 17
 	 * @package    lsx
18 18
 	 * @subpackage layout
19 19
 	 */
20
-	function lsx_layout_selector( $class, $area = 'site' ) {
20
+	function lsx_layout_selector($class, $area = 'site') {
21 21
 		$return_class = '';
22
-		$layout       = get_theme_mod( 'lsx_layout', '1c' );
23
-		$layout       = apply_filters( 'lsx_layout', $layout );
22
+		$layout       = get_theme_mod('lsx_layout', '1c');
23
+		$layout       = apply_filters('lsx_layout', $layout);
24 24
 		$default_size = 'sm';
25
-		$size         = apply_filters( 'lsx_bootstrap_column_size', $default_size );
25
+		$size         = apply_filters('lsx_bootstrap_column_size', $default_size);
26 26
 
27
-		switch ( $layout ) {
27
+		switch ($layout) {
28 28
 			case '1c':
29 29
 				$main_class    = 'col-' . $size . '-12';
30 30
 				$sidebar_class = 'col-' . $size . '-12';
@@ -43,19 +43,19 @@  discard block
 block discarded – undo
43 43
 				break;
44 44
 		}
45 45
 
46
-		if ( 'main' === $class ) {
47
-			$return_class = apply_filters( 'lsx_layout_selector', $main_class, $class, $layout, $size );
46
+		if ('main' === $class) {
47
+			$return_class = apply_filters('lsx_layout_selector', $main_class, $class, $layout, $size);
48 48
 		}
49 49
 
50
-		if ( 'sidebar' === $class ) {
51
-			$return_class = apply_filters( 'lsx_layout_selector', $sidebar_class, $class, $layout, $size );
50
+		if ('sidebar' === $class) {
51
+			$return_class = apply_filters('lsx_layout_selector', $sidebar_class, $class, $layout, $size);
52 52
 		}
53 53
 
54 54
 		return $return_class;
55 55
 	}
56 56
 endif;
57 57
 
58
-if ( ! function_exists( 'lsx_main_class' ) ) :
58
+if ( ! function_exists('lsx_main_class')) :
59 59
 	/**
60 60
 	 * .main classes.
61 61
 	 *
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
 	 * @subpackage layout
64 64
 	 */
65 65
 	function lsx_main_class() {
66
-		return lsx_layout_selector( 'main' );
66
+		return lsx_layout_selector('main');
67 67
 	}
68 68
 endif;
69 69
 
70
-if ( ! function_exists( 'lsx_sidebar_class' ) ) :
70
+if ( ! function_exists('lsx_sidebar_class')) :
71 71
 	/**
72 72
 	 * .sidebar classes.
73 73
 	 *
@@ -75,47 +75,47 @@  discard block
 block discarded – undo
75 75
 	 * @subpackage layout
76 76
 	 */
77 77
 	function lsx_sidebar_class() {
78
-		return lsx_layout_selector( 'sidebar' );
78
+		return lsx_layout_selector('sidebar');
79 79
 	}
80 80
 endif;
81 81
 
82
-if ( ! function_exists( 'lsx_header_classes' ) ) :
82
+if ( ! function_exists('lsx_header_classes')) :
83 83
 	/**
84 84
 	 * Output the classes for the header.
85 85
 	 *
86 86
 	 * @package    lsx
87 87
 	 * @subpackage layout
88 88
 	 */
89
-	function lsx_header_classes( $additional = false ) {
89
+	function lsx_header_classes($additional = false) {
90 90
 		$classes = 'banner navbar navbar-default';
91 91
 
92
-		if ( false !== $additional ) {
92
+		if (false !== $additional) {
93 93
 			$classes .= ' ' . $additional;
94 94
 		}
95 95
 
96
-		echo esc_attr( $classes );
96
+		echo esc_attr($classes);
97 97
 	}
98 98
 endif;
99 99
 
100
-if ( ! function_exists( 'lsx_top_menu_classes' ) ) :
100
+if ( ! function_exists('lsx_top_menu_classes')) :
101 101
 	/**
102 102
 	 * Output the classes for the top-menu.
103 103
 	 *
104 104
 	 * @package    lsx
105 105
 	 * @subpackage layout
106 106
 	 */
107
-	function lsx_top_menu_classes( $additional = false ) {
107
+	function lsx_top_menu_classes($additional = false) {
108 108
 		$classes = 'top-menu-default';
109 109
 
110
-		if ( false !== $additional ) {
110
+		if (false !== $additional) {
111 111
 			$classes .= ' ' . $additional;
112 112
 		}
113 113
 
114
-		echo esc_attr( $classes );
114
+		echo esc_attr($classes);
115 115
 	}
116 116
 endif;
117 117
 
118
-if ( ! function_exists( 'lsx_post_wrapper_class' ) ) :
118
+if ( ! function_exists('lsx_post_wrapper_class')) :
119 119
 	/**
120 120
 	 * Output the classes for the top-menu.
121 121
 	 *
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
 	 * @subpackage layout
124 124
 	 */
125 125
 	function lsx_post_wrapper_class() {
126
-		return apply_filters( 'lsx_post_wrapper_class', '' );
126
+		return apply_filters('lsx_post_wrapper_class', '');
127 127
 	}
128 128
 endif;
129 129
 
130 130
 
131 131
 
132
-if ( ! function_exists( 'lsx_add_footer_sidebar_area' ) ) :
132
+if ( ! function_exists('lsx_add_footer_sidebar_area')) :
133 133
 	/**
134 134
 	 * Output the Footer CTA and/pr Footer Widgets.
135 135
 	 *
@@ -137,33 +137,33 @@  discard block
 block discarded – undo
137 137
 	 * @subpackage layout
138 138
 	 */
139 139
 	function lsx_add_footer_sidebar_area() {
140
-		if ( is_active_sidebar( 'sidebar-footer-cta' ) ) : ?>
140
+		if (is_active_sidebar('sidebar-footer-cta')) : ?>
141 141
 			<div id="footer-cta">
142 142
 				<div class="container">
143 143
 					<div class="lsx-full-width">
144 144
 						<div class="lsx-hero-unit">
145
-							<?php dynamic_sidebar( 'sidebar-footer-cta' ); ?>
145
+							<?php dynamic_sidebar('sidebar-footer-cta'); ?>
146 146
 						</div>
147 147
 					</div>
148 148
 				</div>
149 149
 			</div>
150 150
 		<?php endif; ?>
151 151
 
152
-		<?php if ( is_active_sidebar( 'sidebar-footer' ) ) : ?>
152
+		<?php if (is_active_sidebar('sidebar-footer')) : ?>
153 153
 			<div id="footer-widgets">
154 154
 				<div class="container">
155 155
 					<div class="row">
156
-						<?php dynamic_sidebar( 'sidebar-footer' ); ?>
156
+						<?php dynamic_sidebar('sidebar-footer'); ?>
157 157
 					</div>
158 158
 				</div>
159 159
 			</div>
160 160
 			<?php
161 161
 		endif;
162 162
 	}
163
-	add_action( 'lsx_footer_before', 'lsx_add_footer_sidebar_area' );
163
+	add_action('lsx_footer_before', 'lsx_add_footer_sidebar_area');
164 164
 endif;
165 165
 
166
-if ( ! function_exists( 'lsx_global_header' ) ) :
166
+if ( ! function_exists('lsx_global_header')) :
167 167
 	/**
168 168
 	 * Displays the global header.
169 169
 	 *
@@ -171,36 +171,36 @@  discard block
 block discarded – undo
171 171
 	 * @subpackage layout
172 172
 	 */
173 173
 	function lsx_global_header() {
174
-		$show_on_front  = get_option( 'show_on_front' );
174
+		$show_on_front  = get_option('show_on_front');
175 175
 		$queried_object = get_queried_object();
176 176
 		$default_size   = 'sm';
177
-		$size           = apply_filters( 'lsx_bootstrap_column_size', $default_size );
177
+		$size           = apply_filters('lsx_bootstrap_column_size', $default_size);
178 178
 
179 179
 		// Cart and Checkout won't have banners of any kind.
180
-		if ( function_exists( 'is_woocommerce' ) && ( is_checkout() || is_cart() ) ) {
180
+		if (function_exists('is_woocommerce') && (is_checkout() || is_cart())) {
181 181
 			return;
182 182
 		}
183 183
 
184 184
 		// Product pages have their own banner function 'lsx_page_banner()'.
185
-		if ( function_exists( 'is_woocommerce' ) && ( is_product() ) ) {
185
+		if (function_exists('is_woocommerce') && (is_product())) {
186 186
 			return;
187 187
 		}
188 188
 
189 189
 		// Cart and Checkout won't have banners of any kind.
190
-		if ( function_exists( 'tribe_is_event' ) && tribe_is_event() ) {
190
+		if (function_exists('tribe_is_event') && tribe_is_event()) {
191 191
 			return;
192 192
 		}
193 193
 
194
-		if ( function_exists( 'lsx_is_rest_api_request' ) && lsx_is_rest_api_request() ) {
194
+		if (function_exists('lsx_is_rest_api_request') && lsx_is_rest_api_request()) {
195 195
 			return;
196 196
 		}
197 197
 
198
-		if ( is_page() && ( 'page' !== $show_on_front || ! is_front_page() ) ) :
199
-			if ( class_exists( 'LSX_Banners' ) && empty( apply_filters( 'lsx_banner_plugin_disable', false ) && ( ! has_post_thumbnail() ) ) ) {
198
+		if (is_page() && ('page' !== $show_on_front || ! is_front_page())) :
199
+			if (class_exists('LSX_Banners') && empty(apply_filters('lsx_banner_plugin_disable', false) && ( ! has_post_thumbnail()))) {
200 200
 				return;
201 201
 			}
202 202
 				?>
203
-			<div class="archive-header-wrapper banner-page col-<?php echo esc_attr( $size ); ?>-12">
203
+			<div class="archive-header-wrapper banner-page col-<?php echo esc_attr($size); ?>-12">
204 204
 				<?php lsx_global_header_inner_bottom(); ?>
205 205
 				<header class="archive-header">
206 206
 					<h1 class="archive-title"><?php the_title(); ?></h1>
@@ -209,26 +209,26 @@  discard block
 block discarded – undo
209 209
 			</div>
210 210
 			<?php
211 211
 
212
-		elseif ( is_single() && ! is_singular( 'post' ) ) :
212
+		elseif (is_single() && ! is_singular('post')) :
213 213
 			?>
214
-			<div class="archive-header-wrapper banner-single col-<?php echo esc_attr( $size ); ?>-12">
214
+			<div class="archive-header-wrapper banner-single col-<?php echo esc_attr($size); ?>-12">
215 215
 				<?php lsx_global_header_inner_bottom(); ?>
216 216
 				<header class="archive-header">
217
-					<h1 class="archive-title"><?php echo wp_kses_post( apply_filters( 'lsx_global_header_title', get_the_title() ) ); ?></h1>
217
+					<h1 class="archive-title"><?php echo wp_kses_post(apply_filters('lsx_global_header_title', get_the_title())); ?></h1>
218 218
 				</header>
219 219
 
220 220
 			</div>
221 221
 			<?php
222
-		elseif ( is_search() ) :
222
+		elseif (is_search()) :
223 223
 			?>
224
-			<div class="archive-header-wrapper banner-search col-<?php echo esc_attr( $size ); ?>-12">
224
+			<div class="archive-header-wrapper banner-search col-<?php echo esc_attr($size); ?>-12">
225 225
 				<?php lsx_global_header_inner_bottom(); ?>
226 226
 				<header class="archive-header">
227 227
 					<h1 class="archive-title">
228 228
 						<?php
229 229
 							printf(
230 230
 								/* Translators: %s: search term/query */
231
-								esc_html__( 'Search Results for: %s', 'lsx' ),
231
+								esc_html__('Search Results for: %s', 'lsx'),
232 232
 								'<span>' . get_search_query() . '</span>'
233 233
 							);
234 234
 						?>
@@ -237,12 +237,12 @@  discard block
 block discarded – undo
237 237
 
238 238
 			</div>
239 239
 			<?php
240
-		elseif ( is_author() ) :
240
+		elseif (is_author()) :
241 241
 			$author        = get_the_author();
242
-			$author_avatar = get_avatar( get_the_author_meta( 'ID' ), 256 );
242
+			$author_avatar = get_avatar(get_the_author_meta('ID'), 256);
243 243
 			$author_bio    = get_the_archive_description();
244 244
 			?>
245
-			<div class="archive-header-wrapper banner-archive-author col-<?php echo esc_attr( $size ); ?>-12">
245
+			<div class="archive-header-wrapper banner-archive-author col-<?php echo esc_attr($size); ?>-12">
246 246
 				<?php lsx_global_header_inner_bottom(); ?>
247 247
 				<header class="archive-header">
248 248
 					<h1 class="archive-title"><?php the_archive_title(); ?></h1>
@@ -250,57 +250,57 @@  discard block
 block discarded – undo
250 250
 
251 251
 			</div>
252 252
 			<?php
253
-		elseif ( is_archive() ) :
253
+		elseif (is_archive()) :
254 254
 			?>
255
-			<div class="archive-header-wrapper banner-archive col-<?php echo esc_attr( $size ); ?>-12">
255
+			<div class="archive-header-wrapper banner-archive col-<?php echo esc_attr($size); ?>-12">
256 256
 				<?php lsx_global_header_inner_bottom(); ?>
257 257
 				<header class="archive-header">
258 258
 					<h1 class="archive-title">
259
-						<?php if ( has_post_format() && ! is_category() && ! is_tag() && ! is_date() && ! is_tax( 'post_format' ) ) { ?>
260
-							<?php the_archive_title( esc_html__( 'Type:', 'lsx' ) ); ?>
259
+						<?php if (has_post_format() && ! is_category() && ! is_tag() && ! is_date() && ! is_tax('post_format')) { ?>
260
+							<?php the_archive_title(esc_html__('Type:', 'lsx')); ?>
261 261
 						<?php } else { ?>
262
-							<?php echo wp_kses_post( apply_filters( 'lsx_global_header_title', get_the_archive_title() ) ); ?>
262
+							<?php echo wp_kses_post(apply_filters('lsx_global_header_title', get_the_archive_title())); ?>
263 263
 						<?php } ?>
264 264
 					</h1>
265 265
 
266 266
 					<?php
267
-					if ( false === apply_filters( 'lsx_display_global_header_description', false ) ) {
267
+					if (false === apply_filters('lsx_display_global_header_description', false)) {
268 268
 						the_archive_description();
269 269
 					}
270 270
 					?>
271 271
 				</header>
272 272
 			</div>
273 273
 			<?php
274
-		elseif ( 'page' === $show_on_front && (int) get_option( 'page_for_posts' ) === $queried_object->ID ) :
274
+		elseif ('page' === $show_on_front && (int) get_option('page_for_posts') === $queried_object->ID) :
275 275
 			?>
276
-			<div class="archive-header-wrapper banner-page col-<?php echo esc_attr( $size ); ?>-12">
276
+			<div class="archive-header-wrapper banner-page col-<?php echo esc_attr($size); ?>-12">
277 277
 				<?php lsx_global_header_inner_bottom(); ?>
278 278
 				<header class="archive-header">
279
-					<h1 class="archive-title"><?php esc_html_e( 'Blog', 'lsx' ); ?></h1>
279
+					<h1 class="archive-title"><?php esc_html_e('Blog', 'lsx'); ?></h1>
280 280
 				</header>
281 281
 
282 282
 			</div>
283 283
 			<?php
284
-		elseif ( ! is_singular( 'post' ) ) :
284
+		elseif ( ! is_singular('post')) :
285 285
 			// Display only the breadcrumbs.
286 286
 			?>
287
-			<div class="archive-header-wrapper banner-singular col-<?php echo esc_attr( $size ); ?>-12">
287
+			<div class="archive-header-wrapper banner-singular col-<?php echo esc_attr($size); ?>-12">
288 288
 				<?php lsx_global_header_inner_bottom(); ?>
289 289
 			</div>
290 290
 			<?php
291
-		elseif ( ( true === apply_filters( 'lsx_global_header_disable', false ) ) && ( ! is_search() ) ) :
291
+		elseif ((true === apply_filters('lsx_global_header_disable', false)) && ( ! is_search())) :
292 292
 			// Display only the breadcrumbs.
293 293
 			?>
294
-			<div class="archive-header-wrapper banner-global col-<?php echo esc_attr( $size ); ?>-12">
294
+			<div class="archive-header-wrapper banner-global col-<?php echo esc_attr($size); ?>-12">
295 295
 				<?php lsx_global_header_inner_bottom(); ?>
296 296
 			</div>
297 297
 			<?php
298 298
 		endif;
299 299
 	}
300
-	add_action( 'lsx_content_wrap_before', 'lsx_global_header' );
300
+	add_action('lsx_content_wrap_before', 'lsx_global_header');
301 301
 endif;
302 302
 
303
-if ( ! function_exists( 'lsx_author_extra_info' ) ) :
303
+if ( ! function_exists('lsx_author_extra_info')) :
304 304
 	/**
305 305
 	 * Displays the author extra info.
306 306
 	 *
@@ -309,83 +309,83 @@  discard block
 block discarded – undo
309 309
 	 */
310 310
 	function lsx_author_extra_info() {
311 311
 		$default_size = 'sm';
312
-		$size         = apply_filters( 'lsx_bootstrap_column_size', $default_size );
312
+		$size         = apply_filters('lsx_bootstrap_column_size', $default_size);
313 313
 
314
-		if ( is_author() ) :
315
-			$author_id         = get_the_author_meta( 'ID' );
314
+		if (is_author()) :
315
+			$author_id         = get_the_author_meta('ID');
316 316
 			$author            = get_the_author();
317
-			$author_avatar     = get_avatar( $author_id, 400 );
317
+			$author_avatar     = get_avatar($author_id, 400);
318 318
 			$author_bio        = get_the_archive_description();
319
-			$author_url        = get_the_author_meta( 'url', $author_id );
320
-			$author_email      = get_the_author_meta( 'email', $author_id );
321
-			$author_facebook   = get_the_author_meta( 'facebook', $author_id );
322
-			$author_linkedin   = get_the_author_meta( 'linkedin', $author_id );
323
-			$author_twitter    = get_the_author_meta( 'twitter', $author_id );
324
-			$author_googleplus = get_the_author_meta( 'googleplus', $author_id );
319
+			$author_url        = get_the_author_meta('url', $author_id);
320
+			$author_email      = get_the_author_meta('email', $author_id);
321
+			$author_facebook   = get_the_author_meta('facebook', $author_id);
322
+			$author_linkedin   = get_the_author_meta('linkedin', $author_id);
323
+			$author_twitter    = get_the_author_meta('twitter', $author_id);
324
+			$author_googleplus = get_the_author_meta('googleplus', $author_id);
325 325
 			?>
326
-			<div class="col-<?php echo esc_attr( $size ); ?>-12">
326
+			<div class="col-<?php echo esc_attr($size); ?>-12">
327 327
 				<div class="archive-author-data">
328 328
 					<div class="row">
329
-						<?php if ( ! empty( $author_avatar ) ) : ?>
329
+						<?php if ( ! empty($author_avatar)) : ?>
330 330
 							<div class="col-xs-12 col-sm-4 col-md-3">
331
-							<figure class="archive-author-avatar"><?php echo wp_kses_post( $author_avatar ); ?></figure>
331
+							<figure class="archive-author-avatar"><?php echo wp_kses_post($author_avatar); ?></figure>
332 332
 							</div>
333 333
 						<?php endif; ?>
334 334
 						<div class="col-xs-12 col-sm-8 col-md-9">
335
-							<a class="back-to-blog" href="<?php echo ( esc_url( get_post_type_archive_link( 'post' ) ) ); ?>"><?php echo esc_html__( 'Back To Blog', 'lsx' ); ?></a>
335
+							<a class="back-to-blog" href="<?php echo (esc_url(get_post_type_archive_link('post'))); ?>"><?php echo esc_html__('Back To Blog', 'lsx'); ?></a>
336 336
 							<!-- Name -->
337 337
 							<h2 class="archive-author-title">
338 338
 								<?php
339
-								if ( '' !== $author ) {
340
-									echo esc_html( $author );
339
+								if ('' !== $author) {
340
+									echo esc_html($author);
341 341
 								}
342 342
 								?>
343 343
 							</h2>
344 344
 							<!-- Social -->
345
-							<?php if ( ! empty( $author_url ) || ! empty( $author_email ) || ! empty( $author_facebook ) || ! empty( $author_twitter ) || ! empty( $author_googleplus ) ) : ?>
345
+							<?php if ( ! empty($author_url) || ! empty($author_email) || ! empty($author_facebook) || ! empty($author_twitter) || ! empty($author_googleplus)) : ?>
346 346
 								<div class="archive-author-social-links">
347
-									<?php if ( ! empty( $author_url ) ) : ?>
348
-										<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>
347
+									<?php if ( ! empty($author_url)) : ?>
348
+										<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>
349 349
 									<?php endif; ?>
350 350
 
351
-									<?php if ( ! empty( $author_email ) ) : ?>
352
-										<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>
351
+									<?php if ( ! empty($author_email)) : ?>
352
+										<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>
353 353
 									<?php endif; ?>
354 354
 
355
-									<?php if ( ! empty( $author_facebook ) ) : ?>
356
-										<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>
355
+									<?php if ( ! empty($author_facebook)) : ?>
356
+										<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>
357 357
 									<?php endif; ?>
358 358
 
359
-									<?php if ( ! empty( $author_twitter ) ) : ?>
360
-										<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>
359
+									<?php if ( ! empty($author_twitter)) : ?>
360
+										<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>
361 361
 									<?php endif; ?>
362 362
 
363
-									<?php if ( ! empty( $author_linkedin ) ) : ?>
364
-										<a href="<?php echo esc_url( $author_linkedin ); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-linkedin"><i class="fa fa-linkedin" aria-hidden="true"></i></a>
363
+									<?php if ( ! empty($author_linkedin)) : ?>
364
+										<a href="<?php echo esc_url($author_linkedin); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-linkedin"><i class="fa fa-linkedin" aria-hidden="true"></i></a>
365 365
 									<?php endif; ?>
366 366
 
367
-									<?php if ( ! empty( $author_googleplus ) ) : ?>
368
-										<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>
367
+									<?php if ( ! empty($author_googleplus)) : ?>
368
+										<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>
369 369
 									<?php endif; ?>
370 370
 								</div>
371 371
 							<?php endif; ?>
372 372
 
373 373
 							<!-- Bio -->
374
-							<?php if ( ! empty( $author_bio ) ) : ?>
375
-								<p class="archive-author-bio"><?php echo wp_kses_post( $author_bio ); ?></p>
374
+							<?php if ( ! empty($author_bio)) : ?>
375
+								<p class="archive-author-bio"><?php echo wp_kses_post($author_bio); ?></p>
376 376
 							<?php endif; ?>
377 377
 						</div>
378 378
 					</div>
379 379
 				</div>
380
-				<h2><?php echo esc_html__( 'Posts', 'lsx' ); ?></h2>
380
+				<h2><?php echo esc_html__('Posts', 'lsx'); ?></h2>
381 381
 			</div>
382 382
 			<?php
383 383
 		endif;
384 384
 	}
385
-	add_action( 'lsx_content_wrap_before', 'lsx_author_extra_info', 11 );
385
+	add_action('lsx_content_wrap_before', 'lsx_author_extra_info', 11);
386 386
 endif;
387 387
 
388
-if ( ! function_exists( 'lsx_post_header' ) ) :
388
+if ( ! function_exists('lsx_post_header')) :
389 389
 	/**
390 390
 	 * Displays the post header.
391 391
 	 *
@@ -394,26 +394,26 @@  discard block
 block discarded – undo
394 394
 	 */
395 395
 	function lsx_post_header() {
396 396
 		$default_size = 'sm';
397
-		$size         = apply_filters( 'lsx_bootstrap_column_size', $default_size );
397
+		$size         = apply_filters('lsx_bootstrap_column_size', $default_size);
398 398
 
399
-		$disable_title = get_post_meta( get_the_ID(), 'lsx_disable_title', true );
400
-		if ( 'yes' === $disable_title && is_singular( 'post' ) ) {
399
+		$disable_title = get_post_meta(get_the_ID(), 'lsx_disable_title', true);
400
+		if ('yes' === $disable_title && is_singular('post')) {
401 401
 			return;
402 402
 		}
403 403
 
404
-		if ( is_singular( 'post' ) ) :
404
+		if (is_singular('post')) :
405 405
 			$format = get_post_format();
406 406
 
407
-			if ( false === $format ) {
407
+			if (false === $format) {
408 408
 				$format = 'standard';
409 409
 			}
410 410
 
411
-			$format = lsx_translate_format_to_fontawesome( $format );
411
+			$format = lsx_translate_format_to_fontawesome($format);
412 412
 			?>
413
-			<div class="archive-header-wrapper banner-post-header col-<?php echo esc_attr( $size ); ?>-12">
413
+			<div class="archive-header-wrapper banner-post-header col-<?php echo esc_attr($size); ?>-12">
414 414
 				<header class="archive-header">
415 415
 					<h1 class="archive-title">
416
-						<i class="format-link fa fa-<?php echo esc_attr( $format ); ?>"></i>
416
+						<i class="format-link fa fa-<?php echo esc_attr($format); ?>"></i>
417 417
 						<span><?php the_title(); ?></span>
418 418
 					</h1>
419 419
 				</header>
@@ -421,10 +421,10 @@  discard block
 block discarded – undo
421 421
 			<?php
422 422
 		endif;
423 423
 	}
424
-	add_action( 'lsx_entry_top', 'lsx_post_header' );
424
+	add_action('lsx_entry_top', 'lsx_post_header');
425 425
 endif;
426 426
 
427
-if ( ! function_exists( 'lsx_add_viewport_meta_tag' ) ) :
427
+if ( ! function_exists('lsx_add_viewport_meta_tag')) :
428 428
 	/**
429 429
 	 * Add Viewport Meta Tag to head.
430 430
 	 *
@@ -436,10 +436,10 @@  discard block
 block discarded – undo
436 436
 		<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0">
437 437
 		<?php
438 438
 	}
439
-	add_action( 'wp_head', 'lsx_add_viewport_meta_tag' );
439
+	add_action('wp_head', 'lsx_add_viewport_meta_tag');
440 440
 endif;
441 441
 
442
-if ( ! function_exists( 'lsx_header_search_form' ) ) :
442
+if ( ! function_exists('lsx_header_search_form')) :
443 443
 	/**
444 444
 	 * Add a search form to just above the nav menu.
445 445
 	 *
@@ -447,24 +447,24 @@  discard block
 block discarded – undo
447 447
 	 * @subpackage layout
448 448
 	 */
449 449
 	function lsx_header_search_form() {
450
-		$search_form = get_theme_mod( 'lsx_header_search', false );
450
+		$search_form = get_theme_mod('lsx_header_search', false);
451 451
 
452
-		if ( false !== $search_form || is_customize_preview() ) {
453
-			get_search_form( true );
452
+		if (false !== $search_form || is_customize_preview()) {
453
+			get_search_form(true);
454 454
 		}
455 455
 	}
456
-	$mobile_header_layout = get_theme_mod( 'lsx_header_mobile_layout', 'navigation-bar' );
457
-	add_action( 'lsx_nav_before', 'lsx_header_search_form', 0 );
456
+	$mobile_header_layout = get_theme_mod('lsx_header_mobile_layout', 'navigation-bar');
457
+	add_action('lsx_nav_before', 'lsx_header_search_form', 0);
458 458
 endif;
459 459
 
460 460
 // Add entry meta to single post if active.
461
-if ( ! function_exists( 'lsx_add_entry_meta' ) ) :
461
+if ( ! function_exists('lsx_add_entry_meta')) :
462 462
 	function lsx_add_entry_meta() {
463
-		$disable_title = get_post_meta( get_the_ID(), 'lsx_disable_title', true );
464
-		if ( 'yes' === $disable_title && is_singular( 'post' ) ) {
463
+		$disable_title = get_post_meta(get_the_ID(), 'lsx_disable_title', true);
464
+		if ('yes' === $disable_title && is_singular('post')) {
465 465
 			return;
466 466
 		}
467
-		if ( is_single() && is_singular( 'post' ) ) {
467
+		if (is_single() && is_singular('post')) {
468 468
 			?>
469 469
 			<div class="entry-meta">
470 470
 				<?php lsx_post_meta_single_top(); ?>
@@ -472,5 +472,5 @@  discard block
 block discarded – undo
472 472
 			<?php
473 473
 		}
474 474
 	}
475
-	add_action( 'lsx_entry_top', 'lsx_add_entry_meta', 999 );
475
+	add_action('lsx_entry_top', 'lsx_add_entry_meta', 999);
476 476
 endif;
Please login to merge, or discard this patch.
includes/extras.php 1 patch
Spacing   +161 added lines, -161 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,64 +52,64 @@  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
-		$mobile_header_layout = get_theme_mod( 'lsx_header_mobile_layout', 'navigation-bar' );
61
+		$mobile_header_layout = get_theme_mod('lsx_header_mobile_layout', 'navigation-bar');
62 62
 		$classes[]            = 'mobile-header-' . $mobile_header_layout;
63 63
 
64
-		if ( isset( $post ) ) {
64
+		if (isset($post)) {
65 65
 			$classes[] = $post->post_name;
66 66
 		}
67 67
 
68
-		if ( class_exists( 'LSX_Banners' ) && empty( apply_filters( 'lsx_banner_plugin_disable', false ) ) ) {
69
-			$post_types = array( 'page', 'post' );
70
-			$post_types = apply_filters( 'lsx_allowed_post_type_banners', $post_types );
68
+		if (class_exists('LSX_Banners') && empty(apply_filters('lsx_banner_plugin_disable', false))) {
69
+			$post_types = array('page', 'post');
70
+			$post_types = apply_filters('lsx_allowed_post_type_banners', $post_types);
71 71
 
72
-			$img_group = get_post_meta( $post->ID, 'image_group', true );
72
+			$img_group = get_post_meta($post->ID, 'image_group', true);
73 73
 
74
-			if ( is_singular( $post_types ) && ! empty( $img_group ) && is_array( $img_group ) && ! empty( $img_group['banner_image'] ) ) {
74
+			if (is_singular($post_types) && ! empty($img_group) && is_array($img_group) && ! empty($img_group['banner_image'])) {
75 75
 				$classes[] = 'page-has-banner';
76 76
 			}
77 77
 
78
-			if ( is_singular( $post_types ) && empty( $img_group['banner_image'] ) && ( ! has_post_thumbnail( $post->ID ) ) ) {
78
+			if (is_singular($post_types) && empty($img_group['banner_image']) && ( ! has_post_thumbnail($post->ID))) {
79 79
 				$classes[] = 'page-has-no-banner';
80 80
 			}
81 81
 		}
82 82
 
83
-		if ( function_exists( 'tour_operator' ) ) {
84
-			$post_types = array( 'page', 'post' );
83
+		if (function_exists('tour_operator')) {
84
+			$post_types = array('page', 'post');
85 85
 
86 86
 			$classes[] = 'to-active';
87 87
 		}
88 88
 
89
-		if ( has_nav_menu( 'top-menu' ) || has_nav_menu( 'top-menu-left' ) ) {
89
+		if (has_nav_menu('top-menu') || has_nav_menu('top-menu-left')) {
90 90
 			$classes[] = 'has-top-menu';
91 91
 		}
92 92
 
93
-		$fixed_header = get_theme_mod( 'lsx_header_fixed', false );
93
+		$fixed_header = get_theme_mod('lsx_header_fixed', false);
94 94
 
95
-		if ( false !== $fixed_header ) {
95
+		if (false !== $fixed_header) {
96 96
 			$classes[] = 'top-menu-fixed';
97 97
 		}
98 98
 
99
-		$search_form = get_theme_mod( 'lsx_header_search', false );
99
+		$search_form = get_theme_mod('lsx_header_search', false);
100 100
 
101
-		if ( false !== $search_form ) {
101
+		if (false !== $search_form) {
102 102
 			$classes[] = 'has-header-search';
103 103
 		}
104 104
 
105
-		$preloader_content = get_theme_mod( 'lsx_preloader_content_status', false );
105
+		$preloader_content = get_theme_mod('lsx_preloader_content_status', false);
106 106
 
107
-		if ( false !== $preloader_content ) {
107
+		if (false !== $preloader_content) {
108 108
 			$classes[] = 'preloader-content-enable';
109 109
 		}
110 110
 
111
-		$register_enabled = get_option( 'users_can_register', false );
112
-		if ( ( $register_enabled ) && is_page( 'my-account' ) && is_singular() ) {
111
+		$register_enabled = get_option('users_can_register', false);
112
+		if (($register_enabled) && is_page('my-account') && is_singular()) {
113 113
 			$classes[] = 'register-enabled';
114 114
 		}
115 115
 
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
 
119 119
 endif;
120 120
 
121
-add_filter( 'body_class', 'lsx_body_class' );
121
+add_filter('body_class', 'lsx_body_class');
122 122
 
123
-if ( ! function_exists( 'lsx_embed_wrap' ) ) :
123
+if ( ! function_exists('lsx_embed_wrap')) :
124 124
 
125 125
 	/**
126 126
 	 * Wrap embedded media as suggested by Readability.
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
 	 * @link https://gist.github.com/965956
132 132
 	 * @link http://www.readability.com/publishers/guidelines#publisher
133 133
 	 */
134
-	function lsx_embed_wrap( $cache, $url, $attr = '', $post_id = '' ) {
135
-		if ( false !== strpos( $cache, '<iframe' ) ) {
134
+	function lsx_embed_wrap($cache, $url, $attr = '', $post_id = '') {
135
+		if (false !== strpos($cache, '<iframe')) {
136 136
 			return '<div class="entry-content-asset">' . $cache . '</div>';
137 137
 		}
138 138
 
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
 
142 142
 endif;
143 143
 
144
-add_filter( 'embed_oembed_html', 'lsx_embed_wrap', 10, 4 );
144
+add_filter('embed_oembed_html', 'lsx_embed_wrap', 10, 4);
145 145
 
146
-if ( ! function_exists( 'lsx_remove_self_closing_tags' ) ) :
146
+if ( ! function_exists('lsx_remove_self_closing_tags')) :
147 147
 
148 148
 	/**
149 149
 	 * Remove unnecessary self-closing tags.
@@ -151,17 +151,17 @@  discard block
 block discarded – undo
151 151
 	 * @package    lsx
152 152
 	 * @subpackage extras
153 153
 	 */
154
-	function lsx_remove_self_closing_tags( $input ) {
155
-		return str_replace( ' />', '>', $input );
154
+	function lsx_remove_self_closing_tags($input) {
155
+		return str_replace(' />', '>', $input);
156 156
 	}
157 157
 
158 158
 endif;
159 159
 
160
-add_filter( 'get_avatar', 'lsx_remove_self_closing_tags' ); // <img />
161
-add_filter( 'comment_id_fields', 'lsx_remove_self_closing_tags' ); // <input />
162
-add_filter( 'post_thumbnail_html', 'lsx_remove_self_closing_tags' ); // <img />
160
+add_filter('get_avatar', 'lsx_remove_self_closing_tags'); // <img />
161
+add_filter('comment_id_fields', 'lsx_remove_self_closing_tags'); // <input />
162
+add_filter('post_thumbnail_html', 'lsx_remove_self_closing_tags'); // <img />
163 163
 
164
-if ( ! function_exists( 'lsx_is_element_empty' ) ) :
164
+if ( ! function_exists('lsx_is_element_empty')) :
165 165
 
166 166
 	/**
167 167
 	 * Checks if a Nav $element is empty or not.
@@ -169,14 +169,14 @@  discard block
 block discarded – undo
169 169
 	 * @package    lsx
170 170
 	 * @subpackage extras
171 171
 	 */
172
-	function lsx_is_element_empty( $element ) {
173
-		$element = trim( $element );
174
-		return empty( $element ) ? false : true;
172
+	function lsx_is_element_empty($element) {
173
+		$element = trim($element);
174
+		return empty($element) ? false : true;
175 175
 	}
176 176
 
177 177
 endif;
178 178
 
179
-if ( ! function_exists( 'lsx_get_thumbnail' ) ) :
179
+if ( ! function_exists('lsx_get_thumbnail')) :
180 180
 
181 181
 	/**
182 182
 	 * return the responsive images.
@@ -184,62 +184,62 @@  discard block
 block discarded – undo
184 184
 	 * @package    lsx
185 185
 	 * @subpackage extras
186 186
 	 */
187
-	function lsx_get_thumbnail( $size, $image_src = false ) {
188
-		if ( false === $image_src ) {
187
+	function lsx_get_thumbnail($size, $image_src = false) {
188
+		if (false === $image_src) {
189 189
 			$post_id           = get_the_ID();
190
-			$post_thumbnail_id = get_post_thumbnail_id( $post_id );
191
-		} elseif ( false !== $image_src ) {
192
-			if ( is_numeric( $image_src ) ) {
190
+			$post_thumbnail_id = get_post_thumbnail_id($post_id);
191
+		} elseif (false !== $image_src) {
192
+			if (is_numeric($image_src)) {
193 193
 				$post_thumbnail_id = $image_src;
194 194
 			} else {
195
-				$post_thumbnail_id = lsx_get_attachment_id_from_src( $image_src );
195
+				$post_thumbnail_id = lsx_get_attachment_id_from_src($image_src);
196 196
 			}
197 197
 		}
198 198
 
199
-		$size      = apply_filters( 'lsx_thumbnail_size', $size );
199
+		$size      = apply_filters('lsx_thumbnail_size', $size);
200 200
 		$img       = '';
201 201
 		$lazy_img  = '';
202 202
 		$image_url = '';
203 203
 
204
-		if ( 'lsx-thumbnail-single' === $size || 'lsx-thumbnail-wide' === $size || 'lsx-thumbnail-square' === $size || 'thumbnail' === $size ) {
204
+		if ('lsx-thumbnail-single' === $size || 'lsx-thumbnail-wide' === $size || 'lsx-thumbnail-square' === $size || 'thumbnail' === $size) {
205 205
 			$srcset = false;
206
-			if ( ( ( 'team' === get_post_type() ) || ( 'testimonial' === get_post_type() ) ) && is_search() ) {
207
-				$img = get_the_post_thumbnail_url( get_the_ID(), 'lsx-thumbnail-wide' );
206
+			if ((('team' === get_post_type()) || ('testimonial' === get_post_type())) && is_search()) {
207
+				$img = get_the_post_thumbnail_url(get_the_ID(), 'lsx-thumbnail-wide');
208 208
 			} else {
209
-				$temp_img = wp_get_attachment_image_src( $post_thumbnail_id, $size );
210
-				if ( ! empty( $temp_img ) ) {
209
+				$temp_img = wp_get_attachment_image_src($post_thumbnail_id, $size);
210
+				if ( ! empty($temp_img)) {
211 211
 					$img = $temp_img[0];
212 212
 				}
213 213
 			}
214 214
 		} else {
215 215
 			$srcset = true;
216
-			$img    = wp_get_attachment_image_srcset( $post_thumbnail_id, $size );
216
+			$img    = wp_get_attachment_image_srcset($post_thumbnail_id, $size);
217 217
 
218
-			$temp_lazy = wp_get_attachment_image_src( $post_thumbnail_id, $size );
219
-			if ( ! empty( $temp_lazy ) ) {
218
+			$temp_lazy = wp_get_attachment_image_src($post_thumbnail_id, $size);
219
+			if ( ! empty($temp_lazy)) {
220 220
 				$lazy_img = $temp_lazy[0];
221 221
 			}
222 222
 
223
-			if ( empty( $img ) ) {
223
+			if (empty($img)) {
224 224
 				$srcset = false;
225
-				if ( ! empty( $lazy_img ) ) {
225
+				if ( ! empty($lazy_img)) {
226 226
 					$img = $lazy_img;
227 227
 				}
228 228
 			}
229 229
 		}
230 230
 
231
-		if ( '' !== $img ) {
231
+		if ('' !== $img) {
232 232
 			$image_url = $img;
233
-			$img       = '<img title="' . the_title_attribute( 'echo=0' ) . '" alt="' . the_title_attribute( 'echo=0' ) . '" class="attachment-responsive wp-post-image lsx-responsive" ';
234
-			if ( $srcset ) {
235
-				$img .= 'srcset="' . esc_attr( $image_url ) . '" ';
233
+			$img       = '<img title="' . the_title_attribute('echo=0') . '" alt="' . the_title_attribute('echo=0') . '" class="attachment-responsive wp-post-image lsx-responsive" ';
234
+			if ($srcset) {
235
+				$img .= 'srcset="' . esc_attr($image_url) . '" ';
236 236
 			} else {
237
-				$img .= 'src="' . esc_url( $image_url ) . '" ';
237
+				$img .= 'src="' . esc_url($image_url) . '" ';
238 238
 			}
239 239
 			$img .= '/>';
240 240
 
241
-			$img = apply_filters( 'lsx_lazyload_filter_images', $img );
242
-			$img = apply_filters( 'lsx_lazyload_slider_images', $img, $post_thumbnail_id, $size, $srcset, $image_url );
241
+			$img = apply_filters('lsx_lazyload_filter_images', $img);
242
+			$img = apply_filters('lsx_lazyload_slider_images', $img, $post_thumbnail_id, $size, $srcset, $image_url);
243 243
 		}
244 244
 
245 245
 		return $img;
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 
248 248
 endif;
249 249
 
250
-if ( ! function_exists( 'lsx_thumbnail' ) ) :
250
+if ( ! function_exists('lsx_thumbnail')) :
251 251
 
252 252
 	/**
253 253
 	 * Output the Resonsive Images.
@@ -255,13 +255,13 @@  discard block
 block discarded – undo
255 255
 	 * @package    lsx
256 256
 	 * @subpackage extras
257 257
 	 */
258
-	function lsx_thumbnail( $size = 'thumbnail', $image_src = false ) {
259
-		echo wp_kses_post( lsx_get_thumbnail( $size, $image_src ) );
258
+	function lsx_thumbnail($size = 'thumbnail', $image_src = false) {
259
+		echo wp_kses_post(lsx_get_thumbnail($size, $image_src));
260 260
 	}
261 261
 
262 262
 endif;
263 263
 
264
-if ( ! function_exists( 'lsx_get_attachment_id_from_src' ) ) :
264
+if ( ! function_exists('lsx_get_attachment_id_from_src')) :
265 265
 
266 266
 	/**
267 267
 	 * Gets the attachments ID from the src.
@@ -269,13 +269,13 @@  discard block
 block discarded – undo
269 269
 	 * @package    lsx
270 270
 	 * @subpackage extras
271 271
 	 */
272
-	function lsx_get_attachment_id_from_src( $image_src ) {
273
-		$post_id = wp_cache_get( $image_src, 'lsx_get_attachment_id_from_src' );
272
+	function lsx_get_attachment_id_from_src($image_src) {
273
+		$post_id = wp_cache_get($image_src, 'lsx_get_attachment_id_from_src');
274 274
 
275
-		if ( false === $post_id ) {
275
+		if (false === $post_id) {
276 276
 			global $wpdb;
277
-			$post_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src ) );
278
-			wp_cache_set( $image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600 );
277
+			$post_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src));
278
+			wp_cache_set($image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600);
279 279
 		}
280 280
 
281 281
 		return $post_id;
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 
284 284
 endif;
285 285
 
286
-if ( ! function_exists( 'lsx_page_banner' ) ) :
286
+if ( ! function_exists('lsx_page_banner')) :
287 287
 
288 288
 	/**
289 289
 	 * Add Featured Image as Banner on Single Pages.
@@ -292,30 +292,30 @@  discard block
 block discarded – undo
292 292
 	 * @subpackage extras
293 293
 	 */
294 294
 	function lsx_page_banner() {
295
-		if ( true === apply_filters( 'lsx_page_banner_disable', false ) ) {
295
+		if (true === apply_filters('lsx_page_banner_disable', false)) {
296 296
 			return;
297 297
 		}
298 298
 
299
-		$post_types = array( 'page', 'post' );
300
-		$post_types = apply_filters( 'lsx_allowed_post_type_banners', $post_types );
299
+		$post_types = array('page', 'post');
300
+		$post_types = apply_filters('lsx_allowed_post_type_banners', $post_types);
301 301
 
302
-		if ( is_singular( $post_types ) && has_post_thumbnail() ) :
302
+		if (is_singular($post_types) && has_post_thumbnail()) :
303 303
 			$bg_image = '';
304 304
 
305
-			if ( has_post_thumbnail() ) {
306
-				$temp_bg_image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' );
307
-				if ( ! empty( $temp_bg_image ) ) {
305
+			if (has_post_thumbnail()) {
306
+				$temp_bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full');
307
+				if ( ! empty($temp_bg_image)) {
308 308
 					$bg_image = $temp_bg_image[0];
309 309
 				}
310 310
 			}
311 311
 
312
-			if ( '' !== $bg_image ) :
312
+			if ('' !== $bg_image) :
313 313
 				?>
314 314
 					<div class="page-banner-wrap">
315 315
 						<div class="page-banner">
316 316
 							<?php lsx_banner_inner_top(); ?>
317 317
 
318
-							<div class="page-banner-image" style="background-image:url(<?php echo esc_attr( $bg_image ); ?>);"></div>
318
+							<div class="page-banner-image" style="background-image:url(<?php echo esc_attr($bg_image); ?>);"></div>
319 319
 
320 320
 							<div class="container">
321 321
 								<header class="page-header">
@@ -334,11 +334,11 @@  discard block
 block discarded – undo
334 334
 
335 335
 endif;
336 336
 
337
-add_filter( 'lsx_banner_disable', 'lsx_disable_banner_for_blocks' );
338
-add_filter( 'lsx_global_header_disable', 'lsx_disable_banner_for_blocks' );
337
+add_filter('lsx_banner_disable', 'lsx_disable_banner_for_blocks');
338
+add_filter('lsx_global_header_disable', 'lsx_disable_banner_for_blocks');
339 339
 
340 340
 
341
-if ( ! function_exists( 'lsx_disable_banner_for_blocks' ) ) :
341
+if ( ! function_exists('lsx_disable_banner_for_blocks')) :
342 342
 
343 343
 	/**
344 344
 	 * Disable the Banner if the page is using Blocks
@@ -349,20 +349,20 @@  discard block
 block discarded – undo
349 349
 	 * @param  $disable boolean
350 350
 	 * @return boolean
351 351
 	 */
352
-	function lsx_disable_banner_for_blocks( $disable ) {
352
+	function lsx_disable_banner_for_blocks($disable) {
353 353
 		$queried_object = get_queried_object_id();
354
-		$show_on_front  = get_option( 'show_on_front' );
354
+		$show_on_front  = get_option('show_on_front');
355 355
 
356
-		if ( 'page' === $show_on_front && (int) get_option( 'page_for_posts' ) === $queried_object ) {
356
+		if ('page' === $show_on_front && (int) get_option('page_for_posts') === $queried_object) {
357 357
 			return $disable;
358 358
 		}
359 359
 
360
-		if ( function_exists( 'has_blocks' ) && has_blocks() && ( ! is_archive() ) ) {
360
+		if (function_exists('has_blocks') && has_blocks() && ( ! is_archive())) {
361 361
 			$disable = true;
362 362
 		}
363 363
 
364 364
 		// Single projects will still have banners.
365
-		if ( function_exists( 'has_blocks' ) && has_blocks() && ( is_singular( 'project' ) ) ) {
365
+		if (function_exists('has_blocks') && has_blocks() && (is_singular('project'))) {
366 366
 			$disable = false;
367 367
 		}
368 368
 		return $disable;
@@ -370,9 +370,9 @@  discard block
 block discarded – undo
370 370
 
371 371
 endif;
372 372
 
373
-add_action( 'lsx_header_after', 'lsx_page_banner' );
373
+add_action('lsx_header_after', 'lsx_page_banner');
374 374
 
375
-if ( ! function_exists( 'lsx_form_submit_button' ) ) :
375
+if ( ! function_exists('lsx_form_submit_button')) :
376 376
 
377 377
 	/**
378 378
 	 * filter the Gravity Forms button type.
@@ -384,15 +384,15 @@  discard block
 block discarded – undo
384 384
 	 * @param  $form   Object
385 385
 	 * @return String
386 386
 	 */
387
-	function lsx_form_submit_button( $button, $form ) {
387
+	function lsx_form_submit_button($button, $form) {
388 388
 		return "<button class='btn btn-primary' id='gform_submit_button_{$form["id"]}'><span>Submit</span></button>";
389 389
 	}
390 390
 
391 391
 endif;
392 392
 
393
-add_filter( 'gform_submit_button', 'lsx_form_submit_button', 10, 2 );
393
+add_filter('gform_submit_button', 'lsx_form_submit_button', 10, 2);
394 394
 
395
-if ( ! function_exists( 'lsx_excerpt_more' ) ) :
395
+if ( ! function_exists('lsx_excerpt_more')) :
396 396
 
397 397
 	/**
398 398
 	 * Replaces the excerpt "more" text by a link.
@@ -400,15 +400,15 @@  discard block
 block discarded – undo
400 400
 	 * @package    lsx
401 401
 	 * @subpackage extras
402 402
 	 */
403
-	function lsx_excerpt_more( $more ) {
403
+	function lsx_excerpt_more($more) {
404 404
 		return '...';
405 405
 	}
406 406
 
407 407
 endif;
408 408
 
409
-add_filter( 'excerpt_more', 'lsx_excerpt_more' );
409
+add_filter('excerpt_more', 'lsx_excerpt_more');
410 410
 
411
-if ( ! function_exists( 'lsx_the_excerpt_filter' ) ) :
411
+if ( ! function_exists('lsx_the_excerpt_filter')) :
412 412
 
413 413
 	/**
414 414
 	 * Add a continue reading link to the excerpt.
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 	 * @package    lsx
417 417
 	 * @subpackage extras
418 418
 	 */
419
-	function lsx_the_excerpt_filter( $excerpt ) {
419
+	function lsx_the_excerpt_filter($excerpt) {
420 420
 
421 421
 		$post_formats = array(
422 422
 			'aside'   => 'aside',
@@ -429,10 +429,10 @@  discard block
 block discarded – undo
429 429
 			'audio'   => 'audio',
430 430
 		);
431 431
 
432
-		$show_full_content = has_post_format( apply_filters( 'lsx_the_excerpt_filter_post_types', $post_formats ) );
432
+		$show_full_content = has_post_format(apply_filters('lsx_the_excerpt_filter_post_types', $post_formats));
433 433
 
434
-		if ( ! $show_full_content ) {
435
-			if ( '' !== $excerpt && ! stristr( $excerpt, 'moretag' ) ) {
434
+		if ( ! $show_full_content) {
435
+			if ('' !== $excerpt && ! stristr($excerpt, 'moretag')) {
436 436
 				$pagination = wp_link_pages(
437 437
 					array(
438 438
 						'before'      => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
@@ -443,11 +443,11 @@  discard block
 block discarded – undo
443 443
 					)
444 444
 				);
445 445
 
446
-				if ( ! empty( $pagination ) ) {
446
+				if ( ! empty($pagination)) {
447 447
 					$excerpt .= $pagination;
448 448
 				} else {
449
-					$excerpt_more = '<p><a class="moretag" href="' . esc_url( get_permalink() ) . '">' . esc_html__( 'Read More', 'lsx' ) . '</a></p>';
450
-					$excerpt .= apply_filters( 'excerpt_more_p', $excerpt_more );
449
+					$excerpt_more = '<p><a class="moretag" href="' . esc_url(get_permalink()) . '">' . esc_html__('Read More', 'lsx') . '</a></p>';
450
+					$excerpt .= apply_filters('excerpt_more_p', $excerpt_more);
451 451
 				}
452 452
 			}
453 453
 		}
@@ -457,9 +457,9 @@  discard block
 block discarded – undo
457 457
 
458 458
 endif;
459 459
 
460
-add_filter( 'the_excerpt', 'lsx_the_excerpt_filter', 1, 20 );
460
+add_filter('the_excerpt', 'lsx_the_excerpt_filter', 1, 20);
461 461
 
462
-if ( ! function_exists( 'lsx_full_width_widget_classes' ) ) :
462
+if ( ! function_exists('lsx_full_width_widget_classes')) :
463 463
 
464 464
 	/**
465 465
 	 * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget.
@@ -467,8 +467,8 @@  discard block
 block discarded – undo
467 467
 	 * @package    lsx
468 468
 	 * @subpackage extras
469 469
 	 */
470
-	function lsx_full_width_widget_classes( $params ) {
471
-		if ( is_admin() ) {
470
+	function lsx_full_width_widget_classes($params) {
471
+		if (is_admin()) {
472 472
 			return $params;
473 473
 		}
474 474
 
@@ -477,9 +477,9 @@  discard block
 block discarded – undo
477 477
 		$widget_id   = $params[0]['widget_id'];
478 478
 		$widget_name = $params[0]['widget_name'];
479 479
 
480
-		if ( 'Text' === $widget_name ) {
481
-			$wp_registered_widgets[ $widget_id ]['original_callback'] = $wp_registered_widgets[ $widget_id ]['callback'];
482
-			$wp_registered_widgets[ $widget_id ]['callback']          = 'lsx_full_width_widget_custom_callback';
480
+		if ('Text' === $widget_name) {
481
+			$wp_registered_widgets[$widget_id]['original_callback'] = $wp_registered_widgets[$widget_id]['callback'];
482
+			$wp_registered_widgets[$widget_id]['callback']          = 'lsx_full_width_widget_custom_callback';
483 483
 		}
484 484
 
485 485
 		return $params;
@@ -487,9 +487,9 @@  discard block
 block discarded – undo
487 487
 
488 488
 endif;
489 489
 
490
-add_filter( 'dynamic_sidebar_params', 'lsx_full_width_widget_classes' );
490
+add_filter('dynamic_sidebar_params', 'lsx_full_width_widget_classes');
491 491
 
492
-if ( ! function_exists( 'lsx_full_width_widget_custom_callback' ) ) :
492
+if ( ! function_exists('lsx_full_width_widget_custom_callback')) :
493 493
 
494 494
 	/**
495 495
 	 * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget.
@@ -503,25 +503,25 @@  discard block
 block discarded – undo
503 503
 		$original_callback_params = func_get_args();
504 504
 		$widget_id                = $original_callback_params[0]['widget_id'];
505 505
 
506
-		$original_callback                               = $wp_registered_widgets[ $widget_id ]['original_callback'];
507
-		$wp_registered_widgets[ $widget_id ]['callback'] = $original_callback;
506
+		$original_callback                               = $wp_registered_widgets[$widget_id]['original_callback'];
507
+		$wp_registered_widgets[$widget_id]['callback'] = $original_callback;
508 508
 
509
-		$widget_id_base = $wp_registered_widgets[ $widget_id ]['callback'][0]->id_base;
509
+		$widget_id_base = $wp_registered_widgets[$widget_id]['callback'][0]->id_base;
510 510
 
511 511
 		$widget_classname = '';
512 512
 
513
-		if ( is_callable( $original_callback ) ) {
513
+		if (is_callable($original_callback)) {
514 514
 			ob_start();
515
-			call_user_func_array( $original_callback, $original_callback_params );
515
+			call_user_func_array($original_callback, $original_callback_params);
516 516
 			$widget_output = ob_get_clean();
517 517
 
518
-			echo wp_kses_post( apply_filters( 'lsx_widget_output', $widget_output, $widget_id_base, $widget_classname, $widget_id ) );
518
+			echo wp_kses_post(apply_filters('lsx_widget_output', $widget_output, $widget_id_base, $widget_classname, $widget_id));
519 519
 		}
520 520
 	}
521 521
 
522 522
 endif;
523 523
 
524
-if ( ! function_exists( 'lsx_full_width_widget_output' ) ) :
524
+if ( ! function_exists('lsx_full_width_widget_output')) :
525 525
 
526 526
 	/**
527 527
 	 * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget.
@@ -529,12 +529,12 @@  discard block
 block discarded – undo
529 529
 	 * @package    lsx
530 530
 	 * @subpackage extras
531 531
 	 */
532
-	function lsx_full_width_widget_output( $widget_output, $widget_id_base, $widget_id ) {
533
-		if ( 'text' === $widget_id_base ) {
534
-			if ( false !== strpos( $widget_output, '<div class="lsx-full-width-alt">' ) ) {
535
-				$widget_output = str_replace( 'class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width_alt"', $widget_output );
536
-			} elseif ( false !== strpos( $widget_output, '<div class="lsx-full-width">' ) ) {
537
-				$widget_output = str_replace( 'class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width"', $widget_output );
532
+	function lsx_full_width_widget_output($widget_output, $widget_id_base, $widget_id) {
533
+		if ('text' === $widget_id_base) {
534
+			if (false !== strpos($widget_output, '<div class="lsx-full-width-alt">')) {
535
+				$widget_output = str_replace('class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width_alt"', $widget_output);
536
+			} elseif (false !== strpos($widget_output, '<div class="lsx-full-width">')) {
537
+				$widget_output = str_replace('class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width"', $widget_output);
538 538
 			}
539 539
 		}
540 540
 
@@ -543,13 +543,13 @@  discard block
 block discarded – undo
543 543
 
544 544
 endif;
545 545
 
546
-add_filter( 'lsx_widget_output', 'lsx_full_width_widget_output', 10, 3 );
546
+add_filter('lsx_widget_output', 'lsx_full_width_widget_output', 10, 3);
547 547
 
548 548
 /**
549 549
  * Check if the content has a restricted post format that needs to show a full excerpt.
550 550
  */
551 551
 function lsx_post_format_force_content_on_list() {
552
-	$post_formats = apply_filters( 'lsx_post_format_force_content_on_list',
552
+	$post_formats = apply_filters('lsx_post_format_force_content_on_list',
553 553
 		array(
554 554
 			'video' => 'video',
555 555
 			'audio' => 'audio',
@@ -557,8 +557,8 @@  discard block
 block discarded – undo
557 557
 			'link'  => 'link',
558 558
 		)
559 559
 	);
560
-	$return       = false;
561
-	if ( ! has_post_format( $post_formats ) ) {
560
+	$return = false;
561
+	if ( ! has_post_format($post_formats)) {
562 562
 		$return = true;
563 563
 	}
564 564
 	return $return;
@@ -567,38 +567,38 @@  discard block
 block discarded – undo
567 567
 /**
568 568
  * Remove the Hentry Class Every
569 569
  */
570
-function lsx_remove_hentry( $classes ) {
571
-	if ( 'post' !== get_post_type() ) {
572
-		$classes = array_diff( $classes, array( 'hentry' ) );
570
+function lsx_remove_hentry($classes) {
571
+	if ('post' !== get_post_type()) {
572
+		$classes = array_diff($classes, array('hentry'));
573 573
 	}
574 574
 	return $classes;
575 575
 }
576
-add_filter( 'post_class', 'lsx_remove_hentry' );
576
+add_filter('post_class', 'lsx_remove_hentry');
577 577
 
578 578
 /**
579 579
  * Strip Excerpts.
580 580
  */
581
-function lsx_strip_excerpt( $content ) {
582
-	if ( is_search() || is_archive() || ( is_blog_installed() && ! is_single() && ! is_page() ) ) {
583
-		$content = strip_shortcodes( $content );
584
-		$content = str_replace( ']]>', ']]&gt;', $content );
585
-		$content = strip_tags( $content );
581
+function lsx_strip_excerpt($content) {
582
+	if (is_search() || is_archive() || (is_blog_installed() && ! is_single() && ! is_page())) {
583
+		$content = strip_shortcodes($content);
584
+		$content = str_replace(']]>', ']]&gt;', $content);
585
+		$content = strip_tags($content);
586 586
 	}
587 587
 	return $content;
588 588
 }
589
-add_filter( 'the_content', 'lsx_strip_excerpt' );
589
+add_filter('the_content', 'lsx_strip_excerpt');
590 590
 
591 591
 /**
592 592
  * Disable Gutenberg for LSX Custom Post Types.
593 593
  */
594
-function lsx_disable_gutenberg_product_type( $is_enabled, $post_type ) {
595
-	if ( 'testimonial' === $post_type || 'team' === $post_type || 'project' === $post_type ) {
594
+function lsx_disable_gutenberg_product_type($is_enabled, $post_type) {
595
+	if ('testimonial' === $post_type || 'team' === $post_type || 'project' === $post_type) {
596 596
 		return false;
597 597
 	}
598 598
 
599 599
 	return $is_enabled;
600 600
 }
601
-add_filter( 'gutenberg_add_edit_link_for_post_type', 'lsx_disable_gutenberg_product_type', 10, 2 );
601
+add_filter('gutenberg_add_edit_link_for_post_type', 'lsx_disable_gutenberg_product_type', 10, 2);
602 602
 
603 603
 /**
604 604
  * Add the "Blog" link to the breadcrumbs
@@ -606,27 +606,27 @@  discard block
 block discarded – undo
606 606
  * @param $crumbs
607 607
  * @return array
608 608
  */
609
-function lsx_breadcrumbs_blog_link( $crumbs ) {
609
+function lsx_breadcrumbs_blog_link($crumbs) {
610 610
 
611
-	$show_on_front = get_option( 'show_on_front' );
611
+	$show_on_front = get_option('show_on_front');
612 612
 
613
-	if ( 'page' === $show_on_front && ( is_category() || is_tag() ) ) {
613
+	if ('page' === $show_on_front && (is_category() || is_tag())) {
614 614
 
615
-		$blog_page = get_option( 'page_for_posts' );
616
-		if ( false !== $blog_page && '' !== $blog_page ) {
615
+		$blog_page = get_option('page_for_posts');
616
+		if (false !== $blog_page && '' !== $blog_page) {
617 617
 
618 618
 			$new_crumbs    = array();
619 619
 			$new_crumbs[0] = $crumbs[0];
620 620
 
621
-			if ( function_exists( 'woocommerce_breadcrumb' ) ) {
621
+			if (function_exists('woocommerce_breadcrumb')) {
622 622
 				$new_crumbs[1] = array(
623
-					0 => get_the_title( $blog_page ),
624
-					1 => get_permalink( $blog_page ),
623
+					0 => get_the_title($blog_page),
624
+					1 => get_permalink($blog_page),
625 625
 				);
626 626
 			} else {
627 627
 				$new_crumbs[1] = array(
628
-					'text' => get_the_title( $blog_page ),
629
-					'url'  => get_permalink( $blog_page ),
628
+					'text' => get_the_title($blog_page),
629
+					'url'  => get_permalink($blog_page),
630 630
 				);
631 631
 			}
632 632
 			$new_crumbs[2] = $crumbs[1];
@@ -636,8 +636,8 @@  discard block
 block discarded – undo
636 636
 	}
637 637
 	return $crumbs;
638 638
 }
639
-add_filter( 'wpseo_breadcrumb_links', 'lsx_breadcrumbs_blog_link', 30, 1 );
640
-add_filter( 'woocommerce_get_breadcrumb', 'lsx_breadcrumbs_blog_link', 30, 1 );
639
+add_filter('wpseo_breadcrumb_links', 'lsx_breadcrumbs_blog_link', 30, 1);
640
+add_filter('woocommerce_get_breadcrumb', 'lsx_breadcrumbs_blog_link', 30, 1);
641 641
 
642 642
 /**
643 643
  * Determines if the request is an REST API request.
Please login to merge, or discard this patch.
includes/hooks.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @subpackage hooks
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * This is the 1st action in the theme that fires after <head>.
15 15
  */
16 16
 function lsx_head_top() {
17
-	do_action( 'lsx_head_top' );
17
+	do_action('lsx_head_top');
18 18
 }
19 19
 
20 20
 /**
@@ -23,14 +23,14 @@  discard block
 block discarded – undo
23 23
  * @return void
24 24
  */
25 25
 function lsx_head_bottom() {
26
-	do_action( 'lsx_head_bottom' );
26
+	do_action('lsx_head_bottom');
27 27
 }
28 28
 
29 29
 /**
30 30
  * The 3rd action thta fires after <body>
31 31
  */
32 32
 function lsx_body_top() {
33
-	do_action( 'lsx_body_top' );
33
+	do_action('lsx_body_top');
34 34
 }
35 35
 
36 36
 /**
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
  * $lsx_supports[] = 'header';
40 40
  */
41 41
 function lsx_header_before() {
42
-	do_action( 'lsx_header_before' );
42
+	do_action('lsx_header_before');
43 43
 }
44 44
 
45 45
 /**
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
  * @return void
49 49
  */
50 50
 function lsx_header_top() {
51
-	do_action( 'lsx_header_top' );
51
+	do_action('lsx_header_top');
52 52
 }
53 53
 
54 54
 /**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
  * @return void
58 58
  */
59 59
 function lsx_nav_before() {
60
-	do_action( 'lsx_nav_before' );
60
+	do_action('lsx_nav_before');
61 61
 }
62 62
 
63 63
 /**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
  * @return void
67 67
  */
68 68
 function lsx_nav_after() {
69
-	do_action( 'lsx_nav_after' );
69
+	do_action('lsx_nav_after');
70 70
 }
71 71
 
72 72
 /**
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
  * @return void
76 76
  */
77 77
 function lsx_header_bottom() {
78
-	do_action( 'lsx_header_bottom' );
78
+	do_action('lsx_header_bottom');
79 79
 }
80 80
 
81 81
 /**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
  * @return void
85 85
  */
86 86
 function lsx_header_after() {
87
-	do_action( 'lsx_header_after' );
87
+	do_action('lsx_header_after');
88 88
 }
89 89
 
90 90
 /**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
  * @return void
94 94
  */
95 95
 function lsx_header_wrap_after() {
96
-	do_action( 'lsx_header_wrap_after' );
96
+	do_action('lsx_header_wrap_after');
97 97
 }
98 98
 
99 99
 /**
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
  * @return void
103 103
  */
104 104
 function lsx_header_wrap_container_top() {
105
-	do_action( 'lsx_header_wrap_container_top' );
105
+	do_action('lsx_header_wrap_container_top');
106 106
 }
107 107
 
108 108
 /**
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
  * @return void
112 112
  */
113 113
 function lsx_body_bottom() {
114
-	do_action( 'lsx_body_bottom' );
114
+	do_action('lsx_body_bottom');
115 115
 }
116 116
 
117 117
 /**
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
  * $lsx_supports[] = 'banner';
121 121
  */
122 122
 function lsx_banner_content() {
123
-	do_action( 'lsx_banner_content' );
123
+	do_action('lsx_banner_content');
124 124
 }
125 125
 
126 126
 /**
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
  * @return void
130 130
  */
131 131
 function lsx_banner_inner_top() {
132
-	do_action( 'lsx_banner_inner_top' );
132
+	do_action('lsx_banner_inner_top');
133 133
 }
134 134
 
135 135
 /**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
  * @return void
139 139
  */
140 140
 function lsx_banner_inner_bottom() {
141
-	do_action( 'lsx_banner_inner_bottom' );
141
+	do_action('lsx_banner_inner_bottom');
142 142
 }
143 143
 
144 144
 /**
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
  * $lsx_supports[] = 'global_header';
148 148
  */
149 149
 function lsx_global_header_inner_bottom() {
150
-	do_action( 'lsx_global_header_inner_bottom' );
150
+	do_action('lsx_global_header_inner_bottom');
151 151
 }
152 152
 
153 153
 /**
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
  * $lsx_supports[] = 'content';
157 157
  */
158 158
 function lsx_content_wrap_before() {
159
-	do_action( 'lsx_content_wrap_before' );
159
+	do_action('lsx_content_wrap_before');
160 160
 }
161 161
 
162 162
 /**
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
  * @return void
166 166
  */
167 167
 function lsx_content_wrap_after() {
168
-	do_action( 'lsx_content_wrap_after' );
168
+	do_action('lsx_content_wrap_after');
169 169
 }
170 170
 
171 171
 /**
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
  * @return void
175 175
  */
176 176
 function lsx_content_before() {
177
-	do_action( 'lsx_content_before' );
177
+	do_action('lsx_content_before');
178 178
 }
179 179
 
180 180
 /**
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
  * @return void
184 184
  */
185 185
 function lsx_content_after() {
186
-	do_action( 'lsx_content_after' );
186
+	do_action('lsx_content_after');
187 187
 }
188 188
 
189 189
 /**
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
  * @return void
193 193
  */
194 194
 function lsx_content_top() {
195
-	do_action( 'lsx_content_top' );
195
+	do_action('lsx_content_top');
196 196
 }
197 197
 
198 198
 /**
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
  * @return void
202 202
  */
203 203
 function lsx_content_bottom() {
204
-	do_action( 'lsx_content_bottom' );
204
+	do_action('lsx_content_bottom');
205 205
 }
206 206
 
207 207
 /**
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
  * @return void
211 211
  */
212 212
 function lsx_content_post_tags() {
213
-	do_action( 'lsx_content_post_tags' );
213
+	do_action('lsx_content_post_tags');
214 214
 }
215 215
 
216 216
 /**
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
  * @return void
220 220
  */
221 221
 function lsx_content_sharing() {
222
-	do_action( 'lsx_content_sharing' );
222
+	do_action('lsx_content_sharing');
223 223
 }
224 224
 
225 225
 /**
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
  * $lsx_supports[] = 'entry';
229 229
  */
230 230
 function lsx_entry_before() {
231
-	do_action( 'lsx_entry_before' );
231
+	do_action('lsx_entry_before');
232 232
 }
233 233
 
234 234
 /**
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
  * @return void
238 238
  */
239 239
 function lsx_entry_after() {
240
-	do_action( 'lsx_entry_after' );
240
+	do_action('lsx_entry_after');
241 241
 }
242 242
 
243 243
 /**
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
  * @return void
247 247
  */
248 248
 function lsx_entry_top() {
249
-	do_action( 'lsx_entry_top' );
249
+	do_action('lsx_entry_top');
250 250
 }
251 251
 
252 252
 /**
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
  * @return void
256 256
  */
257 257
 function lsx_entry_inside_top() {
258
-	do_action( 'lsx_entry_inside_top' );
258
+	do_action('lsx_entry_inside_top');
259 259
 }
260 260
 
261 261
 /**
@@ -264,14 +264,14 @@  discard block
 block discarded – undo
264 264
  * @return void
265 265
  */
266 266
 function lsx_entry_bottom() {
267
-	do_action( 'lsx_entry_bottom' );
267
+	do_action('lsx_entry_bottom');
268 268
 }
269 269
 
270 270
 /**
271 271
  * Semantic <entry> hooks
272 272
  */
273 273
 function lsx_post_meta_top() {
274
-	do_action( 'lsx_post_meta_top' );
274
+	do_action('lsx_post_meta_top');
275 275
 }
276 276
 
277 277
 /**
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
  * $lsx_supports[] = 'entry';
281 281
  */
282 282
 function lsx_widget_entry_before() {
283
-	do_action( 'lsx_widget_entry_before' );
283
+	do_action('lsx_widget_entry_before');
284 284
 }
285 285
 
286 286
 /**
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
  * @return void
290 290
  */
291 291
 function lsx_widget_entry_after() {
292
-	do_action( 'lsx_widget_entry_after' );
292
+	do_action('lsx_widget_entry_after');
293 293
 }
294 294
 
295 295
 /**
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
  * @return void
299 299
  */
300 300
 function lsx_widget_entry_top() {
301
-	do_action( 'lsx_widget_entry_top' );
301
+	do_action('lsx_widget_entry_top');
302 302
 }
303 303
 
304 304
 /**
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
  * @return void
308 308
  */
309 309
 function lsx_widget_entry_bottom() {
310
-	do_action( 'lsx_widget_entry_bottom' );
310
+	do_action('lsx_widget_entry_bottom');
311 311
 }
312 312
 
313 313
 /**
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
  * @return void
317 317
  */
318 318
 function lsx_widget_entry_content_top() {
319
-	do_action( 'lsx_widget_entry_content_top' );
319
+	do_action('lsx_widget_entry_content_top');
320 320
 }
321 321
 
322 322
 /**
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
  * @return void
326 326
  */
327 327
 function lsx_widget_entry_content_bottom() {
328
-	do_action( 'lsx_widget_entry_content_bottom' );
328
+	do_action('lsx_widget_entry_content_bottom');
329 329
 }
330 330
 
331 331
 /**
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
  * $lsx_supports[] = 'comments';
335 335
  */
336 336
 function lsx_comments_before() {
337
-	do_action( 'lsx_comments_before' );
337
+	do_action('lsx_comments_before');
338 338
 }
339 339
 
340 340
 /**
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
  * @return void
344 344
  */
345 345
 function lsx_comments_after() {
346
-	do_action( 'lsx_comments_after' );
346
+	do_action('lsx_comments_after');
347 347
 }
348 348
 
349 349
 /**
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
  * $lsx_supports[] = 'sidebar';
353 353
  */
354 354
 function lsx_sidebars_before() {
355
-	do_action( 'lsx_sidebars_before' );
355
+	do_action('lsx_sidebars_before');
356 356
 }
357 357
 
358 358
 /**
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
  * @return void
362 362
  */
363 363
 function lsx_sidebars_after() {
364
-	do_action( 'lsx_sidebars_after' );
364
+	do_action('lsx_sidebars_after');
365 365
 }
366 366
 
367 367
 /**
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
  * @return void
371 371
  */
372 372
 function lsx_sidebar_top() {
373
-	do_action( 'lsx_sidebar_top' );
373
+	do_action('lsx_sidebar_top');
374 374
 }
375 375
 
376 376
 /**
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
  * @return void
380 380
  */
381 381
 function lsx_sidebar_bottom() {
382
-	do_action( 'lsx_sidebar_bottom' );
382
+	do_action('lsx_sidebar_bottom');
383 383
 }
384 384
 
385 385
 /**
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
  * $lsx_supports[] = 'footer';
389 389
  */
390 390
 function lsx_footer_before() {
391
-	do_action( 'lsx_footer_before' );
391
+	do_action('lsx_footer_before');
392 392
 }
393 393
 
394 394
 /**
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
  * @return void
398 398
  */
399 399
 function lsx_footer_after() {
400
-	do_action( 'lsx_footer_after' );
400
+	do_action('lsx_footer_after');
401 401
 }
402 402
 
403 403
 /**
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
  * @return void
407 407
  */
408 408
 function lsx_footer_top() {
409
-	do_action( 'lsx_footer_top' );
409
+	do_action('lsx_footer_top');
410 410
 }
411 411
 
412 412
 /**
@@ -415,5 +415,5 @@  discard block
 block discarded – undo
415 415
  * @return void
416 416
  */
417 417
 function lsx_footer_bottom() {
418
-	do_action( 'lsx_footer_bottom' );
418
+	do_action('lsx_footer_bottom');
419 419
 }
Please login to merge, or discard this patch.
includes/the-events-calendar/the-events-calendar.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  * @subpackage the-events-calendar
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13
-if ( ! function_exists( 'lsx_tec_scripts_add_styles' ) ) :
13
+if ( ! function_exists('lsx_tec_scripts_add_styles')) :
14 14
 
15 15
 	/**
16 16
 	 * The Events Calendar enqueue styles.
@@ -22,26 +22,26 @@  discard block
 block discarded – undo
22 22
 
23 23
 		// Get plugin version.
24 24
 		$plugin  = 'the-events-calendar/the-events-calendar.php';
25
-		$data    = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
25
+		$data    = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
26 26
 		$version = $data['Version'];
27 27
 
28
-		if ( substr( $version, 0, 1 ) >= '5' ) {
28
+		if (substr($version, 0, 1) >= '5') {
29 29
 			// New Version 5.0 and up.
30
-			wp_enqueue_style( 'the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar-5.css', array( 'lsx_main' ), LSX_VERSION );
30
+			wp_enqueue_style('the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar-5.css', array('lsx_main'), LSX_VERSION);
31 31
 		} else {
32 32
 			// Old Version.
33
-			wp_enqueue_style( 'the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar.css', array( 'lsx_main' ), LSX_VERSION );
33
+			wp_enqueue_style('the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar.css', array('lsx_main'), LSX_VERSION);
34 34
 		}
35 35
 
36
-		wp_enqueue_style( 'the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar.css', array( 'lsx_main' ), LSX_VERSION );
37
-		wp_style_add_data( 'the-events-calendar-lsx', 'rtl', 'replace' );
36
+		wp_enqueue_style('the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar.css', array('lsx_main'), LSX_VERSION);
37
+		wp_style_add_data('the-events-calendar-lsx', 'rtl', 'replace');
38 38
 	}
39 39
 
40
-	add_action( 'wp_enqueue_scripts', 'lsx_tec_scripts_add_styles' );
40
+	add_action('wp_enqueue_scripts', 'lsx_tec_scripts_add_styles');
41 41
 
42 42
 endif;
43 43
 
44
-if ( ! function_exists( 'lsx_tec_theme_wrapper_start' ) ) :
44
+if ( ! function_exists('lsx_tec_theme_wrapper_start')) :
45 45
 
46 46
 	/**
47 47
 	 * The Events Calendar wrapper start.
@@ -50,21 +50,21 @@  discard block
 block discarded – undo
50 50
 	 * @subpackage the-events-calendar
51 51
 	 */
52 52
 	function lsx_tec_theme_wrapper_start() {
53
-		if ( function_exists( 'lsx_is_rest_api_request' ) && lsx_is_rest_api_request() ) {
53
+		if (function_exists('lsx_is_rest_api_request') && lsx_is_rest_api_request()) {
54 54
 			return;
55 55
 		}
56 56
 		lsx_content_wrap_before();
57
-		echo '<div id="primary" class="content-area ' . esc_attr( lsx_main_class() ) . '">';
57
+		echo '<div id="primary" class="content-area ' . esc_attr(lsx_main_class()) . '">';
58 58
 		lsx_content_before();
59 59
 		echo '<main id="main" class="site-main" role="main">';
60 60
 		lsx_content_top();
61 61
 	}
62 62
 
63
-	add_action( 'tribe_events_before_html', 'lsx_tec_theme_wrapper_start', 9 );
63
+	add_action('tribe_events_before_html', 'lsx_tec_theme_wrapper_start', 9);
64 64
 
65 65
 endif;
66 66
 
67
-if ( ! function_exists( 'lsx_tec_theme_wrapper_end' ) ) :
67
+if ( ! function_exists('lsx_tec_theme_wrapper_end')) :
68 68
 
69 69
 	/**
70 70
 	 * The Events Calendar wrapper end.
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 * @subpackage the-events-calendar
74 74
 	 */
75 75
 	function lsx_tec_theme_wrapper_end() {
76
-		if ( function_exists( 'lsx_is_rest_api_request' ) && lsx_is_rest_api_request() ) {
76
+		if (function_exists('lsx_is_rest_api_request') && lsx_is_rest_api_request()) {
77 77
 			return;
78 78
 		}
79 79
 		lsx_content_bottom();
@@ -83,11 +83,11 @@  discard block
 block discarded – undo
83 83
 		lsx_content_wrap_after();
84 84
 	}
85 85
 
86
-	add_action( 'tribe_events_after_html', 'lsx_tec_theme_wrapper_end', 11 );
86
+	add_action('tribe_events_after_html', 'lsx_tec_theme_wrapper_end', 11);
87 87
 
88 88
 endif;
89 89
 
90
-if ( ! function_exists( 'lsx_tec_global_header_title' ) ) :
90
+if ( ! function_exists('lsx_tec_global_header_title')) :
91 91
 
92 92
 	/**
93 93
 	 * Move the events title into the global header
@@ -95,45 +95,45 @@  discard block
 block discarded – undo
95 95
 	 * @package    lsx
96 96
 	 * @subpackage the-events-calendar
97 97
 	 */
98
-	function lsx_tec_global_header_title( $title ) {
98
+	function lsx_tec_global_header_title($title) {
99 99
 
100
-		if ( tribe_is_community_edit_event_page() ) {
100
+		if (tribe_is_community_edit_event_page()) {
101 101
 
102
-			$is_route = get_query_var( 'WP_Route' );
103
-			switch ( $is_route ) {
102
+			$is_route = get_query_var('WP_Route');
103
+			switch ($is_route) {
104 104
 				case 'ce-edit-route':
105
-					$title = apply_filters( 'tribe_ce_edit_event_page_title', __( 'Edit an Event', 'lsx' ) );
105
+					$title = apply_filters('tribe_ce_edit_event_page_title', __('Edit an Event', 'lsx'));
106 106
 					break;
107 107
 
108 108
 				case 'ce-edit-organizer-route':
109
-					$title = __( 'Edit an Organizer', 'lsx' );
109
+					$title = __('Edit an Organizer', 'lsx');
110 110
 					break;
111 111
 
112 112
 				case 'ce-edit-venue-route':
113
-					$title = __( 'Edit a Venue', 'lsx' );
113
+					$title = __('Edit a Venue', 'lsx');
114 114
 					break;
115 115
 
116 116
 				default:
117
-					$title = apply_filters( 'tribe_ce_submit_event_page_title', __( 'Submit an Event', 'lsx' ) );
117
+					$title = apply_filters('tribe_ce_submit_event_page_title', __('Submit an Event', 'lsx'));
118 118
 					break;
119 119
 			}
120
-		} elseif ( tribe_is_community_my_events_page() ) {
121
-			$title = apply_filters( 'tribe_ce_submit_event_page_title', __( 'My Events', 'lsx' ) );
122
-		} elseif ( tribe_is_event() ) {
120
+		} elseif (tribe_is_community_my_events_page()) {
121
+			$title = apply_filters('tribe_ce_submit_event_page_title', __('My Events', 'lsx'));
122
+		} elseif (tribe_is_event()) {
123 123
 			$title = tribe_get_events_title();
124 124
 		}
125 125
 
126 126
 		// Only disable the title after we have retrieved it.
127
-		add_filter( 'tribe_get_events_title', 'lsx_text_disable_body_title', 200, 1 );
127
+		add_filter('tribe_get_events_title', 'lsx_text_disable_body_title', 200, 1);
128 128
 
129
-		if ( is_singular( 'tribe_events' ) ) {
130
-			add_filter( 'the_title', 'lsx_text_disable_body_title', 200, 1 );
129
+		if (is_singular('tribe_events')) {
130
+			add_filter('the_title', 'lsx_text_disable_body_title', 200, 1);
131 131
 		}
132 132
 
133
-		if ( class_exists( 'LSX_Banners' ) ) {
134
-			if ( is_archive() && is_post_type_archive( 'tribe_events' ) ) {
135
-				$options = get_option( '_lsx_settings', false );
136
-				if ( is_array( $options ) && isset( $options['tribe_events'] ) && isset( $options['tribe_events']['title'] ) && '' !== $options['tribe_events']['title'] ) {
133
+		if (class_exists('LSX_Banners')) {
134
+			if (is_archive() && is_post_type_archive('tribe_events')) {
135
+				$options = get_option('_lsx_settings', false);
136
+				if (is_array($options) && isset($options['tribe_events']) && isset($options['tribe_events']['title']) && '' !== $options['tribe_events']['title']) {
137 137
 					$title = $options['tribe_events']['title'];
138 138
 				}
139 139
 			}
@@ -141,63 +141,63 @@  discard block
 block discarded – undo
141 141
 		}
142 142
 		return $title;
143 143
 	}
144
-	add_filter( 'lsx_banner_title', 'lsx_tec_global_header_title', 200, 1 );
145
-	add_filter( 'lsx_global_header_title', 'lsx_tec_global_header_title', 200, 1 );
144
+	add_filter('lsx_banner_title', 'lsx_tec_global_header_title', 200, 1);
145
+	add_filter('lsx_global_header_title', 'lsx_tec_global_header_title', 200, 1);
146 146
 
147 147
 endif;
148 148
 
149
-if ( ! function_exists( 'lsx_text_disable_body_title' ) ) :
149
+if ( ! function_exists('lsx_text_disable_body_title')) :
150 150
 	/**
151 151
 	 * Disable the events title for the post archive if the dynamic setting is active.
152 152
 	 *
153 153
 	 * @param $title
154 154
 	 * @return string
155 155
 	 */
156
-	function lsx_text_disable_body_title( $title ) {
156
+	function lsx_text_disable_body_title($title) {
157 157
 		$title = '';
158
-		remove_filter( 'the_title', 'lsx_text_disable_body_title', 200, 1 );
158
+		remove_filter('the_title', 'lsx_text_disable_body_title', 200, 1);
159 159
 		return $title;
160 160
 	}
161 161
 
162 162
 endif;
163 163
 
164
-if ( ! function_exists( 'lsx_tec_breadcrumb_filter' ) ) :
164
+if ( ! function_exists('lsx_tec_breadcrumb_filter')) :
165 165
 	/**
166 166
 	 * Fixes the community events breadcrumb
167 167
 	 *
168 168
 	 * @package    lsx
169 169
 	 * @subpackage the-events-calendar
170 170
 	 */
171
-	function lsx_tec_breadcrumb_filter( $crumbs ) {
171
+	function lsx_tec_breadcrumb_filter($crumbs) {
172 172
 
173
-		if ( tribe_is_venue() || tribe_is_organizer() || tribe_is_community_edit_event_page() || tribe_is_community_my_events_page() ) {
173
+		if (tribe_is_venue() || tribe_is_organizer() || tribe_is_community_edit_event_page() || tribe_is_community_my_events_page()) {
174 174
 			$new_crumbs    = array();
175 175
 			$new_crumbs[0] = $crumbs[0];
176 176
 
177
-			if ( function_exists( 'woocommerce_breadcrumb' ) ) {
177
+			if (function_exists('woocommerce_breadcrumb')) {
178 178
 				$new_crumbs[1] = array(
179
-					0 => __( 'Events', 'lsx' ),
180
-					1 => get_post_type_archive_link( 'tribe_events' ),
179
+					0 => __('Events', 'lsx'),
180
+					1 => get_post_type_archive_link('tribe_events'),
181 181
 				);
182 182
 			} else {
183 183
 				$new_crumbs[1] = array(
184
-					'text' => __( 'Events', 'lsx' ),
185
-					'url'  => get_post_type_archive_link( 'tribe_events' ),
184
+					'text' => __('Events', 'lsx'),
185
+					'url'  => get_post_type_archive_link('tribe_events'),
186 186
 				);
187 187
 			}
188 188
 
189
-			if ( tribe_is_community_my_events_page() ) {
189
+			if (tribe_is_community_my_events_page()) {
190 190
 				$new_crumbs[2] = $crumbs[2];
191
-			} elseif ( tribe_is_community_edit_event_page() ) {
191
+			} elseif (tribe_is_community_edit_event_page()) {
192 192
 
193
-				if ( function_exists( 'woocommerce_breadcrumb' ) ) {
193
+				if (function_exists('woocommerce_breadcrumb')) {
194 194
 					$new_crumbs[2] = array(
195
-						0 => apply_filters( 'tribe_ce_submit_event_page_title', __( 'My Events', 'lsx' ) ),
195
+						0 => apply_filters('tribe_ce_submit_event_page_title', __('My Events', 'lsx')),
196 196
 						1 => tribe_community_events_list_events_link(),
197 197
 					);
198 198
 				} else {
199 199
 					$new_crumbs[2] = array(
200
-						'text' => apply_filters( 'tribe_ce_submit_event_page_title', __( 'My Events', 'lsx' ) ),
200
+						'text' => apply_filters('tribe_ce_submit_event_page_title', __('My Events', 'lsx')),
201 201
 						'url'  => tribe_community_events_list_events_link(),
202 202
 					);
203 203
 				}
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		}
211 211
 		return $crumbs;
212 212
 	}
213
-	add_filter( 'wpseo_breadcrumb_links', 'lsx_tec_breadcrumb_filter', 30, 1 );
214
-	add_filter( 'woocommerce_get_breadcrumb', 'lsx_tec_breadcrumb_filter', 30, 1 );
213
+	add_filter('wpseo_breadcrumb_links', 'lsx_tec_breadcrumb_filter', 30, 1);
214
+	add_filter('woocommerce_get_breadcrumb', 'lsx_tec_breadcrumb_filter', 30, 1);
215 215
 
216 216
 endif;
Please login to merge, or discard this patch.
includes/classes/class-lsx-rest-helper.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if ( ! defined('ABSPATH')) {
4 4
 	exit;
5 5
 }
6 6
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 * Constructor.
34 34
 	 */
35 35
 	public function __construct() {
36
-		add_filter( 'tribe_events_views_v2_rest_params', array( $this, 'check_event_request' ), 10, 2 );
36
+		add_filter('tribe_events_views_v2_rest_params', array($this, 'check_event_request'), 10, 2);
37 37
 	}
38 38
 	/**
39 39
 	 * Return an instance of this class.
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public static function get_instance() {
45 45
 		// If the single instance hasn't been set, set it now.
46
-		if ( null === self::$instance ) {
46
+		if (null === self::$instance) {
47 47
 			self::$instance = new self;
48 48
 		}
49 49
 		return self::$instance;
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 * @param array $request
57 57
 	 * @return void
58 58
 	 */
59
-	public function check_event_request( $params, $request ) {
59
+	public function check_event_request($params, $request) {
60 60
 		$this->is_rest_request = true;
61 61
 		return $params;
62 62
 	}
@@ -67,15 +67,15 @@  discard block
 block discarded – undo
67 67
 	 * @return bool True if it's a REST API request, false otherwise.
68 68
 	 */
69 69
 	public function is_rest_api_request() {
70
-		if ( true === $this->is_rest_request ) {
70
+		if (true === $this->is_rest_request) {
71 71
 			return $this->is_rest_request;
72 72
 		}
73 73
 
74
-		if ( empty( $_SERVER['REQUEST_URI'] ) ) {
74
+		if (empty($_SERVER['REQUEST_URI'])) {
75 75
 			return false;
76 76
 		}
77
-		$rest_prefix         = trailingslashit( rest_get_url_prefix() );
78
-		$this->is_rest_request = ( false !== strpos( $_SERVER['REQUEST_URI'], $rest_prefix ) );
77
+		$rest_prefix = trailingslashit(rest_get_url_prefix());
78
+		$this->is_rest_request = (false !== strpos($_SERVER['REQUEST_URI'], $rest_prefix));
79 79
 		return $this->is_rest_request;
80 80
 	}
81 81
 }
Please login to merge, or discard this patch.