Passed
Push — master ( 5b437b...27e90f )
by Chris
03:53
created
classes/class-lsx-customizer-colour-button.php 1 patch
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -1,105 +1,105 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if ( ! class_exists( 'LSX_Customizer_Colour_Button' ) ) {
3 3
 
4
-	/**
5
-	 * LSX Customizer Colour Button Class
6
-	 *
7
-	 * @package   LSX Customizer
8
-	 * @author    LightSpeed
9
-	 * @license   GPL3
10
-	 * @link
11
-	 * @copyright 2016 LightSpeed
12
-	 */
13
-	class LSX_Customizer_Colour_Button extends LSX_Customizer_Colour {
14
-
15
-		/**
16
-		 * Constructor.
17
-		 *
18
-		 * @since 1.0.0
19
-		 */
20
-		public function __construct() {
21
-			add_action( 'after_switch_theme',   array( $this, 'set_theme_mod' ) );
22
-			add_action( 'customize_save_after', array( $this, 'set_theme_mod' ) );
23
-
24
-			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ), 2999 );
25
-		}
26
-
27
-		/**
28
-		 * Assign CSS to theme mod.
29
-		 *
30
-		 * @since 1.0.0
31
-		 */
32
-		public function set_theme_mod() {
33
-			$theme_mods = $this->get_theme_mods();
34
-			$styles     = $this->get_css( $theme_mods );
35
-
36
-			set_theme_mod( 'lsx_customizer_colour__button_theme_mod', $styles );
37
-		}
38
-
39
-		/**
40
-		 * Enqueues front-end CSS.
41
-		 *
42
-		 * @since 1.0.0
43
-		 */
44
-		public function enqueue_css() {
45
-			$styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__button_theme_mod' );
46
-
47
-			if ( is_customize_preview() || false === $styles_from_theme_mod ) {
48
-				$theme_mods = $this->get_theme_mods();
49
-				$styles     = $this->get_css( $theme_mods );
50
-
51
-				if ( false === $styles_from_theme_mod ) {
52
-					set_theme_mod( 'lsx_customizer_colour__button_theme_mod', $styles );
53
-				}
54
-			} else {
55
-				$styles = $styles_from_theme_mod;
56
-			}
57
-
58
-			wp_add_inline_style( 'lsx-customizer', $styles );
59
-		}
60
-
61
-		/**
62
-		 * Get CSS theme mods.
63
-		 *
64
-		 * @since 1.0.0
65
-		 */
66
-		public function get_theme_mods() {
67
-			$colors = parent::get_color_scheme();
68
-
69
-			return apply_filters( 'lsx_customizer_colours_button', array(
70
-				'button_background_color'       => get_theme_mod( 'button_background_color',       $colors['button_background_color'] ),
71
-				'button_background_hover_color' => get_theme_mod( 'button_background_hover_color', $colors['button_background_hover_color'] ),
72
-				'button_text_color'             => get_theme_mod( 'button_text_color',             $colors['button_text_color'] ),
73
-				'button_text_color_hover'       => get_theme_mod( 'button_text_color_hover',       $colors['button_text_color_hover'] ),
74
-				'button_shadow'                 => get_theme_mod( 'button_shadow',                 $colors['button_shadow'] ),
75
-			) );
76
-		}
77
-
78
-		/**
79
-		 * Returns CSS.
80
-		 *
81
-		 * @since 1.0.0
82
-		 */
83
-		function get_css( $colors ) {
84
-			global $customizer_colour_names;
85
-
86
-			$colors_template = array();
87
-
88
-			foreach ( $customizer_colour_names as $key => $value ) {
89
-				$colors_template[ $key ] = '';
90
-			}
91
-
92
-			$colors = wp_parse_args( $colors, $colors_template );
93
-
94
-			if ( empty( $colors['button_text_color'] )
95
-				|| empty( $colors['button_text_color_hover'] )
96
-				|| empty( $colors['button_background_color'] )
97
-				|| empty( $colors['button_background_hover_color'] )
98
-				|| empty( $colors['button_shadow'] ) ) {
99
-				return '';
100
-			}
101
-
102
-			$css = '
4
+     /**
5
+      * LSX Customizer Colour Button Class
6
+      *
7
+      * @package   LSX Customizer
8
+      * @author    LightSpeed
9
+      * @license   GPL3
10
+      * @link
11
+      * @copyright 2016 LightSpeed
12
+      */
13
+     class LSX_Customizer_Colour_Button extends LSX_Customizer_Colour {
14
+
15
+          /**
16
+           * Constructor.
17
+           *
18
+           * @since 1.0.0
19
+           */
20
+          public function __construct() {
21
+               add_action( 'after_switch_theme',   array( $this, 'set_theme_mod' ) );
22
+               add_action( 'customize_save_after', array( $this, 'set_theme_mod' ) );
23
+
24
+               add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ), 2999 );
25
+          }
26
+
27
+          /**
28
+           * Assign CSS to theme mod.
29
+           *
30
+           * @since 1.0.0
31
+           */
32
+          public function set_theme_mod() {
33
+               $theme_mods = $this->get_theme_mods();
34
+               $styles     = $this->get_css( $theme_mods );
35
+
36
+               set_theme_mod( 'lsx_customizer_colour__button_theme_mod', $styles );
37
+          }
38
+
39
+          /**
40
+           * Enqueues front-end CSS.
41
+           *
42
+           * @since 1.0.0
43
+           */
44
+          public function enqueue_css() {
45
+               $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__button_theme_mod' );
46
+
47
+               if ( is_customize_preview() || false === $styles_from_theme_mod ) {
48
+                    $theme_mods = $this->get_theme_mods();
49
+                    $styles     = $this->get_css( $theme_mods );
50
+
51
+                    if ( false === $styles_from_theme_mod ) {
52
+                         set_theme_mod( 'lsx_customizer_colour__button_theme_mod', $styles );
53
+                    }
54
+               } else {
55
+                    $styles = $styles_from_theme_mod;
56
+               }
57
+
58
+               wp_add_inline_style( 'lsx-customizer', $styles );
59
+          }
60
+
61
+          /**
62
+           * Get CSS theme mods.
63
+           *
64
+           * @since 1.0.0
65
+           */
66
+          public function get_theme_mods() {
67
+               $colors = parent::get_color_scheme();
68
+
69
+               return apply_filters( 'lsx_customizer_colours_button', array(
70
+                    'button_background_color'       => get_theme_mod( 'button_background_color',       $colors['button_background_color'] ),
71
+                    'button_background_hover_color' => get_theme_mod( 'button_background_hover_color', $colors['button_background_hover_color'] ),
72
+                    'button_text_color'             => get_theme_mod( 'button_text_color',             $colors['button_text_color'] ),
73
+                    'button_text_color_hover'       => get_theme_mod( 'button_text_color_hover',       $colors['button_text_color_hover'] ),
74
+                    'button_shadow'                 => get_theme_mod( 'button_shadow',                 $colors['button_shadow'] ),
75
+               ) );
76
+          }
77
+
78
+          /**
79
+           * Returns CSS.
80
+           *
81
+           * @since 1.0.0
82
+           */
83
+          function get_css( $colors ) {
84
+               global $customizer_colour_names;
85
+
86
+               $colors_template = array();
87
+
88
+               foreach ( $customizer_colour_names as $key => $value ) {
89
+                    $colors_template[ $key ] = '';
90
+               }
91
+
92
+               $colors = wp_parse_args( $colors, $colors_template );
93
+
94
+               if ( empty( $colors['button_text_color'] )
95
+                    || empty( $colors['button_text_color_hover'] )
96
+                    || empty( $colors['button_background_color'] )
97
+                    || empty( $colors['button_background_hover_color'] )
98
+                    || empty( $colors['button_shadow'] ) ) {
99
+                    return '';
100
+               }
101
+
102
+               $css = '
103 103
 				@import "' . get_template_directory() . '/assets/css/scss/global/mixins/button";
104 104
 
105 105
 				/**
@@ -114,12 +114,12 @@  discard block
 block discarded – undo
114 114
 				);
115 115
 			';
116 116
 
117
-			$css = apply_filters( 'lsx_customizer_colour_selectors_button', $css, $colors );
118
-			$css = parent::scss_to_css( $css );
117
+               $css = apply_filters( 'lsx_customizer_colour_selectors_button', $css, $colors );
118
+               $css = parent::scss_to_css( $css );
119 119
 
120
-			return $css;
121
-		}
120
+               return $css;
121
+          }
122 122
 
123
-	}
123
+     }
124 124
 
125 125
 }
Please login to merge, or discard this patch.
classes/class-lsx-customizer-colour.php 1 patch
Indentation   +483 added lines, -483 removed lines patch added patch discarded remove patch
@@ -1,411 +1,411 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if ( ! class_exists( 'LSX_Customizer_Colour' ) ) {
3 3
 
4
-	/**
5
-	 * LSX Customizer Colour Class
6
-	 *
7
-	 * @package   LSX Customizer
8
-	 * @author    LightSpeed
9
-	 * @license   GPL3
10
-	 * @link
11
-	 * @copyright 2016 LightSpeed
12
-	 */
13
-	class LSX_Customizer_Colour extends LSX_Customizer {
14
-
15
-		/**
16
-		 * Button customizer instance.
17
-		 *
18
-		 * @var string
19
-		 * @since 1.0.0
20
-		 */
21
-		public $button;
22
-
23
-		/**
24
-		 * Button CTA customizer instance.
25
-		 *
26
-		 * @var string
27
-		 * @since 1.0.0
28
-		 */
29
-		public $button_cta;
30
-
31
-		/**
32
-		 * Button secondary customizer instance.
33
-		 *
34
-		 * @var string
35
-		 * @since 1.1.0
36
-		 */
37
-		public $button_secondary;
38
-
39
-		/**
40
-		 * Button tertiary customizer instance.
41
-		 *
42
-		 * @var string
43
-		 * @since 1.1.0
44
-		 */
45
-		public $button_tertiary;
46
-
47
-		/**
48
-		 * Top Menu customizer instance.
49
-		 *
50
-		 * @var string
51
-		 * @since 1.0.0
52
-		 */
53
-		public $top_menu;
54
-
55
-		/**
56
-		 * Header customizer instance.
57
-		 *
58
-		 * @var string
59
-		 * @since 1.0.0
60
-		 */
61
-		public $header;
62
-
63
-		/**
64
-		 * Main menu customizer instance.
65
-		 *
66
-		 * @var string
67
-		 * @since 1.0.0
68
-		 */
69
-		public $main_menu;
70
-
71
-		/**
72
-		 * Banner customizer instance.
73
-		 *
74
-		 * @var string
75
-		 * @since 1.0.0
76
-		 */
77
-		public $banner;
78
-
79
-		/**
80
-		 * Body customizer instance.
81
-		 *
82
-		 * @var string
83
-		 * @since 1.0.0
84
-		 */
85
-		public $body;
86
-
87
-		/**
88
-		 * Footer CTA customizer instance.
89
-		 *
90
-		 * @var string
91
-		 * @since 1.0.0
92
-		 */
93
-		public $footer_cta;
94
-
95
-		/**
96
-		 * Footer Widgets customizer instance.
97
-		 *
98
-		 * @var string
99
-		 * @since 1.0.0
100
-		 */
101
-		public $footer_widgets;
102
-
103
-		/**
104
-		 * Footer customizer instance.
105
-		 *
106
-		 * @var string
107
-		 * @since 1.0.0
108
-		 */
109
-		public $footer;
110
-
111
-		/**
112
-		 * Constructor.
113
-		 *
114
-		 * @since 1.0.0
115
-		 */
116
-		public function __construct() {
117
-			add_action( 'after_setup_theme',                       array( $this, 'after_setup_theme' ), 20 );
118
-			add_action( 'customize_register',                      array( $this, 'customize_register' ), 20 );
119
-			add_action( 'customize_controls_print_footer_scripts', array( $this, 'colour_scheme_css_template' ) );
120
-		}
121
-
122
-		/**
123
-		 * Customizer Controls and Settings.
124
-		 *
125
-		 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
126
-		 * @since 1.0.0
127
-		 */
128
-		public function after_setup_theme() {
129
-			require_once( LSX_CUSTOMIZER_PATH . 'includes/lsx-customizer-colour-options.php' );
130
-			require_once( LSX_CUSTOMIZER_PATH . 'includes/lsx-customizer-colour-deprecated.php' );
131
-			require_once( LSX_CUSTOMIZER_PATH . 'includes/lsx-customizer-templates.php' );
132
-
133
-			if ( class_exists( 'WP_Customize_Control' ) ) {
134
-				require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-control.php' );
135
-			}
136
-
137
-			require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button.php' );
138
-			$this->button = new LSX_Customizer_Colour_Button;
139
-
140
-			require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-cta.php' );
141
-			$this->button_cta = new LSX_Customizer_Colour_Button_CTA;
142
-
143
-			require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-secondary.php' );
144
-			$this->button_secondary = new LSX_Customizer_Colour_Button_Secondary;
145
-
146
-			require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-tertiary.php' );
147
-			$this->button_tertiary = new LSX_Customizer_Colour_Button_Tertiary;
148
-
149
-			require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-top-menu.php' );
150
-			$this->top_menu = new LSX_Customizer_Colour_Top_Menu;
151
-
152
-			require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-header.php' );
153
-			$this->header = new LSX_Customizer_Colour_Header;
154
-
155
-			require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-main-menu.php' );
156
-			$this->main_menu = new LSX_Customizer_Colour_Main_Menu;
157
-
158
-			require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-banner.php' );
159
-			$this->banner = new LSX_Customizer_Colour_Banner;
160
-
161
-			require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-body.php' );
162
-			$this->body = new LSX_Customizer_Colour_Body;
163
-
164
-			require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer-cta.php' );
165
-			$this->footer_cta = new LSX_Customizer_Colour_Footer_CTA;
166
-
167
-			require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer-widgets.php' );
168
-			$this->footer_widgets = new LSX_Customizer_Colour_Footer_Widgets;
169
-
170
-			require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer.php' );
171
-			$this->footer = new LSX_Customizer_Colour_Footer;
172
-		}
173
-
174
-		/**
175
-		 * Customizer Controls and Settings.
176
-		 *
177
-		 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
178
-		 * @since 1.0.0
179
-		 */
180
-		public function customize_register( $wp_customize ) {
181
-			global $customizer_colour_names;
182
-			global $customizer_colour_choices;
183
-
184
-			/**
185
-			 * Colors
186
-			 */
187
-			$wp_customize->add_panel( 'colors' , array(
188
-				'title'             => esc_html__( 'Colors', 'lsx-customizer' ),
189
-				'priority'          => 60,
190
-			) );
191
-
192
-			/**
193
-			 * Colors - Sections
194
-			 */
195
-			$wp_customize->add_section( 'colors-core' , array(
196
-				'title'             => esc_html__( 'Color Scheme', 'lsx-customizer' ),
197
-				'priority'          => 1,
198
-				'panel'             => 'colors',
199
-			) );
200
-
201
-			$wp_customize->add_section( 'colors-palette' , array(
202
-				'title'             => esc_html__( 'Block Editor Color Palette', 'lsx-customizer' ),
203
-				'description' => esc_html__( 'Add colors to use within the Gutenberg editor color palette.', 'lsx-customizer' ),
204
-				'priority'          => 2,
205
-				'panel'             => 'colors',
206
-			) );
207
-
208
-			$wp_customize->add_section( 'colors-button' , array(
209
-				'title'             => esc_html__( 'Button', 'lsx-customizer' ),
210
-				'priority'          => 3,
211
-				'panel'             => 'colors',
212
-			) );
213
-
214
-			$wp_customize->add_section( 'colors-button-cta' , array(
215
-				'title'             => esc_html__( 'Button CTA', 'lsx-customizer' ),
216
-				'priority'          => 4,
217
-				'panel'             => 'colors',
218
-			) );
219
-
220
-			$wp_customize->add_section( 'colors-button-secondary' , array(
221
-				'title'             => esc_html__( 'Button Secondary', 'lsx-customizer' ),
222
-				'priority'          => 5,
223
-				'panel'             => 'colors',
224
-			) );
225
-
226
-			$wp_customize->add_section( 'colors-button-tertiary' , array(
227
-				'title'             => esc_html__( 'Button Tertiary', 'lsx-customizer' ),
228
-				'priority'          => 6,
229
-				'panel'             => 'colors',
230
-			) );
231
-
232
-			$wp_customize->add_section( 'colors-top-menu' , array(
233
-				'title'             => esc_html__( 'Top Menu', 'lsx-customizer' ),
234
-				'priority'          => 7,
235
-				'panel'             => 'colors',
236
-			) );
237
-
238
-			$wp_customize->add_section( 'colors-header' , array(
239
-				'title'             => esc_html__( 'Header', 'lsx-customizer' ),
240
-				'priority'          => 8,
241
-				'panel'             => 'colors',
242
-			) );
243
-
244
-			$wp_customize->add_section( 'colors-main-menu' , array(
245
-				'title'             => esc_html__( 'Main Menu', 'lsx-customizer' ),
246
-				'priority'          => 9,
247
-				'panel'             => 'colors',
248
-			) );
249
-
250
-			$wp_customize->add_section( 'colors-banner' , array(
251
-				'title'             => esc_html__( 'Banner', 'lsx-customizer' ),
252
-				'priority'          => 10,
253
-				'panel'             => 'colors',
254
-			) );
255
-
256
-			$wp_customize->add_section( 'colors-body' , array(
257
-				'title'             => esc_html__( 'Body', 'lsx-customizer' ),
258
-				'priority'          => 11,
259
-				'panel'             => 'colors',
260
-			) );
261
-
262
-			$wp_customize->add_section( 'colors-footer-cta' , array(
263
-				'title'             => esc_html__( 'Footer CTA', 'lsx-customizer' ),
264
-				'priority'          => 12,
265
-				'panel'             => 'colors',
266
-			) );
267
-
268
-			$wp_customize->add_section( 'colors-footer-widgets' , array(
269
-				'title'             => esc_html__( 'Footer Widgets', 'lsx-customizer' ),
270
-				'priority'          => 13,
271
-				'panel'             => 'colors',
272
-			) );
273
-
274
-			$wp_customize->add_section( 'colors-footer' , array(
275
-				'title'             => esc_html__( 'Footer', 'lsx-customizer' ),
276
-				'priority'          => 14,
277
-				'panel'             => 'colors',
278
-			) );
279
-
280
-			/**
281
-			 * Color Scheme
282
-			 */
283
-			$wp_customize->add_setting( 'color_scheme', array(
284
-				'default'           => 'default',
285
-				'type'	            => 'theme_mod',
286
-				'transport'         => 'postMessage',
287
-			) );
288
-
289
-			$wp_customize->add_control( new LSX_Customizer_Colour_Control(
290
-				$wp_customize, 'color_scheme', array(
291
-				'label'             => esc_html__( 'Base Color Scheme', 'lsx-customizer' ),
292
-				'section'           => 'colors-core',
293
-				'type'              => 'select',
294
-				'priority'          => 1,
295
-				'choices'           => $customizer_colour_choices,
296
-				)
297
-			) );
298
-
299
-			/**
300
-			 * Color Palette
301
-			 */
302
-			$colors = $this->get_color_scheme();
303
-
304
-			$customizer_colour_defaults = array(
305
-				__( 'Primary', 'lsx-customizer' )        => get_theme_mod( 'button_background_color', $colors['button_background_color'] ),
306
-				__( 'Strong Primary', 'lsx-button_shadow' ) => get_theme_mod( 'button_shadow', $colors['body_link_color'] ),
307
-				__( 'Call To Action', 'lsx-customizer' ) => get_theme_mod( 'button_cta_background_color', $colors['button_cta_background_color'] ),
308
-				__( 'Strong CTA', 'lsx-button_shadow' )  => get_theme_mod( 'button_cta_shadow', $colors['button_cta_shadow'] ),
309
-				__( 'Secondary', 'lsx-customizer' )      => get_theme_mod( 'button_secondary_background_color', $colors['button_secondary_background_color'] ),
310
-				__( 'Strong Secondary', 'lsx-button_shadow' ) => get_theme_mod( 'button_secondary_shadow', $colors['button_secondary_shadow'] ),
311
-				__( 'Tertiary', 'lsx-customizer' )       => get_theme_mod( 'button_tertiary_background_color', $colors['button_tertiary_background_color'] ),
312
-				__( 'Strong Tertiary', 'lsx-button_shadow' ) => get_theme_mod( 'button_tertiary_shadow', $colors['button_tertiary_shadow'] ),
313
-				__( 'Heading Color', 'lsx-customizer' )  => get_theme_mod( 'body_text_heading_color', $colors['body_text_heading_color'] ),
314
-				__( 'Body Text color', 'lsx-button_shadow' ) => get_theme_mod( 'body_text_color', $colors['body_text_color'] ),
315
-				__( 'White', 'lsx-button_shadow' )       => '#ffffff',
316
-				__( 'Black', 'lsx-button_shadow' )       => '#000000',
317
-			);
318
-			foreach ( $customizer_colour_defaults as $key => $value ) {
319
-
320
-				$color_name = strtolower( str_replace( ' ', '_', $key ) );
321
-				$color_name = $color_name . '_color';
322
-
323
-				$wp_customize->add_setting( $color_name, array(
324
-					'default'           => $value,
325
-					'type'              => 'theme_mod',
326
-					'transport'         => 'postMessage',
327
-					'sanitize_callback' => 'sanitize_hex_color',
328
-				) );
329
-				$wp_customize->add_control(
330
-					new WP_Customize_Color_Control(
331
-						$wp_customize,
332
-						$color_name,
333
-						array(
334
-							'label'    => $key,
335
-							'section'  => 'colors-palette',
336
-							'settings' => $color_name,
337
-						)
338
-					)
339
-				);
340
-			}
341
-
342
-			/**
343
-			 * Colors
344
-			 */
345
-			foreach ( $customizer_colour_names as $key => $value ) {
346
-				$sanitize_callback = 'sanitize_hex_color';
347
-
348
-				if ( 'background_color' === $key ) {
349
-					$sanitize_callback = 'sanitize_hex_color_no_hash';
350
-				}
351
-
352
-				$section = 'colors-core';
353
-
354
-				if ( preg_match( '/^button_cta_.*/', $key ) ) {
355
-					$section = 'colors-button-cta';
356
-				} elseif ( preg_match( '/^button_secondary_.*/', $key ) ) {
357
-					$section = 'colors-button-secondary';
358
-				} elseif ( preg_match( '/^button_tertiary_.*/', $key ) ) {
359
-					$section = 'colors-button-tertiary';
360
-				} elseif ( preg_match( '/^button_.*/', $key ) ) {
361
-					$section = 'colors-button';
362
-				} elseif ( preg_match( '/^top_menu_.*/', $key ) ) {
363
-					$section = 'colors-top-menu';
364
-				} elseif ( preg_match( '/^header_.*/', $key ) ) {
365
-					$section = 'colors-header';
366
-				} elseif ( preg_match( '/^main_menu_.*/', $key ) ) {
367
-					$section = 'colors-main-menu';
368
-				} elseif ( preg_match( '/^banner_.*/', $key ) ) {
369
-					$section = 'colors-banner';
370
-				} elseif ( preg_match( '/^body_.*/', $key ) || 'background_color' === $key ) {
371
-					$section = 'colors-body';
372
-				} elseif ( preg_match( '/^footer_cta_.*/', $key ) ) {
373
-					$section = 'colors-footer-cta';
374
-				} elseif ( preg_match( '/^footer_widgets_.*/', $key ) ) {
375
-					$section = 'colors-footer-widgets';
376
-				} elseif ( preg_match( '/^footer_.*/', $key ) ) {
377
-					$section = 'colors-footer';
378
-				}
379
-
380
-				$wp_customize->add_setting( $key, array(
381
-					'default'           => $customizer_colour_choices['default']['colors'][ $key ],
382
-					'type'	            => 'theme_mod',
383
-					'transport'         => 'postMessage',
384
-					'sanitize_callback' => $sanitize_callback,
385
-				) );
386
-
387
-				$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, $key, array(
388
-					'label'             => $value,
389
-					'section'           => $section,
390
-					'settings'          => $key,
391
-				) ) );
392
-			}
393
-		}
394
-
395
-		/**
396
-		 * Outputs an Underscore template for generating CSS for the color scheme.
397
-		 *
398
-		 * @since 1.0.0
399
-		 */
400
-		public function colour_scheme_css_template() {
401
-			global $customizer_colour_names;
402
-
403
-			$colors = array();
404
-
405
-			foreach ( $customizer_colour_names as $key => $value ) {
406
-				$colors[ $key ] = 'unquote("{{ data.' . $key . ' }}")';
407
-			}
408
-			?>
4
+     /**
5
+      * LSX Customizer Colour Class
6
+      *
7
+      * @package   LSX Customizer
8
+      * @author    LightSpeed
9
+      * @license   GPL3
10
+      * @link
11
+      * @copyright 2016 LightSpeed
12
+      */
13
+     class LSX_Customizer_Colour extends LSX_Customizer {
14
+
15
+          /**
16
+           * Button customizer instance.
17
+           *
18
+           * @var string
19
+           * @since 1.0.0
20
+           */
21
+          public $button;
22
+
23
+          /**
24
+           * Button CTA customizer instance.
25
+           *
26
+           * @var string
27
+           * @since 1.0.0
28
+           */
29
+          public $button_cta;
30
+
31
+          /**
32
+           * Button secondary customizer instance.
33
+           *
34
+           * @var string
35
+           * @since 1.1.0
36
+           */
37
+          public $button_secondary;
38
+
39
+          /**
40
+           * Button tertiary customizer instance.
41
+           *
42
+           * @var string
43
+           * @since 1.1.0
44
+           */
45
+          public $button_tertiary;
46
+
47
+          /**
48
+           * Top Menu customizer instance.
49
+           *
50
+           * @var string
51
+           * @since 1.0.0
52
+           */
53
+          public $top_menu;
54
+
55
+          /**
56
+           * Header customizer instance.
57
+           *
58
+           * @var string
59
+           * @since 1.0.0
60
+           */
61
+          public $header;
62
+
63
+          /**
64
+           * Main menu customizer instance.
65
+           *
66
+           * @var string
67
+           * @since 1.0.0
68
+           */
69
+          public $main_menu;
70
+
71
+          /**
72
+           * Banner customizer instance.
73
+           *
74
+           * @var string
75
+           * @since 1.0.0
76
+           */
77
+          public $banner;
78
+
79
+          /**
80
+           * Body customizer instance.
81
+           *
82
+           * @var string
83
+           * @since 1.0.0
84
+           */
85
+          public $body;
86
+
87
+          /**
88
+           * Footer CTA customizer instance.
89
+           *
90
+           * @var string
91
+           * @since 1.0.0
92
+           */
93
+          public $footer_cta;
94
+
95
+          /**
96
+           * Footer Widgets customizer instance.
97
+           *
98
+           * @var string
99
+           * @since 1.0.0
100
+           */
101
+          public $footer_widgets;
102
+
103
+          /**
104
+           * Footer customizer instance.
105
+           *
106
+           * @var string
107
+           * @since 1.0.0
108
+           */
109
+          public $footer;
110
+
111
+          /**
112
+           * Constructor.
113
+           *
114
+           * @since 1.0.0
115
+           */
116
+          public function __construct() {
117
+               add_action( 'after_setup_theme',                       array( $this, 'after_setup_theme' ), 20 );
118
+               add_action( 'customize_register',                      array( $this, 'customize_register' ), 20 );
119
+               add_action( 'customize_controls_print_footer_scripts', array( $this, 'colour_scheme_css_template' ) );
120
+          }
121
+
122
+          /**
123
+           * Customizer Controls and Settings.
124
+           *
125
+           * @param WP_Customize_Manager $wp_customize Theme Customizer object.
126
+           * @since 1.0.0
127
+           */
128
+          public function after_setup_theme() {
129
+               require_once( LSX_CUSTOMIZER_PATH . 'includes/lsx-customizer-colour-options.php' );
130
+               require_once( LSX_CUSTOMIZER_PATH . 'includes/lsx-customizer-colour-deprecated.php' );
131
+               require_once( LSX_CUSTOMIZER_PATH . 'includes/lsx-customizer-templates.php' );
132
+
133
+               if ( class_exists( 'WP_Customize_Control' ) ) {
134
+                    require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-control.php' );
135
+               }
136
+
137
+               require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button.php' );
138
+               $this->button = new LSX_Customizer_Colour_Button;
139
+
140
+               require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-cta.php' );
141
+               $this->button_cta = new LSX_Customizer_Colour_Button_CTA;
142
+
143
+               require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-secondary.php' );
144
+               $this->button_secondary = new LSX_Customizer_Colour_Button_Secondary;
145
+
146
+               require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-tertiary.php' );
147
+               $this->button_tertiary = new LSX_Customizer_Colour_Button_Tertiary;
148
+
149
+               require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-top-menu.php' );
150
+               $this->top_menu = new LSX_Customizer_Colour_Top_Menu;
151
+
152
+               require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-header.php' );
153
+               $this->header = new LSX_Customizer_Colour_Header;
154
+
155
+               require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-main-menu.php' );
156
+               $this->main_menu = new LSX_Customizer_Colour_Main_Menu;
157
+
158
+               require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-banner.php' );
159
+               $this->banner = new LSX_Customizer_Colour_Banner;
160
+
161
+               require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-body.php' );
162
+               $this->body = new LSX_Customizer_Colour_Body;
163
+
164
+               require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer-cta.php' );
165
+               $this->footer_cta = new LSX_Customizer_Colour_Footer_CTA;
166
+
167
+               require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer-widgets.php' );
168
+               $this->footer_widgets = new LSX_Customizer_Colour_Footer_Widgets;
169
+
170
+               require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer.php' );
171
+               $this->footer = new LSX_Customizer_Colour_Footer;
172
+          }
173
+
174
+          /**
175
+           * Customizer Controls and Settings.
176
+           *
177
+           * @param WP_Customize_Manager $wp_customize Theme Customizer object.
178
+           * @since 1.0.0
179
+           */
180
+          public function customize_register( $wp_customize ) {
181
+               global $customizer_colour_names;
182
+               global $customizer_colour_choices;
183
+
184
+               /**
185
+                * Colors
186
+                */
187
+               $wp_customize->add_panel( 'colors' , array(
188
+                    'title'             => esc_html__( 'Colors', 'lsx-customizer' ),
189
+                    'priority'          => 60,
190
+               ) );
191
+
192
+               /**
193
+                * Colors - Sections
194
+                */
195
+               $wp_customize->add_section( 'colors-core' , array(
196
+                    'title'             => esc_html__( 'Color Scheme', 'lsx-customizer' ),
197
+                    'priority'          => 1,
198
+                    'panel'             => 'colors',
199
+               ) );
200
+
201
+               $wp_customize->add_section( 'colors-palette' , array(
202
+                    'title'             => esc_html__( 'Block Editor Color Palette', 'lsx-customizer' ),
203
+                    'description' => esc_html__( 'Add colors to use within the Gutenberg editor color palette.', 'lsx-customizer' ),
204
+                    'priority'          => 2,
205
+                    'panel'             => 'colors',
206
+               ) );
207
+
208
+               $wp_customize->add_section( 'colors-button' , array(
209
+                    'title'             => esc_html__( 'Button', 'lsx-customizer' ),
210
+                    'priority'          => 3,
211
+                    'panel'             => 'colors',
212
+               ) );
213
+
214
+               $wp_customize->add_section( 'colors-button-cta' , array(
215
+                    'title'             => esc_html__( 'Button CTA', 'lsx-customizer' ),
216
+                    'priority'          => 4,
217
+                    'panel'             => 'colors',
218
+               ) );
219
+
220
+               $wp_customize->add_section( 'colors-button-secondary' , array(
221
+                    'title'             => esc_html__( 'Button Secondary', 'lsx-customizer' ),
222
+                    'priority'          => 5,
223
+                    'panel'             => 'colors',
224
+               ) );
225
+
226
+               $wp_customize->add_section( 'colors-button-tertiary' , array(
227
+                    'title'             => esc_html__( 'Button Tertiary', 'lsx-customizer' ),
228
+                    'priority'          => 6,
229
+                    'panel'             => 'colors',
230
+               ) );
231
+
232
+               $wp_customize->add_section( 'colors-top-menu' , array(
233
+                    'title'             => esc_html__( 'Top Menu', 'lsx-customizer' ),
234
+                    'priority'          => 7,
235
+                    'panel'             => 'colors',
236
+               ) );
237
+
238
+               $wp_customize->add_section( 'colors-header' , array(
239
+                    'title'             => esc_html__( 'Header', 'lsx-customizer' ),
240
+                    'priority'          => 8,
241
+                    'panel'             => 'colors',
242
+               ) );
243
+
244
+               $wp_customize->add_section( 'colors-main-menu' , array(
245
+                    'title'             => esc_html__( 'Main Menu', 'lsx-customizer' ),
246
+                    'priority'          => 9,
247
+                    'panel'             => 'colors',
248
+               ) );
249
+
250
+               $wp_customize->add_section( 'colors-banner' , array(
251
+                    'title'             => esc_html__( 'Banner', 'lsx-customizer' ),
252
+                    'priority'          => 10,
253
+                    'panel'             => 'colors',
254
+               ) );
255
+
256
+               $wp_customize->add_section( 'colors-body' , array(
257
+                    'title'             => esc_html__( 'Body', 'lsx-customizer' ),
258
+                    'priority'          => 11,
259
+                    'panel'             => 'colors',
260
+               ) );
261
+
262
+               $wp_customize->add_section( 'colors-footer-cta' , array(
263
+                    'title'             => esc_html__( 'Footer CTA', 'lsx-customizer' ),
264
+                    'priority'          => 12,
265
+                    'panel'             => 'colors',
266
+               ) );
267
+
268
+               $wp_customize->add_section( 'colors-footer-widgets' , array(
269
+                    'title'             => esc_html__( 'Footer Widgets', 'lsx-customizer' ),
270
+                    'priority'          => 13,
271
+                    'panel'             => 'colors',
272
+               ) );
273
+
274
+               $wp_customize->add_section( 'colors-footer' , array(
275
+                    'title'             => esc_html__( 'Footer', 'lsx-customizer' ),
276
+                    'priority'          => 14,
277
+                    'panel'             => 'colors',
278
+               ) );
279
+
280
+               /**
281
+                * Color Scheme
282
+                */
283
+               $wp_customize->add_setting( 'color_scheme', array(
284
+                    'default'           => 'default',
285
+                    'type'	            => 'theme_mod',
286
+                    'transport'         => 'postMessage',
287
+               ) );
288
+
289
+               $wp_customize->add_control( new LSX_Customizer_Colour_Control(
290
+                    $wp_customize, 'color_scheme', array(
291
+                    'label'             => esc_html__( 'Base Color Scheme', 'lsx-customizer' ),
292
+                    'section'           => 'colors-core',
293
+                    'type'              => 'select',
294
+                    'priority'          => 1,
295
+                    'choices'           => $customizer_colour_choices,
296
+                    )
297
+               ) );
298
+
299
+               /**
300
+                * Color Palette
301
+                */
302
+               $colors = $this->get_color_scheme();
303
+
304
+               $customizer_colour_defaults = array(
305
+                    __( 'Primary', 'lsx-customizer' )        => get_theme_mod( 'button_background_color', $colors['button_background_color'] ),
306
+                    __( 'Strong Primary', 'lsx-button_shadow' ) => get_theme_mod( 'button_shadow', $colors['body_link_color'] ),
307
+                    __( 'Call To Action', 'lsx-customizer' ) => get_theme_mod( 'button_cta_background_color', $colors['button_cta_background_color'] ),
308
+                    __( 'Strong CTA', 'lsx-button_shadow' )  => get_theme_mod( 'button_cta_shadow', $colors['button_cta_shadow'] ),
309
+                    __( 'Secondary', 'lsx-customizer' )      => get_theme_mod( 'button_secondary_background_color', $colors['button_secondary_background_color'] ),
310
+                    __( 'Strong Secondary', 'lsx-button_shadow' ) => get_theme_mod( 'button_secondary_shadow', $colors['button_secondary_shadow'] ),
311
+                    __( 'Tertiary', 'lsx-customizer' )       => get_theme_mod( 'button_tertiary_background_color', $colors['button_tertiary_background_color'] ),
312
+                    __( 'Strong Tertiary', 'lsx-button_shadow' ) => get_theme_mod( 'button_tertiary_shadow', $colors['button_tertiary_shadow'] ),
313
+                    __( 'Heading Color', 'lsx-customizer' )  => get_theme_mod( 'body_text_heading_color', $colors['body_text_heading_color'] ),
314
+                    __( 'Body Text color', 'lsx-button_shadow' ) => get_theme_mod( 'body_text_color', $colors['body_text_color'] ),
315
+                    __( 'White', 'lsx-button_shadow' )       => '#ffffff',
316
+                    __( 'Black', 'lsx-button_shadow' )       => '#000000',
317
+               );
318
+               foreach ( $customizer_colour_defaults as $key => $value ) {
319
+
320
+                    $color_name = strtolower( str_replace( ' ', '_', $key ) );
321
+                    $color_name = $color_name . '_color';
322
+
323
+                    $wp_customize->add_setting( $color_name, array(
324
+                         'default'           => $value,
325
+                         'type'              => 'theme_mod',
326
+                         'transport'         => 'postMessage',
327
+                         'sanitize_callback' => 'sanitize_hex_color',
328
+                    ) );
329
+                    $wp_customize->add_control(
330
+                         new WP_Customize_Color_Control(
331
+                              $wp_customize,
332
+                              $color_name,
333
+                              array(
334
+                                   'label'    => $key,
335
+                                   'section'  => 'colors-palette',
336
+                                   'settings' => $color_name,
337
+                              )
338
+                         )
339
+                    );
340
+               }
341
+
342
+               /**
343
+                * Colors
344
+                */
345
+               foreach ( $customizer_colour_names as $key => $value ) {
346
+                    $sanitize_callback = 'sanitize_hex_color';
347
+
348
+                    if ( 'background_color' === $key ) {
349
+                         $sanitize_callback = 'sanitize_hex_color_no_hash';
350
+                    }
351
+
352
+                    $section = 'colors-core';
353
+
354
+                    if ( preg_match( '/^button_cta_.*/', $key ) ) {
355
+                         $section = 'colors-button-cta';
356
+                    } elseif ( preg_match( '/^button_secondary_.*/', $key ) ) {
357
+                         $section = 'colors-button-secondary';
358
+                    } elseif ( preg_match( '/^button_tertiary_.*/', $key ) ) {
359
+                         $section = 'colors-button-tertiary';
360
+                    } elseif ( preg_match( '/^button_.*/', $key ) ) {
361
+                         $section = 'colors-button';
362
+                    } elseif ( preg_match( '/^top_menu_.*/', $key ) ) {
363
+                         $section = 'colors-top-menu';
364
+                    } elseif ( preg_match( '/^header_.*/', $key ) ) {
365
+                         $section = 'colors-header';
366
+                    } elseif ( preg_match( '/^main_menu_.*/', $key ) ) {
367
+                         $section = 'colors-main-menu';
368
+                    } elseif ( preg_match( '/^banner_.*/', $key ) ) {
369
+                         $section = 'colors-banner';
370
+                    } elseif ( preg_match( '/^body_.*/', $key ) || 'background_color' === $key ) {
371
+                         $section = 'colors-body';
372
+                    } elseif ( preg_match( '/^footer_cta_.*/', $key ) ) {
373
+                         $section = 'colors-footer-cta';
374
+                    } elseif ( preg_match( '/^footer_widgets_.*/', $key ) ) {
375
+                         $section = 'colors-footer-widgets';
376
+                    } elseif ( preg_match( '/^footer_.*/', $key ) ) {
377
+                         $section = 'colors-footer';
378
+                    }
379
+
380
+                    $wp_customize->add_setting( $key, array(
381
+                         'default'           => $customizer_colour_choices['default']['colors'][ $key ],
382
+                         'type'	            => 'theme_mod',
383
+                         'transport'         => 'postMessage',
384
+                         'sanitize_callback' => $sanitize_callback,
385
+                    ) );
386
+
387
+                    $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, $key, array(
388
+                         'label'             => $value,
389
+                         'section'           => $section,
390
+                         'settings'          => $key,
391
+                    ) ) );
392
+               }
393
+          }
394
+
395
+          /**
396
+           * Outputs an Underscore template for generating CSS for the color scheme.
397
+           *
398
+           * @since 1.0.0
399
+           */
400
+          public function colour_scheme_css_template() {
401
+               global $customizer_colour_names;
402
+
403
+               $colors = array();
404
+
405
+               foreach ( $customizer_colour_names as $key => $value ) {
406
+                    $colors[ $key ] = 'unquote("{{ data.' . $key . ' }}")';
407
+               }
408
+               ?>
409 409
 			<script type="text/html" id="tmpl-lsx-color-scheme">
410 410
 				<?php echo esc_attr( $this->top_menu->get_css( $colors ) ); ?>
411 411
 				<?php echo esc_attr( $this->header->get_css( $colors ) ); ?>
@@ -424,89 +424,89 @@  discard block
 block discarded – undo
424 424
 				<?php echo esc_attr( $this->button_tertiary->get_css( $colors ) ); ?>
425 425
 			</script>
426 426
 			<?php
427
-		}
428
-
429
-		/**
430
-		 * Transform SCSS to CSS.
431
-		 *
432
-		 * @since 1.0.0
433
-		 */
434
-		public function scss_to_css( $scss ) {
435
-			$css                 = '';
436
-			$scss_php_file       = LSX_CUSTOMIZER_PATH . 'vendor/leafo/scssphp/scss.inc.php';
437
-			$lsx_theme_sass_file = get_template_directory() . '/assets/css/scss/lsx.scss';
438
-
439
-			if ( ! empty( $scss ) && file_exists( $scss_php_file ) && file_exists( $lsx_theme_sass_file ) ) {
440
-				require_once $scss_php_file;
441
-
442
-				$compiler = new \Leafo\ScssPhp\Compiler();
443
-				$compiler->setFormatter( 'Leafo\ScssPhp\Formatter\Compact' );
444
-
445
-				try {
446
-					$scss = '
427
+          }
428
+
429
+          /**
430
+           * Transform SCSS to CSS.
431
+           *
432
+           * @since 1.0.0
433
+           */
434
+          public function scss_to_css( $scss ) {
435
+               $css                 = '';
436
+               $scss_php_file       = LSX_CUSTOMIZER_PATH . 'vendor/leafo/scssphp/scss.inc.php';
437
+               $lsx_theme_sass_file = get_template_directory() . '/assets/css/scss/lsx.scss';
438
+
439
+               if ( ! empty( $scss ) && file_exists( $scss_php_file ) && file_exists( $lsx_theme_sass_file ) ) {
440
+                    require_once $scss_php_file;
441
+
442
+                    $compiler = new \Leafo\ScssPhp\Compiler();
443
+                    $compiler->setFormatter( 'Leafo\ScssPhp\Formatter\Compact' );
444
+
445
+                    try {
446
+                         $scss = '
447 447
 						@import "' . LSX_CUSTOMIZER_PATH . '/assets/css/scss/include-media";
448 448
 						@import "' . get_template_directory() . '/assets/css/scss/global/lsx-variables";
449 449
 						@import "' . get_template_directory() . '/assets/css/scss/global/mixins/colours-helper";
450 450
 						' . $scss . '
451 451
 					';
452 452
 
453
-					$css = $compiler->compile( $scss );
454
-				} catch ( \Exception $e ) {
455
-					$error = $e->getMessage();
456
-					return "/*\n\n\$error:\n\n{$error}\n\n\$scss:\n\n{$scss} */";
457
-				}
458
-			}
459
-
460
-			return $css;
461
-		}
462
-
463
-		/**
464
-		 * Converts a HEX value to RGB.
465
-		 *
466
-		 * @since 1.0.0
467
-		 */
468
-		public static function hex2rgb( $color ) {
469
-			$color = trim( $color, '#' );
470
-
471
-			if ( strlen( $color ) === 3 ) {
472
-				$r = hexdec( substr( $color, 0, 1 ) . substr( $color, 0, 1 ) );
473
-				$g = hexdec( substr( $color, 1, 1 ) . substr( $color, 1, 1 ) );
474
-				$b = hexdec( substr( $color, 2, 1 ) . substr( $color, 2, 1 ) );
475
-			} elseif ( strlen( $color ) === 6 ) {
476
-				$r = hexdec( substr( $color, 0, 2 ) );
477
-				$g = hexdec( substr( $color, 2, 2 ) );
478
-				$b = hexdec( substr( $color, 4, 2 ) );
479
-			} else {
480
-				return array();
481
-			}
482
-
483
-			return array(
484
-				'red'   => $r,
485
-				'green' => $g,
486
-				'blue'  => $b,
487
-			);
488
-		}
489
-
490
-		/**
491
-		 * Retrieves the current color scheme.
492
-		 *
493
-		 * @since 1.0.0
494
-		 */
495
-		public function get_color_scheme() {
496
-			global $customizer_colour_choices;
497
-
498
-			$color_scheme_option = get_theme_mod( 'color_scheme', 'default' );
499
-			$color_schemes = $customizer_colour_choices;
500
-
501
-			if ( array_key_exists( $color_scheme_option, $color_schemes ) ) {
502
-				return $color_schemes[ $color_scheme_option ]['colors'];
503
-			}
504
-
505
-			return $color_schemes['default']['colors'];
506
-		}
507
-
508
-	}
509
-
510
-	new LSX_Customizer_Colour;
453
+                         $css = $compiler->compile( $scss );
454
+                    } catch ( \Exception $e ) {
455
+                         $error = $e->getMessage();
456
+                         return "/*\n\n\$error:\n\n{$error}\n\n\$scss:\n\n{$scss} */";
457
+                    }
458
+               }
459
+
460
+               return $css;
461
+          }
462
+
463
+          /**
464
+           * Converts a HEX value to RGB.
465
+           *
466
+           * @since 1.0.0
467
+           */
468
+          public static function hex2rgb( $color ) {
469
+               $color = trim( $color, '#' );
470
+
471
+               if ( strlen( $color ) === 3 ) {
472
+                    $r = hexdec( substr( $color, 0, 1 ) . substr( $color, 0, 1 ) );
473
+                    $g = hexdec( substr( $color, 1, 1 ) . substr( $color, 1, 1 ) );
474
+                    $b = hexdec( substr( $color, 2, 1 ) . substr( $color, 2, 1 ) );
475
+               } elseif ( strlen( $color ) === 6 ) {
476
+                    $r = hexdec( substr( $color, 0, 2 ) );
477
+                    $g = hexdec( substr( $color, 2, 2 ) );
478
+                    $b = hexdec( substr( $color, 4, 2 ) );
479
+               } else {
480
+                    return array();
481
+               }
482
+
483
+               return array(
484
+                    'red'   => $r,
485
+                    'green' => $g,
486
+                    'blue'  => $b,
487
+               );
488
+          }
489
+
490
+          /**
491
+           * Retrieves the current color scheme.
492
+           *
493
+           * @since 1.0.0
494
+           */
495
+          public function get_color_scheme() {
496
+               global $customizer_colour_choices;
497
+
498
+               $color_scheme_option = get_theme_mod( 'color_scheme', 'default' );
499
+               $color_schemes = $customizer_colour_choices;
500
+
501
+               if ( array_key_exists( $color_scheme_option, $color_schemes ) ) {
502
+                    return $color_schemes[ $color_scheme_option ]['colors'];
503
+               }
504
+
505
+               return $color_schemes['default']['colors'];
506
+          }
507
+
508
+     }
509
+
510
+     new LSX_Customizer_Colour;
511 511
 
