Passed
Push — master ( 1a7e47...15dbec )
by Chris
04:38
created
includes/template-tags.php 1 patch
Spacing   +169 added lines, -169 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  * @subpackage template-tags
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13
-if ( ! function_exists( 'lsx_breadcrumbs' ) ) :
13
+if ( ! function_exists('lsx_breadcrumbs')) :
14 14
 
15 15
 	/**
16 16
 	 * Breadcrumbs.
@@ -19,17 +19,17 @@  discard block
 block discarded – undo
19 19
 	 * @subpackage template-tags
20 20
 	 */
21 21
 	function lsx_breadcrumbs() {
22
-		if ( ! function_exists( 'yoast_breadcrumb' ) && ! function_exists( 'woocommerce_breadcrumb' ) ) {
22
+		if ( ! function_exists('yoast_breadcrumb') && ! function_exists('woocommerce_breadcrumb')) {
23 23
 			return null;
24 24
 		}
25 25
 
26
-		$show_on_front = get_option( 'show_on_front' );
26
+		$show_on_front = get_option('show_on_front');
27 27
 
28
-		if ( ( 'posts' === $show_on_front && is_home() ) || ( 'page' === $show_on_front && is_front_page() ) ) {
28
+		if (('posts' === $show_on_front && is_home()) || ('page' === $show_on_front && is_front_page())) {
29 29
 			return;
30 30
 		}
31 31
 
32
-		if ( function_exists( 'woocommerce_breadcrumb' ) ) {
32
+		if (function_exists('woocommerce_breadcrumb')) {
33 33
 			ob_start();
34 34
 
35 35
 			woocommerce_breadcrumb(
@@ -42,23 +42,23 @@  discard block
 block discarded – undo
42 42
 			);
43 43
 
44 44
 			$output = ob_get_clean();
45
-		} elseif ( function_exists( 'yoast_breadcrumb' ) ) {
46
-			$output = yoast_breadcrumb( null, null, false );
45
+		} elseif (function_exists('yoast_breadcrumb')) {
46
+			$output = yoast_breadcrumb(null, null, false);
47 47
 			$output = '<div class="breadcrumbs-container breadcrumbs-yoast"><div class="container"><div class="row"><div class="col-xs-12">' . $output . '</div></div></div></div>';
48 48
 		}
49 49
 
50
-		$output = apply_filters( 'lsx_breadcrumbs', $output );
50
+		$output = apply_filters('lsx_breadcrumbs', $output);
51 51
 
52
-		echo wp_kses_post( $output );
52
+		echo wp_kses_post($output);
53 53
 	}
54 54
 
55 55
 endif;
56 56
 
57
-add_action( 'lsx_header_after', 'lsx_breadcrumbs', 1 );
57
+add_action('lsx_header_after', 'lsx_breadcrumbs', 1);
58 58
 //add_action( 'lsx_banner_inner_bottom', 'lsx_breadcrumbs', 100 );
59 59
 //add_action( 'lsx_global_header_inner_bottom', 'lsx_breadcrumbs', 100 );
60 60
 
61
-if ( ! function_exists( 'lsx_breadcrumbs_wpseo_seperator_filter' ) ) :
61
+if ( ! function_exists('lsx_breadcrumbs_wpseo_seperator_filter')) :
62 62
 
63 63
 	/**
64 64
 	 * Replaces the seperator.
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
66 66
 	 * @package    lsx
67 67
 	 * @subpackage template-tags
68 68
 	 */
69
-	function lsx_breadcrumbs_wpseo_seperator_filter( $seperator ) {
69
+	function lsx_breadcrumbs_wpseo_seperator_filter($seperator) {
70 70
 		$seperator = '<i class="fa fa-angle-right" aria-hidden="true"></i>';
71 71
 		return $seperator;
72 72
 	}
73 73
 
74 74
 endif;
75 75
 
76
-add_filter( 'wpseo_breadcrumb_separator', 'lsx_breadcrumbs_wpseo_seperator_filter' );
76
+add_filter('wpseo_breadcrumb_separator', 'lsx_breadcrumbs_wpseo_seperator_filter');
77 77
 
78
-if ( ! function_exists( 'lsx_breadcrumbs_woocommerce_seperator_filter' ) ) :
78
+if ( ! function_exists('lsx_breadcrumbs_woocommerce_seperator_filter')) :
79 79
 
80 80
 	/**
81 81
 	 * Replaces the seperator.
@@ -83,16 +83,16 @@  discard block
 block discarded – undo
83 83
 	 * @package    lsx
84 84
 	 * @subpackage template-tags
85 85
 	 */
86
-	function lsx_breadcrumbs_woocommerce_seperator_filter( $defaults ) {
86
+	function lsx_breadcrumbs_woocommerce_seperator_filter($defaults) {
87 87
 		$defaults['delimiter'] = '<i class="fa fa-angle-right" aria-hidden="true"></i>';
88 88
 		return $defaults;
89 89
 	}
90 90
 
91 91
 endif;
92 92
 
93
-add_filter( 'woocommerce_breadcrumb_defaults', 'lsx_breadcrumbs_woocommerce_seperator_filter' );
93
+add_filter('woocommerce_breadcrumb_defaults', 'lsx_breadcrumbs_woocommerce_seperator_filter');
94 94
 
95
-if ( ! function_exists( 'lsx_site_title' ) ) :
95
+if ( ! function_exists('lsx_site_title')) :
96 96
 
97 97
 	/**
98 98
 	 * Displays logo when applicable.
@@ -103,15 +103,15 @@  discard block
 block discarded – undo
103 103
 	function lsx_site_title() {
104 104
 		?>
105 105
 			<div class="site-branding">
106
-				<h1 class="site-title"><a title="<?php bloginfo( 'name' ); ?>" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
107
-				<p class="site-description"><?php bloginfo( 'description' ); ?></p>
106
+				<h1 class="site-title"><a title="<?php bloginfo('name'); ?>" href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></h1>
107
+				<p class="site-description"><?php bloginfo('description'); ?></p>
108 108
 			</div>
109 109
 		<?php
110 110
 	}
111 111
 
112 112
 endif;
113 113
 
114
-if ( ! function_exists( 'lsx_post_meta_list_top' ) ) :
114
+if ( ! function_exists('lsx_post_meta_list_top')) :
115 115
 
116 116
 	/**
117 117
 	 * Add customizable post meta (post list - above title).
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
 endif;
134 134
 
135
-if ( ! function_exists( 'lsx_post_meta_single_top' ) ) :
135
+if ( ! function_exists('lsx_post_meta_single_top')) :
136 136
 
137 137
 	/**
138 138
 	 * Add customizable post meta (single post - above title).
@@ -152,11 +152,11 @@  discard block
 block discarded – undo
152 152
 endif;
153 153
 
154 154
 //add_action( 'lsx_post_meta_top', 'lsx_post_meta_avatar' );
155
-add_action( 'lsx_post_meta_top', 'lsx_post_meta_author' );
156
-add_action( 'lsx_post_meta_top', 'lsx_post_meta_date' );
157
-add_action( 'lsx_post_meta_top', 'lsx_post_meta_category' );
155
+add_action('lsx_post_meta_top', 'lsx_post_meta_author');
156
+add_action('lsx_post_meta_top', 'lsx_post_meta_date');
157
+add_action('lsx_post_meta_top', 'lsx_post_meta_category');
158 158
 
159
-if ( ! function_exists( 'lsx_post_meta_single_bottom' ) ) :
159
+if ( ! function_exists('lsx_post_meta_single_bottom')) :
160 160
 
161 161
 	/**
162 162
 	 * Add customizable post meta (single post - below title).
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
 endif;
177 177
 
178
-if ( ! function_exists( 'lsx_post_meta_avatar' ) ) :
178
+if ( ! function_exists('lsx_post_meta_avatar')) :
179 179
 
180 180
 	/**
181 181
 	 * Add customizable post meta: author's avatar.
@@ -185,20 +185,20 @@  discard block
 block discarded – undo
185 185
 	 */
186 186
 	function lsx_post_meta_avatar() {
187 187
 		$author        = get_the_author();
188
-		$author_id     = get_the_author_meta( 'ID' );
189
-		$author_avatar = get_avatar( $author_id, 80 );
190
-		$author_url    = get_author_posts_url( $author_id );
188
+		$author_id     = get_the_author_meta('ID');
189
+		$author_avatar = get_avatar($author_id, 80);
190
+		$author_url    = get_author_posts_url($author_id);
191 191
 
192 192
 		printf(
193 193
 			'<a href="%1$s" class="post-meta-avatar">%2$s</a>',
194
-			esc_url( $author_url ),
195
-			wp_kses_post( $author_avatar )
194
+			esc_url($author_url),
195
+			wp_kses_post($author_avatar)
196 196
 		);
197 197
 	}
198 198
 
199 199
 endif;
200 200
 
201
-if ( ! function_exists( 'lsx_post_meta_date' ) ) :
201
+if ( ! function_exists('lsx_post_meta_date')) :
202 202
 
203 203
 	/**
204 204
 	 * Add customizable post meta: post date.
@@ -211,22 +211,22 @@  discard block
 block discarded – undo
211 211
 
212 212
 		$time_string = sprintf(
213 213
 			$time_string,
214
-			esc_attr( get_the_date( 'c' ) ),
214
+			esc_attr(get_the_date('c')),
215 215
 			get_the_date(),
216
-			esc_attr( get_the_modified_date( 'c' ) ),
216
+			esc_attr(get_the_modified_date('c')),
217 217
 			get_the_modified_date()
218 218
 		);
219 219
 
220 220
 		printf(
221 221
 			'<span class="post-meta-time updated"><a href="%1$s" rel="bookmark">%2$s</a></span>',
222
-			esc_url( get_permalink() ),
223
-			wp_kses_post( $time_string )
222
+			esc_url(get_permalink()),
223
+			wp_kses_post($time_string)
224 224
 		);
225 225
 	}
226 226
 
227 227
 endif;
228 228
 
229
-if ( ! function_exists( 'lsx_post_meta_author' ) ) :
229
+if ( ! function_exists('lsx_post_meta_author')) :
230 230
 
231 231
 	/**
232 232
 	 * Add customizable post meta: post author.
@@ -236,27 +236,27 @@  discard block
 block discarded – undo
236 236
 	 */
237 237
 	function lsx_post_meta_author() {
238 238
 		$author     = get_the_author();
239
-		$author_url = get_author_posts_url( get_the_author_meta( 'ID' ) );
239
+		$author_url = get_author_posts_url(get_the_author_meta('ID'));
240 240
 
241
-		if ( empty( $author ) ) {
241
+		if (empty($author)) {
242 242
 			global $post;
243 243
 
244
-			$author     = get_user_by( 'ID', $post->post_author );
244
+			$author     = get_user_by('ID', $post->post_author);
245 245
 			$author     = $author->display_name;
246
-			$author_url = get_author_posts_url( $post->post_author );
246
+			$author_url = get_author_posts_url($post->post_author);
247 247
 		}
248 248
 
249 249
 		printf(
250 250
 			'<span class="vcard post-meta-author"><span>%1$s</span> <span class="fn"><a href="%2$s">%3$s</a>, </span></span>',
251
-			esc_html__( 'By ', 'lsx' ),
252
-			esc_url( $author_url ),
253
-			esc_html( $author )
251
+			esc_html__('By ', 'lsx'),
252
+			esc_url($author_url),
253
+			esc_html($author)
254 254
 		);
255 255
 	}
256 256
 
257 257
 endif;
258 258
 
259
-if ( ! function_exists( 'lsx_post_meta_category' ) ) :
259
+if ( ! function_exists('lsx_post_meta_category')) :
260 260
 
261 261
 	/**
262 262
 	 * Add customizable post meta: post category(ies).
@@ -265,25 +265,25 @@  discard block
 block discarded – undo
265 265
 	 * @subpackage template-tags
266 266
 	 */
267 267
 	function lsx_post_meta_category() {
268
-		$post_categories = wp_get_post_categories( get_the_ID() );
268
+		$post_categories = wp_get_post_categories(get_the_ID());
269 269
 		$cats            = array();
270 270
 
271
-		foreach ( $post_categories as $c ) {
272
-			$cat = get_category( $c );
271
+		foreach ($post_categories as $c) {
272
+			$cat = get_category($c);
273 273
 			/* Translators: %s: category name */
274
-			$cats[] = '<a href="' . esc_url( get_category_link( $cat->term_id ) ) . '" title="' . sprintf( esc_html__( 'View all posts in %s', 'lsx' ), $cat->name ) . '">' . $cat->name . '</a>';
274
+			$cats[] = '<a href="' . esc_url(get_category_link($cat->term_id)) . '" title="' . sprintf(esc_html__('View all posts in %s', 'lsx'), $cat->name) . '">' . $cat->name . '</a>';
275 275
 		}
276 276
 
277
-		if ( ! empty( $cats ) ) {
277
+		if ( ! empty($cats)) {
278 278
 			?>
279
-			<span class="post-meta-categories"><span><?php esc_html_e( 'Posted in: ', 'lsx' ); ?></span> <?php echo wp_kses_post( implode( ', ', $cats ) ); ?></span>
279
+			<span class="post-meta-categories"><span><?php esc_html_e('Posted in: ', 'lsx'); ?></span> <?php echo wp_kses_post(implode(', ', $cats)); ?></span>
280 280
 			<?php
281 281
 		}
282 282
 	}
283 283
 
284 284
 endif;
285 285
 
286
-if ( ! function_exists( 'lsx_post_tags' ) ) :
286
+if ( ! function_exists('lsx_post_tags')) :
287 287
 
288 288
 	/**
289 289
 	 * Add customizable post meta: post tag(s).
@@ -292,10 +292,10 @@  discard block
 block discarded – undo
292 292
 	 * @subpackage template-tags
293 293
 	 */
294 294
 	function lsx_post_tags() {
295
-		if ( has_tag() ) :
295
+		if (has_tag()) :
296 296
 			?>
297 297
 			<div class="post-tags">
298
-				<span><?php echo esc_html__( 'Tags: ', 'lsx' ); ?></span><?php echo wp_kses_post( get_the_tag_list( '' ) ); ?>
298
+				<span><?php echo esc_html__('Tags: ', 'lsx'); ?></span><?php echo wp_kses_post(get_the_tag_list('')); ?>
299 299
 			</div>
300 300
 			<?php
301 301
 		endif;
@@ -303,9 +303,9 @@  discard block
 block discarded – undo
303 303
 
304 304
 endif;
305 305
 
306
-add_action( 'lsx_content_post_tags', 'lsx_post_tags', 10 );
306
+add_action('lsx_content_post_tags', 'lsx_post_tags', 10);
307 307
 
308
-if ( ! function_exists( 'lsx_sharing_output' ) ) :
308
+if ( ! function_exists('lsx_sharing_output')) :
309 309
 
310 310
 	/**
311 311
 	 * Display sharing buttons.
@@ -315,14 +315,14 @@  discard block
 block discarded – undo
315 315
 	 */
316 316
 	function lsx_sharing_output() {
317 317
 		global $lsx_sharing;
318
-		echo wp_kses_post( $lsx_sharing->sharing_buttons() );
318
+		echo wp_kses_post($lsx_sharing->sharing_buttons());
319 319
 	}
320 320
 
321 321
 endif;
322 322
 
323
-add_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 );
323
+add_action('lsx_content_sharing', 'lsx_sharing_output', 20);
324 324
 
325
-if ( ! function_exists( 'lsx_translate_format_to_fontawesome' ) ) :
325
+if ( ! function_exists('lsx_translate_format_to_fontawesome')) :
326 326
 
327 327
 	/**
328 328
 	 * Translate post format to Font Awesome class.
@@ -330,8 +330,8 @@  discard block
 block discarded – undo
330 330
 	 * @package    lsx
331 331
 	 * @subpackage template-tags
332 332
 	 */
333
-	function lsx_translate_format_to_fontawesome( $format ) {
334
-		switch ( $format ) {
333
+	function lsx_translate_format_to_fontawesome($format) {
334
+		switch ($format) {
335 335
 			case 'image':
336 336
 				$format = 'camera';
337 337
 				break;
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 
364 364
 endif;
365 365
 
366
-if ( ! function_exists( 'lsx_paging_nav' ) ) :
366
+if ( ! function_exists('lsx_paging_nav')) :
367 367
 
368 368
 	/**
369 369
 	 * Display navigation to next/previous set of posts when applicable.
@@ -374,13 +374,13 @@  discard block
 block discarded – undo
374 374
 	function lsx_paging_nav() {
375 375
 		global $wp_query;
376 376
 
377
-		if ( $wp_query->max_num_pages < 2 ) {
377
+		if ($wp_query->max_num_pages < 2) {
378 378
 			return;
379 379
 		}
380 380
 
381
-		if ( true === apply_filters( 'lsx_paging_nav_disable', false ) ) {
381
+		if (true === apply_filters('lsx_paging_nav_disable', false)) {
382 382
 			return true;
383
-		} elseif ( current_theme_supports( 'infinite-scroll' ) && class_exists( 'The_Neverending_Home_Page' ) ) {
383
+		} elseif (current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')) {
384 384
 			return true;
385 385
 		} else {
386 386
 			$html  = '';
@@ -389,24 +389,24 @@  discard block
 block discarded – undo
389 389
 			$html .= '<div class="lsx-pagination">' . PHP_EOL;
390 390
 			$html .= paginate_links(
391 391
 				array(
392
-					'base'      => str_replace( 999999999, '%#%', esc_url( get_pagenum_link( 999999999 ) ) ),
392
+					'base'      => str_replace(999999999, '%#%', esc_url(get_pagenum_link(999999999))),
393 393
 					'format'    => '?paged=%#%',
394 394
 					'total'     => $wp_query->max_num_pages,
395
-					'current'   => max( 1, intval( get_query_var( 'paged' ) ) ),
396
-					'prev_text' => '<span class="meta-nav">&larr;</span> ' . esc_html__( 'Previous', 'lsx' ),
397
-					'next_text' => esc_html__( 'Next', 'lsx' ) . ' <span class="meta-nav">&rarr;</span>',
395
+					'current'   => max(1, intval(get_query_var('paged'))),
396
+					'prev_text' => '<span class="meta-nav">&larr;</span> ' . esc_html__('Previous', 'lsx'),
397
+					'next_text' => esc_html__('Next', 'lsx') . ' <span class="meta-nav">&rarr;</span>',
398 398
 				)
399 399
 			);
400 400
 			$html .= '</div>' . PHP_EOL;
401 401
 			$html .= '</div>' . PHP_EOL;
402 402
 
403
-			echo wp_kses_post( $html );
403
+			echo wp_kses_post($html);
404 404
 		}
405 405
 	}
406 406
 
407 407
 endif;
408 408
 
409
-if ( ! function_exists( 'lsx_post_nav' ) ) :
409
+if ( ! function_exists('lsx_post_nav')) :
410 410
 
411 411
 	/**
412 412
 	 * Display navigation to next/previous post when applicable.
@@ -415,24 +415,24 @@  discard block
 block discarded – undo
415 415
 	 * @subpackage template-tags
416 416
 	 */
417 417
 	function lsx_post_nav() {
418
-		$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
419
-		$next     = get_adjacent_post( false, '', false );
418
+		$previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true);
419
+		$next     = get_adjacent_post(false, '', false);
420 420
 
421
-		if ( ! $next && ! $previous ) {
421
+		if ( ! $next && ! $previous) {
422 422
 			return;
423 423
 		}
424 424
 
425 425
 		$default_size = 'sm';
426
-		$size         = apply_filters( 'lsx_bootstrap_column_size', $default_size );
426
+		$size         = apply_filters('lsx_bootstrap_column_size', $default_size);
427 427
 		?>
428 428
 		<nav class="navigation post-navigation" role="navigation">
429 429
 			<div class="lsx-breaker"></div>
430 430
 			<div class="nav-links pager row">
431
-				<div class="previous <?php echo 'col-' . esc_attr( $size ) . '-6'; ?>">
432
-					<?php previous_post_link( '%link', '<p class="nav-links-description">' . esc_html_x( 'Previous Post', 'Previous post link', 'lsx' ) . '</p><h3>%title</h3>' ); ?>
431
+				<div class="previous <?php echo 'col-' . esc_attr($size) . '-6'; ?>">
432
+					<?php previous_post_link('%link', '<p class="nav-links-description">' . esc_html_x('Previous Post', 'Previous post link', 'lsx') . '</p><h3>%title</h3>'); ?>
433 433
 				</div>
434
-				<div class="next <?php echo 'col-' . esc_attr( $size ) . '-6'; ?>">
435
-					<?php next_post_link( '%link', '<p class="nav-links-description">' . esc_html_x( 'Next Post', 'Next post link', 'lsx' ) . '</p><h3>%title</h3>' ); ?>
434
+				<div class="next <?php echo 'col-' . esc_attr($size) . '-6'; ?>">
435
+					<?php next_post_link('%link', '<p class="nav-links-description">' . esc_html_x('Next Post', 'Next post link', 'lsx') . '</p><h3>%title</h3>'); ?>
436 436
 				</div>
437 437
 			</div><!-- .nav-links -->
438 438
 		</nav><!-- .navigation -->
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 
442 442
 endif;
443 443
 
444
-if ( ! function_exists( 'lsx_cover_custom_logo' ) ) :
444
+if ( ! function_exists('lsx_cover_custom_logo')) :
445 445
 
446 446
 	/**
447 447
 	 * Outputs the Custom Logo on the Cover page if available.
@@ -450,15 +450,15 @@  discard block
 block discarded – undo
450 450
 	 * @subpackage template-tags
451 451
 	 */
452 452
 	function lsx_cover_custom_logo() {
453
-		if ( is_page_template( 'page-templates/template-cover.php' ) ) {
453
+		if (is_page_template('page-templates/template-cover.php')) {
454 454
 
455
-			$custom_logo_id = get_theme_mod( 'lsx_cover_template_alt_logo' );
455
+			$custom_logo_id = get_theme_mod('lsx_cover_template_alt_logo');
456 456
 
457
-			if ( $custom_logo_id ) {
457
+			if ($custom_logo_id) {
458 458
 
459 459
 				$site_url   = get_site_url();
460
-				$site_title = get_bloginfo( 'name' );
461
-				$image      = wp_get_attachment_image_src( $custom_logo_id , 'full' );
460
+				$site_title = get_bloginfo('name');
461
+				$image      = wp_get_attachment_image_src($custom_logo_id, 'full');
462 462
 
463 463
 				echo '<a href="' . $site_url . '" class="custom-logo-link" rel="home"><img class="custom-logo" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" loading="eager" alt="' . $site_title . '"></a>';
464 464
 
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 
473 473
 endif;
474 474
 
475
-if ( ! function_exists( 'lsx_site_identity' ) ) :
475
+if ( ! function_exists('lsx_site_identity')) :
476 476
 
477 477
 	/**
478 478
 	 * Outputs either the Site Title or the Site Logo.
@@ -481,14 +481,14 @@  discard block
 block discarded – undo
481 481
 	 * @subpackage template-tags
482 482
 	 */
483 483
 	function lsx_site_identity() {
484
-		if ( function_exists( 'has_custom_logo' ) && has_custom_logo() ) {
485
-			if ( is_page_template( 'page-templates/template-cover.php' ) ) {
484
+		if (function_exists('has_custom_logo') && has_custom_logo()) {
485
+			if (is_page_template('page-templates/template-cover.php')) {
486 486
 				lsx_cover_custom_logo();
487 487
 			} else {
488 488
 				the_custom_logo();
489 489
 			}
490 490
 		} else {
491
-			if ( get_theme_mod( 'site_logo_header_text', 1 ) ) {
491
+			if (get_theme_mod('site_logo_header_text', 1)) {
492 492
 				lsx_site_title();
493 493
 			}
494 494
 		}
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
 
497 497
 endif;
498 498
 
499
-if ( ! function_exists( 'lsx_navbar_header' ) ) :
499
+if ( ! function_exists('lsx_navbar_header')) :
500 500
 	/**
501 501
 	 * Outputs the Nav Menu.
502 502
 	 *
@@ -504,18 +504,18 @@  discard block
 block discarded – undo
504 504
 	 * @subpackage template-tags
505 505
 	 */
506 506
 	function lsx_navbar_header() {
507
-		$mobile_header_layout = get_theme_mod( 'lsx_header_mobile_layout', 'navigation-bar' );
508
-		if ( 'hamburger' === $mobile_header_layout ) {
507
+		$mobile_header_layout = get_theme_mod('lsx_header_mobile_layout', 'navigation-bar');
508
+		if ('hamburger' === $mobile_header_layout) {
509 509
 			?>
510 510
 			<div class="navbar-header" itemscope itemtype="http://schema.org/WebPage">
511 511
 				<?php
512 512
 				lsx_header_search_form();
513 513
 				lsx_site_identity();
514
-				if ( has_nav_menu( 'primary' ) ) :
514
+				if (has_nav_menu('primary')) :
515 515
 					?>
516 516
 					<div class="wrapper-toggle" data-toggle="collapse" data-target=".primary-navbar">
517 517
 						<button type="button" class="navbar-toggle">
518
-							<span class="sr-only"><?php esc_html_e( 'Toggle navigation', 'lsx' ); ?></span>
518
+							<span class="sr-only"><?php esc_html_e('Toggle navigation', 'lsx'); ?></span>
519 519
 							<span class="icon-bar icon-bar-1"></span>
520 520
 							<span class="icon-bar icon-bar-2"></span>
521 521
 							<span class="icon-bar icon-bar-3"></span>
@@ -530,17 +530,17 @@  discard block
 block discarded – undo
530 530
 			?>
531 531
 			<div class="navbar-header" itemscope itemtype="http://schema.org/WebPage">
532 532
 				<?php
533
-				if ( has_nav_menu( 'primary' ) ) :
533
+				if (has_nav_menu('primary')) :
534 534
 					?>
535 535
 					<div class="wrapper-toggle" data-toggle="collapse" data-target=".primary-navbar">
536 536
 						<button type="button" class="navbar-toggle">
537
-							<span class="sr-only"><?php esc_html_e( 'Toggle navigation', 'lsx' ); ?></span>
537
+							<span class="sr-only"><?php esc_html_e('Toggle navigation', 'lsx'); ?></span>
538 538
 							<span class="icon-bar"></span>
539 539
 							<span class="icon-bar"></span>
540 540
 							<span class="icon-bar"></span>
541 541
 							<span class="icon-bar"></span>
542 542
 						</button>
543
-						<span class="mobile-menu-title"><?php esc_html_e( 'Menu', 'lsx' ); ?></span>
543
+						<span class="mobile-menu-title"><?php esc_html_e('Menu', 'lsx'); ?></span>
544 544
 					</div>
545 545
 					<?php
546 546
 				endif;
@@ -554,9 +554,9 @@  discard block
 block discarded – undo
554 554
 
555 555
 endif;
556 556
 
557
-add_action( 'lsx_nav_before', 'lsx_navbar_header' );
557
+add_action('lsx_nav_before', 'lsx_navbar_header');
558 558
 
559
-if ( ! function_exists( 'lsx_nav_menu' ) ) :
559
+if ( ! function_exists('lsx_nav_menu')) :
560 560
 	/**
561 561
 	 * Outputs the Nav Menu.
562 562
 	 *
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 	 * @subpackage template-tags
565 565
 	 */
566 566
 	function lsx_nav_menu() {
567
-		if ( has_nav_menu( 'primary' ) ) :
567
+		if (has_nav_menu('primary')) :
568 568
 			?>
569 569
 			<nav class="primary-navbar collapse navbar-collapse">
570 570
 				<?php
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 	}
585 585
 endif;
586 586
 
587
-if ( ! function_exists( 'lsx_sitemap_loops' ) ) {
587
+if ( ! function_exists('lsx_sitemap_loops')) {
588 588
 	/**
589 589
 	 * Outputs the loops on the sitemap
590 590
 	 *
@@ -592,19 +592,19 @@  discard block
 block discarded – undo
592 592
 	 * @subpackage template-tags
593 593
 	 */
594 594
 	function lsx_sitemap_loops() {
595
-		$sitemap_loops  = array(
595
+		$sitemap_loops = array(
596 596
 			'page'     => array(
597 597
 				'type'      => 'post_type',
598
-				'label'     => __( 'Pages', 'lsx' ),
598
+				'label'     => __('Pages', 'lsx'),
599 599
 				'heirarchy' => true,
600 600
 			),
601 601
 			'post'     => array(
602 602
 				'type'  => 'post_type',
603
-				'label' => __( 'Posts', 'lsx' ),
603
+				'label' => __('Posts', 'lsx'),
604 604
 			),
605 605
 			'category' => array(
606 606
 				'type'      => 'taxonomy',
607
-				'label'     => __( 'Categories', 'lsx' ),
607
+				'label'     => __('Categories', 'lsx'),
608 608
 				'heirarchy' => true,
609 609
 			),
610 610
 		);
@@ -613,10 +613,10 @@  discard block
 block discarded – undo
613 613
 			'_builtin' => false,
614 614
 			'show_ui'  => true,
615 615
 		);
616
-		$post_types     = get_post_types( $post_type_args, 'objects' );
617
-		if ( ! empty( $post_types ) ) {
618
-			foreach ( $post_types as $post_type_key => $post_type_obj ) {
619
-				$sitemap_loops[ $post_type_key ] = array(
616
+		$post_types = get_post_types($post_type_args, 'objects');
617
+		if ( ! empty($post_types)) {
618
+			foreach ($post_types as $post_type_key => $post_type_obj) {
619
+				$sitemap_loops[$post_type_key] = array(
620 620
 					'type'  => 'post_type',
621 621
 					'label' => $post_type_obj->label,
622 622
 				);
@@ -627,35 +627,35 @@  discard block
 block discarded – undo
627 627
 			'_builtin' => false,
628 628
 			'show_ui'  => true,
629 629
 		);
630
-		$taxonomies    = get_taxonomies( $taxonomy_args, 'objects' );
631
-		if ( ! empty( $taxonomies ) ) {
632
-			foreach ( $taxonomies as $tax_key => $tax_obj ) {
633
-				$sitemap_loops[ $tax_key ] = array(
630
+		$taxonomies = get_taxonomies($taxonomy_args, 'objects');
631
+		if ( ! empty($taxonomies)) {
632
+			foreach ($taxonomies as $tax_key => $tax_obj) {
633
+				$sitemap_loops[$tax_key] = array(
634 634
 					'type'  => 'taxonomy',
635 635
 					'label' => $tax_obj->label,
636 636
 				);
637 637
 			}
638 638
 		}
639
-		$sitemap_loops = apply_filters( 'lsx_sitemap_loops_list', $sitemap_loops );
640
-		foreach ( $sitemap_loops as $sitemap_key => $sitemap_values ) {
641
-			if ( 'post_type' === $sitemap_values['type'] ) {
642
-				if ( isset( $sitemap_values['heirarchy'] ) && true === $sitemap_values['heirarchy'] ) {
643
-					lsx_sitemap_pages( $sitemap_key, $sitemap_values['label'] );
639
+		$sitemap_loops = apply_filters('lsx_sitemap_loops_list', $sitemap_loops);
640
+		foreach ($sitemap_loops as $sitemap_key => $sitemap_values) {
641
+			if ('post_type' === $sitemap_values['type']) {
642
+				if (isset($sitemap_values['heirarchy']) && true === $sitemap_values['heirarchy']) {
643
+					lsx_sitemap_pages($sitemap_key, $sitemap_values['label']);
644 644
 				} else {
645
-					lsx_sitemap_custom_post_type( $sitemap_key, $sitemap_values['label'] );
645
+					lsx_sitemap_custom_post_type($sitemap_key, $sitemap_values['label']);
646 646
 				}
647 647
 			} else {
648
-				if ( isset( $sitemap_values['heirarchy'] ) && true === $sitemap_values['heirarchy'] ) {
649
-					lsx_sitemap_taxonomy( $sitemap_key, $sitemap_values['label'], true );
648
+				if (isset($sitemap_values['heirarchy']) && true === $sitemap_values['heirarchy']) {
649
+					lsx_sitemap_taxonomy($sitemap_key, $sitemap_values['label'], true);
650 650
 				} else {
651
-					lsx_sitemap_taxonomy( $sitemap_key, $sitemap_values['label'], false );
651
+					lsx_sitemap_taxonomy($sitemap_key, $sitemap_values['label'], false);
652 652
 				}
653 653
 			}
654 654
 		}
655 655
 	}
656 656
 }
657 657
 
658
-if ( ! function_exists( 'lsx_sitemap_pages' ) ) :
658
+if ( ! function_exists('lsx_sitemap_pages')) :
659 659
 
660 660
 	/**
661 661
 	 * Outputs Pages for the Sitemap Template.
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 	 * @package    lsx
664 664
 	 * @subpackage template-tags
665 665
 	 */
666
-	function lsx_sitemap_pages( $forced_type = '', $label = '' ) {
666
+	function lsx_sitemap_pages($forced_type = '', $label = '') {
667 667
 		$page_args = array(
668 668
 			'depth'        => 3,
669 669
 			'title_li'     => '',
@@ -672,15 +672,15 @@  discard block
 block discarded – undo
672 672
 			'post_type'    => $forced_type,
673 673
 			'item_spacing' => 'preserve',
674 674
 		);
675
-		echo '<h2>' . esc_html( $label ) . '</h2>';
675
+		echo '<h2>' . esc_html($label) . '</h2>';
676 676
 		echo '<ul>';
677
-		wp_list_pages( $page_args );
677
+		wp_list_pages($page_args);
678 678
 		echo '</ul>';
679 679
 	}
680 680
 
681 681
 endif;
682 682
 
683
-if ( ! function_exists( 'lsx_sitemap_custom_post_type' ) ) :
683
+if ( ! function_exists('lsx_sitemap_custom_post_type')) :
684 684
 
685 685
 	/**
686 686
 	 * Outputs a custom post type section.
@@ -688,18 +688,18 @@  discard block
 block discarded – undo
688 688
 	 * @package    lsx
689 689
 	 * @subpackage template-tags
690 690
 	 */
691
-	function lsx_sitemap_custom_post_type( $forced_type = '', $label = '' ) {
692
-		if ( '' !== $forced_type ) {
693
-			$post_types = array( $forced_type );
691
+	function lsx_sitemap_custom_post_type($forced_type = '', $label = '') {
692
+		if ('' !== $forced_type) {
693
+			$post_types = array($forced_type);
694 694
 		} else {
695 695
 			$args       = array(
696 696
 				'public'   => true,
697 697
 				'_builtin' => false,
698 698
 			);
699
-			$post_types = get_post_types( $args, 'names' );
699
+			$post_types = get_post_types($args, 'names');
700 700
 		}
701 701
 
702
-		foreach ( $post_types as $post_type ) {
702
+		foreach ($post_types as $post_type) {
703 703
 			$post_type_args = array(
704 704
 				'post_type'      => 'page',
705 705
 				'posts_per_page' => 99,
@@ -707,24 +707,24 @@  discard block
 block discarded – undo
707 707
 				'post_type'      => $post_type,
708 708
 			);
709 709
 
710
-			$post_type_items  = new WP_Query( $post_type_args );
711
-			$post_type_object = get_post_type_object( $post_type );
710
+			$post_type_items  = new WP_Query($post_type_args);
711
+			$post_type_object = get_post_type_object($post_type);
712 712
 
713
-			if ( '' !== $label ) {
713
+			if ('' !== $label) {
714 714
 				$title = $label;
715
-			} elseif ( ! empty( $post_type_object ) ) {
715
+			} elseif ( ! empty($post_type_object)) {
716 716
 				$title = $post_type_object->labels->name;
717 717
 			} else {
718
-				$title = ucwords( $post_type );
718
+				$title = ucwords($post_type);
719 719
 			}
720 720
 
721
-			if ( $post_type_items->have_posts() ) {
722
-				echo '<h2>' . esc_html( $title ) . '</h2>';
721
+			if ($post_type_items->have_posts()) {
722
+				echo '<h2>' . esc_html($title) . '</h2>';
723 723
 				echo '<ul>';
724 724
 
725
-				while ( $post_type_items->have_posts() ) {
725
+				while ($post_type_items->have_posts()) {
726 726
 					$post_type_items->the_post();
727
-					echo '<li class="' . esc_attr( get_post_type() ) . '_item ' . esc_attr( get_post_type() ) . '-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>';
727
+					echo '<li class="' . esc_attr(get_post_type()) . '_item ' . esc_attr(get_post_type()) . '-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>';
728 728
 				}
729 729
 
730 730
 				echo '</ul>';
@@ -740,10 +740,10 @@  discard block
 block discarded – undo
740 740
  *
741 741
  * @return void
742 742
  */
743
-function lsx_sitemap_taxonomy( $taxonomy = '', $label = '', $hierarchical = false ) {
744
-	if ( '' !== $taxonomy ) {
743
+function lsx_sitemap_taxonomy($taxonomy = '', $label = '', $hierarchical = false) {
744
+	if ('' !== $taxonomy) {
745 745
 
746
-		$tax_args   = array(
746
+		$tax_args = array(
747 747
 			'echo'                => 0,
748 748
 			'depth'               => 0,
749 749
 			'hide_empty'          => 1,
@@ -751,24 +751,24 @@  discard block
 block discarded – undo
751 751
 			'hierarchical'        => $hierarchical,
752 752
 			'separator'           => '<br />',
753 753
 			'show_count'          => 0,
754
-			'show_option_none'    => __( 'None', 'lsx' ),
754
+			'show_option_none'    => __('None', 'lsx'),
755 755
 			'style'               => 'list',
756 756
 			'taxonomy'            => $taxonomy,
757 757
 			'title_li'            => '',
758 758
 		);
759
-		$categories = wp_list_categories( $tax_args );
760
-		if ( ! empty( $categories ) ) {
759
+		$categories = wp_list_categories($tax_args);
760
+		if ( ! empty($categories)) {
761 761
 			echo '<div class="sitemap-rows">';
762
-			echo '<h2>' . wp_kses_post( $label ) . '</h2>';
762
+			echo '<h2>' . wp_kses_post($label) . '</h2>';
763 763
 			echo '<ul>';
764
-			echo wp_kses_post( $categories );
764
+			echo wp_kses_post($categories);
765 765
 			echo '</ul>';
766 766
 			echo '</div>';
767 767
 		}
768 768
 	}
769 769
 }
770 770
 
771
-if ( ! function_exists( 'lsx_sitemap_taxonomy_clouds' ) ) :
771
+if ( ! function_exists('lsx_sitemap_taxonomy_clouds')) :
772 772
 
773 773
 	/**
774 774
 	 * Outputs the public taxonomies.
@@ -782,10 +782,10 @@  discard block
 block discarded – undo
782 782
 			'_builtin' => false,
783 783
 		);
784 784
 
785
-		$taxonomies = get_taxonomies( $taxonomy_args );
785
+		$taxonomies = get_taxonomies($taxonomy_args);
786 786
 
787
-		if ( ! empty( $taxonomies ) ) {
788
-			foreach ( $taxonomies as $taxonomy_id => $taxonomy ) {
787
+		if ( ! empty($taxonomies)) {
788
+			foreach ($taxonomies as $taxonomy_id => $taxonomy) {
789 789
 				$tag_cloud = wp_tag_cloud(
790 790
 					array(
791 791
 						'taxonomy' => $taxonomy_id,
@@ -793,9 +793,9 @@  discard block
 block discarded – undo
793 793
 					)
794 794
 				);
795 795
 
796
-				if ( ! empty( $tag_cloud ) ) {
797
-					echo '<h2>' . esc_html( $taxonomy ) . '</h2>';
798
-					echo '<aside id="' . esc_attr( $taxonomy_id ) . '" class="widget widget_' . esc_attr( $taxonomy_id ) . '">' . esc_html( $tag_cloud ) . '</aside>';
796
+				if ( ! empty($tag_cloud)) {
797
+					echo '<h2>' . esc_html($taxonomy) . '</h2>';
798
+					echo '<aside id="' . esc_attr($taxonomy_id) . '" class="widget widget_' . esc_attr($taxonomy_id) . '">' . esc_html($tag_cloud) . '</aside>';
799 799
 				}
800 800
 			}
801 801
 		}
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
 
804 804
 endif;
805 805
 
806
-if ( ! function_exists( 'lsx_add_top_menu' ) ) :
806
+if ( ! function_exists('lsx_add_top_menu')) :
807 807
 
808 808
 	/**
809 809
 	 * Adds our top menu to the theme.
@@ -812,11 +812,11 @@  discard block
 block discarded – undo
812 812
 	 * @subpackage template-tags
813 813
 	 */
814 814
 	function lsx_add_top_menu() {
815
-		if ( has_nav_menu( 'top-menu' ) || has_nav_menu( 'top-menu-left' ) ) :
815
+		if (has_nav_menu('top-menu') || has_nav_menu('top-menu-left')) :
816 816
 			?>
817 817
 			<div id="top-menu" class="<?php lsx_top_menu_classes(); ?>">
818 818
 				<div class="container">
819
-					<?php if ( has_nav_menu( 'top-menu' ) ) : ?>
819
+					<?php if (has_nav_menu('top-menu')) : ?>
820 820
 						<nav class="top-menu">
821 821
 							<?php
822 822
 								wp_nav_menu(
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 						</nav>
830 830
 					<?php endif; ?>
831 831
 
832
-					<?php if ( has_nav_menu( 'top-menu-left' ) ) : ?>
832
+					<?php if (has_nav_menu('top-menu-left')) : ?>
833 833
 						<nav class="top-menu pull-left">
834 834
 							<?php
835 835
 								wp_nav_menu(
@@ -849,9 +849,9 @@  discard block
 block discarded – undo
849 849
 
850 850
 endif;
851 851
 
852
-add_action( 'lsx_header_before', 'lsx_add_top_menu' );
852
+add_action('lsx_header_before', 'lsx_add_top_menu');
853 853
 
854
-if ( ! function_exists( 'lsx_get_my_url' ) ) :
854
+if ( ! function_exists('lsx_get_my_url')) :
855 855
 
856 856
 	/**
857 857
 	 * Return URL from a link in the content.
@@ -860,16 +860,16 @@  discard block
 block discarded – undo
860 860
 	 * @subpackage template-tags
861 861
 	 */
862 862
 	function lsx_get_my_url() {
863
-		if ( ! preg_match( '/^<a\s[^>]*?href=[\'"](.+?)[\'"]$/is', get_the_content(), $matches ) ) {
863
+		if ( ! preg_match('/^<a\s[^>]*?href=[\'"](.+?)[\'"]$/is', get_the_content(), $matches)) {
864 864
 			return false;
865 865
 		}
866 866
 
867
-		return esc_url_raw( $matches[1] );
867
+		return esc_url_raw($matches[1]);
868 868
 	}
869 869
 
870 870
 endif;
871 871
 
872
-if ( ! function_exists( 'lsx_get_template_part' ) ) :
872
+if ( ! function_exists('lsx_get_template_part')) :
873 873
 
874 874
 	/**
875 875
 	 * Gets a custom template part if the filters is populated,  or does the normal WP get_content_part()
@@ -878,11 +878,11 @@  discard block
 block discarded – undo
878 878
 	 * @subpackage template-tags
879 879
 	 */
880 880
 	function lsx_get_template_part() {
881
-		$custom_template = apply_filters( 'lsx_get_template_part', '' );
882
-		if ( '' !== $custom_template && file_exists( $custom_template ) ) {
881
+		$custom_template = apply_filters('lsx_get_template_part', '');
882
+		if ('' !== $custom_template && file_exists($custom_template)) {
883 883
 			include $custom_template;
884 884
 		} else {
885
-			get_template_part( 'partials/content', get_post_format() );
885
+			get_template_part('partials/content', get_post_format());
886 886
 		}
887 887
 	}
888 888
 
Please login to merge, or discard this patch.
includes/customizer.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  * @subpackage customizer
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13
-if ( ! function_exists( 'lsx_customizer_layout_controls' ) ) :
13
+if ( ! function_exists('lsx_customizer_layout_controls')) :
14 14
 
15 15
 	/**
16 16
 	 * Returns an array of the layout panel.
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
 	 *
21 21
 	 * @return $lsx_controls array()
22 22
 	 */
23
-	function lsx_customizer_layout_controls( $lsx_controls ) {
23
+	function lsx_customizer_layout_controls($lsx_controls) {
24 24
 		$lsx_controls['sections']['lsx-layout'] = array(
25
-			'title'       => esc_html__( 'Layout', 'lsx' ),
26
-			'description' => esc_html__( 'Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx' ),
25
+			'title'       => esc_html__('Layout', 'lsx'),
26
+			'description' => esc_html__('Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx'),
27 27
 			'priority'    => 22,
28 28
 		);
29 29
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 		);
35 35
 
36 36
 		$lsx_controls['fields']['lsx_header_layout'] = array(
37
-			'label'   => esc_html__( 'Header', 'lsx' ),
37
+			'label'   => esc_html__('Header', 'lsx'),
38 38
 			'section' => 'lsx-layout',
39 39
 			'control' => 'LSX_Customize_Header_Layout_Control',
40 40
 			'choices' => array(
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 		);
52 52
 
53 53
 		$lsx_controls['fields']['lsx_header_mobile_layout'] = array(
54
-			'label'   => esc_html__( 'Mobile Header', 'lsx' ),
54
+			'label'   => esc_html__('Mobile Header', 'lsx'),
55 55
 			'section' => 'lsx-layout',
56 56
 			'control' => 'LSX_Customize_Mobile_Header_Layout_Control',
57 57
 			'choices' => array(
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		);
68 68
 
69 69
 		$lsx_controls['fields']['lsx_layout'] = array(
70
-			'label'   => esc_html__( 'Body', 'lsx' ),
70
+			'label'   => esc_html__('Body', 'lsx'),
71 71
 			'section' => 'lsx-layout',
72 72
 			'control' => 'LSX_Customize_Layout_Control',
73 73
 			'choices' => array(
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		);
85 85
 
86 86
 		$lsx_controls['fields']['lsx_header_fixed'] = array(
87
-			'label'   => esc_html__( 'Fixed Header', 'lsx' ),
87
+			'label'   => esc_html__('Fixed Header', 'lsx'),
88 88
 			'section' => 'lsx-layout',
89 89
 			'type'    => 'checkbox',
90 90
 		);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		);
97 97
 
98 98
 		$lsx_controls['fields']['lsx_header_search'] = array(
99
-			'label'   => esc_html__( 'Search Box in Header', 'lsx' ),
99
+			'label'   => esc_html__('Search Box in Header', 'lsx'),
100 100
 			'section' => 'lsx-layout',
101 101
 			'type'    => 'checkbox',
102 102
 		);
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
 		$lsx_controls['selective_refresh']['lsx_header_search'] = array(
105 105
 			'selector'        => '#lsx-header-search-css',
106 106
 			'render_callback' => function() {
107
-				$search_form = get_theme_mod( 'lsx_header_search' );
107
+				$search_form = get_theme_mod('lsx_header_search');
108 108
 
109
-				if ( false !== $search_form ) {
109
+				if (false !== $search_form) {
110 110
 					echo 'body #searchform { display: block; }';
111 111
 				} else {
112 112
 					echo 'body #searchform { display: none; }';
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
 
120 120
 endif;
121 121
 
122
-add_filter( 'lsx_customizer_controls', 'lsx_customizer_layout_controls' );
122
+add_filter('lsx_customizer_controls', 'lsx_customizer_layout_controls');
123 123
 
124
-if ( ! function_exists( 'lsx_customizer_template_cover_controls' ) ) :
124
+if ( ! function_exists('lsx_customizer_template_cover_controls')) :
125 125
 
126 126
 	/**
127 127
 	 * Returns an array of the Cover Template panel.
@@ -131,10 +131,10 @@  discard block
 block discarded – undo
131 131
 	 *
132 132
 	 * @return $lsx_controls array()
133 133
 	 */
134
-	function lsx_customizer_template_cover_controls( $lsx_controls ) {
134
+	function lsx_customizer_template_cover_controls($lsx_controls) {
135 135
 		$lsx_controls['sections']['lsx-cover-template'] = array(
136
-			'title'       => esc_html__( 'Cover Template Settings', 'lsx' ),
137
-			'description' => esc_html__( 'Change the cover template settings.', 'lsx' ),
136
+			'title'       => esc_html__('Cover Template Settings', 'lsx'),
137
+			'description' => esc_html__('Change the cover template settings.', 'lsx'),
138 138
 			'priority'    => 23,
139 139
 		);
140 140
 
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
 		);
148 148
 
149 149
 		$lsx_controls['fields']['lsx_cover_template_alt_logo'] = array(
150
-			'label'       => esc_html__( 'Upload Alternative Logo Image', 'lsx' ),
151
-			'description' => __( 'Upload an alternative logo image (svg, png or jpg).', 'lsx' ),
150
+			'label'       => esc_html__('Upload Alternative Logo Image', 'lsx'),
151
+			'description' => __('Upload an alternative logo image (svg, png or jpg).', 'lsx'),
152 152
 			'section'     => 'lsx-cover-template',
153 153
 			'control'     => 'WP_Customize_Media_Control',
154 154
 			'mime_type'   => 'image',
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 		);
162 162
 
163 163
 		$lsx_controls['fields']['lsx_cover_template_fixed_background'] = array(
164
-			'label'   => esc_html__( 'Fixed Background Image', 'lsx' ),
164
+			'label'   => esc_html__('Fixed Background Image', 'lsx'),
165 165
 			'section' => 'lsx-cover-template',
166 166
 			'type'    => 'checkbox',
167 167
 		);
@@ -174,8 +174,8 @@  discard block
 block discarded – undo
174 174
 		);
175 175
 
176 176
 		$lsx_controls['fields']['lsx_cover_template_cover_background_color'] = array(
177
-			'label'       => esc_html__( 'Cover Background Colour', 'lsx' ),
178
-			'description' => __( 'The colour used for the cover background, for post or pages without featured image. Defaults to #27639e.', 'lsx' ),
177
+			'label'       => esc_html__('Cover Background Colour', 'lsx'),
178
+			'description' => __('The colour used for the cover background, for post or pages without featured image. Defaults to #27639e.', 'lsx'),
179 179
 			'section'     => 'lsx-cover-template',
180 180
 			'control'     => 'WP_Customize_Color_Control',
181 181
 		);
@@ -188,8 +188,8 @@  discard block
 block discarded – undo
188 188
 		);
189 189
 
190 190
 		$lsx_controls['fields']['lsx_cover_template_overlay_background_color'] = array(
191
-			'label'       => esc_html__( 'Overlay Background Colour', 'lsx' ),
192
-			'description' => __( 'The colour used for the overlay. Defaults to black.', 'lsx' ),
191
+			'label'       => esc_html__('Overlay Background Colour', 'lsx'),
192
+			'description' => __('The colour used for the overlay. Defaults to black.', 'lsx'),
193 193
 			'section'     => 'lsx-cover-template',
194 194
 			'control'     => 'WP_Customize_Color_Control',
195 195
 		);
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
 
204 204
 		$lsx_controls['fields']['lsx_cover_template_overlay_text_color'] = (
205 205
 			array(
206
-				'label'       => __( 'Overlay Text Colour', 'lsx' ),
207
-				'description' => __( 'The colour used for the text in the overlay.', 'lsx' ),
206
+				'label'       => __('Overlay Text Colour', 'lsx'),
207
+				'description' => __('The colour used for the text in the overlay.', 'lsx'),
208 208
 				'section'     => 'lsx-cover-template',
209 209
 				'control'     => 'WP_Customize_Color_Control',
210 210
 			)
@@ -219,8 +219,8 @@  discard block
 block discarded – undo
219 219
 
220 220
 		$lsx_controls['fields']['lsx_cover_template_menu_text_color'] = (
221 221
 			array(
222
-				'label'       => __( 'Menu Text Colour', 'lsx' ),
223
-				'description' => __( 'The colour used for the text in the nav menu.', 'lsx' ),
222
+				'label'       => __('Menu Text Colour', 'lsx'),
223
+				'description' => __('The colour used for the text in the nav menu.', 'lsx'),
224 224
 				'section'     => 'lsx-cover-template',
225 225
 				'control'     => 'WP_Customize_Color_Control',
226 226
 			)
@@ -234,8 +234,8 @@  discard block
 block discarded – undo
234 234
 
235 235
 		$lsx_controls['fields']['lsx_cover_template_overlay_opacity'] = (
236 236
 			array(
237
-				'label'       => __( 'Overlay Opacity', 'lsx' ),
238
-				'description' => __( 'Make sure that the contrast is high enough so that the text is readable.', 'lsx' ),
237
+				'label'       => __('Overlay Opacity', 'lsx'),
238
+				'description' => __('Make sure that the contrast is high enough so that the text is readable.', 'lsx'),
239 239
 				'section'     => 'lsx-cover-template',
240 240
 				'type'        => 'range',
241 241
 			)
@@ -246,10 +246,10 @@  discard block
 block discarded – undo
246 246
 
247 247
 endif;
248 248
 
249
-add_filter( 'lsx_customizer_controls', 'lsx_customizer_template_cover_controls' );
249
+add_filter('lsx_customizer_controls', 'lsx_customizer_template_cover_controls');
250 250
 
251 251
 
252
-if ( ! function_exists( 'lsx_get_customizer_controls' ) ) :
252
+if ( ! function_exists('lsx_get_customizer_controls')) :
253 253
 
254 254
 	/**
255 255
 	 * Returns an array of $controls for the customizer class to generate.
@@ -261,10 +261,10 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	function lsx_get_customizer_controls() {
263 263
 		$lsx_controls = array();
264
-		$lsx_controls = apply_filters( 'lsx_customizer_controls', $lsx_controls );
264
+		$lsx_controls = apply_filters('lsx_customizer_controls', $lsx_controls);
265 265
 		return $lsx_controls;
266 266
 	}
267 267
 
268 268
 endif;
269 269
 
270
-$lsx_customizer = new LSX_Theme_Customizer( lsx_get_customizer_controls() );
270
+$lsx_customizer = new LSX_Theme_Customizer(lsx_get_customizer_controls());
Please login to merge, or discard this patch.
partials/content-page-cover.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -21,66 +21,66 @@  discard block
 block discarded – undo
21 21
 	$color_overlay_style   = '';
22 22
 	$color_overlay_classes = '';
23 23
 
24
-	$image_url = ! post_password_required() ? get_the_post_thumbnail_url( get_the_ID(), 'full' ) : '';
24
+	$image_url = ! post_password_required() ? get_the_post_thumbnail_url(get_the_ID(), 'full') : '';
25 25
 
26
-	if ( $image_url ) {
27
-		$cover_header_style  .= 'background-image: url( ' . esc_url( $image_url ) . ' );';
26
+	if ($image_url) {
27
+		$cover_header_style  .= 'background-image: url( ' . esc_url($image_url) . ' );';
28 28
 		$cover_header_classes = ' bg-image';
29 29
 	}
30 30
 
31 31
 	// Get the color used for the color overlay.
32
-	$color_cover_color = get_theme_mod( 'lsx_cover_template_cover_background_color' );
33
-	if ( $color_cover_color ) {
34
-		$cover_header_style .= ' background-color: ' . esc_attr( $color_cover_color ) . ';';
32
+	$color_cover_color = get_theme_mod('lsx_cover_template_cover_background_color');
33
+	if ($color_cover_color) {
34
+		$cover_header_style .= ' background-color: ' . esc_attr($color_cover_color) . ';';
35 35
 	} else {
36 36
 		$cover_header_style .= ' background-color: #27639e;';
37 37
 	}
38 38
 
39 39
 	// Get the color used for the color overlay.
40
-	$color_overlay_color = get_theme_mod( 'lsx_cover_template_overlay_background_color' );
41
-	if ( $color_overlay_color ) {
42
-		$color_overlay_style = ' style="color: ' . esc_attr( $color_overlay_color ) . ';"';
40
+	$color_overlay_color = get_theme_mod('lsx_cover_template_overlay_background_color');
41
+	if ($color_overlay_color) {
42
+		$color_overlay_style = ' style="color: ' . esc_attr($color_overlay_color) . ';"';
43 43
 	} else {
44 44
 		$color_overlay_style = '';
45 45
 	}
46 46
 
47 47
 	// Get the fixed background attachment option.
48
-	if ( get_theme_mod( 'lsx_cover_template_fixed_background', true ) ) {
48
+	if (get_theme_mod('lsx_cover_template_fixed_background', true)) {
49 49
 		$cover_header_classes .= ' bg-attachment-fixed';
50 50
 	}
51 51
 
52 52
 	// Get the opacity of the color overlay.
53
-	$color_overlay_opacity  = get_theme_mod( 'lsx_cover_template_overlay_opacity' );
54
-	$color_overlay_opacity  = ( false === $color_overlay_opacity ) ? 80 : $color_overlay_opacity;
53
+	$color_overlay_opacity  = get_theme_mod('lsx_cover_template_overlay_opacity');
54
+	$color_overlay_opacity  = (false === $color_overlay_opacity) ? 80 : $color_overlay_opacity;
55 55
 	$color_overlay_classes .= ' opacity-' . $color_overlay_opacity;
56 56
 	?>
57 57
 
58
-	<div class="cover-header <?php echo esc_html( $cover_header_classes ); ?>" style="<?php echo wp_kses_post( $cover_header_style ); ?>">
58
+	<div class="cover-header <?php echo esc_html($cover_header_classes); ?>" style="<?php echo wp_kses_post($cover_header_style); ?>">
59 59
 		<div class="cover-header-inner-wrapper">
60 60
 			<div class="cover-header-inner">
61
-				<div class="cover-color-overlay color-accent<?php echo esc_attr( $color_overlay_classes ); ?>"<?php echo wp_kses_post( $color_overlay_style ); ?>></div>
61
+				<div class="cover-color-overlay color-accent<?php echo esc_attr($color_overlay_classes); ?>"<?php echo wp_kses_post($color_overlay_style); ?>></div>
62 62
 
63 63
 					<header class="entry-header has-text-align-center">
64 64
 						<div class="entry-header-inner section-inner">
65 65
 
66 66
 							<?php
67 67
 
68
-							if ( has_category() ) {
68
+							if (has_category()) {
69 69
 								?>
70 70
 
71 71
 								<div class="entry-categories">
72 72
 									<div class="entry-categories-inner">
73
-										<?php the_category( ' ' ); ?>
73
+										<?php the_category(' '); ?>
74 74
 									</div>
75 75
 								</div>
76 76
 
77 77
 								<?php
78 78
 							}
79 79
 
80
-							the_title( '<h1 class="entry-title">', '</h1>' );
80
+							the_title('<h1 class="entry-title">', '</h1>');
81 81
 
82
-							if ( is_page() ) {
83
-								if ( has_excerpt() ) {
82
+							if (is_page()) {
83
+								if (has_excerpt()) {
84 84
 									?>
85 85
 
86 86
 									<div class="the-excerpt-wrapper">
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 								<?php
105 105
 							} else {
106 106
 
107
-								if ( has_excerpt() ) {
107
+								if (has_excerpt()) {
108 108
 									?>
109 109
 
110 110
 									<div class="intro-text section-inner">
@@ -136,31 +136,31 @@  discard block
 block discarded – undo
136 136
 		<?php
137 137
 			the_content();
138 138
 
139
-			wp_link_pages( array(
139
+			wp_link_pages(array(
140 140
 				'before'      => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
141 141
 				'after'       => '</div></div>',
142 142
 				'link_before' => '<span>',
143 143
 				'link_after'  => '</span>',
144
-			) );
144
+			));
145 145
 		?>
146 146
 	</div><!-- .entry-content -->
147 147
 
148 148
 	<footer class="footer-meta clearfix">
149
-		<?php if ( has_tag() || class_exists( 'LSX_Sharing' ) || ( function_exists( 'sharing_display' ) || class_exists( 'Jetpack_Likes' ) ) ) : ?>
149
+		<?php if (has_tag() || class_exists('LSX_Sharing') || (function_exists('sharing_display') || class_exists('Jetpack_Likes'))) : ?>
150 150
 			<div class="post-tags-wrapper">
151 151
 				<?php lsx_content_post_tags(); ?>
152 152
 
153 153
 				<?php
154
-				if ( class_exists( 'LSX_Sharing' ) ) {
154
+				if (class_exists('LSX_Sharing')) {
155 155
 					lsx_content_sharing();
156 156
 				} else {
157
-					if ( function_exists( 'sharing_display' ) ) {
158
-						sharing_display( '', true );
157
+					if (function_exists('sharing_display')) {
158
+						sharing_display('', true);
159 159
 					}
160 160
 
161
-					if ( class_exists( 'Jetpack_Likes' ) ) {
161
+					if (class_exists('Jetpack_Likes')) {
162 162
 						$custom_likes = new Jetpack_Likes();
163
-						echo wp_kses_post( $custom_likes->post_likes( '' ) );
163
+						echo wp_kses_post($custom_likes->post_likes(''));
164 164
 					}
165 165
 				}
166 166
 				?>
Please login to merge, or discard this patch.