Passed
Pull Request — master (#325)
by Virginia
01:56
created
includes/layout.php 1 patch
Spacing   +110 added lines, -110 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_add_footer_sidebar_area' ) ) :
118
+if ( ! function_exists('lsx_add_footer_sidebar_area')) :
119 119
 	/**
120 120
 	 * Output the Footer CTA and/pr Footer Widgets.
121 121
 	 *
@@ -123,33 +123,33 @@  discard block
 block discarded – undo
123 123
 	 * @subpackage layout
124 124
 	 */
125 125
 	function lsx_add_footer_sidebar_area() {
126
-		if ( is_active_sidebar( 'sidebar-footer-cta' ) ) : ?>
126
+		if (is_active_sidebar('sidebar-footer-cta')) : ?>
127 127
 			<div id="footer-cta">
128 128
 				<div class="container">
129 129
 					<div class="lsx-full-width">
130 130
 						<div class="lsx-hero-unit">
131
-							<?php dynamic_sidebar( 'sidebar-footer-cta' ); ?>
131
+							<?php dynamic_sidebar('sidebar-footer-cta'); ?>
132 132
 						</div>
133 133
 					</div>
134 134
 				</div>
135 135
 			</div>
136 136
 		<?php endif; ?>
137 137
 
138
-		<?php if ( is_active_sidebar( 'sidebar-footer' ) ) : ?>
138
+		<?php if (is_active_sidebar('sidebar-footer')) : ?>
139 139
 			<div id="footer-widgets">
140 140
 				<div class="container">
141 141
 					<div class="row">
142
-						<?php dynamic_sidebar( 'sidebar-footer' ); ?>
142
+						<?php dynamic_sidebar('sidebar-footer'); ?>
143 143
 					</div>
144 144
 				</div>
145 145
 			</div>
146 146
 			<?php
147 147
 		endif;
148 148
 	}
149
-	add_action( 'lsx_footer_before', 'lsx_add_footer_sidebar_area' );
149
+	add_action('lsx_footer_before', 'lsx_add_footer_sidebar_area');
150 150
 endif;
151 151
 
152
-if ( ! function_exists( 'lsx_global_header' ) ) :
152
+if ( ! function_exists('lsx_global_header')) :
153 153
 	/**
154 154
 	 * Displays the global header.
155 155
 	 *
@@ -157,23 +157,23 @@  discard block
 block discarded – undo
157 157
 	 * @subpackage layout
158 158
 	 */
159 159
 	function lsx_global_header() {
160
-		$show_on_front  = get_option( 'show_on_front' );
160
+		$show_on_front  = get_option('show_on_front');
161 161
 		$queried_object = get_queried_object();
162 162
 		$default_size   = 'sm';
163
-		$size           = apply_filters( 'lsx_bootstrap_column_size', $default_size );
163
+		$size           = apply_filters('lsx_bootstrap_column_size', $default_size);
164 164
 
165 165
 		// Pages have their own banner function 'lsx_page_banner()'
166 166
 		// if ( function_exists( 'is_woocommerce' ) && ( is_woocommerce() || is_checkout() || is_cart() || is_account_page() ) ) {
167 167
 		// return;
168 168
 		// }
169 169
 		// Product pages have their own banner function 'lsx_page_banner()'.
170
-		if ( function_exists( 'is_woocommerce' ) && ( is_product() ) ) {
170
+		if (function_exists('is_woocommerce') && (is_product())) {
171 171
 			return;
172 172
 		}
173 173
 
174
-		if ( is_page() && ( 'page' !== $show_on_front || ! is_front_page() ) ) :
174
+		if (is_page() && ('page' !== $show_on_front || ! is_front_page())) :
175 175
 			?>
176
-			<div class="archive-header-wrapper banner-page col-<?php echo esc_attr( $size ); ?>-12">
176
+			<div class="archive-header-wrapper banner-page col-<?php echo esc_attr($size); ?>-12">
177 177
 				<?php lsx_global_header_inner_bottom(); ?>
178 178
 				<header class="archive-header">
179 179
 					<h1 class="archive-title"><?php the_title(); ?></h1>
@@ -181,26 +181,26 @@  discard block
 block discarded – undo
181 181
 
182 182
 			</div>
183 183
 			<?php
184
-		elseif ( is_single() && ! is_singular( 'post' ) ) :
184
+		elseif (is_single() && ! is_singular('post')) :
185 185
 			?>
186
-			<div class="archive-header-wrapper banner-single col-<?php echo esc_attr( $size ); ?>-12">
186
+			<div class="archive-header-wrapper banner-single col-<?php echo esc_attr($size); ?>-12">
187 187
 				<?php lsx_global_header_inner_bottom(); ?>
188 188
 				<header class="archive-header">
189
-					<h1 class="archive-title"><?php echo wp_kses_post( apply_filters( 'lsx_global_header_title', get_the_title() ) ); ?></h1>
189
+					<h1 class="archive-title"><?php echo wp_kses_post(apply_filters('lsx_global_header_title', get_the_title())); ?></h1>
190 190
 				</header>
191 191
 
192 192
 			</div>
193 193
 			<?php
194
-		elseif ( is_search() ) :
194
+		elseif (is_search()) :
195 195
 			?>
196
-			<div class="archive-header-wrapper banner-search col-<?php echo esc_attr( $size ); ?>-12">
196
+			<div class="archive-header-wrapper banner-search col-<?php echo esc_attr($size); ?>-12">
197 197
 				<?php lsx_global_header_inner_bottom(); ?>
198 198
 				<header class="archive-header">
199 199
 					<h1 class="archive-title">
200 200
 						<?php
201 201
 							printf(
202 202
 								/* Translators: %s: search term/query */
203
-								esc_html__( 'Search Results for: %s', 'lsx' ),
203
+								esc_html__('Search Results for: %s', 'lsx'),
204 204
 								'<span>' . get_search_query() . '</span>'
205 205
 							);
206 206
 						?>
@@ -209,12 +209,12 @@  discard block
 block discarded – undo
209 209
 
210 210
 			</div>
211 211
 			<?php
212
-		elseif ( is_author() ) :
212
+		elseif (is_author()) :
213 213
 			$author        = get_the_author();
214
-			$author_avatar = get_avatar( get_the_author_meta( 'ID' ), 256 );
214
+			$author_avatar = get_avatar(get_the_author_meta('ID'), 256);
215 215
 			$author_bio    = get_the_archive_description();
216 216
 			?>
217
-			<div class="archive-header-wrapper banner-archive-author col-<?php echo esc_attr( $size ); ?>-12">
217
+			<div class="archive-header-wrapper banner-archive-author col-<?php echo esc_attr($size); ?>-12">
218 218
 				<?php lsx_global_header_inner_bottom(); ?>
219 219
 				<header class="archive-header">
220 220
 					<h1 class="archive-title"><?php the_archive_title(); ?></h1>
@@ -222,57 +222,57 @@  discard block
 block discarded – undo
222 222
 
223 223
 			</div>
224 224
 			<?php
225
-		elseif ( is_archive() ) :
225
+		elseif (is_archive()) :
226 226
 			?>
227
-			<div class="archive-header-wrapper banner-archive col-<?php echo esc_attr( $size ); ?>-12">
227
+			<div class="archive-header-wrapper banner-archive col-<?php echo esc_attr($size); ?>-12">
228 228
 				<?php lsx_global_header_inner_bottom(); ?>
229 229
 				<header class="archive-header">
230 230
 					<h1 class="archive-title">
231
-						<?php if ( has_post_format() && ! is_category() && ! is_tag() && ! is_date() && ! is_tax( 'post_format' ) ) { ?>
232
-							<?php the_archive_title( esc_html__( 'Type:', 'lsx' ) ); ?>
231
+						<?php if (has_post_format() && ! is_category() && ! is_tag() && ! is_date() && ! is_tax('post_format')) { ?>
232
+							<?php the_archive_title(esc_html__('Type:', 'lsx')); ?>
233 233
 						<?php } else { ?>
234
-							<?php echo wp_kses_post( apply_filters( 'lsx_global_header_title', get_the_archive_title() ) ); ?>
234
+							<?php echo wp_kses_post(apply_filters('lsx_global_header_title', get_the_archive_title())); ?>
235 235
 						<?php } ?>
236 236
 					</h1>
237 237
 
238 238
 					<?php
239
-					if ( false === apply_filters( 'lsx_display_global_header_description', false ) ) {
239
+					if (false === apply_filters('lsx_display_global_header_description', false)) {
240 240
 						the_archive_description();
241 241
 					}
242 242
 					?>
243 243
 				</header>
244 244
 			</div>
245 245
 			<?php
246
-		elseif ( 'page' === $show_on_front && (int) get_option( 'page_for_posts' ) === $queried_object->ID ) :
246
+		elseif ('page' === $show_on_front && (int) get_option('page_for_posts') === $queried_object->ID) :
247 247
 			?>
248
-			<div class="archive-header-wrapper banner-page col-<?php echo esc_attr( $size ); ?>-12">
248
+			<div class="archive-header-wrapper banner-page col-<?php echo esc_attr($size); ?>-12">
249 249
 				<?php lsx_global_header_inner_bottom(); ?>
250 250
 				<header class="archive-header">
251
-					<h1 class="archive-title"><?php esc_html_e( 'Blog', 'lsx' ); ?></h1>
251
+					<h1 class="archive-title"><?php esc_html_e('Blog', 'lsx'); ?></h1>
252 252
 				</header>
253 253
 
254 254
 			</div>
255 255
 			<?php
256
-		elseif ( ! is_singular( 'post' ) ) :
256
+		elseif ( ! is_singular('post')) :
257 257
 			// Display only the breadcrumbs.
258 258
 			?>
259
-			<div class="archive-header-wrapper banner-singular col-<?php echo esc_attr( $size ); ?>-12">
259
+			<div class="archive-header-wrapper banner-singular col-<?php echo esc_attr($size); ?>-12">
260 260
 				<?php lsx_global_header_inner_bottom(); ?>
261 261
 			</div>
262 262
 			<?php
263
-		elseif ( ( true === apply_filters( 'lsx_global_header_disable', false ) ) && ( ! is_search() ) ) :
263
+		elseif ((true === apply_filters('lsx_global_header_disable', false)) && ( ! is_search())) :
264 264
 			// Display only the breadcrumbs.
265 265
 			?>
266
-			<div class="archive-header-wrapper banner-global col-<?php echo esc_attr( $size ); ?>-12">
266
+			<div class="archive-header-wrapper banner-global col-<?php echo esc_attr($size); ?>-12">
267 267
 				<?php lsx_global_header_inner_bottom(); ?>
268 268
 			</div>
269 269
 			<?php
270 270
 		endif;
271 271
 	}
272
-	add_action( 'lsx_content_wrap_before', 'lsx_global_header' );
272
+	add_action('lsx_content_wrap_before', 'lsx_global_header');
273 273
 endif;
274 274
 
275
-if ( ! function_exists( 'lsx_author_extra_info' ) ) :
275
+if ( ! function_exists('lsx_author_extra_info')) :
276 276
 	/**
277 277
 	 * Displays the author extra info.
278 278
 	 *
@@ -281,83 +281,83 @@  discard block
 block discarded – undo
281 281
 	 */
282 282
 	function lsx_author_extra_info() {
283 283
 		$default_size = 'sm';
284
-		$size         = apply_filters( 'lsx_bootstrap_column_size', $default_size );
284
+		$size         = apply_filters('lsx_bootstrap_column_size', $default_size);
285 285
 
286
-		if ( is_author() ) :
287
-			$author_id         = get_the_author_meta( 'ID' );
286
+		if (is_author()) :
287
+			$author_id         = get_the_author_meta('ID');
288 288
 			$author            = get_the_author();
289
-			$author_avatar     = get_avatar( $author_id, 400 );
289
+			$author_avatar     = get_avatar($author_id, 400);
290 290
 			$author_bio        = get_the_archive_description();
291
-			$author_url        = get_the_author_meta( 'url', $author_id );
292
-			$author_email      = get_the_author_meta( 'email', $author_id );
293
-			$author_facebook   = get_the_author_meta( 'facebook', $author_id );
294
-			$author_linkedin   = get_the_author_meta( 'linkedin', $author_id );
295
-			$author_twitter    = get_the_author_meta( 'twitter', $author_id );
296
-			$author_googleplus = get_the_author_meta( 'googleplus', $author_id );
291
+			$author_url        = get_the_author_meta('url', $author_id);
292
+			$author_email      = get_the_author_meta('email', $author_id);
293
+			$author_facebook   = get_the_author_meta('facebook', $author_id);
294
+			$author_linkedin   = get_the_author_meta('linkedin', $author_id);
295
+			$author_twitter    = get_the_author_meta('twitter', $author_id);
296
+			$author_googleplus = get_the_author_meta('googleplus', $author_id);
297 297
 			?>
298
-			<div class="col-<?php echo esc_attr( $size ); ?>-12">
298
+			<div class="col-<?php echo esc_attr($size); ?>-12">
299 299
 				<div class="archive-author-data">
300 300
 					<div class="row">
301
-						<?php if ( ! empty( $author_avatar ) ) : ?>
301
+						<?php if ( ! empty($author_avatar)) : ?>
302 302
 							<div class="col-xs-12 col-sm-4 col-md-3">
303
-							<figure class="archive-author-avatar"><?php echo wp_kses_post( $author_avatar ); ?></figure>
303
+							<figure class="archive-author-avatar"><?php echo wp_kses_post($author_avatar); ?></figure>
304 304
 							</div>
305 305
 						<?php endif; ?>
306 306
 						<div class="col-xs-12 col-sm-8 col-md-9">
307
-							<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>
307
+							<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>
308 308
 							<!-- Name -->
309 309
 							<h2 class="archive-author-title">
310 310
 								<?php
311
-								if ( '' !== $author ) {
312
-									echo esc_html( $author );
311
+								if ('' !== $author) {
312
+									echo esc_html($author);
313 313
 								}
314 314
 								?>
315 315
 							</h2>
316 316
 							<!-- Social -->
317
-							<?php if ( ! empty( $author_url ) || ! empty( $author_email ) || ! empty( $author_facebook ) || ! empty( $author_twitter ) || ! empty( $author_googleplus ) ) : ?>
317
+							<?php if ( ! empty($author_url) || ! empty($author_email) || ! empty($author_facebook) || ! empty($author_twitter) || ! empty($author_googleplus)) : ?>
318 318
 								<div class="archive-author-social-links">
319
-									<?php if ( ! empty( $author_url ) ) : ?>
320
-										<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>
319
+									<?php if ( ! empty($author_url)) : ?>
320
+										<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>
321 321
 									<?php endif; ?>
322 322
 
323
-									<?php if ( ! empty( $author_email ) ) : ?>
324
-										<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>
323
+									<?php if ( ! empty($author_email)) : ?>
324
+										<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>
325 325
 									<?php endif; ?>
326 326
 
327
-									<?php if ( ! empty( $author_facebook ) ) : ?>
328
-										<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>
327
+									<?php if ( ! empty($author_facebook)) : ?>
328
+										<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>
329 329
 									<?php endif; ?>
330 330
 
331
-									<?php if ( ! empty( $author_twitter ) ) : ?>
332
-										<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>
331
+									<?php if ( ! empty($author_twitter)) : ?>
332
+										<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>
333 333
 									<?php endif; ?>
334 334
 
335
-									<?php if ( ! empty( $author_linkedin ) ) : ?>
336
-										<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>
335
+									<?php if ( ! empty($author_linkedin)) : ?>
336
+										<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>
337 337
 									<?php endif; ?>
338 338
 
339
-									<?php if ( ! empty( $author_googleplus ) ) : ?>
340
-										<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>
339
+									<?php if ( ! empty($author_googleplus)) : ?>
340
+										<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>
341 341
 									<?php endif; ?>
342 342
 								</div>
343 343
 							<?php endif; ?>
344 344
 
345 345
 							<!-- Bio -->
346
-							<?php if ( ! empty( $author_bio ) ) : ?>
347
-								<p class="archive-author-bio"><?php echo wp_kses_post( $author_bio ); ?></p>
346
+							<?php if ( ! empty($author_bio)) : ?>
347
+								<p class="archive-author-bio"><?php echo wp_kses_post($author_bio); ?></p>
348 348
 							<?php endif; ?>
349 349
 						</div>
350 350
 					</div>
351 351
 				</div>
352
-				<h2><?php echo esc_html__( 'Posts', 'lsx' ); ?></h2>
352
+				<h2><?php echo esc_html__('Posts', 'lsx'); ?></h2>
353 353
 			</div>
354 354
 			<?php
355 355
 		endif;
356 356
 	}
357
-	add_action( 'lsx_content_wrap_before', 'lsx_author_extra_info', 11 );
357
+	add_action('lsx_content_wrap_before', 'lsx_author_extra_info', 11);
358 358
 endif;
359 359
 
360
-if ( ! function_exists( 'lsx_post_header' ) ) :
360
+if ( ! function_exists('lsx_post_header')) :
361 361
 	/**
362 362
 	 * Displays the post header.
363 363
 	 *
@@ -366,21 +366,21 @@  discard block
 block discarded – undo
366 366
 	 */
367 367
 	function lsx_post_header() {
368 368
 		$default_size = 'sm';
369
-		$size         = apply_filters( 'lsx_bootstrap_column_size', $default_size );
369
+		$size         = apply_filters('lsx_bootstrap_column_size', $default_size);
370 370
 
371
-		if ( is_singular( 'post' ) ) :
371
+		if (is_singular('post')) :
372 372
 			$format = get_post_format();
373 373
 
374
-			if ( false === $format ) {
374
+			if (false === $format) {
375 375
 				$format = 'standard';
376 376
 			}
377 377
 
378
-			$format = lsx_translate_format_to_fontawesome( $format );
378
+			$format = lsx_translate_format_to_fontawesome($format);
379 379
 			?>
380
-			<div class="archive-header-wrapper banner-post-header col-<?php echo esc_attr( $size ); ?>-12">
380
+			<div class="archive-header-wrapper banner-post-header col-<?php echo esc_attr($size); ?>-12">
381 381
 				<header class="archive-header">
382 382
 					<h1 class="archive-title">
383
-						<i class="format-link fa fa-<?php echo esc_attr( $format ); ?>"></i>
383
+						<i class="format-link fa fa-<?php echo esc_attr($format); ?>"></i>
384 384
 						<span><?php the_title(); ?></span>
385 385
 					</h1>
386 386
 				</header>
@@ -388,10 +388,10 @@  discard block
 block discarded – undo
388 388
 			<?php
389 389
 		endif;
390 390
 	}
391
-	add_action( 'lsx_entry_top', 'lsx_post_header' );
391
+	add_action('lsx_entry_top', 'lsx_post_header');
392 392
 endif;
393 393
 
394
-if ( ! function_exists( 'lsx_add_viewport_meta_tag' ) ) :
394
+if ( ! function_exists('lsx_add_viewport_meta_tag')) :
395 395
 	/**
396 396
 	 * Add Viewport Meta Tag to head.
397 397
 	 *
@@ -403,10 +403,10 @@  discard block
 block discarded – undo
403 403
 		<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0">
404 404
 		<?php
405 405
 	}
406
-	add_action( 'wp_head', 'lsx_add_viewport_meta_tag' );
406
+	add_action('wp_head', 'lsx_add_viewport_meta_tag');
407 407
 endif;
408 408
 
409
-if ( ! function_exists( 'lsx_header_search_form' ) ) :
409
+if ( ! function_exists('lsx_header_search_form')) :
410 410
 	/**
411 411
 	 * Add a search form to just above the nav menu.
412 412
 	 *
@@ -414,19 +414,19 @@  discard block
 block discarded – undo
414 414
 	 * @subpackage layout
415 415
 	 */
416 416
 	function lsx_header_search_form() {
417
-		$search_form = get_theme_mod( 'lsx_header_search', false );
417
+		$search_form = get_theme_mod('lsx_header_search', false);
418 418
 
419
-		if ( false !== $search_form || is_customize_preview() ) {
420
-			get_search_form( true );
419
+		if (false !== $search_form || is_customize_preview()) {
420
+			get_search_form(true);
421 421
 		}
422 422
 	}
423
-	add_action( 'lsx_nav_before', 'lsx_header_search_form', 0 );
423
+	add_action('lsx_nav_before', 'lsx_header_search_form', 0);
424 424
 endif;
425 425
 
426 426
 // Add entry meta to single post if active.
427
-if ( ! function_exists( 'lsx_add_entry_meta' ) ) :
427
+if ( ! function_exists('lsx_add_entry_meta')) :
428 428
 	function lsx_add_entry_meta() {
429
-		if ( is_single() && is_singular( 'post' ) ) {
429
+		if (is_single() && is_singular('post')) {
430 430
 			?>
431 431
 			<div class="entry-meta">
432 432
 				<?php lsx_post_meta_single_top(); ?>
@@ -434,5 +434,5 @@  discard block
 block discarded – undo
434 434
 			<?php
435 435
 		}
436 436
 	}
437
-	add_action( 'lsx_entry_top', 'lsx_add_entry_meta', 999 );
437
+	add_action('lsx_entry_top', 'lsx_add_entry_meta', 999);
438 438
 endif;
Please login to merge, or discard this patch.
includes/the-events-calendar/the-events-calendar.php 1 patch
Spacing   +44 added lines, -44 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.
@@ -19,15 +19,15 @@  discard block
 block discarded – undo
19 19
 	 * @subpackage the-events-calendar
20 20
 	 */
21 21
 	function lsx_tec_scripts_add_styles() {
22
-		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 );
23
-		wp_style_add_data( 'the-events-calendar-lsx', 'rtl', 'replace' );
22
+		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);
23
+		wp_style_add_data('the-events-calendar-lsx', 'rtl', 'replace');
24 24
 	}
25 25
 
26
-	add_action( 'wp_enqueue_scripts', 'lsx_tec_scripts_add_styles' );
26
+	add_action('wp_enqueue_scripts', 'lsx_tec_scripts_add_styles');
27 27
 
28 28
 endif;
29 29
 
30
-if ( ! function_exists( 'lsx_tec_theme_wrapper_start' ) ) :
30
+if ( ! function_exists('lsx_tec_theme_wrapper_start')) :
31 31
 
32 32
 	/**
33 33
 	 * The Events Calendar wrapper start.
@@ -37,17 +37,17 @@  discard block
 block discarded – undo
37 37
 	 */
38 38
 	function lsx_tec_theme_wrapper_start() {
39 39
 		lsx_content_wrap_before();
40
-		echo '<div id="primary" class="content-area ' . esc_attr( lsx_main_class() ) . '">';
40
+		echo '<div id="primary" class="content-area ' . esc_attr(lsx_main_class()) . '">';
41 41
 		lsx_content_before();
42 42
 		echo '<main id="main" class="site-main" role="main">';
43 43
 		lsx_content_top();
44 44
 	}
45 45
 
46
-	add_action( 'tribe_events_before_html', 'lsx_tec_theme_wrapper_start', 9 );
46
+	add_action('tribe_events_before_html', 'lsx_tec_theme_wrapper_start', 9);
47 47
 
48 48
 endif;
49 49
 
50
-if ( ! function_exists( 'lsx_tec_theme_wrapper_end' ) ) :
50
+if ( ! function_exists('lsx_tec_theme_wrapper_end')) :
51 51
 
52 52
 	/**
53 53
 	 * The Events Calendar wrapper end.
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
 		lsx_content_wrap_after();
64 64
 	}
65 65
 
66
-	add_action( 'tribe_events_after_html', 'lsx_tec_theme_wrapper_end', 11 );
66
+	add_action('tribe_events_after_html', 'lsx_tec_theme_wrapper_end', 11);
67 67
 
68 68
 endif;
69 69
 
70
-if ( ! function_exists( 'lsx_tec_global_header_title' ) ) :
70
+if ( ! function_exists('lsx_tec_global_header_title')) :
71 71
 
72 72
 	/**
73 73
 	 * Move the events title into the global header
@@ -75,98 +75,98 @@  discard block
 block discarded – undo
75 75
 	 * @package    lsx
76 76
 	 * @subpackage the-events-calendar
77 77
 	 */
78
-	function lsx_tec_global_header_title( $title ) {
78
+	function lsx_tec_global_header_title($title) {
79 79
 
80
-		if ( tribe_is_community_edit_event_page() ) {
80
+		if (tribe_is_community_edit_event_page()) {
81 81
 
82
-			$is_route = get_query_var( 'WP_Route' );
83
-			switch ( $is_route ) {
82
+			$is_route = get_query_var('WP_Route');
83
+			switch ($is_route) {
84 84
 				case 'ce-edit-route':
85
-					$title = apply_filters( 'tribe_ce_edit_event_page_title', __( 'Edit an Event', 'lsx' ) );
85
+					$title = apply_filters('tribe_ce_edit_event_page_title', __('Edit an Event', 'lsx'));
86 86
 					break;
87 87
 
88 88
 				case 'ce-edit-organizer-route':
89
-					$title = __( 'Edit an Organizer', 'lsx' );
89
+					$title = __('Edit an Organizer', 'lsx');
90 90
 					break;
91 91
 
92 92
 				case 'ce-edit-venue-route':
93
-					$title = __( 'Edit a Venue', 'lsx' );
93
+					$title = __('Edit a Venue', 'lsx');
94 94
 					break;
95 95
 
96 96
 				default:
97
-					$title = apply_filters( 'tribe_ce_submit_event_page_title', __( 'Submit an Event', 'lsx' ) );
97
+					$title = apply_filters('tribe_ce_submit_event_page_title', __('Submit an Event', 'lsx'));
98 98
 					break;
99 99
 			}
100
-		} elseif ( tribe_is_community_my_events_page() ) {
101
-			$title = apply_filters( 'tribe_ce_submit_event_page_title', __( 'My Events', 'lsx' ) );
102
-		} elseif ( tribe_is_event() ) {
100
+		} elseif (tribe_is_community_my_events_page()) {
101
+			$title = apply_filters('tribe_ce_submit_event_page_title', __('My Events', 'lsx'));
102
+		} elseif (tribe_is_event()) {
103 103
 			$title = tribe_get_events_title();
104 104
 		}
105 105
 
106 106
 		// Only disable the title after we have retrieved it.
107
-		add_filter( 'tribe_get_events_title', 'lsx_text_disable_body_title', 200, 1 );
107
+		add_filter('tribe_get_events_title', 'lsx_text_disable_body_title', 200, 1);
108 108
 
109
-		if ( is_singular( 'tribe_events' ) ) {
110
-			add_filter( 'the_title', 'lsx_text_disable_body_title', 200, 1 );
109
+		if (is_singular('tribe_events')) {
110
+			add_filter('the_title', 'lsx_text_disable_body_title', 200, 1);
111 111
 		}
112 112
 		return $title;
113 113
 	}
114
-	add_filter( 'lsx_global_header_title', 'lsx_tec_global_header_title', 200, 1 );
114
+	add_filter('lsx_global_header_title', 'lsx_tec_global_header_title', 200, 1);
115 115
 
116 116
 endif;
117 117
 
118
-if ( ! function_exists( 'lsx_text_disable_body_title' ) ) :
118
+if ( ! function_exists('lsx_text_disable_body_title')) :
119 119
 	/**
120 120
 	 * Disable the events title for the post archive if the dynamic setting is active.
121 121
 	 *
122 122
 	 * @param $title
123 123
 	 * @return string
124 124
 	 */
125
-	function lsx_text_disable_body_title( $title ) {
125
+	function lsx_text_disable_body_title($title) {
126 126
 		$title = '';
127
-		remove_filter( 'the_title', 'lsx_text_disable_body_title', 200, 1 );
127
+		remove_filter('the_title', 'lsx_text_disable_body_title', 200, 1);
128 128
 		return $title;
129 129
 	}
130 130
 
131 131
 endif;
132 132
 
133
-if ( ! function_exists( 'lsx_tec_breadcrumb_filter' ) ) :
133
+if ( ! function_exists('lsx_tec_breadcrumb_filter')) :
134 134
 	/**
135 135
 	 * Fixes the community events breadcrumb
136 136
 	 *
137 137
 	 * @package    lsx
138 138
 	 * @subpackage the-events-calendar
139 139
 	 */
140
-	function lsx_tec_breadcrumb_filter( $crumbs ) {
140
+	function lsx_tec_breadcrumb_filter($crumbs) {
141 141
 
142
-		if ( tribe_is_venue() || tribe_is_organizer() || tribe_is_community_edit_event_page() || tribe_is_community_my_events_page() ) {
142
+		if (tribe_is_venue() || tribe_is_organizer() || tribe_is_community_edit_event_page() || tribe_is_community_my_events_page()) {
143 143
 			$new_crumbs    = array();
144 144
 			$new_crumbs[0] = $crumbs[0];
145 145
 
146
-			if ( function_exists( 'woocommerce_breadcrumb' ) ) {
146
+			if (function_exists('woocommerce_breadcrumb')) {
147 147
 				$new_crumbs[1] = array(
148
-					0 => __( 'Events', 'lsx' ),
149
-					1 => get_post_type_archive_link( 'tribe_events' ),
148
+					0 => __('Events', 'lsx'),
149
+					1 => get_post_type_archive_link('tribe_events'),
150 150
 				);
151 151
 			} else {
152 152
 				$new_crumbs[1] = array(
153
-					'text' => __( 'Events', 'lsx' ),
154
-					'url'  => get_post_type_archive_link( 'tribe_events' ),
153
+					'text' => __('Events', 'lsx'),
154
+					'url'  => get_post_type_archive_link('tribe_events'),
155 155
 				);
156 156
 			}
157 157
 
158
-			if ( tribe_is_community_my_events_page() ) {
158
+			if (tribe_is_community_my_events_page()) {
159 159
 				$new_crumbs[2] = $crumbs[2];
160
-			} elseif ( tribe_is_community_edit_event_page() ) {
160
+			} elseif (tribe_is_community_edit_event_page()) {
161 161
 
162
-				if ( function_exists( 'woocommerce_breadcrumb' ) ) {
162
+				if (function_exists('woocommerce_breadcrumb')) {
163 163
 					$new_crumbs[2] = array(
164
-						0 => apply_filters( 'tribe_ce_submit_event_page_title', __( 'My Events', 'lsx' ) ),
164
+						0 => apply_filters('tribe_ce_submit_event_page_title', __('My Events', 'lsx')),
165 165
 						1 => tribe_community_events_list_events_link(),
166 166
 					);
167 167
 				} else {
168 168
 					$new_crumbs[2] = array(
169
-						'text' => apply_filters( 'tribe_ce_submit_event_page_title', __( 'My Events', 'lsx' ) ),
169
+						'text' => apply_filters('tribe_ce_submit_event_page_title', __('My Events', 'lsx')),
170 170
 						'url'  => tribe_community_events_list_events_link(),
171 171
 					);
172 172
 				}
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 		}
180 180
 		return $crumbs;
181 181
 	}
182
-	add_filter( 'wpseo_breadcrumb_links', 'lsx_tec_breadcrumb_filter', 30, 1 );
183
-	add_filter( 'woocommerce_get_breadcrumb', 'lsx_tec_breadcrumb_filter', 30, 1 );
182
+	add_filter('wpseo_breadcrumb_links', 'lsx_tec_breadcrumb_filter', 30, 1);
183
+	add_filter('woocommerce_get_breadcrumb', 'lsx_tec_breadcrumb_filter', 30, 1);
184 184
 
185 185
 endif;
Please login to merge, or discard this patch.
includes/nav-bootstrap-navwalker.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@  discard block
 block discarded – undo
7 7
  * @category   bootstrap-navigation-walker
8 8
  */
9 9
 
10
-if ( ! defined( 'ABSPATH' ) ) {
10
+if ( ! defined('ABSPATH')) {
11 11
 	exit;
12 12
 }
13 13
 
14
-if ( ! function_exists( 'lsx_wpml_nav_language_switcher_fix' ) ) :
14
+if ( ! function_exists('lsx_wpml_nav_language_switcher_fix')) :
15 15
 
16 16
 	/**
17 17
 	 * Add in our custom classes to the menus.
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
20 20
 	 * @subpackage navigation
21 21
 	 * @category   bootstrap-navigation-walker
22 22
 	 */
23
-	function lsx_wpml_nav_language_switcher_fix( $items, $args ) {
24
-		$items = str_replace( 'menu-item-language-current', 'menu-item-language-current dropdown', $items );
25
-		$items = str_replace( 'submenu-languages', 'submenu-languages dropdown-menu', $items );
23
+	function lsx_wpml_nav_language_switcher_fix($items, $args) {
24
+		$items = str_replace('menu-item-language-current', 'menu-item-language-current dropdown', $items);
25
+		$items = str_replace('submenu-languages', 'submenu-languages dropdown-menu', $items);
26 26
 		return $items;
27 27
 	}
28 28
 
29 29
 endif;
30 30
 
31
-add_filter( 'wp_nav_menu_items', 'lsx_wpml_nav_language_switcher_fix', 10, 2 );
31
+add_filter('wp_nav_menu_items', 'lsx_wpml_nav_language_switcher_fix', 10, 2);
Please login to merge, or discard this patch.
includes/walker-comment.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  * @subpackage comment-walker
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13
-if ( ! function_exists( 'lsx_get_avatar' ) ) :
13
+if ( ! function_exists('lsx_get_avatar')) :
14 14
 
15 15
 	/**
16 16
 	 * Comment Form Field Filter.
@@ -18,25 +18,25 @@  discard block
 block discarded – undo
18 18
 	 * @package    lsx
19 19
 	 * @subpackage comment-walker
20 20
 	 */
21
-	function lsx_get_avatar( $avatar ) {
22
-		$avatar = str_replace( "class='avatar", "class='avatar pull-left media-object ", $avatar );
23
-		$avatar = str_replace( 'class="avatar', 'class="avatar pull-left media-object ', $avatar );
21
+	function lsx_get_avatar($avatar) {
22
+		$avatar = str_replace("class='avatar", "class='avatar pull-left media-object ", $avatar);
23
+		$avatar = str_replace('class="avatar', 'class="avatar pull-left media-object ', $avatar);
24 24
 		return $avatar;
25 25
 	}
26 26
 
27 27
 endif;
28 28
 
29
-add_filter( 'get_avatar', 'lsx_get_avatar' );
29
+add_filter('get_avatar', 'lsx_get_avatar');
30 30
 
31
-add_action( 'admin_bar_menu', function() {
32
-	remove_filter( 'get_avatar', 'lsx_get_avatar' );
33
-}, 0 );
31
+add_action('admin_bar_menu', function() {
32
+	remove_filter('get_avatar', 'lsx_get_avatar');
33
+}, 0);
34 34
 
35
-add_action( 'wp_after_admin_bar_render', function() {
36
-	add_filter( 'get_avatar', 'lsx_get_avatar' );
35
+add_action('wp_after_admin_bar_render', function() {
36
+	add_filter('get_avatar', 'lsx_get_avatar');
37 37
 } );
38 38
 
39
-if ( ! function_exists( 'lsx_comment_form_fields_filter' ) ) :
39
+if ( ! function_exists('lsx_comment_form_fields_filter')) :
40 40
 
41 41
 	/**
42 42
 	 * Comment Form Field Filter.
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 	 * @package    lsx
45 45
 	 * @subpackage comment-walker
46 46
 	 */
47
-	function lsx_comment_form_fields_filter( $fields ) {
48
-		foreach ( $fields as &$field ) {
49
-			if ( stristr( 'class=', $field ) ) {
50
-				$field = str_replace( 'class="', 'class="form-control ', $field );
47
+	function lsx_comment_form_fields_filter($fields) {
48
+		foreach ($fields as &$field) {
49
+			if (stristr('class=', $field)) {
50
+				$field = str_replace('class="', 'class="form-control ', $field);
51 51
 			} else {
52
-				$field = str_replace( '<input', '<input class="form-control" ', $field );
52
+				$field = str_replace('<input', '<input class="form-control" ', $field);
53 53
 			}
54 54
 		}
55 55
 
@@ -58,4 +58,4 @@  discard block
 block discarded – undo
58 58
 
59 59
 endif;
60 60
 
61
-add_filter( 'comment_form_default_fields', 'lsx_comment_form_fields_filter' );
61
+add_filter('comment_form_default_fields', 'lsx_comment_form_fields_filter');
Please login to merge, or discard this patch.
includes/config.php 1 patch
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  * @subpackage config
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13
-if ( ! function_exists( 'lsx_setup' ) ) :
13
+if ( ! function_exists('lsx_setup')) :
14 14
 
15 15
 	/**
16 16
 	 * Theme after_setup_theme action.
@@ -22,26 +22,26 @@  discard block
 block discarded – undo
22 22
 		global $content_width;
23 23
 		$content_width = 1140;
24 24
 
25
-		load_theme_textdomain( 'lsx', get_template_directory() . '/languages' );
25
+		load_theme_textdomain('lsx', get_template_directory() . '/languages');
26 26
 
27
-		add_image_size( 'lsx-thumbnail-carousel', 350, 230, true );
28
-		add_image_size( 'lsx-thumbnail-wide', 360, 168, true );
29
-		add_image_size( 'lsx-thumbnail-square', 350, 350, true );
30
-		add_image_size( 'lsx-thumbnail-single', 750, 350, true );
31
-		add_image_size( 'lsx-banner', 1920, 600, true );
27
+		add_image_size('lsx-thumbnail-carousel', 350, 230, true);
28
+		add_image_size('lsx-thumbnail-wide', 360, 168, true);
29
+		add_image_size('lsx-thumbnail-square', 350, 350, true);
30
+		add_image_size('lsx-thumbnail-single', 750, 350, true);
31
+		add_image_size('lsx-banner', 1920, 600, true);
32 32
 
33 33
 		register_nav_menus(
34 34
 			array(
35
-				'primary'       => esc_html__( 'Primary Menu', 'lsx' ),
36
-				'top-menu'      => esc_html__( 'Top Menu (right)', 'lsx' ),
37
-				'top-menu-left' => esc_html__( 'Top Menu (left)', 'lsx' ),
38
-				'social'        => esc_html__( 'Social Menu', 'lsx' ),
39
-				'footer'        => esc_html__( 'Footer Menu', 'lsx' ),
35
+				'primary'       => esc_html__('Primary Menu', 'lsx'),
36
+				'top-menu'      => esc_html__('Top Menu (right)', 'lsx'),
37
+				'top-menu-left' => esc_html__('Top Menu (left)', 'lsx'),
38
+				'social'        => esc_html__('Social Menu', 'lsx'),
39
+				'footer'        => esc_html__('Footer Menu', 'lsx'),
40 40
 			)
41 41
 		);
42 42
 
43
-		add_theme_support( 'automatic-feed-links' );
44
-		add_theme_support( 'custom-background' );
43
+		add_theme_support('automatic-feed-links');
44
+		add_theme_support('custom-background');
45 45
 
46 46
 		add_theme_support(
47 47
 			'custom-logo',
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 			)
54 54
 		);
55 55
 
56
-		add_theme_support( 'html5', array( 'caption' ) );
56
+		add_theme_support('html5', array('caption'));
57 57
 
58 58
 		add_theme_support(
59 59
 			'post-formats',
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 			)
67 67
 		);
68 68
 
69
-		add_theme_support( 'post-thumbnails' );
70
-		add_theme_support( 'sensei' );
69
+		add_theme_support('post-thumbnails');
70
+		add_theme_support('sensei');
71 71
 
72 72
 		add_theme_support(
73 73
 			'site-logo',
@@ -80,14 +80,14 @@  discard block
 block discarded – undo
80 80
 			)
81 81
 		);
82 82
 
83
-		add_theme_support( 'title-tag' );
83
+		add_theme_support('title-tag');
84 84
 
85 85
 		/*
86 86
 		 * @TODO - Necessary to test it
87 87
 		 */
88 88
 		// add_theme_support( 'woocommerce' );
89 89
 
90
-		add_theme_support( 'starter-content', array(
90
+		add_theme_support('starter-content', array(
91 91
 			'widgets'     => array(
92 92
 				'sidebar-home'       => array(
93 93
 					'custom_widget_1' => array(
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
 						array(
97 97
 							'title' => '',
98
-							'text'  => wp_kses_post( '<div class="row"><div class="col-sm-12 text-center"><h3>Build your perfect website <small>with the LSX theme</small></h3></div></div><div class="row"><div class="col-sm-4 text-center"><h4>Fast</h4><p>"Quick" isn\'t a word most people use when describing their website building experience.</p></div><div class="col-sm-4 text-center"><h4>Easy</h4><p>We\'ve built websites for countless clients, and we know what kind of back-end makes sense easily.</p></div><div class="col-sm-4 text-center"><h4>Comprehensive</h4><p>The LSX extensions come with features out the box that are essential.</p></div></div>' ),
98
+							'text'  => wp_kses_post('<div class="row"><div class="col-sm-12 text-center"><h3>Build your perfect website <small>with the LSX theme</small></h3></div></div><div class="row"><div class="col-sm-4 text-center"><h4>Fast</h4><p>"Quick" isn\'t a word most people use when describing their website building experience.</p></div><div class="col-sm-4 text-center"><h4>Easy</h4><p>We\'ve built websites for countless clients, and we know what kind of back-end makes sense easily.</p></div><div class="col-sm-4 text-center"><h4>Comprehensive</h4><p>The LSX extensions come with features out the box that are essential.</p></div></div>'),
99 99
 						),
100 100
 					),
101 101
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
 						array(
106 106
 							'title' => '',
107
-							'text'  => wp_kses_post( '<div class="lsx-full-width-alt"><div class="row"><div class="col-xs-12"><h3>A big CTA title</h3><p class="text-center"><a class="btn cta-btn" href="http://www.lsdeb.biz/" target="_blank" rel="noreferrer noopener">Hire Us</a><p></div></div></div>' ),
107
+							'text'  => wp_kses_post('<div class="lsx-full-width-alt"><div class="row"><div class="col-xs-12"><h3>A big CTA title</h3><p class="text-center"><a class="btn cta-btn" href="http://www.lsdeb.biz/" target="_blank" rel="noreferrer noopener">Hire Us</a><p></div></div></div>'),
108 108
 						),
109 109
 					),
110 110
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
 						array(
115 115
 							'title' => '',
116
-							'text'  => wp_kses_post( '<div class="row"><div class="col-xs-12"><h3>Homepage Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.</p></div></div>' ),
116
+							'text'  => wp_kses_post('<div class="row"><div class="col-xs-12"><h3>Homepage Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.</p></div></div>'),
117 117
 						),
118 118
 					),
119 119
 				),
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
 						'text',
124 124
 
125 125
 						array(
126
-							'title' => esc_html__( 'Space for Footer Widgets', 'lsx' ),
127
-							'text'  => esc_html__( 'This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx' ),
126
+							'title' => esc_html__('Space for Footer Widgets', 'lsx'),
127
+							'text'  => esc_html__('This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx'),
128 128
 						),
129 129
 					),
130 130
 
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 						'text',
133 133
 
134 134
 						array(
135
-							'title' => esc_html__( 'Space for Footer Widgets', 'lsx' ),
136
-							'text'  => esc_html__( 'This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx' ),
135
+							'title' => esc_html__('Space for Footer Widgets', 'lsx'),
136
+							'text'  => esc_html__('This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx'),
137 137
 						),
138 138
 					),
139 139
 
@@ -141,8 +141,8 @@  discard block
 block discarded – undo
141 141
 						'text',
142 142
 
143 143
 						array(
144
-							'title' => esc_html__( 'Contact us:', 'lsx' ),
145
-							'text'  => wp_kses_post( '<a href="mailto:[email protected]><i class="fa fa-envelope fa-fw"></i> [email protected]</a><br><a href="tel:+27214489843"><i class="fa fa-phone fa-fw"></i> +27 21 448 9843</a><br><i class="fa fa-skype fa-fw"></i> /lightspeeddevelopment' ),
144
+							'title' => esc_html__('Contact us:', 'lsx'),
145
+							'text'  => wp_kses_post('<a href="mailto:[email protected]><i class="fa fa-envelope fa-fw"></i> [email protected]</a><br><a href="tel:+27214489843"><i class="fa fa-phone fa-fw"></i> +27 21 448 9843</a><br><i class="fa fa-skype fa-fw"></i> /lightspeeddevelopment'),
146 146
 						),
147 147
 					),
148 148
 				),
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
 						'text',
153 153
 
154 154
 						array(
155
-							'title' => esc_html__( 'A Footer Call to Action', 'lsx' ),
156
-							'text'  => esc_html__( 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.', 'lsx' ),
155
+							'title' => esc_html__('A Footer Call to Action', 'lsx'),
156
+							'text'  => esc_html__('Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.', 'lsx'),
157 157
 						),
158 158
 					),
159 159
 				),
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 				'home'    => array(
164 164
 					'template'     => 'page-templates/template-front-page.php',
165 165
 					'thumbnail'    => '{{image-banner-example-01}}',
166
-					'post_title'   => esc_html__( 'LSX is a free WordPress theme', 'lsx' ),
166
+					'post_title'   => esc_html__('LSX is a free WordPress theme', 'lsx'),
167 167
 					'post_content' => '',
168 168
 				),
169 169
 
@@ -180,17 +180,17 @@  discard block
 block discarded – undo
180 180
 
181 181
 			'attachments' => array(
182 182
 				'image-banner-example-01' => array(
183
-					'post_title' => esc_html_x( 'Banner Example 01', 'Theme starter content', 'lsx' ),
183
+					'post_title' => esc_html_x('Banner Example 01', 'Theme starter content', 'lsx'),
184 184
 					'file'       => 'assets/images/admin/banner-example-01.jpg',
185 185
 				),
186 186
 
187 187
 				'image-banner-example-02' => array(
188
-					'post_title' => esc_html_x( 'Banner Example 02', 'Theme starter content', 'lsx' ),
188
+					'post_title' => esc_html_x('Banner Example 02', 'Theme starter content', 'lsx'),
189 189
 					'file'       => 'assets/images/admin/banner-example-02.jpg',
190 190
 				),
191 191
 
192 192
 				'image-banner-example-03' => array(
193
-					'post_title' => esc_html_x( 'Banner Example 03', 'Theme starter content', 'lsx' ),
193
+					'post_title' => esc_html_x('Banner Example 03', 'Theme starter content', 'lsx'),
194 194
 					'file'       => 'assets/images/admin/banner-example-03.jpg',
195 195
 				),
196 196
 			),
@@ -199,12 +199,12 @@  discard block
 block discarded – undo
199 199
 				'show_on_front'   => 'page',
200 200
 				'page_on_front'   => '{{home}}',
201 201
 				'page_for_posts'  => '{{blog}}',
202
-				'blogdescription' => esc_html__( 'LSX starter content example', 'lsx' ),
202
+				'blogdescription' => esc_html__('LSX starter content example', 'lsx'),
203 203
 			),
204 204
 
205 205
 			'nav_menus'   => array(
206 206
 				'primary'  => array(
207
-					'name'  => esc_html__( 'Primary Menu', 'lsx' ),
207
+					'name'  => esc_html__('Primary Menu', 'lsx'),
208 208
 
209 209
 					'items' => array(
210 210
 						'page_home',
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 				),
216 216
 
217 217
 				'top-menu' => array(
218
-					'name'  => esc_html__( 'Top Menu', 'lsx' ),
218
+					'name'  => esc_html__('Top Menu', 'lsx'),
219 219
 
220 220
 					'items' => array(
221 221
 						'custom_link_1' => array(
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 				),
244 244
 
245 245
 				'social'   => array(
246
-					'name'  => esc_html__( 'Social Menu', 'lsx' ),
246
+					'name'  => esc_html__('Social Menu', 'lsx'),
247 247
 
248 248
 					'items' => array(
249 249
 						'link_facebook',
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 				),
259 259
 
260 260
 				'footer'   => array(
261
-					'name'  => esc_html__( 'Footer Menu', 'lsx' ),
261
+					'name'  => esc_html__('Footer Menu', 'lsx'),
262 262
 
263 263
 					'items' => array(
264 264
 						'page_about',
@@ -272,14 +272,14 @@  discard block
 block discarded – undo
272 272
 				'lsx_header_search' => false,
273 273
 				'lsx_layout'        => '1c',
274 274
 			),
275
-		) );
275
+		));
276 276
 	}
277 277
 
278 278
 endif;
279 279
 
280
-add_action( 'after_setup_theme', 'lsx_setup' );
280
+add_action('after_setup_theme', 'lsx_setup');
281 281
 
282
-if ( ! function_exists( 'lsx_init' ) ) :
282
+if ( ! function_exists('lsx_init')) :
283 283
 
284 284
 	/**
285 285
 	 * Theme init action.
@@ -288,20 +288,20 @@  discard block
 block discarded – undo
288 288
 	 * @subpackage config
289 289
 	 */
290 290
 	function lsx_init() {
291
-		add_post_type_support( 'page', 'excerpt' );
291
+		add_post_type_support('page', 'excerpt');
292 292
 
293
-		if ( class_exists( 'WooCommerce' ) ) {
294
-			remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 );
293
+		if (class_exists('WooCommerce')) {
294
+			remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20);
295 295
 		}
296 296
 
297
-		remove_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce', 10 );
297
+		remove_action('comment_form', 'wp_comment_form_unfiltered_html_nonce', 10);
298 298
 	}
299 299
 
300 300
 endif;
301 301
 
302
-add_action( 'init', 'lsx_init', 100 );
302
+add_action('init', 'lsx_init', 100);
303 303
 
304
-if ( ! function_exists( 'lsx_process_content_width' ) ) :
304
+if ( ! function_exists('lsx_process_content_width')) :
305 305
 
306 306
 	/**
307 307
 	 * Overwrite the $content_width var, based on the layout of the page.
@@ -313,8 +313,8 @@  discard block
 block discarded – undo
313 313
 		global $content_width;
314 314
 
315 315
 		if (
316
-			is_page_template( 'page-templates/template-front-page.php' ) ||
317
-			is_page_template( 'page-templates/template-full-width.php' )
316
+			is_page_template('page-templates/template-front-page.php') ||
317
+			is_page_template('page-templates/template-full-width.php')
318 318
 		) {
319 319
 			$content_width = 1140;
320 320
 		}
@@ -322,9 +322,9 @@  discard block
 block discarded – undo
322 322
 
323 323
 endif;
324 324
 
325
-add_action( 'wp_head', 'lsx_process_content_width' );
325
+add_action('wp_head', 'lsx_process_content_width');
326 326
 
327
-if ( ! function_exists( 'lsx_file_get_contents' ) ) :
327
+if ( ! function_exists('lsx_file_get_contents')) :
328 328
 
329 329
 	/**
330 330
 	 * Get file contents.
@@ -332,19 +332,19 @@  discard block
 block discarded – undo
332 332
 	 * @package    lsx
333 333
 	 * @subpackage config
334 334
 	 */
335
-	function lsx_file_get_contents( $file ) {
336
-		if ( file_exists( $file ) ) {
335
+	function lsx_file_get_contents($file) {
336
+		if (file_exists($file)) {
337 337
 			global $wp_filesystem;
338 338
 
339
-			if ( empty( $wp_filesystem ) ) {
340
-				require_once( ABSPATH . 'wp-admin/includes/file.php' );
339
+			if (empty($wp_filesystem)) {
340
+				require_once(ABSPATH . 'wp-admin/includes/file.php');
341 341
 				WP_Filesystem();
342 342
 			}
343 343
 
344
-			if ( $wp_filesystem ) {
345
-				$contents = $wp_filesystem->get_contents( $file );
344
+			if ($wp_filesystem) {
345
+				$contents = $wp_filesystem->get_contents($file);
346 346
 
347
-				if ( ! empty( $contents ) ) {
347
+				if ( ! empty($contents)) {
348 348
 					return $contents;
349 349
 				}
350 350
 			}
Please login to merge, or discard this patch.
includes/welcome.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  * @subpackage welcome-page
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13
-if ( ! function_exists( 'lsx_activation_admin_notice_dismiss' ) ) :
13
+if ( ! function_exists('lsx_activation_admin_notice_dismiss')) :
14 14
 
15 15
 	/**
16 16
 	 * Dismiss the admin notice (successful activation).
@@ -19,15 +19,15 @@  discard block
 block discarded – undo
19 19
 	 * @subpackage welcome-page
20 20
 	 */
21 21
 	function lsx_activation_admin_notice_dismiss() {
22
-		update_option( 'lsx-notice-dismissed', '1' );
22
+		update_option('lsx-notice-dismissed', '1');
23 23
 		wp_die();
24 24
 	}
25 25
 
26 26
 endif;
27 27
 
28
-add_action( 'wp_ajax_lsx_dismiss_theme_notice', 'lsx_activation_admin_notice_dismiss' );
28
+add_action('wp_ajax_lsx_dismiss_theme_notice', 'lsx_activation_admin_notice_dismiss');
29 29
 
30
-if ( ! function_exists( 'lsx_activation_admin_notice' ) ) :
30
+if ( ! function_exists('lsx_activation_admin_notice')) :
31 31
 
32 32
 	/**
33 33
 	 * Adds an admin notice upon successful activation.
@@ -36,16 +36,16 @@  discard block
 block discarded – undo
36 36
 	 * @subpackage welcome-page
37 37
 	 */
38 38
 	function lsx_activation_admin_notice() {
39
-		if ( empty( get_option( 'lsx-notice-dismissed' ) ) ) {
40
-			add_action( 'admin_notices', 'lsx_welcome_admin_notice', 99 );
39
+		if (empty(get_option('lsx-notice-dismissed'))) {
40
+			add_action('admin_notices', 'lsx_welcome_admin_notice', 99);
41 41
 		}
42 42
 	}
43 43
 
44 44
 endif;
45 45
 
46
-add_action( 'admin_notices', 'lsx_activation_admin_notice' );
46
+add_action('admin_notices', 'lsx_activation_admin_notice');
47 47
 
48
-if ( ! function_exists( 'lsx_welcome_admin_notice' ) ) :
48
+if ( ! function_exists('lsx_welcome_admin_notice')) :
49 49
 
50 50
 	/**
51 51
 	 * Display an admin notice linking to the welcome screen.
@@ -60,20 +60,20 @@  discard block
 block discarded – undo
60 60
 					<?php
61 61
 						printf(
62 62
 							/* Translators: 1: HTML open tag link, 2: HTML close tag link */
63
-							esc_html__( 'Thanks for choosing LSX! You can read hints and tips on how get the most out of your new theme on the %1$swelcome screen%2$s.', 'lsx' ),
64
-							'<a href="' . esc_url( admin_url( 'themes.php?page=lsx-welcome' ) ) . '">',
63
+							esc_html__('Thanks for choosing LSX! You can read hints and tips on how get the most out of your new theme on the %1$swelcome screen%2$s.', 'lsx'),
64
+							'<a href="' . esc_url(admin_url('themes.php?page=lsx-welcome')) . '">',
65 65
 							'</a>'
66 66
 						);
67 67
 					?>
68 68
 				</p>
69
-				<p><a href="<?php echo esc_url( admin_url( 'themes.php?page=lsx-welcome' ) ); ?>" class="button" style="text-decoration: none;"><?php esc_attr_e( 'Get started with LSX', 'lsx' ); ?></a></p>
69
+				<p><a href="<?php echo esc_url(admin_url('themes.php?page=lsx-welcome')); ?>" class="button" style="text-decoration: none;"><?php esc_attr_e('Get started with LSX', 'lsx'); ?></a></p>
70 70
 			</div>
71 71
 		<?php
72 72
 	}
73 73
 
74 74
 endif;
75 75
 
76
-if ( ! function_exists( 'lsx_welcome_style' ) ) :
76
+if ( ! function_exists('lsx_welcome_style')) :
77 77
 
78 78
 	/**
79 79
 	 * Load welcome screen css.
@@ -83,19 +83,19 @@  discard block
 block discarded – undo
83 83
 	 *
84 84
 	 * @param string $hook_suffix the current page hook suffix.
85 85
 	 */
86
-	function lsx_welcome_style( $hook_suffix ) {
87
-		if ( 'appearance_page_lsx-welcome' === $hook_suffix ) {
88
-			wp_enqueue_style( 'lsx-welcome-screen-mailchimp', '//cdn-images.mailchimp.com/embedcode/classic-10_7.css', array(), LSX_VERSION );
89
-			wp_enqueue_style( 'lsx-welcome-screen', get_template_directory_uri() . '/assets/css/admin/welcome.css', array( 'lsx-welcome-screen-mailchimp' ), LSX_VERSION );
90
-			wp_style_add_data( 'lsx-welcome-screen', 'rtl', 'replace' );
86
+	function lsx_welcome_style($hook_suffix) {
87
+		if ('appearance_page_lsx-welcome' === $hook_suffix) {
88
+			wp_enqueue_style('lsx-welcome-screen-mailchimp', '//cdn-images.mailchimp.com/embedcode/classic-10_7.css', array(), LSX_VERSION);
89
+			wp_enqueue_style('lsx-welcome-screen', get_template_directory_uri() . '/assets/css/admin/welcome.css', array('lsx-welcome-screen-mailchimp'), LSX_VERSION);
90
+			wp_style_add_data('lsx-welcome-screen', 'rtl', 'replace');
91 91
 		}
92 92
 	}
93 93
 
94 94
 endif;
95 95
 
96
-add_action( 'admin_enqueue_scripts', 'lsx_welcome_style' );
96
+add_action('admin_enqueue_scripts', 'lsx_welcome_style');
97 97
 
98
-if ( ! function_exists( 'lsx_welcome_register_menu' ) ) :
98
+if ( ! function_exists('lsx_welcome_register_menu')) :
99 99
 
100 100
 	/**
101 101
 	 * Creates the dashboard page.
@@ -104,14 +104,14 @@  discard block
 block discarded – undo
104 104
 	 * @subpackage welcome-page
105 105
 	 */
106 106
 	function lsx_welcome_register_menu() {
107
-		add_theme_page( 'LSX', 'LSX', 'activate_plugins', 'lsx-welcome', 'lsx_welcome_screen' );
107
+		add_theme_page('LSX', 'LSX', 'activate_plugins', 'lsx-welcome', 'lsx_welcome_screen');
108 108
 	}
109 109
 
110 110
 endif;
111 111
 
112
-add_action( 'admin_menu', 'lsx_welcome_register_menu' );
112
+add_action('admin_menu', 'lsx_welcome_register_menu');
113 113
 
114
-if ( ! function_exists( 'lsx_welcome_screen' ) ) :
114
+if ( ! function_exists('lsx_welcome_screen')) :
115 115
 
116 116
 	/**
117 117
 	 * The welcome screen.
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 			 * @hooked lsx_welcome_enhance - 20
134 134
 			 * @hooked lsx_welcome_footer  - 30
135 135
 			 */
136
-			do_action( 'lsx_welcome' );
136
+			do_action('lsx_welcome');
137 137
 			?>
138 138
 		</div>
139 139
 		<?php
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 
142 142
 endif;
143 143
 
144
-if ( ! function_exists( 'lsx_welcome_header' ) ) :
144
+if ( ! function_exists('lsx_welcome_header')) :
145 145
 
146 146
 	/**
147 147
 	 * Welcome screen intro.
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
 
156 156
 endif;
157 157
 
158
-add_action( 'lsx_welcome', 'lsx_welcome_header', 10 );
158
+add_action('lsx_welcome', 'lsx_welcome_header', 10);
159 159
 
160
-if ( ! function_exists( 'lsx_welcome_enhance' ) ) :
160
+if ( ! function_exists('lsx_welcome_enhance')) :
161 161
 
162 162
 	/**
163 163
 	 * Welcome screen enhance section.
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
 
172 172
 endif;
173 173
 
174
-add_action( 'lsx_welcome', 'lsx_welcome_enhance', 20 );
174
+add_action('lsx_welcome', 'lsx_welcome_enhance', 20);
175 175
 
176
-if ( ! function_exists( 'lsx_welcome_footer' ) ) :
176
+if ( ! function_exists('lsx_welcome_footer')) :
177 177
 
178 178
 	/**
179 179
 	 * Welcome screen contribute section.
@@ -187,4 +187,4 @@  discard block
 block discarded – undo
187 187
 
188 188
 endif;
189 189
 
190
-add_action( 'lsx_welcome', 'lsx_welcome_footer', 30 );
190
+add_action('lsx_welcome', 'lsx_welcome_footer', 30);
Please login to merge, or discard this patch.
includes/widgets.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  * @subpackage widgets
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13
-if ( ! function_exists( 'lsx_widget_area_init' ) ) :
13
+if ( ! function_exists('lsx_widget_area_init')) :
14 14
 
15 15
 	/**
16 16
 	 * Register widgetized area and update sidebar with default widgets.
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	function lsx_widget_area_init() {
22 22
 		register_sidebar(
23 23
 			array(
24
-				'name'          => esc_html__( 'Home', 'lsx' ),
24
+				'name'          => esc_html__('Home', 'lsx'),
25 25
 				'id'            => 'sidebar-home',
26 26
 				'before_widget' => '<aside id="%1$s" class="widget %2$s">',
27 27
 				'after_widget'  => '</aside>',
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 		register_sidebar(
34 34
 			array(
35
-				'name'          => esc_html__( 'Sidebar', 'lsx' ),
35
+				'name'          => esc_html__('Sidebar', 'lsx'),
36 36
 				'id'            => 'sidebar-1',
37 37
 				'before_widget' => '<aside id="%1$s" class="widget %2$s">',
38 38
 				'after_widget'  => '</aside>',
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
 		register_sidebar(
45 45
 			array(
46
-				'name'          => esc_html__( 'Footer', 'lsx' ),
46
+				'name'          => esc_html__('Footer', 'lsx'),
47 47
 				'id'            => 'sidebar-footer',
48 48
 				'before_widget' => '<div class="styler"><aside id="%1$s" class="widget %2$s">',
49 49
 				'after_widget'  => '</aside></div>',
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 		register_sidebar(
56 56
 			array(
57
-				'name'          => esc_html__( 'Footer Call to Action', 'lsx' ),
57
+				'name'          => esc_html__('Footer Call to Action', 'lsx'),
58 58
 				'id'            => 'sidebar-footer-cta',
59 59
 				'before_widget' => '<aside id="%1$s" class="widget %2$s">',
60 60
 				'after_widget'  => '</aside>',
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
 
67 67
 endif;
68 68
 
69
-add_action( 'widgets_init', 'lsx_widget_area_init' );
69
+add_action('widgets_init', 'lsx_widget_area_init');
70 70
 
71
-if ( ! function_exists( 'lsx_sidebar_footer_params' ) ) :
71
+if ( ! function_exists('lsx_sidebar_footer_params')) :
72 72
 
73 73
 	/**
74 74
 	 * Register widgetized area and update sidebar with default widgets.
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
 	 * @package    lsx
77 77
 	 * @subpackage widgets
78 78
 	 */
79
-	function lsx_sidebar_footer_params( $params ) {
79
+	function lsx_sidebar_footer_params($params) {
80 80
 		$sidebar_id = $params[0]['id'];
81 81
 
82
-		if ( 'sidebar-footer' === $sidebar_id ) {
82
+		if ('sidebar-footer' === $sidebar_id) {
83 83
 			$total_widgets              = wp_get_sidebars_widgets();
84
-			$sidebar_widgets            = count( $total_widgets[ $sidebar_id ] );
85
-			$params[0]['before_widget'] = str_replace( 'class="styler', 'class="col-md-' . floor( 12 / $sidebar_widgets ), $params[0]['before_widget'] );
84
+			$sidebar_widgets            = count($total_widgets[$sidebar_id]);
85
+			$params[0]['before_widget'] = str_replace('class="styler', 'class="col-md-' . floor(12 / $sidebar_widgets), $params[0]['before_widget']);
86 86
 		}
87 87
 
88 88
 		return $params;
@@ -90,4 +90,4 @@  discard block
 block discarded – undo
90 90
 
91 91
 endif;
92 92
 
93
-add_filter( 'dynamic_sidebar_params', 'lsx_sidebar_footer_params' );
93
+add_filter('dynamic_sidebar_params', 'lsx_sidebar_footer_params');
Please login to merge, or discard this patch.
includes/sensei/class-lsx-sensei-course.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @subpackage sensei
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit; // Exit if accessed directly.
11 11
 }
12 12
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * Constructor.
27 27
 	 */
28 28
 	public function __construct() {
29
-		add_action( 'init', array( $this, 'init' ) );
29
+		add_action('init', array($this, 'init'));
30 30
 	} // End __construct()
31 31
 
32 32
 	/**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 * @return self
36 36
 	 */
37 37
 	public static function instance() {
38
-		if ( ! self::$instance ) {
38
+		if ( ! self::$instance) {
39 39
 			self::$instance = new self();
40 40
 		}
41 41
 		return self::$instance;
@@ -49,32 +49,32 @@  discard block
 block discarded – undo
49 49
 		global $woothemes_sensei;
50 50
 
51 51
 		// Switching the course filters and the headers around.
52
-		remove_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 10, 0 );
53
-		remove_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_sorting' ) );
54
-		remove_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_filters' ) );
55
-		add_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 11, 0 );
56
-		add_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_sorting' ), 12 );
57
-		add_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_filters' ), 12 );
52
+		remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 10, 0);
53
+		remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting'));
54
+		remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters'));
55
+		add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 11, 0);
56
+		add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting'), 12);
57
+		add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters'), 12);
58 58
 
59 59
 		// First add the thumbnail.
60
-		add_action( 'sensei_course_content_inside_before', array( $this, 'get_course_thumbnail' ), 1 );
60
+		add_action('sensei_course_content_inside_before', array($this, 'get_course_thumbnail'), 1);
61 61
 
62 62
 		// This is for our wrapper, we run it on 2, after the thumbnail we added.
63
-		add_action( 'sensei_course_content_inside_before', array( $this, 'course_body_div_open' ), 1 );
64
-		add_action( 'sensei_course_content_inside_after', array( $this, 'course_body_div_close' ), 50 );
63
+		add_action('sensei_course_content_inside_before', array($this, 'course_body_div_open'), 1);
64
+		add_action('sensei_course_content_inside_after', array($this, 'course_body_div_close'), 50);
65 65
 
66 66
 		// This is for our wrapper, we run it on 2, after the thumbnail we added.
67
-		add_action( 'sensei_course_content_inside_before', array( $this, 'course_body_div_results_open' ), 20 );
68
-		add_action( 'sensei_course_content_inside_after', array( $this, 'course_body_div_results_close' ), 49 );
67
+		add_action('sensei_course_content_inside_before', array($this, 'course_body_div_results_open'), 20);
68
+		add_action('sensei_course_content_inside_after', array($this, 'course_body_div_results_close'), 49);
69 69
 
70
-		add_action( 'sensei_single_course_content_inside_before', array( $this, 'display_course_amount' ), 20 );
70
+		add_action('sensei_single_course_content_inside_before', array($this, 'display_course_amount'), 20);
71 71
 
72 72
 		// removes the course image above the content.
73
-		remove_action( 'sensei_course_content_inside_before', array( $woothemes_sensei->course, 'course_image' ), 30, 1 );
73
+		remove_action('sensei_course_content_inside_before', array($woothemes_sensei->course, 'course_image'), 30, 1);
74 74
 		// add the course image to the left of the content.
75
-		add_action( 'lsx_sensei_course_content_inside_before', array( $woothemes_sensei->course, 'course_image' ), 30, 1 );
75
+		add_action('lsx_sensei_course_content_inside_before', array($woothemes_sensei->course, 'course_image'), 30, 1);
76 76
 
77
-		add_filter( 'attach_shortcode_hooks', 'lsx_attach_shortcode_hooks', 10, 1 );
77
+		add_filter('attach_shortcode_hooks', 'lsx_attach_shortcode_hooks', 10, 1);
78 78
 
79 79
 	}
80 80
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	public function get_course_thumbnail() {
87 87
 		?>
88 88
 		<div class="course-thumbnail">
89
-			<?php do_action( 'lsx_sensei_course_content_inside_before', get_the_ID() ); ?>
89
+			<?php do_action('lsx_sensei_course_content_inside_before', get_the_ID()); ?>
90 90
 		</div>
91 91
 		<?php
92 92
 	}
@@ -98,13 +98,13 @@  discard block
 block discarded – undo
98 98
 	 */
99 99
 	public function course_body_div_open() {
100 100
 		global $post, $current_user;
101
-		$is_user_taking_course    = Sensei_Utils::user_started_course( $post->ID, $current_user->ID );
101
+		$is_user_taking_course    = Sensei_Utils::user_started_course($post->ID, $current_user->ID);
102 102
 		$user_taking_course_class = '';
103
-		if ( ! empty( $is_user_taking_course ) ) {
103
+		if ( ! empty($is_user_taking_course)) {
104 104
 			$user_taking_course_class = 'currently-in-course';
105 105
 		}
106 106
 		?>
107
-		<div class="course-body <?php echo esc_html( $user_taking_course_class ); ?>">
107
+		<div class="course-body <?php echo esc_html($user_taking_course_class); ?>">
108 108
 		<?php
109 109
 	}
110 110
 
@@ -148,16 +148,16 @@  discard block
 block discarded – undo
148 148
 	 */
149 149
 	public function display_course_amount() {
150 150
 		global $post, $current_user;
151
-		$is_user_taking_course = Sensei_Utils::user_started_course( $post->ID, $current_user->ID );
152
-		$wc_post_id            = absint( get_post_meta( $post->ID, '_course_woocommerce_product', true ) );
153
-		if ( class_exists( 'Sensei_WC' ) ) {
154
-			$course_purchasable = Sensei_WC::is_course_purchasable( $post->ID );
151
+		$is_user_taking_course = Sensei_Utils::user_started_course($post->ID, $current_user->ID);
152
+		$wc_post_id            = absint(get_post_meta($post->ID, '_course_woocommerce_product', true));
153
+		if (class_exists('Sensei_WC')) {
154
+			$course_purchasable = Sensei_WC::is_course_purchasable($post->ID);
155 155
 			$currency           = get_woocommerce_currency_symbol();
156
-			$product            = new WC_Product( $wc_post_id );
157
-			if ( ( ! empty( $product->price ) ) && ( ! $is_user_taking_course ) ) {
158
-				echo '<span class="course-product-price price"><span>' . esc_html( $currency ) . ' </span>' . sprintf( '%0.2f', esc_html( $product->price ) ) . '</span>';
159
-			} elseif ( ( '' === $product->get_price() || 0 == $product->get_price() ) && $course_purchasable ) {
160
-				echo '<span class="course-product-price price">' . wp_kses_post( 'Free!', 'lsx' ) . '</span>';
156
+			$product            = new WC_Product($wc_post_id);
157
+			if (( ! empty($product->price)) && ( ! $is_user_taking_course)) {
158
+				echo '<span class="course-product-price price"><span>' . esc_html($currency) . ' </span>' . sprintf('%0.2f', esc_html($product->price)) . '</span>';
159
+			} elseif (('' === $product->get_price() || 0 == $product->get_price()) && $course_purchasable) {
160
+				echo '<span class="course-product-price price">' . wp_kses_post('Free!', 'lsx') . '</span>';
161 161
 			}
162 162
 		}
163 163
 	}
Please login to merge, or discard this patch.
includes/sensei/class-lsx-sensei-lesson.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @subpackage sensei
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit; // Exit if accessed directly.
11 11
 }
12 12
 
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 	 * Constructor.
27 27
 	 */
28 28
 	public function __construct() {
29
-		add_action( 'init', array( $this, 'init' ) );
30
-		add_action( 'widgets_init', array( $this, 'lsx_widget_area_sensei_init' ), 100 );
31
-		add_filter( 'body_class', array( $this, 'lsx_widget_area_sensei_is_active' ) );
29
+		add_action('init', array($this, 'init'));
30
+		add_action('widgets_init', array($this, 'lsx_widget_area_sensei_init'), 100);
31
+		add_filter('body_class', array($this, 'lsx_widget_area_sensei_is_active'));
32 32
 	} // End __construct()
33 33
 
34 34
 	/**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 * @return self
38 38
 	 */
39 39
 	public static function instance() {
40
-		if ( ! self::$instance ) {
40
+		if ( ! self::$instance) {
41 41
 			self::$instance = new self();
42 42
 		}
43 43
 		return self::$instance;
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	 * Run our changes.
48 48
 	 */
49 49
 	public function init() {
50
-		add_action( 'lsx_content_top', array( $this, 'lsx_sensei_lesson_sidebar' ) );
50
+		add_action('lsx_content_top', array($this, 'lsx_sensei_lesson_sidebar'));
51 51
 
52 52
 	}
53 53
 
@@ -57,15 +57,15 @@  discard block
 block discarded – undo
57 57
 	 * @return void
58 58
 	 */
59 59
 	public function lsx_widget_area_sensei_init() {
60
-		if ( class_exists( 'Sensei_Course_Participants' ) || class_exists( 'Sensei_Course_Progress' ) ) {
61
-			register_sidebar( array(
62
-				'name'          => esc_html__( 'LSX Sensei Sidebar', 'lsx' ),
60
+		if (class_exists('Sensei_Course_Participants') || class_exists('Sensei_Course_Progress')) {
61
+			register_sidebar(array(
62
+				'name'          => esc_html__('LSX Sensei Sidebar', 'lsx'),
63 63
 				'id'            => 'lsx-sensei-sidebar',
64 64
 				'before_widget' => '<aside id="%1$s" class="widget %2$s">',
65 65
 				'after_widget'  => '</aside>',
66 66
 				'before_title'  => '<h3 class="widget-title">',
67 67
 				'after_title'   => '</h3>',
68
-			) );
68
+			));
69 69
 		}
70 70
 	}
71 71
 
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
 	 * @param [type] $classes
76 76
 	 * @return classes
77 77
 	 */
78
-	public function lsx_widget_area_sensei_is_active( $classes ) {
78
+	public function lsx_widget_area_sensei_is_active($classes) {
79 79
 
80
-		if ( class_exists( 'Sensei_Lesson' ) && is_active_sidebar( 'lsx-sensei-sidebar' ) ) {
80
+		if (class_exists('Sensei_Lesson') && is_active_sidebar('lsx-sensei-sidebar')) {
81 81
 			$classes[] = 'lsx-sensei-sidebar-active';
82 82
 		}
83 83
 
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 	 * @return void
91 91
 	 */
92 92
 	public function lsx_sensei_lesson_sidebar() {
93
-		if ( class_exists( 'Sensei_Lesson' ) && ( class_exists( 'Sensei_Course_Participants' ) || class_exists( 'Sensei_Course_Progress' ) ) ) {
94
-			if ( ( is_single() && ( is_singular( 'lesson' ) ) ) || ( is_single() && ( is_singular( 'quiz' ) ) ) ) {
95
-				if ( is_active_sidebar( 'lsx-sensei-sidebar' ) ) {
93
+		if (class_exists('Sensei_Lesson') && (class_exists('Sensei_Course_Participants') || class_exists('Sensei_Course_Progress'))) {
94
+			if ((is_single() && (is_singular('lesson'))) || (is_single() && (is_singular('quiz')))) {
95
+				if (is_active_sidebar('lsx-sensei-sidebar')) {
96 96
 					echo '<div id="secondary" class="widget-area lsx-sensei-sidebar">';
97
-					dynamic_sidebar( 'lsx-sensei-sidebar' );
97
+					dynamic_sidebar('lsx-sensei-sidebar');
98 98
 					echo '</div>';
99 99
 				}
100 100
 			}
Please login to merge, or discard this patch.