512 512
 }
Please login to merge, or discard this patch.
classes/class-lsx-customizer-colour-banner.php 1 patch
Indentation   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -1,107 +1,107 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if ( ! class_exists( 'LSX_Customizer_Colour_Banner' ) ) {
3 3
 
4
-	/**
5
-	 * LSX Customizer Colour Banner Class
6
-	 *
7
-	 * @package   LSX Customizer
8
-	 * @author    LightSpeed
9
-	 * @license   GPL3
10
-	 * @link
11
-	 * @copyright 2016 LightSpeed
12
-	 */
13
-	class LSX_Customizer_Colour_Banner extends LSX_Customizer_Colour {
14
-
15
-		/**
16
-		 * Constructor.
17
-		 *
18
-		 * @since 1.0.0
19
-		 */
20
-		public function __construct() {
21
-			add_action( 'after_switch_theme',   array( $this, 'set_theme_mod' ) );
22
-			add_action( 'customize_save_after', array( $this, 'set_theme_mod' ) );
23
-
24
-			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ), 2999 );
25
-		}
26
-
27
-		/**
28
-		 * Assign CSS to theme mod.
29
-		 *
30
-		 * @since 1.0.0
31
-		 */
32
-		public function set_theme_mod() {
33
-			$theme_mods = $this->get_theme_mods();
34
-			$styles     = $this->get_css( $theme_mods );
35
-
36
-			set_theme_mod( 'lsx_customizer_colour__banner_theme_mod', $styles );
37
-		}
38
-
39
-		/**
40
-		 * Enqueues front-end CSS.
41
-		 *
42
-		 * @since 1.0.0
43
-		 */
44
-		public function enqueue_css() {
45
-			$styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__banner_theme_mod' );
46
-
47
-			if ( is_customize_preview() || false === $styles_from_theme_mod ) {
48
-				$theme_mods = $this->get_theme_mods();
49
-				$styles     = $this->get_css( $theme_mods );
50
-
51
-				if ( false === $styles_from_theme_mod ) {
52
-					set_theme_mod( 'lsx_customizer_colour__banner_theme_mod', $styles );
53
-				}
54
-			} else {
55
-				$styles = $styles_from_theme_mod;
56
-			}
57
-
58
-			wp_add_inline_style( 'lsx-customizer', $styles );
59
-		}
60
-
61
-		/**
62
-		 * Get CSS theme mods.
63
-		 *
64
-		 * @since 1.0.0
65
-		 */
66
-		public function get_theme_mods() {
67
-			$colors = parent::get_color_scheme();
68
-
69
-			return apply_filters( 'lsx_customizer_colours_banner', array(
70
-				'banner_background_color'               => get_theme_mod( 'banner_background_color',               $colors['banner_background_color'] ),
71
-				'banner_text_color'                     => get_theme_mod( 'banner_text_color',                     $colors['banner_text_color'] ),
72
-				'banner_text_image_color'               => get_theme_mod( 'banner_text_image_color',               $colors['banner_text_image_color'] ),
73
-				'banner_breadcrumb_background_color'    => get_theme_mod( 'banner_breadcrumb_background_color',    $colors['banner_breadcrumb_background_color'] ),
74
-				'banner_breadcrumb_text_color'          => get_theme_mod( 'banner_breadcrumb_text_color',          $colors['banner_breadcrumb_text_color'] ),
75
-				'banner_breadcrumb_text_selected_color' => get_theme_mod( 'banner_breadcrumb_text_selected_color', $colors['banner_breadcrumb_text_selected_color'] ),
76
-			) );
77
-		}
78
-
79
-		/**
80
-		 * Returns CSS.
81
-		 *
82
-		 * @since 1.0.0
83
-		 */
84
-		function get_css( $colors ) {
85
-			global $customizer_colour_names;
86
-
87
-			$colors_template = array();
88
-
89
-			foreach ( $customizer_colour_names as $key => $value ) {
90
-				$colors_template[ $key ] = '';
91
-			}
92
-
93
-			$colors = wp_parse_args( $colors, $colors_template );
94
-
95
-			if ( empty( $colors['banner_background_color'] )
96
-				|| empty( $colors['banner_text_color'] )
97
-				|| empty( $colors['banner_text_image_color'] )
98
-				|| empty( $colors['banner_breadcrumb_background_color'] )
99
-				|| empty( $colors['banner_breadcrumb_text_color'] )
100
-				|| empty( $colors['banner_breadcrumb_text_selected_color'] ) ) {
101
-				return '';
102
-			}
103
-
104
-			$css = '
4
+     /**
5
+      * LSX Customizer Colour Banner Class
6
+      *
7
+      * @package   LSX Customizer
8
+      * @author    LightSpeed
9
+      * @license   GPL3
10
+      * @link
11
+      * @copyright 2016 LightSpeed
12
+      */
13
+     class LSX_Customizer_Colour_Banner extends LSX_Customizer_Colour {
14
+
15
+          /**
16
+           * Constructor.
17
+           *
18
+           * @since 1.0.0
19
+           */
20
+          public function __construct() {
21
+               add_action( 'after_switch_theme',   array( $this, 'set_theme_mod' ) );
22
+               add_action( 'customize_save_after', array( $this, 'set_theme_mod' ) );
23
+
24
+               add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ), 2999 );
25
+          }
26
+
27
+          /**
28
+           * Assign CSS to theme mod.
29
+           *
30
+           * @since 1.0.0
31
+           */
32
+          public function set_theme_mod() {
33
+               $theme_mods = $this->get_theme_mods();
34
+               $styles     = $this->get_css( $theme_mods );
35
+
36
+               set_theme_mod( 'lsx_customizer_colour__banner_theme_mod', $styles );
37
+          }
38
+
39
+          /**
40
+           * Enqueues front-end CSS.
41
+           *
42
+           * @since 1.0.0
43
+           */
44
+          public function enqueue_css() {
45
+               $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__banner_theme_mod' );
46
+
47
+               if ( is_customize_preview() || false === $styles_from_theme_mod ) {
48
+                    $theme_mods = $this->get_theme_mods();
49
+                    $styles     = $this->get_css( $theme_mods );
50
+
51
+                    if ( false === $styles_from_theme_mod ) {
52
+                         set_theme_mod( 'lsx_customizer_colour__banner_theme_mod', $styles );
53
+                    }
54
+               } else {
55
+                    $styles = $styles_from_theme_mod;
56
+               }
57
+
58
+               wp_add_inline_style( 'lsx-customizer', $styles );
59
+          }
60
+
61
+          /**
62
+           * Get CSS theme mods.
63
+           *
64
+           * @since 1.0.0
65
+           */
66
+          public function get_theme_mods() {
67
+               $colors = parent::get_color_scheme();
68
+
69
+               return apply_filters( 'lsx_customizer_colours_banner', array(
70
+                    'banner_background_color'               => get_theme_mod( 'banner_background_color',               $colors['banner_background_color'] ),
71
+                    'banner_text_color'                     => get_theme_mod( 'banner_text_color',                     $colors['banner_text_color'] ),
72
+                    'banner_text_image_color'               => get_theme_mod( 'banner_text_image_color',               $colors['banner_text_image_color'] ),
73
+                    'banner_breadcrumb_background_color'    => get_theme_mod( 'banner_breadcrumb_background_color',    $colors['banner_breadcrumb_background_color'] ),
74
+                    'banner_breadcrumb_text_color'          => get_theme_mod( 'banner_breadcrumb_text_color',          $colors['banner_breadcrumb_text_color'] ),
75
+                    'banner_breadcrumb_text_selected_color' => get_theme_mod( 'banner_breadcrumb_text_selected_color', $colors['banner_breadcrumb_text_selected_color'] ),
76
+               ) );
77
+          }
78
+
79
+          /**
80
+           * Returns CSS.
81
+           *
82
+           * @since 1.0.0
83
+           */
84
+          function get_css( $colors ) {
85
+               global $customizer_colour_names;
86
+
87
+               $colors_template = array();
88
+
89
+               foreach ( $customizer_colour_names as $key => $value ) {
90
+                    $colors_template[ $key ] = '';
91
+               }
92
+
93
+               $colors = wp_parse_args( $colors, $colors_template );
94
+
95
+               if ( empty( $colors['banner_background_color'] )
96
+                    || empty( $colors['banner_text_color'] )
97
+                    || empty( $colors['banner_text_image_color'] )
98
+                    || empty( $colors['banner_breadcrumb_background_color'] )
99
+                    || empty( $colors['banner_breadcrumb_text_color'] )
100
+                    || empty( $colors['banner_breadcrumb_text_selected_color'] ) ) {
101
+                    return '';
102
+               }
103
+
104
+               $css = '
105 105
 				@import "' . get_template_directory() . '/assets/css/scss/global/mixins/banner";
106 106
 
107 107
 				/**
@@ -117,12 +117,12 @@  discard block
 block discarded – undo
117 117
 				);
118 118
 			';
119 119
 
120
-			$css = apply_filters( 'lsx_customizer_colour_selectors_banner', $css, $colors );
121
-			$css = parent::scss_to_css( $css );
120
+               $css = apply_filters( 'lsx_customizer_colour_selectors_banner', $css, $colors );
121
+               $css = parent::scss_to_css( $css );
122 122
 
123
-			return $css;
124
-		}
123
+               return $css;
124
+          }
125 125
 
126
-	}
126
+     }
127 127
 
128 128
 }
Please login to merge, or discard this patch.
classes/class-lsx-customizer-colour-main-menu.php 1 patch
Indentation   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -1,109 +1,109 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if ( ! class_exists( 'LSX_Customizer_Colour_Main_Menu' ) ) {
3 3
 
4
-	/**
5
-	 * LSX Customizer Colour Main Menu Class
6
-	 *
7
-	 * @package   LSX Customizer
8
-	 * @author    LightSpeed
9
-	 * @license   GPL3
10
-	 * @link
11
-	 * @copyright 2016 LightSpeed
12
-	 */
13
-	class LSX_Customizer_Colour_Main_Menu extends LSX_Customizer_Colour {
14
-
15
-		/**
16
-		 * Constructor.
17
-		 *
18
-		 * @since 1.0.0
19
-		 */
20
-		public function __construct() {
21
-			add_action( 'after_switch_theme',   array( $this, 'set_theme_mod' ) );
22
-			add_action( 'customize_save_after', array( $this, 'set_theme_mod' ) );
23
-
24
-			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ), 2999 );
25
-		}
26
-
27
-		/**
28
-		 * Assign CSS to theme mod.
29
-		 *
30
-		 * @since 1.0.0
31
-		 */
32
-		public function set_theme_mod() {
33
-			$theme_mods = $this->get_theme_mods();
34
-			$styles     = $this->get_css( $theme_mods );
35
-
36
-			set_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod', $styles );
37
-		}
38
-
39
-		/**
40
-		 * Enqueues front-end CSS.
41
-		 *
42
-		 * @since 1.0.0
43
-		 */
44
-		public function enqueue_css() {
45
-			$styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod' );
46
-
47
-			if ( is_customize_preview() || false === $styles_from_theme_mod ) {
48
-				$theme_mods = $this->get_theme_mods();
49
-				$styles     = $this->get_css( $theme_mods );
50
-
51
-				if ( false === $styles_from_theme_mod ) {
52
-					set_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod', $styles );
53
-				}
54
-			} else {
55
-				$styles = $styles_from_theme_mod;
56
-			}
57
-
58
-			wp_add_inline_style( 'lsx-customizer', $styles );
59
-		}
60
-
61
-		/**
62
-		 * Get CSS theme mods.
63
-		 *
64
-		 * @since 1.0.0
65
-		 */
66
-		public function get_theme_mods() {
67
-			$colors = parent::get_color_scheme();
68
-
69
-			return apply_filters( 'lsx_customizer_colours_main_menu', array(
70
-				'main_menu_background_color'                => get_theme_mod( 'main_menu_background_color',                $colors['main_menu_background_color'] ),
71
-				'main_menu_link_color'                      => get_theme_mod( 'main_menu_link_color',                      $colors['main_menu_link_color'] ),
72
-				'main_menu_link_hover_color'                => get_theme_mod( 'main_menu_link_hover_color',                $colors['main_menu_link_hover_color'] ),
73
-				'main_menu_dropdown_background_color'       => get_theme_mod( 'main_menu_dropdown_background_color',       $colors['main_menu_dropdown_background_color'] ),
74
-				'main_menu_dropdown_background_hover_color' => get_theme_mod( 'main_menu_dropdown_background_hover_color', $colors['main_menu_dropdown_background_hover_color'] ),
75
-				'main_menu_dropdown_link_color'             => get_theme_mod( 'main_menu_dropdown_link_color',             $colors['main_menu_dropdown_link_color'] ),
76
-				'main_menu_dropdown_link_hover_color'       => get_theme_mod( 'main_menu_dropdown_link_hover_color',       $colors['main_menu_dropdown_link_hover_color'] ),
77
-			) );
78
-		}
79
-
80
-		/**
81
-		 * Returns CSS.
82
-		 *
83
-		 * @since 1.0.0
84
-		 */
85
-		function get_css( $colors ) {
86
-			global $customizer_colour_names;
87
-
88
-			$colors_template = array();
89
-
90
-			foreach ( $customizer_colour_names as $key => $value ) {
91
-				$colors_template[ $key ] = '';
92
-			}
93
-
94
-			$colors = wp_parse_args( $colors, $colors_template );
95
-
96
-			if ( empty( $colors['main_menu_background_color'] )
97
-				|| empty( $colors['main_menu_link_color'] )
98
-				|| empty( $colors['main_menu_link_hover_color'] )
99
-				|| empty( $colors['main_menu_dropdown_background_color'] )
100
-				|| empty( $colors['main_menu_dropdown_background_hover_color'] )
101
-				|| empty( $colors['main_menu_dropdown_link_color'] )
102
-				|| empty( $colors['main_menu_dropdown_link_hover_color'] ) ) {
103
-				return '';
104
-			}
105
-
106
-			$css = '
4
+     /**
5
+      * LSX Customizer Colour Main Menu Class
6
+      *
7
+      * @package   LSX Customizer
8
+      * @author    LightSpeed
9
+      * @license   GPL3
10
+      * @link
11
+      * @copyright 2016 LightSpeed
12
+      */
13
+     class LSX_Customizer_Colour_Main_Menu extends LSX_Customizer_Colour {
14
+
15
+          /**
16
+           * Constructor.
17
+           *
18
+           * @since 1.0.0
19
+           */
20
+          public function __construct() {
21
+               add_action( 'after_switch_theme',   array( $this, 'set_theme_mod' ) );
22
+               add_action( 'customize_save_after', array( $this, 'set_theme_mod' ) );
23
+
24
+               add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ), 2999 );
25
+          }
26
+
27
+          /**
28
+           * Assign CSS to theme mod.
29
+           *
30
+           * @since 1.0.0
31
+           */
32
+          public function set_theme_mod() {
33
+               $theme_mods = $this->get_theme_mods();
34
+               $styles     = $this->get_css( $theme_mods );
35
+
36
+               set_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod', $styles );
37
+          }
38
+
39
+          /**
40
+           * Enqueues front-end CSS.
41
+           *
42
+           * @since 1.0.0
43
+           */
44
+          public function enqueue_css() {
45
+               $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod' );
46
+
47
+               if ( is_customize_preview() || false === $styles_from_theme_mod ) {
48
+                    $theme_mods = $this->get_theme_mods();
49
+                    $styles     = $this->get_css( $theme_mods );
50
+
51
+                    if ( false === $styles_from_theme_mod ) {
52
+                         set_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod', $styles );
53
+                    }
54
+               } else {
55
+                    $styles = $styles_from_theme_mod;
56
+               }
57
+
58
+               wp_add_inline_style( 'lsx-customizer', $styles );
59
+          }
60
+
61
+          /**
62
+           * Get CSS theme mods.
63
+           *
64
+           * @since 1.0.0
65
+           */
66
+          public function get_theme_mods() {
67
+               $colors = parent::get_color_scheme();
68
+
69
+               return apply_filters( 'lsx_customizer_colours_main_menu', array(
70
+                    'main_menu_background_color'                => get_theme_mod( 'main_menu_background_color',                $colors['main_menu_background_color'] ),
71
+                    'main_menu_link_color'                      => get_theme_mod( 'main_menu_link_color',                      $colors['main_menu_link_color'] ),
72
+                    'main_menu_link_hover_color'                => get_theme_mod( 'main_menu_link_hover_color',                $colors['main_menu_link_hover_color'] ),
73
+                    'main_menu_dropdown_background_color'       => get_theme_mod( 'main_menu_dropdown_background_color',       $colors['main_menu_dropdown_background_color'] ),
74
+                    'main_menu_dropdown_background_hover_color' => get_theme_mod( 'main_menu_dropdown_background_hover_color', $colors['main_menu_dropdown_background_hover_color'] ),
75
+                    'main_menu_dropdown_link_color'             => get_theme_mod( 'main_menu_dropdown_link_color',             $colors['main_menu_dropdown_link_color'] ),
76
+                    'main_menu_dropdown_link_hover_color'       => get_theme_mod( 'main_menu_dropdown_link_hover_color',       $colors['main_menu_dropdown_link_hover_color'] ),
77
+               ) );
78
+          }
79
+
80
+          /**
81
+           * Returns CSS.
82
+           *
83
+           * @since 1.0.0
84
+           */
85
+          function get_css( $colors ) {
86
+               global $customizer_colour_names;
87
+
88
+               $colors_template = array();
89
+
90
+               foreach ( $customizer_colour_names as $key => $value ) {
91
+                    $colors_template[ $key ] = '';
92
+               }
93
+
94
+               $colors = wp_parse_args( $colors, $colors_template );
95
+
96
+               if ( empty( $colors['main_menu_background_color'] )
97
+                    || empty( $colors['main_menu_link_color'] )
98
+                    || empty( $colors['main_menu_link_hover_color'] )
99
+                    || empty( $colors['main_menu_dropdown_background_color'] )
100
+                    || empty( $colors['main_menu_dropdown_background_hover_color'] )
101
+                    || empty( $colors['main_menu_dropdown_link_color'] )
102
+                    || empty( $colors['main_menu_dropdown_link_hover_color'] ) ) {
103
+                    return '';
104
+               }
105
+
106
+               $css = '
107 107
 				@import "' . get_template_directory() . '/assets/css/scss/global/mixins/nav";
108 108
 
109 109
 				/**
@@ -120,12 +120,12 @@  discard block
 block discarded – undo
120 120
 				);
121 121
 			';
122 122
 
123
-			$css = apply_filters( 'lsx_customizer_colour_selectors_main_menu', $css, $colors );
124
-			$css = parent::scss_to_css( $css );
123
+               $css = apply_filters( 'lsx_customizer_colour_selectors_main_menu', $css, $colors );
124
+               $css = parent::scss_to_css( $css );
125 125
 
126
-			return $css;
127
-		}
126
+               return $css;
127
+          }
128 128
 
129
-	}
129
+     }
130 130
 
131 131
 }
Please login to merge, or discard this patch.
classes/class-lsx-customizer-woocommerce.php 1 patch
Indentation   +607 added lines, -607 removed lines patch added patch discarded remove patch
@@ -1,365 +1,365 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if ( ! class_exists( 'LSX_Customizer_WooCommerce' ) ) {
3 3
 
4
-	/**
5
-	 * LSX Customizer WooCommerce Class
6
-	 *
7
-	 * @package   LSX Customizer
8
-	 * @author    LightSpeed
9
-	 * @license   GPL3
10
-	 * @link
11
-	 * @copyright 2016 LightSpeed
12
-	 */
13
-	class LSX_Customizer_WooCommerce extends LSX_Customizer {
14
-
15
-		/**
16
-		 * Constructor.
17
-		 *
18
-		 * @since 1.1.1
19
-		 */
20
-		public function __construct() {
21
-			add_action( 'customize_register', array( $this, 'customize_register' ), 20 );
22
-
23
-			add_filter( 'body_class', array( $this, 'body_class' ), 2999 );
24
-
25
-			add_action( 'template_redirect', array( $this, 'thankyou_page' ), 2999 );
26
-
27
-			if ( empty( get_theme_mod( 'lsx_two_step_checkout', false ) ) ) {
28
-				add_action( 'lsx_entry_inside_top', array( $this, 'checkout_steps' ), 15 );
29
-			}
30
-
31
-			add_action( 'wp', array( $this, 'cart_extra_html' ), 2999 );
32
-			add_action( 'wp', array( $this, 'checkout_extra_html' ), 2999 );
33
-			add_action( 'lsx_wc_cart_menu_item_position', array( $this, 'cart_menu_item_position' ) );
34
-			add_action( 'lsx_wc_cart_menu_item_class', array( $this, 'cart_menu_item_class' ) );
35
-
36
-			add_filter( 'wp_nav_menu_items', array( $this, 'my_account_menu_item' ), 9, 2 );
37
-			add_action( 'lsx_wc_my_account_menu_item_position', array( $this, 'my_account_menu_item_position' ) );
38
-			add_action( 'lsx_wc_my_account_menu_item_class', array( $this, 'my_account_menu_item_class' ) );
39
-
40
-			// Shop Layout Switcher.
41
-			//add_action( 'wp_head', array( $this, 'show_layout_switcher' ), 1 );
42
-			//add_filter( 'gridlist_toggle_button_output', array( $this, 'gridlist_toggle_button_output' ), 10, 3 );
43
-		}
44
-
45
-		/**
46
-		 * Customizer Controls and Settings.
47
-		 *
48
-		 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
49
-		 * @since 1.1.1
50
-		 */
51
-		public function customize_register( $wp_customize ) {
52
-			/**
53
-			 * Checkout.
54
-			 */
55
-
56
-			$wp_customize->add_section( 'lsx-wc-checkout' , array(
57
-				'title'       => esc_html__( 'LSX Checkout', 'lsx-customizer' ),
58
-				'description' => esc_html__( 'Change the WooCommerce checkout settings.', 'lsx-customizer' ),
59
-				'panel'       => 'woocommerce',
60
-				'priority'    => 3,
61
-			) );
62
-
63
-			$wp_customize->add_setting( 'lsx_checkout_steps', array(
64
-				'default'           => true,
65
-				'sanitize_callback' => array( $this, 'sanitize_checkbox' ),
66
-			) );
67
-
68
-			$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_checkout_steps', array(
69
-				'label'       => esc_html__( 'Steps', 'lsx-customizer' ),
70
-				'description' => esc_html__( 'Enable the checkout steps header.', 'lsx-customizer' ),
71
-				'section'     => 'lsx-wc-checkout',
72
-				'settings'    => 'lsx_checkout_steps',
73
-				'type'        => 'checkbox',
74
-				'priority'    => 1,
75
-			) ) );
76
-
77
-			/**
78
-			 * Checkout Layout
79
-			 */
80
-			$wp_customize->add_setting( 'lsx_wc_checkout_layout', array(
81
-				'default' => 'default',
82
-				'sanitize_callback' => array( $this, 'sanitize_select' ),
83
-			) );
84
-
85
-			$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_checkout_layout', array(
86
-				'label'       => esc_html__( 'Layout', 'lsx-customizer' ),
87
-				'description' => esc_html__( 'WooCommerce checkout layout.', 'lsx-customizer' ),
88
-				'section'     => 'lsx-wc-checkout',
89
-				'settings'    => 'lsx_wc_checkout_layout',
90
-				'type'        => 'select',
91
-				'priority'    => 2,
92
-				'choices'     => array(
93
-					'default' => esc_html__( 'Default', 'lsx-customizer' ),
94
-					'stacked' => esc_html__( 'Stacked', 'lsx-customizer' ),
95
-					'columns' => esc_html__( 'Columns', 'lsx-customizer' ),
96
-				),
97
-			) ) );
98
-
99
-			$wp_customize->add_setting( 'lsx_wc_checkout_thankyou_page', array(
100
-				'default' => '0',
101
-				'sanitize_callback' => array( $this, 'sanitize_select' ),
102
-			) );
103
-
104
-			$choices = array(
105
-				'0' => esc_html__( 'Default', 'lsx-customizer' ),
106
-			);
107
-
108
-			/**
109
-			 * Distraction Free Checkout
110
-			 */
111
-			$wp_customize->add_setting( 'lsx_distraction_free_checkout', array(
112
-				'sanitize_callback' => array( $this, 'sanitize_checkbox' ),
113
-			) );
114
-
115
-			$wp_customize->add_control( new WP_Customize_Control(
116
-				$wp_customize,
117
-				'lsx_distraction_free_checkout',
118
-				array(
119
-					'label'       => esc_html__( 'Distraction Free Checkout', 'lsx-customizer' ),
120
-					'description' => esc_html__( 'Removes all clutter from the checkout, allowing the customer to focus entirely on that procedure. Removes the stepped cart and checkout.', 'lsx-customizer' ),
121
-					'section'     => 'lsx-wc-checkout',
122
-					'settings'    => 'lsx_distraction_free_checkout',
123
-					'type'        => 'checkbox',
124
-					'priority'    => 3,
125
-				)
126
-			) );
127
-
128
-			/**
129
-			 * Two Step Checkout
130
-			 */
131
-			$wp_customize->add_setting( 'lsx_two_step_checkout', array(
132
-				'sanitize_callback' => array( $this, 'sanitize_checkbox' ),
133
-			) );
134
-
135
-			$wp_customize->add_control( new WP_Customize_Control(
136
-				$wp_customize,
137
-				'lsx_two_step_checkout',
138
-				array(
139
-					'label'       => esc_html__( 'Two Step Checkout', 'lsx-customizer' ),
140
-					'description' => esc_html__( 'Separates the customer details collection form, and the order summary / payment details form in to two separate pages. Removes the stepped cart and checkout.', 'lsx-customizer' ),
141
-					'section'     => 'lsx-wc-checkout',
142
-					'settings'    => 'lsx_two_step_checkout',
143
-					'type'        => 'checkbox',
144
-					'priority'    => 4,
145
-				)
146
-			) );
147
-
148
-			/**
149
-			 * Thank you page options
150
-			 */
151
-			$pages = get_pages();
152
-
153
-			foreach ( $pages as $key => $page ) {
154
-				$choices[ $page->ID ] = $page->post_title;
155
-			}
156
-
157
-			$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_checkout_thankyou_page', array(
158
-				'label'       => esc_html__( 'Thank You Page', 'lsx-customizer' ),
159
-				'description' => esc_html__( 'WooCommerce checkout thank you page.', 'lsx-customizer' ),
160
-				'section'     => 'lsx-wc-checkout',
161
-				'settings'    => 'lsx_wc_checkout_thankyou_page',
162
-				'type'        => 'select',
163
-				'priority'    => 5,
164
-				'choices'     => $choices,
165
-			) ) );
166
-
167
-			$wp_customize->add_setting( 'lsx_wc_checkout_extra_html', array(
168
-				'default'           => '',
169
-				'sanitize_callback' => 'wp_kses_post',
170
-			) );
171
-
172
-			$wp_customize->add_control( new LSX_Customizer_Wysiwyg_Control( $wp_customize, 'lsx_wc_checkout_extra_html', array(
173
-				'label'       => esc_html__( 'Extra HTML', 'lsx-customizer' ),
174
-				'description' => esc_html__( 'Extra HTML to display at checkout page (bottom/right).', 'lsx-customizer' ),
175
-				'section'     => 'lsx-wc-checkout',
176
-				'settings'    => 'lsx_wc_checkout_extra_html',
177
-				'priority'    => 6,
178
-				'type'        => 'wysiwyg',
179
-			) ) );
180
-
181
-			/**
182
-			 * Cart.
183
-			 */
184
-
185
-			$wp_customize->add_setting( 'lsx_wc_cart_menu_item_style', array(
186
-				'default' => 'extended',
187
-				'sanitize_callback' => array( $this, 'sanitize_select' ),
188
-			) );
189
-
190
-			$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_cart_menu_item_style', array(
191
-				'label'       => esc_html__( 'Menu Item Style', 'lsx-customizer' ),
192
-				'description' => esc_html__( 'WooCommerce menu item cart style.', 'lsx-customizer' ),
193
-				'section'     => 'lsx-wc-cart',
194
-				'settings'    => 'lsx_wc_cart_menu_item_style',
195
-				'type'        => 'select',
196
-				'priority'    => 2,
197
-				'choices'     => array(
198
-					'simple'   => esc_html__( 'Simple', 'lsx-customizer' ),
199
-					'extended' => esc_html__( 'Extended', 'lsx-customizer' ),
200
-				),
201
-			) ) );
202
-
203
-			$wp_customize->add_setting( 'lsx_wc_cart_menu_item_position', array(
204
-				'default' => 'main-menu-in',
205
-				'sanitize_callback' => array( $this, 'sanitize_select' ),
206
-			) );
207
-
208
-			$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_cart_menu_item_position', array(
209
-				'label'       => esc_html__( 'Menu Item Position', 'lsx-customizer' ),
210
-				'description' => esc_html__( 'WooCommerce menu item cart position.', 'lsx-customizer' ),
211
-				'section'     => 'lsx-wc-cart',
212
-				'settings'    => 'lsx_wc_cart_menu_item_position',
213
-				'type'        => 'select',
214
-				'priority'    => 3,
215
-				'choices'     => array(
216
-					'main-menu-in'   => esc_html__( 'Main Menu (as last item)', 'lsx-customizer' ),
217
-					'main-menu-out'  => esc_html__( 'Main Menu (as last item, right aligned)', 'lsx-customizer' ),
218
-					'top-menu-left'  => esc_html__( 'Top Menu (left)', 'lsx-customizer' ),
219
-					'top-menu-right' => esc_html__( 'Top Menu (right)', 'lsx-customizer' ),
220
-				),
221
-			) ) );
222
-
223
-			$wp_customize->add_setting( 'lsx_wc_cart_extra_html', array(
224
-				'default'           => '',
225
-				'sanitize_callback' => 'wp_kses_post',
226
-			) );
227
-
228
-			$wp_customize->add_control( new LSX_Customizer_Wysiwyg_Control( $wp_customize, 'lsx_wc_cart_extra_html', array(
229
-				'label'       => esc_html__( 'Extra HTML', 'lsx-customizer' ),
230
-				'description' => esc_html__( 'Extra HTML to display at cart page (bottom/left).', 'lsx-customizer' ),
231
-				'section'     => 'lsx-wc-cart',
232
-				'settings'    => 'lsx_wc_cart_extra_html',
233
-				'priority'    => 4,
234
-				'type'        => 'wysiwyg',
235
-			) ) );
236
-
237
-			/**
238
-			 * My Account.
239
-			 */
240
-
241
-			$wp_customize->add_section( 'lsx-wc-my-account' , array(
242
-				'title'       => esc_html__( 'LSX My Account', 'lsx-customizer' ),
243
-				'description' => esc_html__( 'Change the WooCommerce My Account settings.', 'lsx-customizer' ),
244
-				'panel'       => 'woocommerce',
245
-				'priority'    => 4,
246
-			) );
247
-
248
-			$wp_customize->add_setting( 'lsx_wc_my_account_menu_item', array(
249
-				'default'           => false,
250
-				'sanitize_callback' => array( $this, 'sanitize_checkbox' ),
251
-			) );
252
-
253
-			$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_my_account_menu_item', array(
254
-				'label'       => esc_html__( 'Menu Item', 'lsx-customizer' ),
255
-				'description' => esc_html__( 'Enable the My Account menu item.', 'lsx-customizer' ),
256
-				'section'     => 'lsx-wc-my-account',
257
-				'settings'    => 'lsx_wc_my_account_menu_item',
258
-				'type'        => 'checkbox',
259
-				'priority'    => 1,
260
-			) ) );
261
-
262
-			$wp_customize->add_setting( 'lsx_wc_my_account_menu_item_style', array(
263
-				'default' => 'extended',
264
-				'sanitize_callback' => array( $this, 'sanitize_select' ),
265
-			) );
266
-
267
-			$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_my_account_menu_item_style', array(
268
-				'label'       => esc_html__( 'Menu Item Style', 'lsx-customizer' ),
269
-				'description' => esc_html__( 'WooCommerce menu item My Account style.', 'lsx-customizer' ),
270
-				'section'     => 'lsx-wc-my-account',
271
-				'settings'    => 'lsx_wc_my_account_menu_item_style',
272
-				'type'        => 'select',
273
-				'priority'    => 2,
274
-				'choices'     => array(
275
-					'simple'   => esc_html__( 'Simple', 'lsx-customizer' ),
276
-					'extended' => esc_html__( 'Extended', 'lsx-customizer' ),
277
-				),
278
-			) ) );
279
-
280
-			$wp_customize->add_setting( 'lsx_wc_my_account_menu_item_position', array(
281
-				'default' => 'main-menu-in',
282
-				'sanitize_callback' => array( $this, 'sanitize_select' ),
283
-			) );
284
-
285
-			$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_my_account_menu_item_position', array(
286
-				'label'       => esc_html__( 'Menu Item Position', 'lsx-customizer' ),
287
-				'description' => esc_html__( 'WooCommerce menu item My Account position.', 'lsx-customizer' ),
288
-				'section'     => 'lsx-wc-my-account',
289
-				'settings'    => 'lsx_wc_my_account_menu_item_position',
290
-				'type'        => 'select',
291
-				'priority'    => 3,
292
-				'choices'     => array(
293
-					'main-menu-in'   => esc_html__( 'Main Menu (as last item)', 'lsx-customizer' ),
294
-					'main-menu-out'  => esc_html__( 'Main Menu (as last item, right aligned)', 'lsx-customizer' ),
295
-					'top-menu-left'  => esc_html__( 'Top Menu (left)', 'lsx-customizer' ),
296
-					'top-menu-right' => esc_html__( 'Top Menu (right)', 'lsx-customizer' ),
297
-				),
298
-			) ) );
299
-		}
300
-
301
-		/**
302
-		 * Add and remove WC body_class() classes.
303
-		 *
304
-		 * @since 1.1.1
305
-		 */
306
-		public function body_class( $classes ) {
307
-			$distraction_free = get_theme_mod( 'lsx_distraction_free_checkout', false );
308
-			$two_step_checkout = get_theme_mod( 'lsx_two_step_checkout', false );
309
-			if ( is_checkout() ) {
310
-				$layout = get_theme_mod( 'lsx_wc_checkout_layout', 'default' );
311
-
312
-				if ( 'default' === $layout ) {
313
-					$classes[] = 'lsx-wc-checkout-layout-default';
314
-				} elseif ( 'stacked' === $layout ) {
315
-					$classes[] = 'lsx-wc-checkout-layout-stacked';
316
-				} elseif ( 'columns' === $layout ) {
317
-					$classes[] = 'lsx-wc-checkout-layout-two-column-addreses';
318
-				}
319
-				if ( ! empty( $distraction_free ) ) {
320
-					$classes[] = 'lsx-wc-checkout-distraction-free';
321
-				}
322
-				if ( ! empty( $two_step_checkout ) ) {
323
-					$classes[] = 'lsx-wc-checkout-two-steps';
324
-				}
325
-			}
326
-
327
-			return $classes;
328
-		}
329
-
330
-		/**
331
-		 * WC thank you page.
332
-		 *
333
-		 * @since 1.1.1
334
-		 */
335
-		public function thankyou_page() {
336
-			global $wp;
337
-
338
-			if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) {
339
-				$thankyou_page = get_theme_mod( 'lsx_wc_checkout_thankyou_page', '0' );
340
-
341
-				if ( ! empty( $thankyou_page ) && ! is_page( $thankyou_page ) ) {
342
-					$order_id  = apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ) );
343
-					$order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) );
344
-
345
-					if ( $order_id > 0 ) {
346
-						wp_safe_redirect( get_permalink( $thankyou_page ) . '?order-received=' . $order_id . '&key=' . $order_key, 302 );
347
-						exit;
348
-					}
349
-				}
350
-			}
351
-		}
352
-
353
-		/**
354
-		 * Display WC checkout steps.
355
-		 *
356
-		 * @since 1.1.1
357
-		 */
358
-		public function checkout_steps() {
359
-			$cart_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : WC()->cart->get_cart_url();
360
-			if ( ( is_checkout() || is_cart() ) && ! empty( get_theme_mod( 'lsx_checkout_steps', '1' ) ) ) :
361
-				global $wp;
362
-				?>
4
+     /**
5
+      * LSX Customizer WooCommerce Class
6
+      *
7
+      * @package   LSX Customizer
8
+      * @author    LightSpeed
9
+      * @license   GPL3
10
+      * @link
11
+      * @copyright 2016 LightSpeed
12
+      */
13
+     class LSX_Customizer_WooCommerce extends LSX_Customizer {
14
+
15
+          /**
16
+           * Constructor.
17
+           *
18
+           * @since 1.1.1
19
+           */
20
+          public function __construct() {
21
+               add_action( 'customize_register', array( $this, 'customize_register' ), 20 );
22
+
23
+               add_filter( 'body_class', array( $this, 'body_class' ), 2999 );
24
+
25
+               add_action( 'template_redirect', array( $this, 'thankyou_page' ), 2999 );
26
+
27
+               if ( empty( get_theme_mod( 'lsx_two_step_checkout', false ) ) ) {
28
+                    add_action( 'lsx_entry_inside_top', array( $this, 'checkout_steps' ), 15 );
29
+               }
30
+
31
+               add_action( 'wp', array( $this, 'cart_extra_html' ), 2999 );
32
+               add_action( 'wp', array( $this, 'checkout_extra_html' ), 2999 );
33
+               add_action( 'lsx_wc_cart_menu_item_position', array( $this, 'cart_menu_item_position' ) );
34
+               add_action( 'lsx_wc_cart_menu_item_class', array( $this, 'cart_menu_item_class' ) );
35
+
36
+               add_filter( 'wp_nav_menu_items', array( $this, 'my_account_menu_item' ), 9, 2 );
37
+               add_action( 'lsx_wc_my_account_menu_item_position', array( $this, 'my_account_menu_item_position' ) );
38
+               add_action( 'lsx_wc_my_account_menu_item_class', array( $this, 'my_account_menu_item_class' ) );
39
+
40
+               // Shop Layout Switcher.
41
+               //add_action( 'wp_head', array( $this, 'show_layout_switcher' ), 1 );
42
+               //add_filter( 'gridlist_toggle_button_output', array( $this, 'gridlist_toggle_button_output' ), 10, 3 );
43
+          }
44
+
45
+          /**
46
+           * Customizer Controls and Settings.
47
+           *
48
+           * @param WP_Customize_Manager $wp_customize Theme Customizer object.
49
+           * @since 1.1.1
50
+           */
51
+          public function customize_register( $wp_customize ) {
52
+               /**
53
+                * Checkout.
54
+                */
55
+
56
+               $wp_customize->add_section( 'lsx-wc-checkout' , array(
57
+                    'title'       => esc_html__( 'LSX Checkout', 'lsx-customizer' ),
58
+                    'description' => esc_html__( 'Change the WooCommerce checkout settings.', 'lsx-customizer' ),
59
+                    'panel'       => 'woocommerce',
60
+                    'priority'    => 3,
61
+               ) );
62
+
63
+               $wp_customize->add_setting( 'lsx_checkout_steps', array(
64
+                    'default'           => true,
65
+                    'sanitize_callback' => array( $this, 'sanitize_checkbox' ),
66
+               ) );
67
+
68
+               $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_checkout_steps', array(
69
+                    'label'       => esc_html__( 'Steps', 'lsx-customizer' ),
70
+                    'description' => esc_html__( 'Enable the checkout steps header.', 'lsx-customizer' ),
71
+                    'section'     => 'lsx-wc-checkout',
72
+                    'settings'    => 'lsx_checkout_steps',
73
+                    'type'        => 'checkbox',
74
+                    'priority'    => 1,
75
+               ) ) );
76
+
77
+               /**
78
+                * Checkout Layout
79
+                */
80
+               $wp_customize->add_setting( 'lsx_wc_checkout_layout', array(
81
+                    'default' => 'default',
82
+                    'sanitize_callback' => array( $this, 'sanitize_select' ),
83
+               ) );
84
+
85
+               $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_checkout_layout', array(
86
+                    'label'       => esc_html__( 'Layout', 'lsx-customizer' ),
87
+                    'description' => esc_html__( 'WooCommerce checkout layout.', 'lsx-customizer' ),
88
+                    'section'     => 'lsx-wc-checkout',
89
+                    'settings'    => 'lsx_wc_checkout_layout',
90
+                    'type'        => 'select',
91
+                    'priority'    => 2,
92
+                    'choices'     => array(
93
+                         'default' => esc_html__( 'Default', 'lsx-customizer' ),
94
+                         'stacked' => esc_html__( 'Stacked', 'lsx-customizer' ),
95
+                         'columns' => esc_html__( 'Columns', 'lsx-customizer' ),
96
+                    ),
97
+               ) ) );
98
+
99
+               $wp_customize->add_setting( 'lsx_wc_checkout_thankyou_page', array(
100
+                    'default' => '0',
101
+                    'sanitize_callback' => array( $this, 'sanitize_select' ),
102
+               ) );
103
+
104
+               $choices = array(
105
+                    '0' => esc_html__( 'Default', 'lsx-customizer' ),
106
+               );
107
+
108
+               /**
109
+                * Distraction Free Checkout
110
+                */
111
+               $wp_customize->add_setting( 'lsx_distraction_free_checkout', array(
112
+                    'sanitize_callback' => array( $this, 'sanitize_checkbox' ),
113
+               ) );
114
+
115
+               $wp_customize->add_control( new WP_Customize_Control(
116
+                    $wp_customize,
117
+                    'lsx_distraction_free_checkout',
118
+                    array(
119
+                         'label'       => esc_html__( 'Distraction Free Checkout', 'lsx-customizer' ),
120
+                         'description' => esc_html__( 'Removes all clutter from the checkout, allowing the customer to focus entirely on that procedure. Removes the stepped cart and checkout.', 'lsx-customizer' ),
121
+                         'section'     => 'lsx-wc-checkout',
122
+                         'settings'    => 'lsx_distraction_free_checkout',
123
+                         'type'        => 'checkbox',
124
+                         'priority'    => 3,
125
+                    )
126
+               ) );
127
+
128
+               /**
129
+                * Two Step Checkout
130
+                */
131
+               $wp_customize->add_setting( 'lsx_two_step_checkout', array(
132
+                    'sanitize_callback' => array( $this, 'sanitize_checkbox' ),
133
+               ) );
134
+
135
+               $wp_customize->add_control( new WP_Customize_Control(
136
+                    $wp_customize,
137
+                    'lsx_two_step_checkout',
138
+                    array(
139
+                         'label'       => esc_html__( 'Two Step Checkout', 'lsx-customizer' ),
140
+                         'description' => esc_html__( 'Separates the customer details collection form, and the order summary / payment details form in to two separate pages. Removes the stepped cart and checkout.', 'lsx-customizer' ),
141
+                         'section'     => 'lsx-wc-checkout',
142
+                         'settings'    => 'lsx_two_step_checkout',
143
+                         'type'        => 'checkbox',
144
+                         'priority'    => 4,
145
+                    )
146
+               ) );
147
+
148
+               /**
149
+                * Thank you page options
150
+                */
151
+               $pages = get_pages();
152
+
153
+               foreach ( $pages as $key => $page ) {
154
+                    $choices[ $page->ID ] = $page->post_title;
155
+               }
156
+
157
+               $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_checkout_thankyou_page', array(
158
+                    'label'       => esc_html__( 'Thank You Page', 'lsx-customizer' ),
159
+                    'description' => esc_html__( 'WooCommerce checkout thank you page.', 'lsx-customizer' ),
160
+                    'section'     => 'lsx-wc-checkout',
161
+                    'settings'    => 'lsx_wc_checkout_thankyou_page',
162
+                    'type'        => 'select',
163
+                    'priority'    => 5,
164
+                    'choices'     => $choices,
165
+               ) ) );
166
+
167
+               $wp_customize->add_setting( 'lsx_wc_checkout_extra_html', array(
168
+                    'default'           => '',
169
+                    'sanitize_callback' => 'wp_kses_post',
170
+               ) );
171
+
172
+               $wp_customize->add_control( new LSX_Customizer_Wysiwyg_Control( $wp_customize, 'lsx_wc_checkout_extra_html', array(
173
+                    'label'       => esc_html__( 'Extra HTML', 'lsx-customizer' ),
174
+                    'description' => esc_html__( 'Extra HTML to display at checkout page (bottom/right).', 'lsx-customizer' ),
175
+                    'section'     => 'lsx-wc-checkout',
176
+                    'settings'    => 'lsx_wc_checkout_extra_html',
177
+                    'priority'    => 6,
178
+                    'type'        => 'wysiwyg',
179
+               ) ) );
180
+
181
+               /**
182
+                * Cart.
183
+                */
184
+
185
+               $wp_customize->add_setting( 'lsx_wc_cart_menu_item_style', array(
186
+                    'default' => 'extended',
187
+                    'sanitize_callback' => array( $this, 'sanitize_select' ),
188
+               ) );
189
+
190
+               $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_cart_menu_item_style', array(
191
+                    'label'       => esc_html__( 'Menu Item Style', 'lsx-customizer' ),
192
+                    'description' => esc_html__( 'WooCommerce menu item cart style.', 'lsx-customizer' ),
193
+                    'section'     => 'lsx-wc-cart',
194
+                    'settings'    => 'lsx_wc_cart_menu_item_style',
195
+                    'type'        => 'select',
196
+                    'priority'    => 2,
197
+                    'choices'     => array(
198
+                         'simple'   => esc_html__( 'Simple', 'lsx-customizer' ),
199
+                         'extended' => esc_html__( 'Extended', 'lsx-customizer' ),
200
+                    ),
201
+               ) ) );
202
+
203
+               $wp_customize->add_setting( 'lsx_wc_cart_menu_item_position', array(
204
+                    'default' => 'main-menu-in',
205
+                    'sanitize_callback' => array( $this, 'sanitize_select' ),
206
+               ) );
207
+
208
+               $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_cart_menu_item_position', array(
209
+                    'label'       => esc_html__( 'Menu Item Position', 'lsx-customizer' ),
210
+                    'description' => esc_html__( 'WooCommerce menu item cart position.', 'lsx-customizer' ),
211
+                    'section'     => 'lsx-wc-cart',
212
+                    'settings'    => 'lsx_wc_cart_menu_item_position',
213
+                    'type'        => 'select',
214
+                    'priority'    => 3,
215
+                    'choices'     => array(
216
+                         'main-menu-in'   => esc_html__( 'Main Menu (as last item)', 'lsx-customizer' ),
217
+                         'main-menu-out'  => esc_html__( 'Main Menu (as last item, right aligned)', 'lsx-customizer' ),
218
+                         'top-menu-left'  => esc_html__( 'Top Menu (left)', 'lsx-customizer' ),
219
+                         'top-menu-right' => esc_html__( 'Top Menu (right)', 'lsx-customizer' ),
220
+                    ),
221
+               ) ) );
222
+
223
+               $wp_customize->add_setting( 'lsx_wc_cart_extra_html', array(
224
+                    'default'           => '',
225
+                    'sanitize_callback' => 'wp_kses_post',
226
+               ) );
227
+
228
+               $wp_customize->add_control( new LSX_Customizer_Wysiwyg_Control( $wp_customize, 'lsx_wc_cart_extra_html', array(
229
+                    'label'       => esc_html__( 'Extra HTML', 'lsx-customizer' ),
230
+                    'description' => esc_html__( 'Extra HTML to display at cart page (bottom/left).', 'lsx-customizer' ),
231
+                    'section'     => 'lsx-wc-cart',
232
+                    'settings'    => 'lsx_wc_cart_extra_html',
233
+                    'priority'    => 4,
234
+                    'type'        => 'wysiwyg',
235
+               ) ) );
236
+
237
+               /**
238
+                * My Account.
239
+                */
240
+
241
+               $wp_customize->add_section( 'lsx-wc-my-account' , array(
242
+                    'title'       => esc_html__( 'LSX My Account', 'lsx-customizer' ),
243
+                    'description' => esc_html__( 'Change the WooCommerce My Account settings.', 'lsx-customizer' ),
244
+                    'panel'       => 'woocommerce',
245
+                    'priority'    => 4,
246
+               ) );
247
+
248
+               $wp_customize->add_setting( 'lsx_wc_my_account_menu_item', array(
249
+                    'default'           => false,
250
+                    'sanitize_callback' => array( $this, 'sanitize_checkbox' ),
251
+               ) );
252
+
253
+               $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_my_account_menu_item', array(
254
+                    'label'       => esc_html__( 'Menu Item', 'lsx-customizer' ),
255
+                    'description' => esc_html__( 'Enable the My Account menu item.', 'lsx-customizer' ),
256
+                    'section'     => 'lsx-wc-my-account',
257
+                    'settings'    => 'lsx_wc_my_account_menu_item',
258
+                    'type'        => 'checkbox',
259
+                    'priority'    => 1,
260
+               ) ) );
261
+
262
+               $wp_customize->add_setting( 'lsx_wc_my_account_menu_item_style', array(
263
+                    'default' => 'extended',
264
+                    'sanitize_callback' => array( $this, 'sanitize_select' ),
265
+               ) );
266
+
267
+               $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_my_account_menu_item_style', array(
268
+                    'label'       => esc_html__( 'Menu Item Style', 'lsx-customizer' ),
269
+                    'description' => esc_html__( 'WooCommerce menu item My Account style.', 'lsx-customizer' ),
270
+                    'section'     => 'lsx-wc-my-account',
271
+                    'settings'    => 'lsx_wc_my_account_menu_item_style',
272
+                    'type'        => 'select',
273
+                    'priority'    => 2,
274
+                    'choices'     => array(
275
+                         'simple'   => esc_html__( 'Simple', 'lsx-customizer' ),
276
+                         'extended' => esc_html__( 'Extended', 'lsx-customizer' ),
277
+                    ),
278
+               ) ) );
279
+
280
+               $wp_customize->add_setting( 'lsx_wc_my_account_menu_item_position', array(
281
+                    'default' => 'main-menu-in',
282
+                    'sanitize_callback' => array( $this, 'sanitize_select' ),
283
+               ) );
284
+
285
+               $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_my_account_menu_item_position', array(
286
+                    'label'       => esc_html__( 'Menu Item Position', 'lsx-customizer' ),
287
+                    'description' => esc_html__( 'WooCommerce menu item My Account position.', 'lsx-customizer' ),
288
+                    'section'     => 'lsx-wc-my-account',
289
+                    'settings'    => 'lsx_wc_my_account_menu_item_position',
290
+                    'type'        => 'select',
291
+                    'priority'    => 3,
292
+                    'choices'     => array(
293
+                         'main-menu-in'   => esc_html__( 'Main Menu (as last item)', 'lsx-customizer' ),
294
+                         'main-menu-out'  => esc_html__( 'Main Menu (as last item, right aligned)', 'lsx-customizer' ),
295
+                         'top-menu-left'  => esc_html__( 'Top Menu (left)', 'lsx-customizer' ),
296
+                         'top-menu-right' => esc_html__( 'Top Menu (right)', 'lsx-customizer' ),
297
+                    ),
298
+               ) ) );
299
+          }
300
+
301
+          /**
302
+           * Add and remove WC body_class() classes.
303
+           *
304
+           * @since 1.1.1
305
+           */
306
+          public function body_class( $classes ) {
307
+               $distraction_free = get_theme_mod( 'lsx_distraction_free_checkout', false );
308
+               $two_step_checkout = get_theme_mod( 'lsx_two_step_checkout', false );
309
+               if ( is_checkout() ) {
310
+                    $layout = get_theme_mod( 'lsx_wc_checkout_layout', 'default' );
311
+
312
+                    if ( 'default' === $layout ) {
313
+                         $classes[] = 'lsx-wc-checkout-layout-default';
314
+                    } elseif ( 'stacked' === $layout ) {
315
+                         $classes[] = 'lsx-wc-checkout-layout-stacked';
316
+                    } elseif ( 'columns' === $layout ) {
317
+                         $classes[] = 'lsx-wc-checkout-layout-two-column-addreses';
318
+                    }
319
+                    if ( ! empty( $distraction_free ) ) {
320
+                         $classes[] = 'lsx-wc-checkout-distraction-free';
321
+                    }
322
+                    if ( ! empty( $two_step_checkout ) ) {
323
+                         $classes[] = 'lsx-wc-checkout-two-steps';
324
+                    }
325
+               }
326
+
327
+               return $classes;
328
+          }
329
+
330
+          /**
331
+           * WC thank you page.
332
+           *
333
+           * @since 1.1.1
334
+           */
335
+          public function thankyou_page() {
336
+               global $wp;
337
+
338
+               if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) {
339
+                    $thankyou_page = get_theme_mod( 'lsx_wc_checkout_thankyou_page', '0' );
340
+
341
+                    if ( ! empty( $thankyou_page ) && ! is_page( $thankyou_page ) ) {
342
+                         $order_id  = apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ) );
343
+                         $order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) );
344
+
345
+                         if ( $order_id > 0 ) {
346
+                              wp_safe_redirect( get_permalink( $thankyou_page ) . '?order-received=' . $order_id . '&key=' . $order_key, 302 );
347
+                              exit;
348
+                         }
349
+                    }
350
+               }
351
+          }
352
+
353
+          /**
354
+           * Display WC checkout steps.
355
+           *
356
+           * @since 1.1.1
357
+           */
358
+          public function checkout_steps() {
359
+               $cart_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : WC()->cart->get_cart_url();
360
+               if ( ( is_checkout() || is_cart() ) && ! empty( get_theme_mod( 'lsx_checkout_steps', '1' ) ) ) :
361
+                    global $wp;
362
+                    ?>
363 363
 				<div class="lsx-wc-checkout-steps">
364 364
 					<ul class="lsx-wc-checkout-steps-items">
365 365
 
@@ -452,266 +452,266 @@  discard block
 block discarded – undo
452 452
 					</ul>
453 453
 				</div>
454 454
 				<?php
455
-			endif;
456
-		}
457
-
458
-		/**
459
-		 * Display extra HTML on checkout.
460
-		 *
461
-		 * @since 1.1.1
462
-		 */
463
-		public function checkout_extra_html() {
464
-			if ( is_checkout() ) {
465
-				$checkout_extra_html = get_theme_mod( 'lsx_wc_checkout_extra_html', '' );
466
-
467
-				if ( ! empty( $checkout_extra_html ) ) {
468
-					add_action( 'woocommerce_review_order_after_payment', array( $this, 'checkout_extra_html_echo' ), 9 );
469
-				}
470
-			}
471
-		}
472
-
473
-		/**
474
-		 * Display extra HTML on checkout.
475
-		 *
476
-		 * @since 1.1.1
477
-		 */
478
-		public function checkout_extra_html_echo() {
479
-			if ( is_checkout() ) {
480
-				$checkout_extra_html = get_theme_mod( 'lsx_wc_checkout_extra_html', '' );
481
-
482
-				if ( ! empty( $checkout_extra_html ) ) {
483
-					?>
455
+               endif;
456
+          }
457
+
458
+          /**
459
+           * Display extra HTML on checkout.
460
+           *
461
+           * @since 1.1.1
462
+           */
463
+          public function checkout_extra_html() {
464
+               if ( is_checkout() ) {
465
+                    $checkout_extra_html = get_theme_mod( 'lsx_wc_checkout_extra_html', '' );
466
+
467
+                    if ( ! empty( $checkout_extra_html ) ) {
468
+                         add_action( 'woocommerce_review_order_after_payment', array( $this, 'checkout_extra_html_echo' ), 9 );
469
+                    }
470
+               }
471
+          }
472
+
473
+          /**
474
+           * Display extra HTML on checkout.
475
+           *
476
+           * @since 1.1.1
477
+           */
478
+          public function checkout_extra_html_echo() {
479
+               if ( is_checkout() ) {
480
+                    $checkout_extra_html = get_theme_mod( 'lsx_wc_checkout_extra_html', '' );
481
+
482
+                    if ( ! empty( $checkout_extra_html ) ) {
483
+                         ?>
484 484
 					<div class="lsx-wc-checkout-extra-html">
485 485
 						<?php echo wp_kses_post( $checkout_extra_html ); ?>
486 486
 					</div>
487 487
 				<?php
488
-				}
489
-			}
490
-		}
491
-
492
-		/**
493
-		 * Display extra HTML on cart.
494
-		 *
495
-		 * @since 1.1.1
496
-		 */
497
-		public function cart_extra_html() {
498
-			if ( is_cart() ) {
499
-				$cart_extra_html = get_theme_mod( 'lsx_wc_cart_extra_html', '' );
500
-
501
-				if ( ! empty( $cart_extra_html ) ) {
502
-					remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
503
-					add_action( 'woocommerce_cart_collaterals', array( $this, 'cart_extra_html_echo' ), 9 );
504
-				}
505
-			}
506
-		}
507
-
508
-		/**
509
-		 * Display extra HTML on cart.
510
-		 *
511
-		 * @since 1.1.1
512
-		 */
513
-		public function cart_extra_html_echo() {
514
-			if ( is_cart() ) {
515
-				$cart_extra_html = get_theme_mod( 'lsx_wc_cart_extra_html', '' );
516
-
517
-				if ( ! empty( $cart_extra_html ) ) { ?>
488
+                    }
489
+               }
490
+          }
491
+
492
+          /**
493
+           * Display extra HTML on cart.
494
+           *
495
+           * @since 1.1.1
496
+           */
497
+          public function cart_extra_html() {
498
+               if ( is_cart() ) {
499
+                    $cart_extra_html = get_theme_mod( 'lsx_wc_cart_extra_html', '' );
500
+
501
+                    if ( ! empty( $cart_extra_html ) ) {
502
+                         remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
503
+                         add_action( 'woocommerce_cart_collaterals', array( $this, 'cart_extra_html_echo' ), 9 );
504
+                    }
505
+               }
506
+          }
507
+
508
+          /**
509
+           * Display extra HTML on cart.
510
+           *
511
+           * @since 1.1.1
512
+           */
513
+          public function cart_extra_html_echo() {
514
+               if ( is_cart() ) {
515
+                    $cart_extra_html = get_theme_mod( 'lsx_wc_cart_extra_html', '' );
516
+
517
+                    if ( ! empty( $cart_extra_html ) ) { ?>
518 518
 					<div class="lsx-wc-cart-extra-html">
519 519
 						<?php echo wp_kses_post( $cart_extra_html ); ?>
520 520
 					</div>
521 521
 				<?php }
522
-			}
523
-		}
524
-
525
-		/**
526
-		 * The place (menu) to display the cart menu item position.
527
-		 *
528
-		 * @since 1.1.1
529
-		 */
530
-		public function cart_menu_item_position( $menu_position ) {
531
-			$position = get_theme_mod( 'lsx_wc_cart_menu_item_position', '' );
532
-
533
-			if ( ! empty( $position ) ) {
534
-				switch ( $position ) {
535
-					case 'main-menu-in':
536
-					case 'main-menu-out':
537
-						$menu_position = 'primary';
538
-						break;
539
-
540
-					case 'top-menu-right':
541
-						$menu_position = 'top-menu';
542
-						break;
543
-
544
-					case 'top-menu-left':
545
-						$menu_position = 'top-menu-left';
546
-						break;
547
-				}
548
-			}
549
-
550
-			return $menu_position;
551
-		}
552
-
553
-		/**
554
-		 * The place (menu) to display the cart menu item position.
555
-		 *
556
-		 * @since 1.1.1
557
-		 */
558
-		public function cart_menu_item_class( $item_class ) {
559
-			$position = get_theme_mod( 'lsx_wc_cart_menu_item_position', '' );
560
-
561
-			if ( 'main-menu-out' === $position ) {
562
-				$item_class .= ' lsx-wc-cart-menu-item-right-aligned';
563
-			}
564
-
565
-			$style = get_theme_mod( 'lsx_wc_cart_menu_item_style', '' );
566
-
567
-			if ( 'simple' === $style ) {
568
-				$item_class .= ' lsx-wc-cart-menu-item-simple';
569
-			}
570
-
571
-			return $item_class;
572
-		}
573
-
574
-		/**
575
-		 * Adds WC My Account to the header.
576
-		 *
577
-		 * @since 1.1.1
578
-		 */
579
-		public function my_account_menu_item( $items, $args ) {
580
-			$my_account_menu_item_position = apply_filters( 'lsx_wc_my_account_menu_item_position', 'primary' );
581
-
582
-			if ( $my_account_menu_item_position === $args->theme_location || ( 'primary_logged_out' === $args->theme_location && 'primary' === $my_account_menu_item_position ) ) {
583
-				$customizer_option  = get_theme_mod( 'lsx_wc_my_account_menu_item', false );
584
-
585
-				if ( ! empty( $customizer_option ) ) {
586
-					if ( is_account_page() ) {
587
-						$class = 'current-menu-item';
588
-					} else {
589
-						$class = '';
590
-					}
591
-
592
-					$item_class = 'menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children dropdown lsx-wc-my-account-menu-item ' . $class;
593
-					$item_class = apply_filters( 'lsx_wc_my_account_menu_item_class', $item_class );
594
-
595
-					$endpoints = WC()->query->get_query_vars();
596
-
597
-					if ( is_user_logged_in() ) {
598
-						$item  = '<li class="' . $item_class . '">';
599
-						$item .= '<a title="' . esc_attr__( 'View your account', 'lsx-customizer' ) . '" href="' . esc_url( get_permalink( wc_get_page_id( 'myaccount' ) ) ) . '" data-toggle="dropdown" class="dropdown-toggle" aria-haspopup="true"><span>' . esc_attr__( 'My Account', 'lsx-customizer' ) . '</span></a>';
600
-						$item .= '<ul role="menu" class=" dropdown-menu lsx-wc-my-account-sub-menu">';
601
-							foreach ( wc_get_account_menu_items() as $endpoint => $label ) {
602
-								$slug = $endpoint;
603
-								if ( isset( $endpoints[ $endpoint ] ) && '' !== $endpoints[ $endpoint ] ) {
604
-									$slug = $endpoints[ $endpoint ];
605
-								}
606
-								if ( 'dashboard' === $slug ) {
607
-									$slug = '';
608
-								}
609
-								$item .= '<li class="menu-item"><a title="" href="' . esc_url( get_permalink( wc_get_page_id( 'myaccount' ) ) . $slug ) . '">' . $label . '</a></li>';
610
-							}
611
-						$item .= '</ul></li>';
612
-
613
-					} else {
614
-						$item = '<li class="' . $item_class . '">' .
615
-									'<a title="' . esc_attr__( 'View your account', 'lsx-customizer' ) . '" href="' . esc_url( get_permalink( wc_get_page_id( 'myaccount' ) ) ) . '"><span>' . esc_attr__( 'Login', 'lsx-customizer' ) . '</span></a>' .
616
-								'</li>';
617
-					}
618
-
619
-					if ( 'top-menu' === $args->theme_location ) {
620
-						$items = $item . $items;
621
-					} else {
622
-						$items = $items . $item;
623
-					}
624
-				}
625
-			}
626
-
627
-			return $items;
628
-		}
629
-
630
-		/**
631
-		 * The place (menu) to display the My Account menu item position.
632
-		 *
633
-		 * @since 1.1.1
634
-		 */
635
-		public function my_account_menu_item_position( $menu_position ) {
636
-			$position = get_theme_mod( 'lsx_wc_my_account_menu_item_position', '' );
637
-
638
-			if ( ! empty( $position ) ) {
639
-				switch ( $position ) {
640
-					case 'main-menu-in':
641
-					case 'main-menu-out':
642
-						$menu_position = 'primary';
643
-						break;
644
-
645
-					case 'top-menu-right':
646
-						$menu_position = 'top-menu';
647
-						break;
648
-
649
-					case 'top-menu-left':
650
-						$menu_position = 'top-menu-left';
651
-						break;
652
-				}
653
-			}
654
-
655
-			return $menu_position;
656
-		}
657
-
658
-		/**
659
-		 * The place (menu) to display the My Account menu item position.
660
-		 *
661
-		 * @since 1.1.1
662
-		 */
663
-		public function my_account_menu_item_class( $item_class ) {
664
-			$position = get_theme_mod( 'lsx_wc_my_account_menu_item_position', '' );
665
-
666
-			if ( 'main-menu-out' === $position ) {
667
-				$item_class .= ' lsx-wc-my-account-menu-item-right-aligned';
668
-			}
669
-
670
-			if ( ! is_user_logged_in() ) {
671
-				$item_class .= ' lsx-wc-my-account-login';
672
-			}
673
-
674
-			$style = get_theme_mod( 'lsx_wc_my_account_menu_item_style', '' );
675
-
676
-			if ( 'simple' === $style ) {
677
-				$item_class .= ' lsx-wc-my-account-menu-item-simple';
678
-			}
679
-
680
-			return $item_class;
681
-		}
682
-		/**
683
-		 * Display the woocommerce archive swticher.
684
-		 */
685
-		public function show_layout_switcher() {
686
-			$body_classes = get_body_class();
687
-			if ( in_array( 'post-type-archive-product', $body_classes ) ) {
688
-				global $WC_List_Grid;
689
-				if ( null !== $WC_List_Grid ) {
690
-					remove_action( 'woocommerce_before_shop_loop', array( $WC_List_Grid, 'gridlist_toggle_button' ), 30 );
691
-					add_action( 'lsx_banner_inner_bottom', array( $this, 'shop_gridlist_toggle_button' ), 90 );
692
-					add_action( 'lsx_global_header_inner_bottom', array( $this, 'shop_gridlist_toggle_button' ), 90 );
693
-					wp_deregister_style( 'grid-list-button' );
694
-				}
695
-			}
696
-		}
697
-		/**
698
-		 * Display the woocommerce archive swticher.
699
-		 */
700
-		public function shop_gridlist_toggle_button() {
701
-			global $WC_List_Grid;
702
-			?>
522
+               }
523
+          }
524
+
525
+          /**
526
+           * The place (menu) to display the cart menu item position.
527
+           *
528
+           * @since 1.1.1
529
+           */
530
+          public function cart_menu_item_position( $menu_position ) {
531
+               $position = get_theme_mod( 'lsx_wc_cart_menu_item_position', '' );
532
+
533
+               if ( ! empty( $position ) ) {
534
+                    switch ( $position ) {
535
+                         case 'main-menu-in':
536
+                         case 'main-menu-out':
537
+                              $menu_position = 'primary';
538
+                              break;
539
+
540
+                         case 'top-menu-right':
541
+                              $menu_position = 'top-menu';
542
+                              break;
543
+
544
+                         case 'top-menu-left':
545
+                              $menu_position = 'top-menu-left';
546
+                              break;
547
+                    }
548
+               }
549
+
550
+               return $menu_position;
551
+          }
552
+
553
+          /**
554
+           * The place (menu) to display the cart menu item position.
555
+           *
556
+           * @since 1.1.1
557
+           */
558
+          public function cart_menu_item_class( $item_class ) {
559
+               $position = get_theme_mod( 'lsx_wc_cart_menu_item_position', '' );
560
+
561
+               if ( 'main-menu-out' === $position ) {
562
+                    $item_class .= ' lsx-wc-cart-menu-item-right-aligned';
563
+               }
564
+
565
+               $style = get_theme_mod( 'lsx_wc_cart_menu_item_style', '' );
566
+
567
+               if ( 'simple' === $style ) {
568
+                    $item_class .= ' lsx-wc-cart-menu-item-simple';
569
+               }
570
+
571
+               return $item_class;
572
+          }
573
+
574
+          /**
575
+           * Adds WC My Account to the header.
576
+           *
577
+           * @since 1.1.1
578
+           */
579
+          public function my_account_menu_item( $items, $args ) {
580
+               $my_account_menu_item_position = apply_filters( 'lsx_wc_my_account_menu_item_position', 'primary' );
581
+
582
+               if ( $my_account_menu_item_position === $args->theme_location || ( 'primary_logged_out' === $args->theme_location && 'primary' === $my_account_menu_item_position ) ) {
583
+                    $customizer_option  = get_theme_mod( 'lsx_wc_my_account_menu_item', false );
584
+
585
+                    if ( ! empty( $customizer_option ) ) {
586
+                         if ( is_account_page() ) {
587
+                              $class = 'current-menu-item';
588
+                         } else {
589
+                              $class = '';
590
+                         }
591
+
592
+                         $item_class = 'menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children dropdown lsx-wc-my-account-menu-item ' . $class;
593
+                         $item_class = apply_filters( 'lsx_wc_my_account_menu_item_class', $item_class );
594
+
595
+                         $endpoints = WC()->query->get_query_vars();
596
+
597
+                         if ( is_user_logged_in() ) {
598
+                              $item  = '<li class="' . $item_class . '">';
599
+                              $item .= '<a title="' . esc_attr__( 'View your account', 'lsx-customizer' ) . '" href="' . esc_url( get_permalink( wc_get_page_id( 'myaccount' ) ) ) . '" data-toggle="dropdown" class="dropdown-toggle" aria-haspopup="true"><span>' . esc_attr__( 'My Account', 'lsx-customizer' ) . '</span></a>';
600
+                              $item .= '<ul role="menu" class=" dropdown-menu lsx-wc-my-account-sub-menu">';
601
+                                   foreach ( wc_get_account_menu_items() as $endpoint => $label ) {
602
+                                        $slug = $endpoint;
603
+                                        if ( isset( $endpoints[ $endpoint ] ) && '' !== $endpoints[ $endpoint ] ) {
604
+                                             $slug = $endpoints[ $endpoint ];
605
+                                        }
606
+                                        if ( 'dashboard' === $slug ) {
607
+                                             $slug = '';
608
+                                        }
609
+                                        $item .= '<li class="menu-item"><a title="" href="' . esc_url( get_permalink( wc_get_page_id( 'myaccount' ) ) . $slug ) . '">' . $label . '</a></li>';
610
+                                   }
611
+                              $item .= '</ul></li>';
612
+
613
+                         } else {
614
+                              $item = '<li class="' . $item_class . '">' .
615
+                                             '<a title="' . esc_attr__( 'View your account', 'lsx-customizer' ) . '" href="' . esc_url( get_permalink( wc_get_page_id( 'myaccount' ) ) ) . '"><span>' . esc_attr__( 'Login', 'lsx-customizer' ) . '</span></a>' .
616
+                                        '</li>';
617
+                         }
618
+
619
+                         if ( 'top-menu' === $args->theme_location ) {
620
+                              $items = $item . $items;
621
+                         } else {
622
+                              $items = $items . $item;
623
+                         }
624
+                    }
625
+               }
626
+
627
+               return $items;
628
+          }
629
+
630
+          /**
631
+           * The place (menu) to display the My Account menu item position.
632
+           *
633
+           * @since 1.1.1
634
+           */
635
+          public function my_account_menu_item_position( $menu_position ) {
636
+               $position = get_theme_mod( 'lsx_wc_my_account_menu_item_position', '' );
637
+
638
+               if ( ! empty( $position ) ) {
639
+                    switch ( $position ) {
640
+                         case 'main-menu-in':
641
+                         case 'main-menu-out':
642
+                              $menu_position = 'primary';
643
+                              break;
644
+
645
+                         case 'top-menu-right':
646
+                              $menu_position = 'top-menu';
647
+                              break;
648
+
649
+                         case 'top-menu-left':
650
+                              $menu_position = 'top-menu-left';
651
+                              break;
652
+                    }
653
+               }
654
+
655
+               return $menu_position;
656
+          }
657
+
658
+          /**
659
+           * The place (menu) to display the My Account menu item position.
660
+           *
661
+           * @since 1.1.1
662
+           */
663
+          public function my_account_menu_item_class( $item_class ) {
664
+               $position = get_theme_mod( 'lsx_wc_my_account_menu_item_position', '' );
665
+
666
+               if ( 'main-menu-out' === $position ) {
667
+                    $item_class .= ' lsx-wc-my-account-menu-item-right-aligned';
668
+               }
669
+
670
+               if ( ! is_user_logged_in() ) {
671
+                    $item_class .= ' lsx-wc-my-account-login';
672
+               }
673
+
674
+               $style = get_theme_mod( 'lsx_wc_my_account_menu_item_style', '' );
675
+
676
+               if ( 'simple' === $style ) {
677
+                    $item_class .= ' lsx-wc-my-account-menu-item-simple';
678
+               }
679
+
680
+               return $item_class;
681
+          }
682
+          /**
683
+           * Display the woocommerce archive swticher.
684
+           */
685
+          public function show_layout_switcher() {
686
+               $body_classes = get_body_class();
687
+               if ( in_array( 'post-type-archive-product', $body_classes ) ) {
688
+                    global $WC_List_Grid;
689
+                    if ( null !== $WC_List_Grid ) {
690
+                         remove_action( 'woocommerce_before_shop_loop', array( $WC_List_Grid, 'gridlist_toggle_button' ), 30 );
691
+                         add_action( 'lsx_banner_inner_bottom', array( $this, 'shop_gridlist_toggle_button' ), 90 );
692
+                         add_action( 'lsx_global_header_inner_bottom', array( $this, 'shop_gridlist_toggle_button' ), 90 );
693
+                         wp_deregister_style( 'grid-list-button' );
694
+                    }
695
+               }
696
+          }
697
+          /**
698
+           * Display the woocommerce archive swticher.
699
+           */
700
+          public function shop_gridlist_toggle_button() {
701
+               global $WC_List_Grid;
702
+               ?>
703 703
 			<div class="lsx-layout-switcher">
704 704
 				<span class="lsx-layout-switcher-label"><?php esc_html_e( 'Select view:', 'lsx-blog-customizer' ); ?></span>
705 705
 				<?php $WC_List_Grid->gridlist_toggle_button(); ?>
706 706
 			</div>
707 707
 			<?php
708
-		}
709
-		public function gridlist_toggle_button_output( $output, $grid_view, $list_view ) {
710
-			$output = sprintf( '<div class="gridlist-toggle lsx-layout-switcher-options"><a href="#" class="lsx-layout-switcher-option" id="grid" title="%1$s"><span class="fa fa fa-th"></span></a><a href="#" class="lsx-layout-switcher-option" id="list" title="%2$s"><span class="fa fa-bars"></span></a></div>', $grid_view, $list_view );
711
-			return $output;
712
-		}
713
-	}
714
-
715
-	new LSX_Customizer_WooCommerce;
708
+          }
709
+          public function gridlist_toggle_button_output( $output, $grid_view, $list_view ) {
710
+               $output = sprintf( '<div class="gridlist-toggle lsx-layout-switcher-options"><a href="#" class="lsx-layout-switcher-option" id="grid" title="%1$s"><span class="fa fa fa-th"></span></a><a href="#" class="lsx-layout-switcher-option" id="list" title="%2$s"><span class="fa fa-bars"></span></a></div>', $grid_view, $list_view );
711
+               return $output;
712
+          }
713
+     }
714
+
715
+     new LSX_Customizer_WooCommerce;
716 716
 
