Passed
Branch master (2d09fd)
by Ashley
03:51
created
inc/customizer-colour.php 2 patches
Spacing   +260 added lines, -260 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) return; // Exit if accessed directly
3 3
 
4 4
 /**
5 5
  * Transform SCSS to CSS
6 6
  */
7
-function lsx_customizer_colour__scss_to_css( $scss ) {
7
+function lsx_customizer_colour__scss_to_css($scss) {
8 8
 	$css = '';
9
-	$scssphp_file = get_template_directory() .'/vendor/leafo/scssphp/scss.inc.php';
9
+	$scssphp_file = get_template_directory() . '/vendor/leafo/scssphp/scss.inc.php';
10 10
 
11
-	if ( ! empty( $scss ) && file_exists( $scssphp_file ) ) {
11
+	if ( ! empty($scss) && file_exists($scssphp_file)) {
12 12
 		require_once $scssphp_file;
13 13
 
14 14
 		$compiler = new \Leafo\ScssPhp\Compiler();
15
-		$compiler->setFormatter( 'Leafo\ScssPhp\Formatter\Compact' );
15
+		$compiler->setFormatter('Leafo\ScssPhp\Formatter\Compact');
16 16
 
17 17
 		try {
18
-			$css = $compiler->compile( $scss );
19
-		} catch ( Exception $e ) {
18
+			$css = $compiler->compile($scss);
19
+		} catch (Exception $e) {
20 20
 			$error = $e->getMessage();
21 21
 			return "/*\n\n\$error:\n\n{$error}\n\n\$scss:\n\n{$scss} */";
22 22
 		}
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
  * 
30 30
  */
31 31
 function lsx_customizer_colour__add_footer_styles() {
32
-	wp_enqueue_style( 'lsx_customizer_colour', get_stylesheet_uri() );
32
+	wp_enqueue_style('lsx_customizer_colour', get_stylesheet_uri());
33 33
 }
34
-add_action( 'wp_footer', 'lsx_customizer_colour__add_footer_styles', 11 );
34
+add_action('wp_footer', 'lsx_customizer_colour__add_footer_styles', 11);
35 35
 
36 36
 /**
37 37
  * Outputs an Underscore template for generating CSS for the color scheme.
@@ -41,28 +41,28 @@  discard block
 block discarded – undo
41 41
 	
42 42
 	$colors = array();
43 43
 
44
-	foreach ( $customizer_colour_names as $key => $value ) {
45
-		$colors[$key] = 'unquote("{{ data.'.$key.' }}")';
44
+	foreach ($customizer_colour_names as $key => $value) {
45
+		$colors[$key] = 'unquote("{{ data.' . $key . ' }}")';
46 46
 	}
47 47
 	?>
48 48
 	<script type="text/html" id="tmpl-lsx-color-scheme">
49
-		<?php echo lsx_customizer_colour__top_menu_get_css( $colors ) ?>
50
-		<?php echo lsx_customizer_colour__header_get_css( $colors ) ?>
51
-		<?php echo lsx_customizer_colour__main_menu_get_css( $colors ) ?>
49
+		<?php echo lsx_customizer_colour__top_menu_get_css($colors) ?>
50
+		<?php echo lsx_customizer_colour__header_get_css($colors) ?>
51
+		<?php echo lsx_customizer_colour__main_menu_get_css($colors) ?>
52 52
 
53
-		<?php echo lsx_customizer_colour__banner_get_css( $colors ) ?>
54
-		<?php echo lsx_customizer_colour__body_get_css( $colors ) ?>
53
+		<?php echo lsx_customizer_colour__banner_get_css($colors) ?>
54
+		<?php echo lsx_customizer_colour__body_get_css($colors) ?>
55 55
 
56
-		<?php echo lsx_customizer_colour__footer_cta_get_css( $colors ) ?>
57
-		<?php echo lsx_customizer_colour__footer_widgets_get_css( $colors ) ?>
58
-		<?php echo lsx_customizer_colour__footer_get_css( $colors ) ?>
56
+		<?php echo lsx_customizer_colour__footer_cta_get_css($colors) ?>
57
+		<?php echo lsx_customizer_colour__footer_widgets_get_css($colors) ?>
58
+		<?php echo lsx_customizer_colour__footer_get_css($colors) ?>
59 59
 
60
-		<?php echo lsx_customizer_colour__button_get_css( $colors ) ?>
61
-		<?php echo lsx_customizer_colour__button_cta_get_css( $colors ) ?>
60
+		<?php echo lsx_customizer_colour__button_get_css($colors) ?>
61
+		<?php echo lsx_customizer_colour__button_cta_get_css($colors) ?>
62 62
 	</script>
63 63
 	<?php
64 64
 }
65
-add_action( 'customize_controls_print_footer_scripts', 'lsx_customizer_colour__color_scheme_css_template' );
65
+add_action('customize_controls_print_footer_scripts', 'lsx_customizer_colour__color_scheme_css_template');
66 66
 
67 67
 /**
68 68
  * Retrieves the current color scheme.
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
 function lsx_customizer_colour__get_color_scheme() {
71 71
 	global $customizer_colour_choices;
72 72
 
73
-	$color_scheme_option = get_theme_mod( 'color_scheme', 'default' );
73
+	$color_scheme_option = get_theme_mod('color_scheme', 'default');
74 74
 	$color_schemes = $customizer_colour_choices;
75 75
 
76
-	if ( array_key_exists( $color_scheme_option, $color_schemes ) ) {
77
-		return $color_schemes[ $color_scheme_option ]['colors'];
76
+	if (array_key_exists($color_scheme_option, $color_schemes)) {
77
+		return $color_schemes[$color_scheme_option]['colors'];
78 78
 	}
79 79
 
80 80
 	return $color_schemes['default']['colors'];
@@ -83,22 +83,22 @@  discard block
 block discarded – undo
83 83
 /**
84 84
  * Converts a HEX value to RGB.
85 85
  */
86
-function lsx_customizer_colour__hex2rgb( $color ) {
87
-	$color = trim( $color, '#' );
88
-
89
-	if ( strlen( $color ) === 3 ) {
90
-		$r = hexdec( substr( $color, 0, 1 ).substr( $color, 0, 1 ) );
91
-		$g = hexdec( substr( $color, 1, 1 ).substr( $color, 1, 1 ) );
92
-		$b = hexdec( substr( $color, 2, 1 ).substr( $color, 2, 1 ) );
93
-	} else if ( strlen( $color ) === 6 ) {
94
-		$r = hexdec( substr( $color, 0, 2 ) );
95
-		$g = hexdec( substr( $color, 2, 2 ) );
96
-		$b = hexdec( substr( $color, 4, 2 ) );
86
+function lsx_customizer_colour__hex2rgb($color) {
87
+	$color = trim($color, '#');
88
+
89
+	if (strlen($color) === 3) {
90
+		$r = hexdec(substr($color, 0, 1) . substr($color, 0, 1));
91
+		$g = hexdec(substr($color, 1, 1) . substr($color, 1, 1));
92
+		$b = hexdec(substr($color, 2, 1) . substr($color, 2, 1));
93
+	} else if (strlen($color) === 6) {
94
+		$r = hexdec(substr($color, 0, 2));
95
+		$g = hexdec(substr($color, 2, 2));
96
+		$b = hexdec(substr($color, 4, 2));
97 97
 	} else {
98 98
 		return array();
99 99
 	}
100 100
 
101
-	return array( 'red' => $r, 'green' => $g, 'blue' => $b );
101
+	return array('red' => $r, 'green' => $g, 'blue' => $b);
102 102
 }
103 103
 
104 104
 /* ################################################################################# */
@@ -109,33 +109,33 @@  discard block
 block discarded – undo
109 109
  */
110 110
 function lsx_customizer_colour__button_set_theme_mod() {
111 111
 	$theme_mods = lsx_customizer_colour__button_get_theme_mods();
112
-	$styles     = lsx_customizer_colour__button_get_css( $theme_mods );
112
+	$styles     = lsx_customizer_colour__button_get_css($theme_mods);
113 113
 	
114
-	set_theme_mod( 'lsx_customizer_colour__button_theme_mod', $styles );
114
+	set_theme_mod('lsx_customizer_colour__button_theme_mod', $styles);
115 115
 }
116
-add_action( 'after_switch_theme',   'lsx_customizer_colour__button_set_theme_mod' );
117
-add_action( 'customize_save_after', 'lsx_customizer_colour__button_set_theme_mod' );
116
+add_action('after_switch_theme', 'lsx_customizer_colour__button_set_theme_mod');
117
+add_action('customize_save_after', 'lsx_customizer_colour__button_set_theme_mod');
118 118
 
119 119
 /**
120 120
  * Enqueues front-end CSS for the button.
121 121
  */
122 122
 function lsx_customizer_colour__button_css() {
123
-	$styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__button_theme_mod' );
123
+	$styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__button_theme_mod');
124 124
 	
125
-	if ( is_customize_preview() || false === $styles_from_theme_mod ) {
125
+	if (is_customize_preview() || false === $styles_from_theme_mod) {
126 126
 		$theme_mods = lsx_customizer_colour__button_get_theme_mods();
127
-		$styles     = lsx_customizer_colour__button_get_css( $theme_mods );
127
+		$styles     = lsx_customizer_colour__button_get_css($theme_mods);
128 128
 		
129
-		if ( false === $styles_from_theme_mod ) {
130
-			set_theme_mod( 'lsx_customizer_colour__button_theme_mod', $styles );
129
+		if (false === $styles_from_theme_mod) {
130
+			set_theme_mod('lsx_customizer_colour__button_theme_mod', $styles);
131 131
 		}
132 132
 	} else {
133 133
 		$styles = $styles_from_theme_mod;
134 134
 	}
135 135
 
136
-	wp_add_inline_style( 'lsx_customizer_colour', $styles );
136
+	wp_add_inline_style('lsx_customizer_colour', $styles);
137 137
 }
138
-add_action( 'wp_footer', 'lsx_customizer_colour__button_css', 12 );
138
+add_action('wp_footer', 'lsx_customizer_colour__button_css', 12);
139 139
 
140 140
 /**
141 141
  * Get button CSS theme mods.
@@ -147,32 +147,32 @@  discard block
 block discarded – undo
147 147
 	$colors       = array();
148 148
 	$counter      = 0;
149 149
 
150
-	foreach ( $customizer_colour_names as $key => $value ) {
150
+	foreach ($customizer_colour_names as $key => $value) {
151 151
 		$colors[$key] = $color_scheme[$counter];
152 152
 		$counter++;
153 153
 	}
154 154
 
155 155
 	return array(
156
-		'button_background_color' =>       get_theme_mod( 'button_background_color',       $colors['button_background_color'] ),
157
-		'button_background_hover_color' => get_theme_mod( 'button_background_hover_color', $colors['button_background_hover_color'] ),
158
-		'button_text_color' =>             get_theme_mod( 'button_text_color',             $colors['button_text_color'] ),
159
-		'button_text_color_hover' =>       get_theme_mod( 'button_text_color_hover',       $colors['button_text_color_hover'] )
156
+		'button_background_color' =>       get_theme_mod('button_background_color', $colors['button_background_color']),
157
+		'button_background_hover_color' => get_theme_mod('button_background_hover_color', $colors['button_background_hover_color']),
158
+		'button_text_color' =>             get_theme_mod('button_text_color', $colors['button_text_color']),
159
+		'button_text_color_hover' =>       get_theme_mod('button_text_color_hover', $colors['button_text_color_hover'])
160 160
 	);
161 161
 }
162 162
 
163 163
 /**
164 164
  * Returns CSS for the button.
165 165
  */
166
-function lsx_customizer_colour__button_get_css( $colors ) {
166
+function lsx_customizer_colour__button_get_css($colors) {
167 167
 	global $customizer_colour_names;
168 168
 	
169 169
 	$colors_template = array();
170 170
 
171
-	foreach ( $customizer_colour_names as $key => $value ) {
171
+	foreach ($customizer_colour_names as $key => $value) {
172 172
 		$colors_template[$key] = '';
173 173
 	}
174 174
 
175
-	$colors = wp_parse_args( $colors, $colors_template );
175
+	$colors = wp_parse_args($colors, $colors_template);
176 176
 
177 177
 	$css = <<<CSS
178 178
 		/*
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
 		}
263 263
 CSS;
264 264
 
265
-	$css = apply_filters( 'lsx_customizer_colour_selectors_button', $css, $colors );
266
-	$css = lsx_customizer_colour__scss_to_css( $css );
265
+	$css = apply_filters('lsx_customizer_colour_selectors_button', $css, $colors);
266
+	$css = lsx_customizer_colour__scss_to_css($css);
267 267
 	return $css;
268 268
 }
269 269
 
@@ -276,33 +276,33 @@  discard block
 block discarded – undo
276 276
  */
277 277
 function lsx_customizer_colour__button_cta_set_theme_mod() {
278 278
 	$theme_mods = lsx_customizer_colour__button_cta_get_theme_mods();
279
-	$styles     = lsx_customizer_colour__button_cta_get_css( $theme_mods );
279
+	$styles     = lsx_customizer_colour__button_cta_get_css($theme_mods);
280 280
 	
281
-	set_theme_mod( 'lsx_customizer_colour__button_cta_theme_mod', $styles );
281
+	set_theme_mod('lsx_customizer_colour__button_cta_theme_mod', $styles);
282 282
 }
283
-add_action( 'after_switch_theme',   'lsx_customizer_colour__button_cta_set_theme_mod' );
284
-add_action( 'customize_save_after', 'lsx_customizer_colour__button_cta_set_theme_mod' );
283
+add_action('after_switch_theme', 'lsx_customizer_colour__button_cta_set_theme_mod');
284
+add_action('customize_save_after', 'lsx_customizer_colour__button_cta_set_theme_mod');
285 285
 
286 286
 /**
287 287
  * Enqueues front-end CSS for the button cta.
288 288
  */
289 289
 function lsx_customizer_colour__button_cta_css() {
290
-	$styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__button_cta_theme_mod' );
290
+	$styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__button_cta_theme_mod');
291 291
 	
292
-	if ( is_customize_preview() || false === $styles_from_theme_mod ) {
292
+	if (is_customize_preview() || false === $styles_from_theme_mod) {
293 293
 		$theme_mods = lsx_customizer_colour__button_cta_get_theme_mods();
294
-		$styles     = lsx_customizer_colour__button_cta_get_css( $theme_mods );
294
+		$styles     = lsx_customizer_colour__button_cta_get_css($theme_mods);
295 295
 		
296
-		if ( false === $styles_from_theme_mod ) {
297
-			set_theme_mod( 'lsx_customizer_colour__button_cta_theme_mod', $styles );
296
+		if (false === $styles_from_theme_mod) {
297
+			set_theme_mod('lsx_customizer_colour__button_cta_theme_mod', $styles);
298 298
 		}
299 299
 	} else {
300 300
 		$styles = $styles_from_theme_mod;
301 301
 	}
302 302
 
303
-	wp_add_inline_style( 'lsx_customizer_colour', $styles );
303
+	wp_add_inline_style('lsx_customizer_colour', $styles);
304 304
 }
305
-add_action( 'wp_footer', 'lsx_customizer_colour__button_cta_css', 12 );
305
+add_action('wp_footer', 'lsx_customizer_colour__button_cta_css', 12);
306 306
 
307 307
 /**
308 308
  * Get button cta CSS theme mods.
@@ -314,32 +314,32 @@  discard block
 block discarded – undo
314 314
 	$colors       = array();
315 315
 	$counter      = 0;
316 316
 
317
-	foreach ( $customizer_colour_names as $key => $value ) {
317
+	foreach ($customizer_colour_names as $key => $value) {
318 318
 		$colors[$key] = $color_scheme[$counter];
319 319
 		$counter++;
320 320
 	}
321 321
 
322 322
 	return array(
323
-		'button_cta_background_color' =>       get_theme_mod( 'button_cta_background_color',       $colors['button_cta_background_color'] ),
324
-		'button_cta_background_hover_color' => get_theme_mod( 'button_cta_background_hover_color', $colors['button_cta_background_hover_color'] ),
325
-		'button_cta_text_color' =>             get_theme_mod( 'button_cta_text_color',             $colors['button_cta_text_color'] ),
326
-		'button_cta_text_color_hover' =>       get_theme_mod( 'button_cta_text_color_hover',       $colors['button_cta_text_color_hover'] )
323
+		'button_cta_background_color' =>       get_theme_mod('button_cta_background_color', $colors['button_cta_background_color']),
324
+		'button_cta_background_hover_color' => get_theme_mod('button_cta_background_hover_color', $colors['button_cta_background_hover_color']),
325
+		'button_cta_text_color' =>             get_theme_mod('button_cta_text_color', $colors['button_cta_text_color']),
326
+		'button_cta_text_color_hover' =>       get_theme_mod('button_cta_text_color_hover', $colors['button_cta_text_color_hover'])
327 327
 	);
328 328
 }
329 329
 
330 330
 /**
331 331
  * Returns CSS for the button cta.
332 332
  */
333
-function lsx_customizer_colour__button_cta_get_css( $colors ) {
333
+function lsx_customizer_colour__button_cta_get_css($colors) {
334 334
 	global $customizer_colour_names;
335 335
 	
336 336
 	$colors_template = array();
337 337
 
338
-	foreach ( $customizer_colour_names as $key => $value ) {
338
+	foreach ($customizer_colour_names as $key => $value) {
339 339
 		$colors_template[$key] = '';
340 340
 	}
341 341
 
342
-	$colors = wp_parse_args( $colors, $colors_template );
342
+	$colors = wp_parse_args($colors, $colors_template);
343 343
 
344 344
 	$css = <<<CSS
345 345
 		/*
@@ -405,8 +405,8 @@  discard block
 block discarded – undo
405 405
 		}
406 406
 CSS;
407 407
 
408
-	$css = apply_filters( 'lsx_customizer_colour_selectors_button_cta', $css, $colors );
409
-	$css = lsx_customizer_colour__scss_to_css( $css );
408
+	$css = apply_filters('lsx_customizer_colour_selectors_button_cta', $css, $colors);
409
+	$css = lsx_customizer_colour__scss_to_css($css);
410 410
 	return $css;
411 411
 }
412 412
 
@@ -419,33 +419,33 @@  discard block
 block discarded – undo
419 419
  */
420 420
 function lsx_customizer_colour__top_menu_set_theme_mod() {
421 421
 	$theme_mods = lsx_customizer_colour__top_menu_get_theme_mods();
422
-	$styles     = lsx_customizer_colour__top_menu_get_css( $theme_mods );
422
+	$styles     = lsx_customizer_colour__top_menu_get_css($theme_mods);
423 423
 	
424
-	set_theme_mod( 'lsx_customizer_colour__top_menu_theme_mod', $styles );
424
+	set_theme_mod('lsx_customizer_colour__top_menu_theme_mod', $styles);
425 425
 }
426
-add_action( 'after_switch_theme',   'lsx_customizer_colour__top_menu_set_theme_mod' );
427
-add_action( 'customize_save_after', 'lsx_customizer_colour__top_menu_set_theme_mod' );
426
+add_action('after_switch_theme', 'lsx_customizer_colour__top_menu_set_theme_mod');
427
+add_action('customize_save_after', 'lsx_customizer_colour__top_menu_set_theme_mod');
428 428
 
429 429
 /**
430 430
  * Enqueues front-end CSS for the top menu.
431 431
  */
432 432
 function lsx_customizer_colour__top_menu_css() {
433
-	$styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__top_menu_theme_mod' );
433
+	$styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__top_menu_theme_mod');
434 434
 	
435
-	if ( is_customize_preview() || false === $styles_from_theme_mod ) {
435
+	if (is_customize_preview() || false === $styles_from_theme_mod) {
436 436
 		$theme_mods = lsx_customizer_colour__top_menu_get_theme_mods();
437
-		$styles     = lsx_customizer_colour__top_menu_get_css( $theme_mods );
437
+		$styles     = lsx_customizer_colour__top_menu_get_css($theme_mods);
438 438
 		
439
-		if ( false === $styles_from_theme_mod ) {
440
-			set_theme_mod( 'lsx_customizer_colour__top_menu_theme_mod', $styles );
439
+		if (false === $styles_from_theme_mod) {
440
+			set_theme_mod('lsx_customizer_colour__top_menu_theme_mod', $styles);
441 441
 		}
442 442
 	} else {
443 443
 		$styles = $styles_from_theme_mod;
444 444
 	}
445 445
 
446
-	wp_add_inline_style( 'lsx_customizer_colour', $styles );
446
+	wp_add_inline_style('lsx_customizer_colour', $styles);
447 447
 }
448
-add_action( 'wp_footer', 'lsx_customizer_colour__top_menu_css', 12 );
448
+add_action('wp_footer', 'lsx_customizer_colour__top_menu_css', 12);
449 449
 
450 450
 /**
451 451
  * Get top menu CSS theme mods.
@@ -457,31 +457,31 @@  discard block
 block discarded – undo
457 457
 	$colors       = array();
458 458
 	$counter      = 0;
459 459
 
460
-	foreach ( $customizer_colour_names as $key => $value ) {
460
+	foreach ($customizer_colour_names as $key => $value) {
461 461
 		$colors[$key] = $color_scheme[$counter];
462 462
 		$counter++;
463 463
 	}
464 464
 
465 465
 	return array(
466
-		'top_menu_background_color' => get_theme_mod( 'top_menu_background_color', $colors['top_menu_background_color'] ),
467
-		'top_menu_text_color' =>       get_theme_mod( 'top_menu_text_color',       $colors['top_menu_text_color'] ),
468
-		'top_menu_text_hover_color' => get_theme_mod( 'top_menu_text_hover_color', $colors['top_menu_text_hover_color'] )
466
+		'top_menu_background_color' => get_theme_mod('top_menu_background_color', $colors['top_menu_background_color']),
467
+		'top_menu_text_color' =>       get_theme_mod('top_menu_text_color', $colors['top_menu_text_color']),
468
+		'top_menu_text_hover_color' => get_theme_mod('top_menu_text_hover_color', $colors['top_menu_text_hover_color'])
469 469
 	);
470 470
 }
471 471
 
472 472
 /**
473 473
  * Returns CSS for the top menu.
474 474
  */
475
-function lsx_customizer_colour__top_menu_get_css( $colors ) {
475
+function lsx_customizer_colour__top_menu_get_css($colors) {
476 476
 	global $customizer_colour_names;
477 477
 	
478 478
 	$colors_template = array();
479 479
 
480
-	foreach ( $customizer_colour_names as $key => $value ) {
480
+	foreach ($customizer_colour_names as $key => $value) {
481 481
 		$colors_template[$key] = '';
482 482
 	}
483 483
 
484
-	$colors = wp_parse_args( $colors, $colors_template );
484
+	$colors = wp_parse_args($colors, $colors_template);
485 485
 
486 486
 	$css = <<<CSS
487 487
 		/*
@@ -521,8 +521,8 @@  discard block
 block discarded – undo
521 521
 		}
522 522
 CSS;
523 523
 
524
-	$css = apply_filters( 'lsx_customizer_colour_selectors_top_menu', $css, $colors );
525
-	$css = lsx_customizer_colour__scss_to_css( $css );
524
+	$css = apply_filters('lsx_customizer_colour_selectors_top_menu', $css, $colors);
525
+	$css = lsx_customizer_colour__scss_to_css($css);
526 526
 	return $css;
527 527
 }
528 528
 
@@ -535,33 +535,33 @@  discard block
 block discarded – undo
535 535
  */
536 536
 function lsx_customizer_colour__header_set_theme_mod() {
537 537
 	$theme_mods = lsx_customizer_colour__header_get_theme_mods();
538
-	$styles     = lsx_customizer_colour__header_get_css( $theme_mods );
538
+	$styles     = lsx_customizer_colour__header_get_css($theme_mods);
539 539
 	
540
-	set_theme_mod( 'lsx_customizer_colour__header_theme_mod', $styles );
540
+	set_theme_mod('lsx_customizer_colour__header_theme_mod', $styles);
541 541
 }
542
-add_action( 'after_switch_theme',   'lsx_customizer_colour__header_set_theme_mod' );
543
-add_action( 'customize_save_after', 'lsx_customizer_colour__header_set_theme_mod' );
542
+add_action('after_switch_theme', 'lsx_customizer_colour__header_set_theme_mod');
543
+add_action('customize_save_after', 'lsx_customizer_colour__header_set_theme_mod');
544 544
 
545 545
 /**
546 546
  * Enqueues front-end CSS for the header.
547 547
  */
548 548
 function lsx_customizer_colour__header_css() {
549
-	$styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__header_theme_mod' );
549
+	$styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__header_theme_mod');
550 550
 	
551
-	if ( is_customize_preview() || false === $styles_from_theme_mod ) {
551
+	if (is_customize_preview() || false === $styles_from_theme_mod) {
552 552
 		$theme_mods = lsx_customizer_colour__header_get_theme_mods();
553
-		$styles     = lsx_customizer_colour__header_get_css( $theme_mods );
553
+		$styles     = lsx_customizer_colour__header_get_css($theme_mods);
554 554
 		
555
-		if ( false === $styles_from_theme_mod ) {
556
-			set_theme_mod( 'lsx_customizer_colour__header_theme_mod', $styles );
555
+		if (false === $styles_from_theme_mod) {
556
+			set_theme_mod('lsx_customizer_colour__header_theme_mod', $styles);
557 557
 		}
558 558
 	} else {
559 559
 		$styles = $styles_from_theme_mod;
560 560
 	}
561 561
 
562
-	wp_add_inline_style( 'lsx_customizer_colour', $styles );
562
+	wp_add_inline_style('lsx_customizer_colour', $styles);
563 563
 }
564
-add_action( 'wp_footer', 'lsx_customizer_colour__header_css', 12 );
564
+add_action('wp_footer', 'lsx_customizer_colour__header_css', 12);
565 565
 
566 566
 /**
567 567
  * Get header CSS theme mods.
@@ -573,32 +573,32 @@  discard block
 block discarded – undo
573 573
 	$colors       = array();
574 574
 	$counter      = 0;
575 575
 
576
-	foreach ( $customizer_colour_names as $key => $value ) {
576
+	foreach ($customizer_colour_names as $key => $value) {
577 577
 		$colors[$key] = $color_scheme[$counter];
578 578
 		$counter++;
579 579
 	}
580 580
 
581 581
 	return array(
582
-		'header_background_color'  => get_theme_mod( 'header_background_color',  $colors['header_background_color'] ),
583
-		'header_title_color'       => get_theme_mod( 'header_title_color',       $colors['header_title_color'] ),
584
-		'header_title_hover_color' => get_theme_mod( 'header_title_hover_color', $colors['header_title_hover_color'] ),
585
-		'header_description_color' => get_theme_mod( 'header_description_color', $colors['header_description_color'] )
582
+		'header_background_color'  => get_theme_mod('header_background_color', $colors['header_background_color']),
583
+		'header_title_color'       => get_theme_mod('header_title_color', $colors['header_title_color']),
584
+		'header_title_hover_color' => get_theme_mod('header_title_hover_color', $colors['header_title_hover_color']),
585
+		'header_description_color' => get_theme_mod('header_description_color', $colors['header_description_color'])
586 586
 	);
587 587
 }
588 588
 
589 589
 /**
590 590
  * Returns CSS for the header.
591 591
  */
592
-function lsx_customizer_colour__header_get_css( $colors ) {
592
+function lsx_customizer_colour__header_get_css($colors) {
593 593
 	global $customizer_colour_names;
594 594
 	
595 595
 	$colors_template = array();
596 596
 
597
-	foreach ( $customizer_colour_names as $key => $value ) {
597
+	foreach ($customizer_colour_names as $key => $value) {
598 598
 		$colors_template[$key] = '';
599 599
 	}
600 600
 
601
-	$colors = wp_parse_args( $colors, $colors_template );
601
+	$colors = wp_parse_args($colors, $colors_template);
602 602
 
603 603
 	$css = <<<CSS
604 604
 		/*
@@ -635,8 +635,8 @@  discard block
 block discarded – undo
635 635
 		}
636 636
 CSS;
637 637
 
638
-	$css = apply_filters( 'lsx_customizer_colour_selectors_header', $css, $colors );
639
-	$css = lsx_customizer_colour__scss_to_css( $css );
638
+	$css = apply_filters('lsx_customizer_colour_selectors_header', $css, $colors);
639
+	$css = lsx_customizer_colour__scss_to_css($css);
640 640
 	return $css;
641 641
 }
642 642
 
@@ -649,33 +649,33 @@  discard block
 block discarded – undo
649 649
  */
650 650
 function lsx_customizer_colour__main_menu_set_theme_mod() {
651 651
 	$theme_mods = lsx_customizer_colour__main_menu_get_theme_mods();
652
-	$styles     = lsx_customizer_colour__main_menu_get_css( $theme_mods );
652
+	$styles     = lsx_customizer_colour__main_menu_get_css($theme_mods);
653 653
 	
654
-	set_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod', $styles );
654
+	set_theme_mod('lsx_customizer_colour__main_menu_theme_mod', $styles);
655 655
 }
656
-add_action( 'after_switch_theme',   'lsx_customizer_colour__main_menu_set_theme_mod' );
657
-add_action( 'customize_save_after', 'lsx_customizer_colour__main_menu_set_theme_mod' );
656
+add_action('after_switch_theme', 'lsx_customizer_colour__main_menu_set_theme_mod');
657
+add_action('customize_save_after', 'lsx_customizer_colour__main_menu_set_theme_mod');
658 658
 
659 659
 /**
660 660
  * Enqueues front-end CSS for the main menu.
661 661
  */
662 662
 function lsx_customizer_colour__main_menu_css() {
663
-	$styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod' );
663
+	$styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__main_menu_theme_mod');
664 664
 	
665
-	if ( is_customize_preview() || false === $styles_from_theme_mod ) {
665
+	if (is_customize_preview() || false === $styles_from_theme_mod) {
666 666
 		$theme_mods = lsx_customizer_colour__main_menu_get_theme_mods();
667
-		$styles     = lsx_customizer_colour__main_menu_get_css( $theme_mods );
667
+		$styles     = lsx_customizer_colour__main_menu_get_css($theme_mods);
668 668
 		
669
-		if ( false === $styles_from_theme_mod ) {
670
-			set_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod', $styles );
669
+		if (false === $styles_from_theme_mod) {
670
+			set_theme_mod('lsx_customizer_colour__main_menu_theme_mod', $styles);
671 671
 		}
672 672
 	} else {
673 673
 		$styles = $styles_from_theme_mod;
674 674
 	}
675 675
 
676
-	wp_add_inline_style( 'lsx_customizer_colour', $styles );
676
+	wp_add_inline_style('lsx_customizer_colour', $styles);
677 677
 }
678
-add_action( 'wp_footer', 'lsx_customizer_colour__main_menu_css', 12 );
678
+add_action('wp_footer', 'lsx_customizer_colour__main_menu_css', 12);
679 679
 
680 680
 /**
681 681
  * Get main menu CSS theme mods.
@@ -687,33 +687,33 @@  discard block
 block discarded – undo
687 687
 	$colors       = array();
688 688
 	$counter      = 0;
689 689
 
690
-	foreach ( $customizer_colour_names as $key => $value ) {
690
+	foreach ($customizer_colour_names as $key => $value) {
691 691
 		$colors[$key] = $color_scheme[$counter];
692 692
 		$counter++;
693 693
 	}
694 694
 
695 695
 	return array(
696
-		'main_menu_background_hover1_color' => get_theme_mod( 'main_menu_background_hover1_color', $colors['main_menu_background_hover1_color'] ),
697
-		'main_menu_background_hover2_color' => get_theme_mod( 'main_menu_background_hover2_color', $colors['main_menu_background_hover2_color'] ),
698
-		'main_menu_text_color' =>              get_theme_mod( 'main_menu_text_color',              $colors['main_menu_text_color'] ),
699
-		'main_menu_text_hover1_color' =>       get_theme_mod( 'main_menu_text_hover1_color',       $colors['main_menu_text_hover1_color'] ),
700
-		'main_menu_text_hover2_color' =>       get_theme_mod( 'main_menu_text_hover2_color',       $colors['main_menu_text_hover2_color'] )
696
+		'main_menu_background_hover1_color' => get_theme_mod('main_menu_background_hover1_color', $colors['main_menu_background_hover1_color']),
697
+		'main_menu_background_hover2_color' => get_theme_mod('main_menu_background_hover2_color', $colors['main_menu_background_hover2_color']),
698
+		'main_menu_text_color' =>              get_theme_mod('main_menu_text_color', $colors['main_menu_text_color']),
699
+		'main_menu_text_hover1_color' =>       get_theme_mod('main_menu_text_hover1_color', $colors['main_menu_text_hover1_color']),
700
+		'main_menu_text_hover2_color' =>       get_theme_mod('main_menu_text_hover2_color', $colors['main_menu_text_hover2_color'])
701 701
 	);
702 702
 }
703 703
 
704 704
 /**
705 705
  * Returns CSS for the main menu.
706 706
  */
707
-function lsx_customizer_colour__main_menu_get_css( $colors ) {
707
+function lsx_customizer_colour__main_menu_get_css($colors) {
708 708
 	global $customizer_colour_names;
709 709
 	
710 710
 	$colors_template = array();
711 711
 
712
-	foreach ( $customizer_colour_names as $key => $value ) {
712
+	foreach ($customizer_colour_names as $key => $value) {
713 713
 		$colors_template[$key] = '';
714 714
 	}
715 715
 
716
-	$colors = wp_parse_args( $colors, $colors_template );
716
+	$colors = wp_parse_args($colors, $colors_template);
717 717
 
718 718
 	$css = <<<CSS
719 719
 		/*
@@ -812,8 +812,8 @@  discard block
 block discarded – undo
812 812
 		}
813 813
 CSS;
814 814
 
815
-	$css = apply_filters( 'lsx_customizer_colour_selectors_main_menu', $css, $colors );
816
-	$css = lsx_customizer_colour__scss_to_css( $css );
815
+	$css = apply_filters('lsx_customizer_colour_selectors_main_menu', $css, $colors);
816
+	$css = lsx_customizer_colour__scss_to_css($css);
817 817
 	return $css;
818 818
 }
819 819
 
@@ -826,33 +826,33 @@  discard block
 block discarded – undo
826 826
  */
827 827
 function lsx_customizer_colour__banner_set_theme_mod() {
828 828
 	$theme_mods = lsx_customizer_colour__banner_get_theme_mods();
829
-	$styles     = lsx_customizer_colour__banner_get_css( $theme_mods );
829
+	$styles     = lsx_customizer_colour__banner_get_css($theme_mods);
830 830
 	
831
-	set_theme_mod( 'lsx_customizer_colour__banner_theme_mod', $styles );
831
+	set_theme_mod('lsx_customizer_colour__banner_theme_mod', $styles);
832 832
 }
833
-add_action( 'after_switch_theme',   'lsx_customizer_colour__banner_set_theme_mod' );
834
-add_action( 'customize_save_after', 'lsx_customizer_colour__banner_set_theme_mod' );
833
+add_action('after_switch_theme', 'lsx_customizer_colour__banner_set_theme_mod');
834
+add_action('customize_save_after', 'lsx_customizer_colour__banner_set_theme_mod');
835 835
 
836 836
 /**
837 837
  * Enqueues front-end CSS for the banner.
838 838
  */
839 839
 function lsx_customizer_colour__banner_css() {
840
-	$styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__banner_theme_mod' );
840
+	$styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__banner_theme_mod');
841 841
 	
842
-	if ( is_customize_preview() || false === $styles_from_theme_mod ) {
842
+	if (is_customize_preview() || false === $styles_from_theme_mod) {
843 843
 		$theme_mods = lsx_customizer_colour__banner_get_theme_mods();
844
-		$styles     = lsx_customizer_colour__banner_get_css( $theme_mods );
844
+		$styles     = lsx_customizer_colour__banner_get_css($theme_mods);
845 845
 		
846
-		if ( false === $styles_from_theme_mod ) {
847
-			set_theme_mod( 'lsx_customizer_colour__banner_theme_mod', $styles );
846
+		if (false === $styles_from_theme_mod) {
847
+			set_theme_mod('lsx_customizer_colour__banner_theme_mod', $styles);
848 848
 		}
849 849
 	} else {
850 850
 		$styles = $styles_from_theme_mod;
851 851
 	}
852 852
 
853
-	wp_add_inline_style( 'lsx_customizer_colour', $styles );
853
+	wp_add_inline_style('lsx_customizer_colour', $styles);
854 854
 }
855
-add_action( 'wp_footer', 'lsx_customizer_colour__banner_css', 12 );
855
+add_action('wp_footer', 'lsx_customizer_colour__banner_css', 12);
856 856
 
857 857
 /**
858 858
  * Get banner CSS theme mods.
@@ -864,31 +864,31 @@  discard block
 block discarded – undo
864 864
 	$colors       = array();
865 865
 	$counter      = 0;
866 866
 
867
-	foreach ( $customizer_colour_names as $key => $value ) {
867
+	foreach ($customizer_colour_names as $key => $value) {
868 868
 		$colors[$key] = $color_scheme[$counter];
869 869
 		$counter++;
870 870
 	}
871 871
 
872 872
 	return array(
873
-		'banner_background_color' => get_theme_mod( 'banner_background_color', $colors['banner_background_color'] ),
874
-		'banner_text_color' =>       get_theme_mod( 'banner_text_color',       $colors['banner_text_color'] ),
875
-		'banner_text_image_color' => get_theme_mod( 'banner_text_image_color', $colors['banner_text_image_color'] )
873
+		'banner_background_color' => get_theme_mod('banner_background_color', $colors['banner_background_color']),
874
+		'banner_text_color' =>       get_theme_mod('banner_text_color', $colors['banner_text_color']),
875
+		'banner_text_image_color' => get_theme_mod('banner_text_image_color', $colors['banner_text_image_color'])
876 876
 	);
877 877
 }
878 878
 
879 879
 /**
880 880
  * Returns CSS for the banner.
881 881
  */
882
-function lsx_customizer_colour__banner_get_css( $colors ) {
882
+function lsx_customizer_colour__banner_get_css($colors) {
883 883
 	global $customizer_colour_names;
884 884
 	
885 885
 	$colors_template = array();
886 886
 
887
-	foreach ( $customizer_colour_names as $key => $value ) {
887
+	foreach ($customizer_colour_names as $key => $value) {
888 888
 		$colors_template[$key] = '';
889 889
 	}
890 890
 
891
-	$colors = wp_parse_args( $colors, $colors_template );
891
+	$colors = wp_parse_args($colors, $colors_template);
892 892
 
893 893
 	$css = <<<CSS
894 894
 		/*
@@ -917,8 +917,8 @@  discard block
 block discarded – undo
917 917
 		}
918 918
 CSS;
919 919
 
920
-	$css = apply_filters( 'lsx_customizer_colour_selectors_banner', $css, $colors );
921
-	$css = lsx_customizer_colour__scss_to_css( $css );
920
+	$css = apply_filters('lsx_customizer_colour_selectors_banner', $css, $colors);
921
+	$css = lsx_customizer_colour__scss_to_css($css);
922 922
 	return $css;
923 923
 }
924 924
 
@@ -931,33 +931,33 @@  discard block
 block discarded – undo
931 931
  */
932 932
 function lsx_customizer_colour__body_set_theme_mod() {
933 933
 	$theme_mods = lsx_customizer_colour__body_get_theme_mods();
934
-	$styles     = lsx_customizer_colour__body_get_css( $theme_mods );
934
+	$styles     = lsx_customizer_colour__body_get_css($theme_mods);
935 935
 	
936
-	set_theme_mod( 'lsx_customizer_colour__body_theme_mod', $styles );
936
+	set_theme_mod('lsx_customizer_colour__body_theme_mod', $styles);
937 937
 }
938
-add_action( 'after_switch_theme',   'lsx_customizer_colour__body_set_theme_mod' );
939
-add_action( 'customize_save_after', 'lsx_customizer_colour__body_set_theme_mod' );
938
+add_action('after_switch_theme', 'lsx_customizer_colour__body_set_theme_mod');
939
+add_action('customize_save_after', 'lsx_customizer_colour__body_set_theme_mod');
940 940
 
941 941
 /**
942 942
  * Enqueues front-end CSS for the body.
943 943
  */
944 944
 function lsx_customizer_colour__body_css() {
945
-	$styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__body_theme_mod' );
945
+	$styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__body_theme_mod');
946 946
 	
947
-	if ( is_customize_preview() || false === $styles_from_theme_mod ) {
947
+	if (is_customize_preview() || false === $styles_from_theme_mod) {
948 948
 		$theme_mods = lsx_customizer_colour__body_get_theme_mods();
949
-		$styles     = lsx_customizer_colour__body_get_css( $theme_mods );
949
+		$styles     = lsx_customizer_colour__body_get_css($theme_mods);
950 950
 		
951
-		if ( false === $styles_from_theme_mod ) {
952
-			set_theme_mod( 'lsx_customizer_colour__body_theme_mod', $styles );
951
+		if (false === $styles_from_theme_mod) {
952
+			set_theme_mod('lsx_customizer_colour__body_theme_mod', $styles);
953 953
 		}
954 954
 	} else {
955 955
 		$styles = $styles_from_theme_mod;
956 956
 	}
957 957
 
958
-	wp_add_inline_style( 'lsx_customizer_colour', $styles );
958
+	wp_add_inline_style('lsx_customizer_colour', $styles);
959 959
 }
960
-add_action( 'wp_footer', 'lsx_customizer_colour__body_css', 12 );
960
+add_action('wp_footer', 'lsx_customizer_colour__body_css', 12);
961 961
 
962 962
 /**
963 963
  * Get body CSS theme mods.
@@ -969,36 +969,36 @@  discard block
 block discarded – undo
969 969
 	$colors       = array();
970 970
 	$counter      = 0;
971 971
 
972
-	foreach ( $customizer_colour_names as $key => $value ) {
972
+	foreach ($customizer_colour_names as $key => $value) {
973 973
 		$colors[$key] = $color_scheme[$counter];
974 974
 		$counter++;
975 975
 	}
976 976
 
977 977
 	return array(
978
-		'body_background_color' =>   get_theme_mod( 'body_background_color',   $colors['body_background_color'] ),
979
-		'body_line_color' =>         get_theme_mod( 'body_line_color',         $colors['body_line_color'] ),
980
-		'body_text_heading_color' => get_theme_mod( 'body_text_heading_color', $colors['body_text_heading_color'] ),
981
-		'body_text_color' =>         get_theme_mod( 'body_text_color',         $colors['body_text_color'] ),
982
-		'body_link_color' =>         get_theme_mod( 'body_link_color',         $colors['body_link_color'] ),
983
-		'body_link_hover_color' =>   get_theme_mod( 'body_link_hover_color',   $colors['body_link_hover_color'] )
978
+		'body_background_color' =>   get_theme_mod('body_background_color', $colors['body_background_color']),
979
+		'body_line_color' =>         get_theme_mod('body_line_color', $colors['body_line_color']),
980
+		'body_text_heading_color' => get_theme_mod('body_text_heading_color', $colors['body_text_heading_color']),
981
+		'body_text_color' =>         get_theme_mod('body_text_color', $colors['body_text_color']),
982
+		'body_link_color' =>         get_theme_mod('body_link_color', $colors['body_link_color']),
983
+		'body_link_hover_color' =>   get_theme_mod('body_link_hover_color', $colors['body_link_hover_color'])
984 984
 	);
985 985
 }
986 986
 
987 987
 /**
988 988
  * Returns CSS for the body.
989 989
  */
990
-function lsx_customizer_colour__body_get_css( $colors ) {
990
+function lsx_customizer_colour__body_get_css($colors) {
991 991
 	global $customizer_colour_names;
992 992
 	
993 993
 	$colors_template = array();
994 994
 
995
-	foreach ( $customizer_colour_names as $key => $value ) {
995
+	foreach ($customizer_colour_names as $key => $value) {
996 996
 		$colors_template[$key] = '';
997 997
 	}
998 998
 
999
-	$colors = wp_parse_args( $colors, $colors_template );
999
+	$colors = wp_parse_args($colors, $colors_template);
1000 1000
 
1001
-	$rgb = lsx_customizer_colour__hex2rgb( $colors['body_line_color'] );
1001
+	$rgb = lsx_customizer_colour__hex2rgb($colors['body_line_color']);
1002 1002
 	$colors['body_line_color_rgba'] = "rgba({$rgb['red']}, {$rgb['green']}, {$rgb['blue']}, 0.5)";
1003 1003
 
1004 1004
 	$css = <<<CSS
@@ -1243,8 +1243,8 @@  discard block
 block discarded – undo
1243 1243
 		}
1244 1244
 CSS;
1245 1245
 
1246
-	$css = apply_filters( 'lsx_customizer_colour_selectors_body', $css, $colors );
1247
-	$css = lsx_customizer_colour__scss_to_css( $css );
1246
+	$css = apply_filters('lsx_customizer_colour_selectors_body', $css, $colors);
1247
+	$css = lsx_customizer_colour__scss_to_css($css);
1248 1248
 	return $css;
1249 1249
 }
1250 1250
 
@@ -1257,33 +1257,33 @@  discard block
 block discarded – undo
1257 1257
  */
1258 1258
 function lsx_customizer_colour__footer_cta_set_theme_mod() {
1259 1259
 	$theme_mods = lsx_customizer_colour__footer_cta_get_theme_mods();
1260
-	$styles     = lsx_customizer_colour__footer_cta_get_css( $theme_mods );
1260
+	$styles     = lsx_customizer_colour__footer_cta_get_css($theme_mods);
1261 1261
 	
1262
-	set_theme_mod( 'lsx_customizer_colour__footer_cta_theme_mod', $styles );
1262
+	set_theme_mod('lsx_customizer_colour__footer_cta_theme_mod', $styles);
1263 1263
 }
1264
-add_action( 'after_switch_theme',   'lsx_customizer_colour__footer_cta_set_theme_mod' );
1265
-add_action( 'customize_save_after', 'lsx_customizer_colour__footer_cta_set_theme_mod' );
1264
+add_action('after_switch_theme', 'lsx_customizer_colour__footer_cta_set_theme_mod');
1265
+add_action('customize_save_after', 'lsx_customizer_colour__footer_cta_set_theme_mod');
1266 1266
 
1267 1267
 /**
1268 1268
  * Enqueues front-end CSS for the footer cta.
1269 1269
  */
1270 1270
 function lsx_customizer_colour__footer_cta_css() {
1271
-	$styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__footer_cta_theme_mod' );
1271
+	$styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__footer_cta_theme_mod');
1272 1272
 	
1273
-	if ( is_customize_preview() || false === $styles_from_theme_mod ) {
1273
+	if (is_customize_preview() || false === $styles_from_theme_mod) {
1274 1274
 		$theme_mods = lsx_customizer_colour__footer_cta_get_theme_mods();
1275
-		$styles     = lsx_customizer_colour__footer_cta_get_css( $theme_mods );
1275
+		$styles     = lsx_customizer_colour__footer_cta_get_css($theme_mods);
1276 1276
 		
1277
-		if ( false === $styles_from_theme_mod ) {
1278
-			set_theme_mod( 'lsx_customizer_colour__footer_cta_theme_mod', $styles );
1277
+		if (false === $styles_from_theme_mod) {
1278
+			set_theme_mod('lsx_customizer_colour__footer_cta_theme_mod', $styles);
1279 1279
 		}
1280 1280
 	} else {
1281 1281
 		$styles = $styles_from_theme_mod;
1282 1282
 	}
1283 1283
 
1284
-	wp_add_inline_style( 'lsx_customizer_colour', $styles );
1284
+	wp_add_inline_style('lsx_customizer_colour', $styles);
1285 1285
 }
1286
-add_action( 'wp_footer', 'lsx_customizer_colour__footer_cta_css', 12 );
1286
+add_action('wp_footer', 'lsx_customizer_colour__footer_cta_css', 12);
1287 1287
 
1288 1288
 /**
1289 1289
  * Get footer cta CSS theme mods.
@@ -1295,32 +1295,32 @@  discard block
 block discarded – undo
1295 1295
 	$colors       = array();
1296 1296
 	$counter      = 0;
1297 1297
 
1298
-	foreach ( $customizer_colour_names as $key => $value ) {
1298
+	foreach ($customizer_colour_names as $key => $value) {
1299 1299
 		$colors[$key] = $color_scheme[$counter];
1300 1300
 		$counter++;
1301 1301
 	}
1302 1302
 
1303 1303
 	return array(
1304
-		'footer_cta_background_color' => get_theme_mod( 'footer_cta_background_color', $colors['footer_cta_background_color'] ),
1305
-		'footer_cta_text_color'       => get_theme_mod( 'footer_cta_text_color',       $colors['footer_cta_text_color'] ),
1306
-		'footer_cta_link_color'       => get_theme_mod( 'footer_cta_link_color',       $colors['footer_cta_link_color'] ),
1307
-		'footer_cta_link_hover_color' => get_theme_mod( 'footer_cta_link_hover_color', $colors['footer_cta_link_hover_color'] )
1304
+		'footer_cta_background_color' => get_theme_mod('footer_cta_background_color', $colors['footer_cta_background_color']),
1305
+		'footer_cta_text_color'       => get_theme_mod('footer_cta_text_color', $colors['footer_cta_text_color']),
1306
+		'footer_cta_link_color'       => get_theme_mod('footer_cta_link_color', $colors['footer_cta_link_color']),
1307
+		'footer_cta_link_hover_color' => get_theme_mod('footer_cta_link_hover_color', $colors['footer_cta_link_hover_color'])
1308 1308
 	);
1309 1309
 }
1310 1310
 
1311 1311
 /**
1312 1312
  * Returns CSS for the footer cta.
1313 1313
  */
1314
-function lsx_customizer_colour__footer_cta_get_css( $colors ) {
1314
+function lsx_customizer_colour__footer_cta_get_css($colors) {
1315 1315
 	global $customizer_colour_names;
1316 1316
 	
1317 1317
 	$colors_template = array();
1318 1318
 
1319
-	foreach ( $customizer_colour_names as $key => $value ) {
1319
+	foreach ($customizer_colour_names as $key => $value) {
1320 1320
 		$colors_template[$key] = '';
1321 1321
 	}
1322 1322
 
1323
-	$colors = wp_parse_args( $colors, $colors_template );
1323
+	$colors = wp_parse_args($colors, $colors_template);
1324 1324
 
1325 1325
 	$css = <<<CSS
1326 1326
 		/*
@@ -1355,8 +1355,8 @@  discard block
 block discarded – undo
1355 1355
 		}
1356 1356
 CSS;
1357 1357
 
1358
-	$css = apply_filters( 'lsx_customizer_colour_selectors_footer_cta', $css, $colors );
1359
-	$css = lsx_customizer_colour__scss_to_css( $css );
1358
+	$css = apply_filters('lsx_customizer_colour_selectors_footer_cta', $css, $colors);
1359
+	$css = lsx_customizer_colour__scss_to_css($css);
1360 1360
 	return $css;
1361 1361
 }
1362 1362
 
@@ -1368,33 +1368,33 @@  discard block
 block discarded – undo
1368 1368
  */
1369 1369
 function lsx_customizer_colour__footer_widgets_set_theme_mod() {
1370 1370
 	$theme_mods = lsx_customizer_colour__footer_widgets_get_theme_mods();
1371
-	$styles     = lsx_customizer_colour__footer_widgets_get_css( $theme_mods );
1371
+	$styles     = lsx_customizer_colour__footer_widgets_get_css($theme_mods);
1372 1372
 	
1373
-	set_theme_mod( 'lsx_customizer_colour__footer_widgets_theme_mod', $styles );
1373
+	set_theme_mod('lsx_customizer_colour__footer_widgets_theme_mod', $styles);
1374 1374
 }
1375
-add_action( 'after_switch_theme',   'lsx_customizer_colour__footer_widgets_set_theme_mod' );
1376
-add_action( 'customize_save_after', 'lsx_customizer_colour__footer_widgets_set_theme_mod' );
1375
+add_action('after_switch_theme', 'lsx_customizer_colour__footer_widgets_set_theme_mod');
1376
+add_action('customize_save_after', 'lsx_customizer_colour__footer_widgets_set_theme_mod');
1377 1377
 
1378 1378
 /**
1379 1379
  * Enqueues front-end CSS for the footer widgets.
1380 1380
  */
1381 1381
 function lsx_customizer_colour__footer_widgets_css() {
1382
-	$styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__footer_widgets_theme_mod' );
1382
+	$styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__footer_widgets_theme_mod');
1383 1383
 	
1384
-	if ( is_customize_preview() || false === $styles_from_theme_mod ) {
1384
+	if (is_customize_preview() || false === $styles_from_theme_mod) {
1385 1385
 		$theme_mods = lsx_customizer_colour__footer_widgets_get_theme_mods();
1386
-		$styles     = lsx_customizer_colour__footer_widgets_get_css( $theme_mods );
1386
+		$styles     = lsx_customizer_colour__footer_widgets_get_css($theme_mods);
1387 1387
 		
1388
-		if ( false === $styles_from_theme_mod ) {
1389
-			set_theme_mod( 'lsx_customizer_colour__footer_widgets_theme_mod', $styles );
1388
+		if (false === $styles_from_theme_mod) {
1389
+			set_theme_mod('lsx_customizer_colour__footer_widgets_theme_mod', $styles);
1390 1390
 		}
1391 1391
 	} else {
1392 1392
 		$styles = $styles_from_theme_mod;
1393 1393
 	}
1394 1394
 
1395
-	wp_add_inline_style( 'lsx_customizer_colour', $styles );
1395
+	wp_add_inline_style('lsx_customizer_colour', $styles);
1396 1396
 }
1397
-add_action( 'wp_footer', 'lsx_customizer_colour__footer_widgets_css', 12 );
1397
+add_action('wp_footer', 'lsx_customizer_colour__footer_widgets_css', 12);
1398 1398
 
1399 1399
 /**
1400 1400
  * Get footer widgets CSS theme mods.
@@ -1406,32 +1406,32 @@  discard block
 block discarded – undo
1406 1406
 	$colors       = array();
1407 1407
 	$counter      = 0;
1408 1408
 
1409
-	foreach ( $customizer_colour_names as $key => $value ) {
1409
+	foreach ($customizer_colour_names as $key => $value) {
1410 1410
 		$colors[$key] = $color_scheme[$counter];
1411 1411
 		$counter++;
1412 1412
 	}
1413 1413
 
1414 1414
 	return array(
1415
-		'footer_widgets_background_color' => get_theme_mod( 'footer_widgets_background_color', $colors['footer_widgets_background_color'] ),
1416
-		'footer_widgets_text_color'       => get_theme_mod( 'footer_widgets_text_color',       $colors['footer_widgets_text_color'] ),
1417
-		'footer_widgets_link_color'       => get_theme_mod( 'footer_widgets_link_color',       $colors['footer_widgets_link_color'] ),
1418
-		'footer_widgets_link_hover_color' => get_theme_mod( 'footer_widgets_link_hover_color', $colors['footer_widgets_link_hover_color'] )
1415
+		'footer_widgets_background_color' => get_theme_mod('footer_widgets_background_color', $colors['footer_widgets_background_color']),
1416
+		'footer_widgets_text_color'       => get_theme_mod('footer_widgets_text_color', $colors['footer_widgets_text_color']),
1417
+		'footer_widgets_link_color'       => get_theme_mod('footer_widgets_link_color', $colors['footer_widgets_link_color']),
1418
+		'footer_widgets_link_hover_color' => get_theme_mod('footer_widgets_link_hover_color', $colors['footer_widgets_link_hover_color'])
1419 1419
 	);
1420 1420
 }
1421 1421
 
1422 1422
 /**
1423 1423
  * Returns CSS for the footer widgets.
1424 1424
  */
1425
-function lsx_customizer_colour__footer_widgets_get_css( $colors ) {
1425
+function lsx_customizer_colour__footer_widgets_get_css($colors) {
1426 1426
 	global $customizer_colour_names;
1427 1427
 	
1428 1428
 	$colors_template = array();
1429 1429
 
1430
-	foreach ( $customizer_colour_names as $key => $value ) {
1430
+	foreach ($customizer_colour_names as $key => $value) {
1431 1431
 		$colors_template[$key] = '';
1432 1432
 	}
1433 1433
 
1434
-	$colors = wp_parse_args( $colors, $colors_template );
1434
+	$colors = wp_parse_args($colors, $colors_template);
1435 1435
 
1436 1436
 	$css = <<<CSS
1437 1437
 		/*
@@ -1470,8 +1470,8 @@  discard block
 block discarded – undo
1470 1470
 		}
1471 1471
 CSS;
1472 1472
 
1473
-	$css = apply_filters( 'lsx_customizer_colour_selectors_footer_widgets', $css, $colors );
1474
-	$css = lsx_customizer_colour__scss_to_css( $css );
1473
+	$css = apply_filters('lsx_customizer_colour_selectors_footer_widgets', $css, $colors);
1474
+	$css = lsx_customizer_colour__scss_to_css($css);
1475 1475
 	return $css;
1476 1476
 }
1477 1477
 
@@ -1483,33 +1483,33 @@  discard block
 block discarded – undo
1483 1483
  */
1484 1484
 function lsx_customizer_colour__footer_set_theme_mod() {
1485 1485
 	$theme_mods = lsx_customizer_colour__footer_get_theme_mods();
1486
-	$styles     = lsx_customizer_colour__footer_get_css( $theme_mods );
1486
+	$styles     = lsx_customizer_colour__footer_get_css($theme_mods);
1487 1487
 	
1488
-	set_theme_mod( 'lsx_customizer_colour__footer_theme_mod', $styles );
1488
+	set_theme_mod('lsx_customizer_colour__footer_theme_mod', $styles);
1489 1489
 }
1490
-add_action( 'after_switch_theme',   'lsx_customizer_colour__footer_set_theme_mod' );
1491
-add_action( 'customize_save_after', 'lsx_customizer_colour__footer_set_theme_mod' );
1490
+add_action('after_switch_theme', 'lsx_customizer_colour__footer_set_theme_mod');
1491
+add_action('customize_save_after', 'lsx_customizer_colour__footer_set_theme_mod');
1492 1492
 
1493 1493
 /**
1494 1494
  * Enqueues front-end CSS for the footer.
1495 1495
  */
1496 1496
 function lsx_customizer_colour__footer_css() {
1497
-	$styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__footer_theme_mod' );
1497
+	$styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__footer_theme_mod');
1498 1498
 
1499
-	if ( is_customize_preview() || false === $styles_from_theme_mod ) {
1499
+	if (is_customize_preview() || false === $styles_from_theme_mod) {
1500 1500
 		$theme_mods = lsx_customizer_colour__footer_get_theme_mods();
1501
-		$styles     = lsx_customizer_colour__footer_get_css( $theme_mods );
1501
+		$styles     = lsx_customizer_colour__footer_get_css($theme_mods);
1502 1502
 		
1503
-		if ( false === $styles_from_theme_mod ) {
1504
-			set_theme_mod( 'lsx_customizer_colour__footer_theme_mod', $styles );
1503
+		if (false === $styles_from_theme_mod) {
1504
+			set_theme_mod('lsx_customizer_colour__footer_theme_mod', $styles);
1505 1505
 		}
1506 1506
 	} else {
1507 1507
 		$styles = $styles_from_theme_mod;
1508 1508
 	}
1509 1509
 
1510
-	wp_add_inline_style( 'lsx_customizer_colour', $styles );
1510
+	wp_add_inline_style('lsx_customizer_colour', $styles);
1511 1511
 }
1512
-add_action( 'wp_footer', 'lsx_customizer_colour__footer_css', 12 );
1512
+add_action('wp_footer', 'lsx_customizer_colour__footer_css', 12);
1513 1513
 
1514 1514
 /**
1515 1515
  * Get footer CSS theme mods.
@@ -1521,32 +1521,32 @@  discard block
 block discarded – undo
1521 1521
 	$colors       = array();
1522 1522
 	$counter      = 0;
1523 1523
 
1524
-	foreach ( $customizer_colour_names as $key => $value ) {
1524
+	foreach ($customizer_colour_names as $key => $value) {
1525 1525
 		$colors[$key] = $color_scheme[$counter];
1526 1526
 		$counter++;
1527 1527
 	}
1528 1528
 
1529 1529
 	return array(
1530
-		'footer_background_color' => get_theme_mod( 'footer_background_color', $colors['footer_background_color'] ),
1531
-		'footer_text_color'       => get_theme_mod( 'footer_text_color',       $colors['footer_text_color'] ),
1532
-		'footer_link_color'       => get_theme_mod( 'footer_link_color',       $colors['footer_link_color'] ),
1533
-		'footer_link_hover_color' => get_theme_mod( 'footer_link_hover_color', $colors['footer_link_hover_color'] )
1530
+		'footer_background_color' => get_theme_mod('footer_background_color', $colors['footer_background_color']),
1531
+		'footer_text_color'       => get_theme_mod('footer_text_color', $colors['footer_text_color']),
1532
+		'footer_link_color'       => get_theme_mod('footer_link_color', $colors['footer_link_color']),
1533
+		'footer_link_hover_color' => get_theme_mod('footer_link_hover_color', $colors['footer_link_hover_color'])
1534 1534
 	);
1535 1535
 }
1536 1536
 
1537 1537
 /**
1538 1538
  * Returns CSS for the footer.
1539 1539
  */
1540
-function lsx_customizer_colour__footer_get_css( $colors ) {
1540
+function lsx_customizer_colour__footer_get_css($colors) {
1541 1541
 	global $customizer_colour_names;
1542 1542
 	
1543 1543
 	$colors_template = array();
1544 1544
 
1545
-	foreach ( $customizer_colour_names as $key => $value ) {
1545
+	foreach ($customizer_colour_names as $key => $value) {
1546 1546
 		$colors_template[$key] = '';
1547 1547
 	}
1548 1548
 
1549
-	$colors = wp_parse_args( $colors, $colors_template );
1549
+	$colors = wp_parse_args($colors, $colors_template);
1550 1550
 
1551 1551
 	$css = <<<CSS
1552 1552
 		/*
@@ -1586,8 +1586,8 @@  discard block
 block discarded – undo
1586 1586
 		}
1587 1587
 CSS;
1588 1588
 
1589
-	$css = apply_filters( 'lsx_customizer_colour_selectors_footer', $css, $colors );
1590
-	$css = lsx_customizer_colour__scss_to_css( $css );
1589
+	$css = apply_filters('lsx_customizer_colour_selectors_footer', $css, $colors);
1590
+	$css = lsx_customizer_colour__scss_to_css($css);
1591 1591
 	return $css;
1592 1592
 }
1593 1593
 
@@ -1599,7 +1599,7 @@  discard block
 block discarded – undo
1599 1599
  * Customize Colour Control Class
1600 1600
  */
1601 1601
 
1602
-if ( ! class_exists( 'WP_Customize_Control' ) ) {
1602
+if ( ! class_exists('WP_Customize_Control')) {
1603 1603
 	return;
1604 1604
 }
1605 1605
 
@@ -1609,37 +1609,37 @@  discard block
 block discarded – undo
1609 1609
 	 * Enqueue control related scripts/styles.
1610 1610
 	 */
1611 1611
 	public function enqueue() {
1612
-		wp_enqueue_script( 'lsx-colour-control', get_template_directory_uri() .'/js/customizer-colour.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), null, true );
1613
-		wp_localize_script( 'lsx-colour-control', 'colorScheme', $this->choices );
1612
+		wp_enqueue_script('lsx-colour-control', get_template_directory_uri() . '/js/customizer-colour.js', array('customize-controls', 'iris', 'underscore', 'wp-util'), null, true);
1613
+		wp_localize_script('lsx-colour-control', 'colorScheme', $this->choices);
1614 1614
 
1615 1615
 		global $customizer_colour_names;
1616 1616
 		$colors = array();
1617
-		foreach ( $customizer_colour_names as $key => $value ) {
1617
+		foreach ($customizer_colour_names as $key => $value) {
1618 1618
 			$colors[] = $key;
1619 1619
 		}
1620
-		wp_localize_script( 'lsx-colour-control', 'colorSchemeKeys', $colors );
1620
+		wp_localize_script('lsx-colour-control', 'colorSchemeKeys', $colors);
1621 1621
 	}
1622 1622
 
1623 1623
 	/**
1624 1624
 	 * Render the control's content.
1625 1625
 	 */
1626 1626
 	public function render_content() {
1627
-		if ( empty( $this->choices ) ) {
1627
+		if (empty($this->choices)) {
1628 1628
 			return;
1629 1629
 		}
1630 1630
 
1631 1631
 		?> 
1632 1632
 		<label>
1633
-			<?php if ( ! empty( $this->label ) ) { ?>
1634
-				<span class="customize-control-title"><?php echo esc_html( $this->label ) ?></span>
1633
+			<?php if ( ! empty($this->label)) { ?>
1634
+				<span class="customize-control-title"><?php echo esc_html($this->label) ?></span>
1635 1635
 			<?php }
1636
-			if ( ! empty( $this->description ) ) { ?>
1636
+			if ( ! empty($this->description)) { ?>
1637 1637
 				<span class="description customize-control-description"><?php echo $this->description ?></span>
1638 1638
 			<?php } ?>
1639 1639
 			<select <?php $this->link() ?>>
1640 1640
 				<?php
1641
-					foreach ( $this->choices as $value => $label ) {
1642
-						echo '<option value="'. esc_attr( $value ) .'"'. selected( $this->value(), $value, false ) .'>'. $label['label'] .'</option>';
1641
+					foreach ($this->choices as $value => $label) {
1642
+						echo '<option value="' . esc_attr($value) . '"' . selected($this->value(), $value, false) . '>' . $label['label'] . '</option>';
1643 1643
 					}
1644 1644
 				?>
1645 1645
 			</select>
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined( 'ABSPATH' ) ) {
3
+	return;
4
+}
5
+// Exit if accessed directly
3 6
 
4 7
 /**
5 8
  * Transform SCSS to CSS
Please login to merge, or discard this patch.
inc/customizer.php 2 patches
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) return; // Exit if accessed directly
3 3
 
4 4
 /**
5 5
  * Customizer Configuration File
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @author  [email protected] <lsdev.biz>
10 10
  * 
11 11
  */
12
-if ( ! class_exists( 'LSX_Theme_Customizer' ) ) {
12
+if ( ! class_exists('LSX_Theme_Customizer')) {
13 13
 	
14 14
 	class LSX_Theme_Customizer {
15 15
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 		 *
30 30
 		 * @since     1.0.0
31 31
 		 */
32
-		public function __construct( $controls ) {
32
+		public function __construct($controls) {
33 33
 			require get_template_directory() . '/inc/google-font.php';
34 34
 			require get_template_directory() . '/inc/google-font-collection.php';
35 35
 			require get_template_directory() . '/inc/customizer-core.php';
@@ -40,19 +40,19 @@  discard block
 block discarded – undo
40 40
 
41 41
 			$this->controls = $controls;
42 42
 
43
-			add_action( 'customize_preview_init', array($this,'customize_preview_js' ),20);
44
-			add_action( 'customize_register', array($this,'customizer'), 11 );
43
+			add_action('customize_preview_init', array($this, 'customize_preview_js'), 20);
44
+			add_action('customize_register', array($this, 'customizer'), 11);
45 45
 			
46
-			add_action( 'wp_ajax_customizer_site_title', array($this,'ajax_site_title') );
47
-			add_action( 'wp_ajax_nopriv_customizer_site_title', array($this,'ajax_site_title') );
46
+			add_action('wp_ajax_customizer_site_title', array($this, 'ajax_site_title'));
47
+			add_action('wp_ajax_nopriv_customizer_site_title', array($this, 'ajax_site_title'));
48 48
 		}
49 49
 		
50 50
 		/**
51 51
 		 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
52 52
 		 */
53 53
 		function customize_preview_js() {
54
-			wp_enqueue_script( 'lsx_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ) , wp_get_theme()->Version, true );
55
-			wp_localize_script( 'lsx_customizer', 'lsx_customizer_params', array( 'template_directory' => get_template_directory_uri() ) );
54
+			wp_enqueue_script('lsx_customizer', get_template_directory_uri() . '/js/customizer.js', array('customize-preview'), wp_get_theme()->Version, true);
55
+			wp_localize_script('lsx_customizer', 'lsx_customizer_params', array('template_directory' => get_template_directory_uri()));
56 56
 		}
57 57
 		
58 58
 		/**
@@ -60,40 +60,40 @@  discard block
 block discarded – undo
60 60
 		 *
61 61
 		 * @since     1.0.0
62 62
 		 */		
63
-		public function customizer( $wp_customize ) {
63
+		public function customizer($wp_customize) {
64 64
 			// start panels
65
-			if( !empty( $this->controls['panels'] ) ){
66
-				foreach( $this->controls['panels'] as $panel_slug => $args ){
67
-					$this->add_panel( $panel_slug, $args, $wp_customize );
65
+			if ( ! empty($this->controls['panels'])) {
66
+				foreach ($this->controls['panels'] as $panel_slug => $args) {
67
+					$this->add_panel($panel_slug, $args, $wp_customize);
68 68
 				}
69 69
 			}
70 70
 
71 71
 			// start sections
72
-			if( !empty( $this->controls['sections'] ) ){
73
-				foreach( $this->controls['sections'] as $section_slug => $args ){
74
-					$this->add_section( $section_slug, $args, $wp_customize );
72
+			if ( ! empty($this->controls['sections'])) {
73
+				foreach ($this->controls['sections'] as $section_slug => $args) {
74
+					$this->add_section($section_slug, $args, $wp_customize);
75 75
 				}
76 76
 			}
77 77
 
78 78
 			// start settings
79
-			if( !empty( $this->controls['settings'] ) ){
80
-				foreach( $this->controls['settings'] as $settings_slug => $args ){
81
-					$this->add_setting( $settings_slug, $args, $wp_customize );
79
+			if ( ! empty($this->controls['settings'])) {
80
+				foreach ($this->controls['settings'] as $settings_slug => $args) {
81
+					$this->add_setting($settings_slug, $args, $wp_customize);
82 82
 				}
83 83
 			}
84 84
 
85 85
 			// start fields
86
-			if( !empty( $this->controls['fields'] ) ){
87
-				foreach( $this->controls['fields'] as $field_slug => $args ){
88
-					$this->add_control( $field_slug, $args, $wp_customize );
86
+			if ( ! empty($this->controls['fields'])) {
87
+				foreach ($this->controls['fields'] as $field_slug => $args) {
88
+					$this->add_control($field_slug, $args, $wp_customize);
89 89
 				}
90 90
 			}
91 91
 			
92
-			$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
93
-			$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
94
-			$wp_customize->get_setting( 'background_color' )->transport = 'postMessage';
92
+			$wp_customize->get_setting('blogname')->transport = 'postMessage';
93
+			$wp_customize->get_setting('blogdescription')->transport = 'postMessage';
94
+			$wp_customize->get_setting('background_color')->transport = 'postMessage';
95 95
 
96
-			$wp_customize->remove_control( 'background_color' );
96
+			$wp_customize->remove_control('background_color');
97 97
 		}
98 98
 
99 99
 		/**
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		 *
102 102
 		 * @since     1.0.0
103 103
 		 */		
104
-		private function add_panel( $slug, $args, $wp_customize ) {
104
+		private function add_panel($slug, $args, $wp_customize) {
105 105
 			$default_args = array(
106 106
 				'title' 		=> null,
107 107
 				'description' 	=> null,
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
 			$wp_customize->add_panel(
111 111
 				$slug,
112
-				array_merge( $default_args, $args )
112
+				array_merge($default_args, $args)
113 113
 			);
114 114
 		}
115 115
 
@@ -118,14 +118,14 @@  discard block
 block discarded – undo
118 118
 		 *
119 119
 		 * @since     1.0.0
120 120
 		 */		
121
-		private function add_section( $slug, $args, $wp_customize ) {
121
+		private function add_section($slug, $args, $wp_customize) {
122 122
 			$default_args = array(
123 123
 				'capability' => 'edit_theme_options', //Capability needed to tweak
124 124
 				'description' => null, //Descriptive tooltip
125 125
 			);
126 126
 
127
-			$wp_customize->add_section( $slug, 
128
-				array_merge( $default_args, $args )
127
+			$wp_customize->add_section($slug, 
128
+				array_merge($default_args, $args)
129 129
 			);
130 130
 		}
131 131
 
@@ -134,15 +134,15 @@  discard block
 block discarded – undo
134 134
 		 *
135 135
 		 * @since     1.0.0
136 136
 		 */		
137
-		private function add_setting( $slug, $args, $wp_customize ) {
138
-			$wp_customize->add_setting( $slug, //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record
139
-				array_merge( array(
137
+		private function add_setting($slug, $args, $wp_customize) {
138
+			$wp_customize->add_setting($slug, //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record
139
+				array_merge(array(
140 140
 					'default' 			=> null, //Default setting/value to save
141 141
 					'type' 				=> 'theme_mod', //Is this an 'option' or a 'theme_mod'?
142 142
 					'capability'		=> 'edit_theme_options', //Optional. Special permissions for accessing this setting.
143 143
 					'transport' 		=> 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)?
144 144
 					'sanitize_callback'	=> 'lsx_sanitize_choices'
145
-				), $args )
145
+				), $args)
146 146
 			);
147 147
 		}
148 148
 
@@ -151,28 +151,28 @@  discard block
 block discarded – undo
151 151
 		 *
152 152
 		 * @since     1.0.0
153 153
 		 */		
154
-		private function add_control( $slug, $args, $wp_customize ) {
154
+		private function add_control($slug, $args, $wp_customize) {
155 155
 			$default_args = array(
156 156
 
157 157
 			);
158 158
 
159
-			if( isset( $args['control'] ) && class_exists( $args['control'] )){
159
+			if (isset($args['control']) && class_exists($args['control'])) {
160 160
 				
161 161
 				$control_class = $args['control'];
162
-				unset( $args['control'] );
162
+				unset($args['control']);
163 163
 
164
-				$control = new $control_class( $wp_customize, $slug, array_merge( $default_args, $args ) );
165
-				$wp_customize->add_control( $control );
164
+				$control = new $control_class($wp_customize, $slug, array_merge($default_args, $args));
165
+				$wp_customize->add_control($control);
166 166
 			
167
-			}else{
167
+			} else {
168 168
 				
169
-				if( isset( $args['control'] ) ){
170
-					unset( $args['control'] );
169
+				if (isset($args['control'])) {
170
+					unset($args['control']);
171 171
 				}
172 172
 
173 173
 				$wp_customize->add_control(
174 174
 					$slug,
175
-					array_merge( $default_args, $args )
175
+					array_merge($default_args, $args)
176 176
 				);
177 177
 			}
178 178
 		}
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined( 'ABSPATH' ) ) {
3
+	return;
4
+}
5
+// Exit if accessed directly
3 6
 
4 7
 /**
5 8
  * Customizer Configuration File
@@ -164,7 +167,7 @@  discard block
 block discarded – undo
164 167
 				$control = new $control_class( $wp_customize, $slug, array_merge( $default_args, $args ) );
165 168
 				$wp_customize->add_control( $control );
166 169
 			
167
-			}else{
170
+			} else{
168 171
 				
169 172
 				if( isset( $args['control'] ) ){
170 173
 					unset( $args['control'] );
Please login to merge, or discard this patch.
inc/woocommerce.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,6 +69,6 @@
 block discarded – undo
69 69
 add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
70 70
 
71 71
 function lsx_woocommerce_styles() {
72
-    wp_enqueue_style( 'woocommerce', get_template_directory_uri() . '/css/woocommerce.css' );
72
+	wp_enqueue_style( 'woocommerce', get_template_directory_uri() . '/css/woocommerce.css' );
73 73
 }
74 74
 add_action( 'wp_enqueue_scripts', 'lsx_woocommerce_styles' );
75 75
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
 /*
10 10
  * Hooks
11 11
  */
12
-remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
13
-remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
12
+remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
13
+remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
14 14
 
15 15
 add_action('woocommerce_before_main_content', 'lsx_woocommerce_before_content', 10);
16 16
 add_action('woocommerce_after_main_content', 'lsx_woocommerce_after_content', 10);
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  * @subpackage woocommerce
26 26
  * @category 	layout
27 27
  */
28
-function lsx_woocommerce_before_content(){ ?>
28
+function lsx_woocommerce_before_content() { ?>
29 29
 	<?php lsx_content_wrap_before(); ?>
30 30
 
31 31
 	<div id="primary" class="content-area <?php echo lsx_main_class(); ?>">
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
  * @subpackage woocommerce
44 44
  * @category 	layout
45 45
  */
46
-function lsx_woocommerce_after_content(){ ?>
46
+function lsx_woocommerce_after_content() { ?>
47 47
 		<?php lsx_content_bottom(); ?>
48 48
 
49 49
 		</main><!-- #main -->
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
  * @subpackage woocommerce
67 67
  * @category 	styles
68 68
  */
69
-add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
69
+add_filter('woocommerce_enqueue_styles', '__return_empty_array');
70 70
 
71 71
 function lsx_woocommerce_styles() {
72
-    wp_enqueue_style( 'woocommerce', get_template_directory_uri() . '/css/woocommerce.css' );
72
+    wp_enqueue_style('woocommerce', get_template_directory_uri() . '/css/woocommerce.css');
73 73
 }
74
-add_action( 'wp_enqueue_scripts', 'lsx_woocommerce_styles' );
75 74
\ No newline at end of file
75
+add_action('wp_enqueue_scripts', 'lsx_woocommerce_styles');
76 76
\ No newline at end of file
Please login to merge, or discard this patch.
inc/the-events-calendar.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
  */
19 19
 
20 20
 function lsx_events_styles() {
21
-    wp_enqueue_style( 'events', get_template_directory_uri() . '/css/the-events-calendar.css' );
21
+	wp_enqueue_style( 'events', get_template_directory_uri() . '/css/the-events-calendar.css' );
22 22
 }
23 23
 add_action( 'wp_enqueue_scripts', 'lsx_events_styles' );
24 24
 
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
  */
19 19
 
20 20
 function lsx_events_styles() {
21
-    wp_enqueue_style( 'events', get_template_directory_uri() . '/css/the-events-calendar.css' );
21
+    wp_enqueue_style('events', get_template_directory_uri() . '/css/the-events-calendar.css');
22 22
 }
23
-add_action( 'wp_enqueue_scripts', 'lsx_events_styles' );
23
+add_action('wp_enqueue_scripts', 'lsx_events_styles');
24 24
 
25 25
 
26 26
 /**
@@ -32,41 +32,41 @@  discard block
 block discarded – undo
32 32
 
33 33
 function lsx_tribe_breadcrumbs($output) {
34 34
 	global $wp_query;
35
-	if( (isset($wp_query->tribe_is_event) && true === $wp_query->tribe_is_event) || (isset($wp_query->query_vars['post_type']) && !is_array($wp_query->query_vars['post_type']) && 'tribe_venue' === $wp_query->query_vars['post_type'])){
36
-		if(function_exists('woocommerce_breadcrumb')){
35
+	if ((isset($wp_query->tribe_is_event) && true === $wp_query->tribe_is_event) || (isset($wp_query->query_vars['post_type']) && ! is_array($wp_query->query_vars['post_type']) && 'tribe_venue' === $wp_query->query_vars['post_type'])) {
36
+		if (function_exists('woocommerce_breadcrumb')) {
37 37
 		 	$closing_div = '</nav>';
38 38
 
39
-		 	if( is_single()) {
40
-		 		$output = str_replace('Page','<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a>',$output);
41
-		 		if(isset($wp_query->query_vars['eventDisplay']) && 'all' === $wp_query->query_vars['eventDisplay']){
42
-		 			$output = str_replace($closing_div,get_the_title($wp_query->query_vars['post_parent']).$closing_div,$output);
43
-		 		}else{
39
+		 	if (is_single()) {
40
+		 		$output = str_replace('Page', '<a href="' . get_post_type_archive_link('tribe_events') . '">' . __('Events', 'lsx') . '</a>', $output);
41
+		 		if (isset($wp_query->query_vars['eventDisplay']) && 'all' === $wp_query->query_vars['eventDisplay']) {
42
+		 			$output = str_replace($closing_div, get_the_title($wp_query->query_vars['post_parent']) . $closing_div, $output);
43
+		 		} else {
44 44
 		 			$single_event = get_queried_object();
45
-		 			$output = str_replace($closing_div,apply_filters('the_title',$single_event->post_title).$closing_div,$output);		 			
45
+		 			$output = str_replace($closing_div, apply_filters('the_title', $single_event->post_title) . $closing_div, $output);		 			
46 46
 		 		}
47
-		 	}elseif( is_tax()) {
47
+		 	}elseif (is_tax()) {
48 48
 		 		$tax_event = get_queried_object();
49
-		 		$output = str_replace('Page','<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a>',$output);
50
-		 		$output = str_replace($closing_div,'&nbsp;/&nbsp;'.apply_filters('the_title',$tax_event->name).$closing_div,$output);
51
-		 	}else{
52
-		 		$output = str_replace('Page',__('Events','lsx'),$output);
49
+		 		$output = str_replace('Page', '<a href="' . get_post_type_archive_link('tribe_events') . '">' . __('Events', 'lsx') . '</a>', $output);
50
+		 		$output = str_replace($closing_div, '&nbsp;/&nbsp;' . apply_filters('the_title', $tax_event->name) . $closing_div, $output);
51
+		 	} else {
52
+		 		$output = str_replace('Page', __('Events', 'lsx'), $output);
53 53
 		 	}		 	
54
-		 }elseif(function_exists('yoast_breadcrumb')){
54
+		 }elseif (function_exists('yoast_breadcrumb')) {
55 55
 		 	$closing_div = '</div>';
56
-		 	$last_breadcrumb = '<span class="breadcrumb_last">'.__('Events','lsx').'</span>';
56
+		 	$last_breadcrumb = '<span class="breadcrumb_last">' . __('Events', 'lsx') . '</span>';
57 57
 		 	
58
-		 	if( is_single()) {
58
+		 	if (is_single()) {
59 59
 		 		$single_event = get_queried_object();
60
-		 		$output = str_replace($closing_div,'<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a>&nbsp;/&nbsp;'.apply_filters('the_title',$single_event->post_title),$output);
61
-		 	}elseif( is_tax()) {
60
+		 		$output = str_replace($closing_div, '<a href="' . get_post_type_archive_link('tribe_events') . '">' . __('Events', 'lsx') . '</a>&nbsp;/&nbsp;' . apply_filters('the_title', $single_event->post_title), $output);
61
+		 	}elseif (is_tax()) {
62 62
 		 		$tax_event = get_queried_object();
63
-		 		$output = str_replace($last_breadcrumb,'<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a>&nbsp;/&nbsp;'.apply_filters('the_title',$tax_event->name),$output);
63
+		 		$output = str_replace($last_breadcrumb, '<a href="' . get_post_type_archive_link('tribe_events') . '">' . __('Events', 'lsx') . '</a>&nbsp;/&nbsp;' . apply_filters('the_title', $tax_event->name), $output);
64 64
 		 		
65
-		 	}else{
66
-		 		$output = str_replace('Page',__('Events','lsx'),$output);
65
+		 	} else {
66
+		 		$output = str_replace('Page', __('Events', 'lsx'), $output);
67 67
 		 	}		 	
68 68
 		 }		
69 69
 	}
70 70
 	return $output;
71 71
 }
72
-add_filter( 'lsx_breadcrumbs', 'lsx_tribe_breadcrumbs',1,10 );
73 72
\ No newline at end of file
73
+add_filter('lsx_breadcrumbs', 'lsx_tribe_breadcrumbs', 1, 10);
74 74
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,29 +40,29 @@
 block discarded – undo
40 40
 		 		$output = str_replace('Page','<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a>',$output);
41 41
 		 		if(isset($wp_query->query_vars['eventDisplay']) && 'all' === $wp_query->query_vars['eventDisplay']){
42 42
 		 			$output = str_replace($closing_div,get_the_title($wp_query->query_vars['post_parent']).$closing_div,$output);
43
-		 		}else{
43
+		 		} else{
44 44
 		 			$single_event = get_queried_object();
45 45
 		 			$output = str_replace($closing_div,apply_filters('the_title',$single_event->post_title).$closing_div,$output);		 			
46 46
 		 		}
47
-		 	}elseif( is_tax()) {
47
+		 	} elseif( is_tax()) {
48 48
 		 		$tax_event = get_queried_object();
49 49
 		 		$output = str_replace('Page','<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a>',$output);
50 50
 		 		$output = str_replace($closing_div,'&nbsp;/&nbsp;'.apply_filters('the_title',$tax_event->name).$closing_div,$output);
51
-		 	}else{
51
+		 	} else{
52 52
 		 		$output = str_replace('Page',__('Events','lsx'),$output);
53 53
 		 	}		 	
54
-		 }elseif(function_exists('yoast_breadcrumb')){
54
+		 } elseif(function_exists('yoast_breadcrumb')){
55 55
 		 	$closing_div = '</div>';
56 56
 		 	$last_breadcrumb = '<span class="breadcrumb_last">'.__('Events','lsx').'</span>';
57 57
 		 	
58 58
 		 	if( is_single()) {
59 59
 		 		$single_event = get_queried_object();
60 60
 		 		$output = str_replace($closing_div,'<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a>&nbsp;/&nbsp;'.apply_filters('the_title',$single_event->post_title),$output);
61
-		 	}elseif( is_tax()) {
61
+		 	} elseif( is_tax()) {
62 62
 		 		$tax_event = get_queried_object();
63 63
 		 		$output = str_replace($last_breadcrumb,'<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a>&nbsp;/&nbsp;'.apply_filters('the_title',$tax_event->name),$output);
64 64
 		 		
65
-		 	}else{
65
+		 	} else{
66 66
 		 		$output = str_replace('Page',__('Events','lsx'),$output);
67 67
 		 	}		 	
68 68
 		 }		
Please login to merge, or discard this patch.
inc/customizer-colour-options.php 2 patches
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -1,66 +1,66 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) return; // Exit if accessed directly
3 3
 
4 4
 global $customizer_colour_names;
5 5
 global $customizer_colour_choices;
6 6
 
7
-$customizer_colour_names = apply_filters( 'lsx_customizer_colour_names', array(
8
-	'button_background_color'           => esc_html__( 'BUTTON: Background', 'lsx' ),
9
-	'button_background_hover_color'     => esc_html__( 'BUTTON: Background (hover)', 'lsx' ),
10
-	'button_text_color'                 => esc_html__( 'BUTTON: Text', 'lsx' ),
11
-	'button_text_color_hover'           => esc_html__( 'BUTTON: Text (hover)', 'lsx' ),
7
+$customizer_colour_names = apply_filters('lsx_customizer_colour_names', array(
8
+	'button_background_color'           => esc_html__('BUTTON: Background', 'lsx'),
9
+	'button_background_hover_color'     => esc_html__('BUTTON: Background (hover)', 'lsx'),
10
+	'button_text_color'                 => esc_html__('BUTTON: Text', 'lsx'),
11
+	'button_text_color_hover'           => esc_html__('BUTTON: Text (hover)', 'lsx'),
12 12
 
13
-	'button_cta_background_color'       => esc_html__( 'BUTTON CTA: Background', 'lsx' ),
14
-	'button_cta_background_hover_color' => esc_html__( 'BUTTON CTA: Background (hover)', 'lsx' ),
15
-	'button_cta_text_color'             => esc_html__( 'BUTTON CTA: Text', 'lsx' ),
16
-	'button_cta_text_color_hover'       => esc_html__( 'BUTTON CTA: Text (hover)', 'lsx' ),
13
+	'button_cta_background_color'       => esc_html__('BUTTON CTA: Background', 'lsx'),
14
+	'button_cta_background_hover_color' => esc_html__('BUTTON CTA: Background (hover)', 'lsx'),
15
+	'button_cta_text_color'             => esc_html__('BUTTON CTA: Text', 'lsx'),
16
+	'button_cta_text_color_hover'       => esc_html__('BUTTON CTA: Text (hover)', 'lsx'),
17 17
 
18
-	'top_menu_background_color'         => esc_html__( 'TOP MENU: Background', 'lsx' ),
19
-	'top_menu_text_color'               => esc_html__( 'TOP MENU: Text', 'lsx' ),
20
-	'top_menu_text_hover_color'         => esc_html__( 'TOP MENU: Text (hover)', 'lsx' ),
18
+	'top_menu_background_color'         => esc_html__('TOP MENU: Background', 'lsx'),
19
+	'top_menu_text_color'               => esc_html__('TOP MENU: Text', 'lsx'),
20
+	'top_menu_text_hover_color'         => esc_html__('TOP MENU: Text (hover)', 'lsx'),
21 21
 
22
-	'header_background_color'           => esc_html__( 'HEADER: Background', 'lsx' ),
23
-	'header_title_color'                => esc_html__( 'HEADER: Title', 'lsx' ),
24
-	'header_title_hover_color'          => esc_html__( 'HEADER: Title (hover)', 'lsx' ),
25
-	'header_description_color'          => esc_html__( 'HEADER: Description', 'lsx' ),
22
+	'header_background_color'           => esc_html__('HEADER: Background', 'lsx'),
23
+	'header_title_color'                => esc_html__('HEADER: Title', 'lsx'),
24
+	'header_title_hover_color'          => esc_html__('HEADER: Title (hover)', 'lsx'),
25
+	'header_description_color'          => esc_html__('HEADER: Description', 'lsx'),
26 26
 
27
-	'main_menu_background_hover1_color' => esc_html__( 'MENU: Background (L1 hover)', 'lsx' ),
28
-	'main_menu_background_hover2_color' => esc_html__( 'MENU: Background (L2 hover)', 'lsx' ),
29
-	'main_menu_text_color'              => esc_html__( 'MENU: Text (L1)', 'lsx' ),
30
-	'main_menu_text_hover1_color'       => esc_html__( 'MENU: Text (L1 hover)', 'lsx' ),
31
-	'main_menu_text_hover2_color'       => esc_html__( 'MENU: Text (L2 hover)', 'lsx' ),
27
+	'main_menu_background_hover1_color' => esc_html__('MENU: Background (L1 hover)', 'lsx'),
28
+	'main_menu_background_hover2_color' => esc_html__('MENU: Background (L2 hover)', 'lsx'),
29
+	'main_menu_text_color'              => esc_html__('MENU: Text (L1)', 'lsx'),
30
+	'main_menu_text_hover1_color'       => esc_html__('MENU: Text (L1 hover)', 'lsx'),
31
+	'main_menu_text_hover2_color'       => esc_html__('MENU: Text (L2 hover)', 'lsx'),
32 32
 
33
-	'banner_background_color'           => esc_html__( 'BANNER: Background', 'lsx' ),
34
-	'banner_text_color'                 => esc_html__( 'BANNER: Text', 'lsx' ),
35
-	'banner_text_image_color'           => esc_html__( 'BANNER: Text (over image)', 'lsx' ),
33
+	'banner_background_color'           => esc_html__('BANNER: Background', 'lsx'),
34
+	'banner_text_color'                 => esc_html__('BANNER: Text', 'lsx'),
35
+	'banner_text_image_color'           => esc_html__('BANNER: Text (over image)', 'lsx'),
36 36
 
37
-	'body_background_color'             => esc_html__( 'BODY: Background', 'lsx' ),
38
-	'body_line_color'                   => esc_html__( 'BODY: Line', 'lsx' ),
39
-	'body_text_heading_color'           => esc_html__( 'BODY: Text (heading)', 'lsx' ),
40
-	'body_text_color'                   => esc_html__( 'BODY: Text', 'lsx' ),
41
-	'body_link_color'                   => esc_html__( 'BODY: Link', 'lsx' ),
42
-	'body_link_hover_color'             => esc_html__( 'BODY: Link (hover)', 'lsx' ),
37
+	'body_background_color'             => esc_html__('BODY: Background', 'lsx'),
38
+	'body_line_color'                   => esc_html__('BODY: Line', 'lsx'),
39
+	'body_text_heading_color'           => esc_html__('BODY: Text (heading)', 'lsx'),
40
+	'body_text_color'                   => esc_html__('BODY: Text', 'lsx'),
41
+	'body_link_color'                   => esc_html__('BODY: Link', 'lsx'),
42
+	'body_link_hover_color'             => esc_html__('BODY: Link (hover)', 'lsx'),
43 43
 
44
-	'footer_cta_background_color'       => esc_html__( 'FOOTER CTA: Background', 'lsx' ),
45
-	'footer_cta_text_color'             => esc_html__( 'FOOTER CTA: Text', 'lsx' ),
46
-	'footer_cta_link_color'             => esc_html__( 'FOOTER CTA: Link', 'lsx' ),
47
-	'footer_cta_link_hover_color'       => esc_html__( 'FOOTER CTA: Link (hover)', 'lsx' ),
44
+	'footer_cta_background_color'       => esc_html__('FOOTER CTA: Background', 'lsx'),
45
+	'footer_cta_text_color'             => esc_html__('FOOTER CTA: Text', 'lsx'),
46
+	'footer_cta_link_color'             => esc_html__('FOOTER CTA: Link', 'lsx'),
47
+	'footer_cta_link_hover_color'       => esc_html__('FOOTER CTA: Link (hover)', 'lsx'),
48 48
 
49
-	'footer_widgets_background_color'   => esc_html__( 'FOOTER WIDGETS: Background', 'lsx' ),
50
-	'footer_widgets_text_color'         => esc_html__( 'FOOTER WIDGETS: Text', 'lsx' ),
51
-	'footer_widgets_link_color'         => esc_html__( 'FOOTER WIDGETS: Link', 'lsx' ),
52
-	'footer_widgets_link_hover_color'   => esc_html__( 'FOOTER WIDGETS: Link (hover)', 'lsx' ),
49
+	'footer_widgets_background_color'   => esc_html__('FOOTER WIDGETS: Background', 'lsx'),
50
+	'footer_widgets_text_color'         => esc_html__('FOOTER WIDGETS: Text', 'lsx'),
51
+	'footer_widgets_link_color'         => esc_html__('FOOTER WIDGETS: Link', 'lsx'),
52
+	'footer_widgets_link_hover_color'   => esc_html__('FOOTER WIDGETS: Link (hover)', 'lsx'),
53 53
 
54
-	'footer_background_color'           => esc_html__( 'FOOTER: Background', 'lsx' ),
55
-	'footer_text_color'                 => esc_html__( 'FOOTER: Text', 'lsx' ),
56
-	'footer_link_color'                 => esc_html__( 'FOOTER: Link', 'lsx' ),
57
-	'footer_link_hover_color'           => esc_html__( 'FOOTER: Link (hover)', 'lsx' )
58
-) );
54
+	'footer_background_color'           => esc_html__('FOOTER: Background', 'lsx'),
55
+	'footer_text_color'                 => esc_html__('FOOTER: Text', 'lsx'),
56
+	'footer_link_color'                 => esc_html__('FOOTER: Link', 'lsx'),
57
+	'footer_link_hover_color'           => esc_html__('FOOTER: Link (hover)', 'lsx')
58
+));
59 59
 
60
-$customizer_colour_choices = apply_filters( 'lsx_customizer_colour_choices', array(
60
+$customizer_colour_choices = apply_filters('lsx_customizer_colour_choices', array(
61 61
 	'default' => array(
62
-		'label'  => __( 'Default', 'lsx' ),
63
-		'colors' => apply_filters( 'lsx_customizer_colour_choices_default', array(
62
+		'label'  => __('Default', 'lsx'),
63
+		'colors' => apply_filters('lsx_customizer_colour_choices_default', array(
64 64
 			// Button
65 65
 			'#428bca', '#2a6496', '#ffffff', '#ffffff',
66 66
 			// Button CTA
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
 			'#333333', '#eeeeee', '#dddddd', '#cccccc',
82 82
 			// Footer
83 83
 			'#232222', '#ffffff', '#337ab7', '#969696'
84
-		) )
84
+		))
85 85
 	),
86 86
 	'red' => array(
87
-		'label'  => __( 'Red', 'lsx' ),
88
-		'colors' => apply_filters( 'lsx_customizer_colour_choices_red', array(
87
+		'label'  => __('Red', 'lsx'),
88
+		'colors' => apply_filters('lsx_customizer_colour_choices_red', array(
89 89
 			// Button
90 90
 			'#b64d3f', '#87291c', '#ffffff', '#ffffff',
91 91
 			// Button CTA
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
 			'#333333', '#eeeeee', '#dddddd', '#cccccc',
107 107
 			// Footer
108 108
 			'#232222', '#ffffff', '#b64d3f', '#969696'
109
-		) )
109
+		))
110 110
 	),
111 111
 	'orange' => array(
112
-		'label'  => __( 'Orange', 'lsx' ),
113
-		'colors' => apply_filters( 'lsx_customizer_colour_choices_orange', array(
112
+		'label'  => __('Orange', 'lsx'),
113
+		'colors' => apply_filters('lsx_customizer_colour_choices_orange', array(
114 114
 			// Button
115 115
 			'#fbaf3f', '#e49435', '#260e03', '#260e03',
116 116
 			// Button CTA
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
 			'#333333', '#eeeeee', '#dddddd', '#cccccc',
132 132
 			// Footer
133 133
 			'#232222', '#ffffff', '#e4701e', '#969696'
134
-		) )
134
+		))
135 135
 	),
136 136
 	'green' => array(
137
-		'label'  => __( 'Green', 'lsx' ),
138
-		'colors' => apply_filters( 'lsx_customizer_colour_choices_green', array(
137
+		'label'  => __('Green', 'lsx'),
138
+		'colors' => apply_filters('lsx_customizer_colour_choices_green', array(
139 139
 			// Button
140 140
 			'#596b46', '#3d4a30', '#ffffff', '#ffffff',
141 141
 			// Button CTA
@@ -156,11 +156,11 @@  discard block
 block discarded – undo
156 156
 			'#333333', '#eeeeee', '#dddddd', '#cccccc',
157 157
 			// Footer
158 158
 			'#232222', '#ffffff', '#596b46', '#969696'
159
-		) )
159
+		))
160 160
 	),
161 161
 	'brown' => array(
162
-		'label'  => __( 'Brown', 'lsx' ),
163
-		'colors' => apply_filters( 'lsx_customizer_colour_choices_brown', array(
162
+		'label'  => __('Brown', 'lsx'),
163
+		'colors' => apply_filters('lsx_customizer_colour_choices_brown', array(
164 164
 			// Button
165 165
 			'#8c6a45', '#5b452e', '#ffffff', '#ffffff',
166 166
 			// Button CTA
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
 			'#333333', '#eeeeee', '#dddddd', '#cccccc',
182 182
 			// Footer
183 183
 			'#232222', '#ffffff', '#8c6a45', '#969696'
184
-		) )
184
+		))
185 185
 	)
186
-) );
186
+));
187 187
 
188 188
 ?>
189 189
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined( 'ABSPATH' ) ) {
3
+	return;
4
+}
5
+// Exit if accessed directly
3 6
 
4 7
 global $customizer_colour_names;
5 8
 global $customizer_colour_choices;
Please login to merge, or discard this patch.
inc/customizer-layout.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) return; // Exit if accessed directly
3 3
 
4 4
 /**
5 5
  * Customize Swatch Control Class
6 6
  *
7 7
  * @since 1.0.0
8 8
  */
9
-if( !class_exists( 'WP_Customize_Control' ) ){
9
+if ( ! class_exists('WP_Customize_Control')) {
10 10
 	return;
11 11
 }
12 12
 class LSX_Customize_Layout_Control extends WP_Customize_Control {
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 	 * @param string $id
39 39
 	 * @param array $args
40 40
 	 */
41
-	public function __construct( $manager, $id, $args = array() ) {
42
-		parent::__construct( $manager, $id, $args );
43
-		if( !empty( $args['choices'] ) ){
41
+	public function __construct($manager, $id, $args = array()) {
42
+		parent::__construct($manager, $id, $args);
43
+		if ( ! empty($args['choices'])) {
44 44
 			$this->layouts = $args['choices'];
45 45
 		}
46 46
 	}
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	public function enqueue() {
54 54
 		// 
55
-		wp_enqueue_script( 'lsx-layout-control', get_template_directory_uri() .'/js/customizer-layout.js', array('jquery'), null, true );
55
+		wp_enqueue_script('lsx-layout-control', get_template_directory_uri() . '/js/customizer-layout.js', array('jquery'), null, true);
56 56
 	}
57 57
 
58 58
 	/**
@@ -62,26 +62,26 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function render_content() {
64 64
 		
65
-		$post_id    = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) );
65
+		$post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id));
66 66
 		$class = 'customize-control customize-control-' . $this->type;
67 67
 		$value = $this->value();
68 68
 
69 69
 		?>
70 70
 		<label>
71
-			<?php if ( ! empty( $this->label ) ) { ?>
72
-				<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
71
+			<?php if ( ! empty($this->label)) { ?>
72
+				<span class="customize-control-title"><?php echo esc_html($this->label); ?></span>
73 73
 			<?php }
74
-			if ( ! empty( $this->description ) ) { ?>
74
+			if ( ! empty($this->description)) { ?>
75 75
 				<span class="description customize-control-description"><?php echo $this->description; ?></span>
76 76
 			<?php } ?>
77 77
 			<div class="layouts-selector">
78 78
 			<?php
79
-			foreach( $this->layouts as $layout ){
79
+			foreach ($this->layouts as $layout) {
80 80
 				$sel = 'border: 1px solid transparent;';
81
-				if( $value == $layout ){
81
+				if ($value == $layout) {
82 82
 					$sel = 'border: 1px solid rgb(43, 166, 203);';
83 83
 				}
84
-				echo '<img class="layout-button" style="padding:2px;'. $sel .'" src="' . get_template_directory_uri() .'/img/' . $layout . '.png" data-option="' . $layout . '">';
84
+				echo '<img class="layout-button" style="padding:2px;' . $sel . '" src="' . get_template_directory_uri() . '/img/' . $layout . '.png" data-option="' . $layout . '">';
85 85
 			}
86 86
 
87 87
 			?>
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined( 'ABSPATH' ) ) {
3
+	return;
4
+}
5
+// Exit if accessed directly
3 6
 
4 7
 /**
5 8
  * Customize Swatch Control Class
Please login to merge, or discard this patch.