717 717
 }
Please login to merge, or discard this patch.
examples/lsx-customizer-colour.php 1 patch
Indentation   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@  discard block
 block discarded – undo
6 6
  * Add two new colors (test) in main array of colors
7 7
  */
8 8
 function test_lsx_customizer_colour_names( $array ) {
9
-	$array['test_text_color']       = esc_html__( 'TEST: Text', 'lsx-customizer' );
10
-	$array['test_text_color_hover'] = esc_html__( 'TEST: Text (hover)', 'lsx-customizer' );
11
-	return $array;
9
+     $array['test_text_color']       = esc_html__( 'TEST: Text', 'lsx-customizer' );
10
+     $array['test_text_color_hover'] = esc_html__( 'TEST: Text (hover)', 'lsx-customizer' );
11
+     return $array;
12 12
 }
13 13
 add_filter( 'lsx_customizer_colour_names', 'test_lsx_customizer_colour_names' );
14 14
 
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
  * Add the new colors (test) in default scheme
19 19
  */
20 20
 function test_lsx_customizer_colour_choices_default( $array ) {
21
-	$array['test_text_color']       = '#ddddd1';
22
-	$array['test_text_color_hover'] = '#eeeee1';
23
-	return $array;
21
+     $array['test_text_color']       = '#ddddd1';
22
+     $array['test_text_color_hover'] = '#eeeee1';
23
+     return $array;
24 24
 }
25 25
 add_filter( 'lsx_customizer_colour_choices_default', 'test_lsx_customizer_colour_choices_default' );
26 26
 
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
  * Add the new colors (test) in red scheme
31 31
  */
32 32
 function test_lsx_customizer_colour_choices_red( $array ) {
33
-	$array['test_text_color']       = '#ddddd2';
34
-	$array['test_text_color_hover'] = '#eeeee2';
35
-	return $array;
33
+     $array['test_text_color']       = '#ddddd2';
34
+     $array['test_text_color_hover'] = '#eeeee2';
35
+     return $array;
36 36
 }
37 37
 add_filter( 'lsx_customizer_colour_choices_red', 'test_lsx_customizer_colour_choices_red' );
38 38
 
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
  * Add the new colors (test) in orange scheme
43 43
  */
44 44
 function test_lsx_customizer_colour_choices_orange( $array ) {
45
-	$array['test_text_color']       = '#ddddd3';
46
-	$array['test_text_color_hover'] = '#eeeee3';
47
-	return $array;
45
+     $array['test_text_color']       = '#ddddd3';
46
+     $array['test_text_color_hover'] = '#eeeee3';
47
+     return $array;
48 48
 }
49 49
 add_filter( 'lsx_customizer_colour_choices_orange', 'test_lsx_customizer_colour_choices_orange' );
50 50
 
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
  * Add the new colors (test) in green scheme
55 55
  */
56 56
 function test_lsx_customizer_colour_choices_green( $array ) {
57
-	$array['test_text_color']       = '#ddddd4';
58
-	$array['test_text_color_hover'] = '#eeeee4';
59
-	return $array;
57
+     $array['test_text_color']       = '#ddddd4';
58
+     $array['test_text_color_hover'] = '#eeeee4';
59
+     return $array;
60 60
 }
61 61
 add_filter( 'lsx_customizer_colour_choices_green', 'test_lsx_customizer_colour_choices_green' );
62 62
 
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
  * Add the new colors (test) in brown scheme
67 67
  */
68 68
 function test_lsx_customizer_colour_choices_brown( $array ) {
69
-	$array['test_text_color']       = '#ddddd5';
70
-	$array['test_text_color_hover'] = '#eeeee5';
71
-	return $array;
69
+     $array['test_text_color']       = '#ddddd5';
70
+     $array['test_text_color_hover'] = '#eeeee5';
71
+     return $array;
72 72
 }
73 73
 add_filter( 'lsx_customizer_colour_choices_brown', 'test_lsx_customizer_colour_choices_brown' );
74 74
 
@@ -79,88 +79,88 @@  discard block
 block discarded – undo
79 79
  * Also add the new colors (test) in new scheme
80 80
  */
81 81
 function test_lsx_customizer_colour_choices( $array ) {
82
-	$array['test'] = array(
83
-		'label'  => esc_html__( 'Test', 'lsx-customizer' ),
84
-		'colors' => array(
85
-			'button_background_color'       => '#428bca',
86
-			'button_background_hover_color' => '#2a6496',
87
-			'button_text_color'             => '#ffffff',
88
-			'button_text_color_hover'       => '#ffffff',
89
-			'button_shadow'                 => '#2a6496',
90
-
91
-			'button_cta_background_color'       => '#f7941d',
92
-			'button_cta_background_hover_color' => '#f7741d',
93
-			'button_cta_text_color'             => '#ffffff',
94
-			'button_cta_text_color_hover'       => '#ffffff',
95
-			'button_cta_shadow'                 => '#f7741d',
96
-
97
-			'top_menu_background_color'          => '#333333',
98
-			'top_menu_link_color'                => '#ffffff',
99
-			'top_menu_link_hover_color'          => '#428bca',
100
-			'top_menu_icon_color'                => '#428bca',
101
-			'top_menu_icon_hover_color'          => '#ffffff',
102
-			'top_menu_dropdown_color'            => '#333333',
103
-			'top_menu_dropdown_hover_color'      => '#444444',
104
-			'top_menu_dropdown_link_color'       => '#ffffff',
105
-			'top_menu_dropdown_link_hover_color' => '#428bca',
106
-
107
-			'header_background_color'  => '#ffffff',
108
-			'header_link_color'        => '#428bca',
109
-			'header_link_hover_color'  => '#1072c9',
110
-			'header_description_color' => '#555555',
111
-
112
-			'main_menu_background_color'                => '#ffffff',
113
-			'main_menu_link_color'                      => '#555555',
114
-			'main_menu_link_hover_color'                => '#ffffff',
115
-			'main_menu_dropdown_background_color'       => '#428bca',
116
-			'main_menu_dropdown_background_hover_color' => '#1072c9',
117
-			'main_menu_dropdown_link_color'             => '#ffffff',
118
-			'main_menu_dropdown_link_hover_color'       => '#dddddd',
119
-
120
-			'banner_background_color'               => '#2a6496',
121
-			'banner_text_color'                     => '#ffffff',
122
-			'banner_text_image_color'               => '#ffffff',
123
-			'banner_breadcrumb_background_color'    => '#374750',
124
-			'banner_breadcrumb_text_color'          => '#919191',
125
-			'banner_breadcrumb_text_selected_color' => '#ffffff',
126
-
127
-			'background_color'                       => '#ffffff',
128
-			'body_line_color'                        => '#dddddd',
129
-			'body_text_heading_color'                => '#333333',
130
-			'body_text_small_color'                  => '#919191',
131
-			'body_text_color'                        => '#333333',
132
-			'body_link_color'                        => '#596b46',
133
-			'body_link_hover_color'                  => '#3d4a30',
134
-			'body_section_full_background_color'     => '#596b46',
135
-			'body_section_full_text_color'           => '#ffffff',
136
-			'body_section_full_link_color'           => '#eeeeee',
137
-			'body_section_full_link_hover_color'     => '#dddddd',
138
-			'body_section_full_cta_background_color' => '#333333',
139
-			'body_section_full_cta_text_color'       => '#ffffff',
140
-			'body_section_full_cta_link_color'       => '#eeeeee',
141
-			'body_section_full_cta_link_hover_color' => '#dddddd',
142
-
143
-			'footer_cta_background_color' => '#428bca',
144
-			'footer_cta_text_color'       => '#ffffff',
145
-			'footer_cta_link_color'       => '#dddddd',
146
-			'footer_cta_link_hover_color' => '#ffffff',
147
-
148
-			'footer_widgets_background_color' => '#333333',
149
-			'footer_widgets_text_color'       => '#eeeeee',
150
-			'footer_widgets_link_color'       => '#428bca',
151
-			'footer_widgets_link_hover_color' => '#1072c9',
152
-
153
-			'footer_background_color' => '#232222',
154
-			'footer_text_color'       => '#ffffff',
155
-			'footer_link_color'       => '#428bca',
156
-			'footer_link_hover_color' => '#1072c9',
157
-
158
-			'test_text_color'       => '#ddddd6',
159
-			'test_text_color_hover' => '#eeeee6',
160
-		),
161
-	);
162
-
163
-	return $array;
82
+     $array['test'] = array(
83
+          'label'  => esc_html__( 'Test', 'lsx-customizer' ),
84
+          'colors' => array(
85
+               'button_background_color'       => '#428bca',
86
+               'button_background_hover_color' => '#2a6496',
87
+               'button_text_color'             => '#ffffff',
88
+               'button_text_color_hover'       => '#ffffff',
89
+               'button_shadow'                 => '#2a6496',
90
+
91
+               'button_cta_background_color'       => '#f7941d',
92
+               'button_cta_background_hover_color' => '#f7741d',
93
+               'button_cta_text_color'             => '#ffffff',
94
+               'button_cta_text_color_hover'       => '#ffffff',
95
+               'button_cta_shadow'                 => '#f7741d',
96
+
97
+               'top_menu_background_color'          => '#333333',
98
+               'top_menu_link_color'                => '#ffffff',
99
+               'top_menu_link_hover_color'          => '#428bca',
100
+               'top_menu_icon_color'                => '#428bca',
101
+               'top_menu_icon_hover_color'          => '#ffffff',
102
+               'top_menu_dropdown_color'            => '#333333',
103
+               'top_menu_dropdown_hover_color'      => '#444444',
104
+               'top_menu_dropdown_link_color'       => '#ffffff',
105
+               'top_menu_dropdown_link_hover_color' => '#428bca',
106
+
107
+               'header_background_color'  => '#ffffff',
108
+               'header_link_color'        => '#428bca',
109
+               'header_link_hover_color'  => '#1072c9',
110
+               'header_description_color' => '#555555',
111
+
112
+               'main_menu_background_color'                => '#ffffff',
113
+               'main_menu_link_color'                      => '#555555',
114
+               'main_menu_link_hover_color'                => '#ffffff',
115
+               'main_menu_dropdown_background_color'       => '#428bca',
116
+               'main_menu_dropdown_background_hover_color' => '#1072c9',
117
+               'main_menu_dropdown_link_color'             => '#ffffff',
118
+               'main_menu_dropdown_link_hover_color'       => '#dddddd',
119
+
120
+               'banner_background_color'               => '#2a6496',
121
+               'banner_text_color'                     => '#ffffff',
122
+               'banner_text_image_color'               => '#ffffff',
123
+               'banner_breadcrumb_background_color'    => '#374750',
124
+               'banner_breadcrumb_text_color'          => '#919191',
125
+               'banner_breadcrumb_text_selected_color' => '#ffffff',
126
+
127
+               'background_color'                       => '#ffffff',
128
+               'body_line_color'                        => '#dddddd',
129
+               'body_text_heading_color'                => '#333333',
130
+               'body_text_small_color'                  => '#919191',
131
+               'body_text_color'                        => '#333333',
132
+               'body_link_color'                        => '#596b46',
133
+               'body_link_hover_color'                  => '#3d4a30',
134
+               'body_section_full_background_color'     => '#596b46',
135
+               'body_section_full_text_color'           => '#ffffff',
136
+               'body_section_full_link_color'           => '#eeeeee',
137
+               'body_section_full_link_hover_color'     => '#dddddd',
138
+               'body_section_full_cta_background_color' => '#333333',
139
+               'body_section_full_cta_text_color'       => '#ffffff',
140
+               'body_section_full_cta_link_color'       => '#eeeeee',
141
+               'body_section_full_cta_link_hover_color' => '#dddddd',
142
+
143
+               'footer_cta_background_color' => '#428bca',
144
+               'footer_cta_text_color'       => '#ffffff',
145
+               'footer_cta_link_color'       => '#dddddd',
146
+               'footer_cta_link_hover_color' => '#ffffff',
147
+
148
+               'footer_widgets_background_color' => '#333333',
149
+               'footer_widgets_text_color'       => '#eeeeee',
150
+               'footer_widgets_link_color'       => '#428bca',
151
+               'footer_widgets_link_hover_color' => '#1072c9',
152
+
153
+               'footer_background_color' => '#232222',
154
+               'footer_text_color'       => '#ffffff',
155
+               'footer_link_color'       => '#428bca',
156
+               'footer_link_hover_color' => '#1072c9',
157
+
158
+               'test_text_color'       => '#ddddd6',
159
+               'test_text_color_hover' => '#eeeee6',
160
+          ),
161
+     );
162
+
163
+     return $array;
164 164
 }
165 165
 add_filter( 'lsx_customizer_colour_choices', 'test_lsx_customizer_colour_choices' );
166 166
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
  * Add new selectors in "button" group of colours
171 171
  */
172 172
 function test_lsx_customizer_colour_selectors_button( $css, $colors ) {
173
-	$css .= <<<CSS
173
+     $css .= <<<CSS
174 174
 
175 175
 	/* Button TEST */
176 176
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 	}
184 184
 CSS;
185 185
 
186
-	return $css;
186
+     return $css;
187 187
 }
188 188
 add_filter( 'lsx_customizer_colour_selectors_button', 'test_lsx_customizer_colour_selectors_button', 10, 2 );
189 189
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
  * Add new selectors in "button cta" group of colours
194 194
  */
195 195
 function test_lsx_customizer_colour_selectors_button_cta( $css, $colors ) {
196
-	$css .= <<<CSS
196
+     $css .= <<<CSS
197 197
 
198 198
 	/* Button CTA TEST */
199 199
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	}
207 207
 CSS;
208 208
 
209
-	return $css;
209
+     return $css;
210 210
 }
211 211
 add_filter( 'lsx_customizer_colour_selectors_button_cta', 'test_lsx_customizer_colour_selectors_button_cta', 10, 2 );
212 212
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
  * Add new selectors in "top menu" group of colours
217 217
  */
218 218
 function test_lsx_customizer_colour_selectors_top_menu( $css, $colors ) {
219
-	$css .= <<<CSS
219
+     $css .= <<<CSS
220 220
 
221 221
 	/* Top Menu TEST */
222 222
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	}
234 234
 CSS;
235 235
 
236
-	return $css;
236
+     return $css;
237 237
 }
238 238
 add_filter( 'lsx_customizer_colour_selectors_top_menu', 'test_lsx_customizer_colour_selectors_top_menu', 10, 2 );
239 239
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
  * Add new selectors in "header" group of colours
244 244
  */
245 245
 function test_lsx_customizer_colour_selectors_header( $css, $colors ) {
246
-	$css .= <<<CSS
246
+     $css .= <<<CSS
247 247
 
248 248
 	/* Header TEST */
249 249
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	}
256 256
 CSS;
257 257
 
258
-	return $css;
258
+     return $css;
259 259
 }
260 260
 add_filter( 'lsx_customizer_colour_selectors_header', 'test_lsx_customizer_colour_selectors_header', 10, 2 );
261 261
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
  * Add new selectors in "main meun" group of colours
266 266
  */
267 267
 function test_lsx_customizer_colour_selectors_main_menu( $css, $colors ) {
268
-	$css .= <<<CSS
268
+     $css .= <<<CSS
269 269
 
270 270
 	/* Main Menu TEST */
271 271
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	}
281 281
 CSS;
282 282
 
283
-	return $css;
283
+     return $css;
284 284
 }
285 285
 add_filter( 'lsx_customizer_colour_selectors_main_menu', 'test_lsx_customizer_colour_selectors_main_menu', 10, 2 );
286 286
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
  * Add new selectors in "banner" group of colours
291 291
  */
292 292
 function test_lsx_customizer_colour_selectors_banner( $css, $colors ) {
293
-	$css .= <<<CSS
293
+     $css .= <<<CSS
294 294
 
295 295
 	/* Banner TEST */
296 296
 
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 	}
305 305
 CSS;
306 306
 
307
-	return $css;
307
+     return $css;
308 308
 }
309 309
 add_filter( 'lsx_customizer_colour_selectors_banner', 'test_lsx_customizer_colour_selectors_banner', 10, 2 );
310 310
 
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
  * Add new selectors in "body" group of colours
315 315
  */
316 316
 function test_lsx_customizer_colour_selectors_body( $css, $colors ) {
317
-	$css .= <<<CSS
317
+     $css .= <<<CSS
318 318
 
319 319
 	/* Body TEST */
320 320
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	}
339 339
 CSS;
340 340
 
341
-	return $css;
341
+     return $css;
342 342
 }
343 343
 add_filter( 'lsx_customizer_colour_selectors_body', 'test_lsx_customizer_colour_selectors_body', 10, 2 );
344 344
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
  * Add new selectors in "footer cta" group of colours
349 349
  */
350 350
 function test_lsx_customizer_colour_selectors_footer_cta( $css, $colors ) {
351
-	$css .= <<<CSS
351
+     $css .= <<<CSS
352 352
 
353 353
 	/* Footer CTA TEST */
354 354
 
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 	}
361 361
 CSS;
362 362
 
363
-	return $css;
363
+     return $css;
364 364
 }
365 365
 add_filter( 'lsx_customizer_colour_selectors_footer_cta', 'test_lsx_customizer_colour_selectors_footer_cta', 10, 2 );
366 366
 
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
  * Add new selectors in "footer widgets" group of colours
371 371
  */
372 372
 function test_lsx_customizer_colour_selectors_footer_widgets( $css, $colors ) {
373
-	$css .= <<<CSS
373
+     $css .= <<<CSS
374 374
 
375 375
 	/* Footer Widgets TEST */
376 376
 
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 	}
383 383
 CSS;
384 384
 
385
-	return $css;
385
+     return $css;
386 386
 }
387 387
 add_filter( 'lsx_customizer_colour_selectors_footer_widgets', 'test_lsx_customizer_colour_selectors_footer_widgets', 10, 2 );
388 388
 
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
  * Add new selectors in "footer" group of colours
393 393
  */
394 394
 function test_lsx_customizer_colour_selectors_footer( $css, $colors ) {
395
-	$css .= <<<CSS
395
+     $css .= <<<CSS
396 396
 
397 397
 	/* Footer TEST */
398 398
 
@@ -404,6 +404,6 @@  discard block
 block discarded – undo
404 404
 	}
405 405
 CSS;
406 406
 
407
-	return $css;
407
+     return $css;
408 408
 }
409 409
 add_filter( 'lsx_customizer_colour_selectors_footer', 'test_lsx_customizer_colour_selectors_footer', 10, 2 );
Please login to merge, or discard this patch.