@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! class_exists( 'LSX_Customizer_Colour' ) ) { |
|
2 | +if ( ! class_exists('LSX_Customizer_Colour')) { |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * LSX Customizer Colour Class |
@@ -114,9 +114,9 @@ discard block |
||
114 | 114 | * @since 1.0.0 |
115 | 115 | */ |
116 | 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' ) ); |
|
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 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -126,44 +126,44 @@ discard block |
||
126 | 126 | * @since 1.0.0 |
127 | 127 | */ |
128 | 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' ); |
|
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 | 132 | |
133 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button.php' ); |
|
133 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button.php'); |
|
134 | 134 | $this->button = new LSX_Customizer_Colour_Button(); |
135 | 135 | |
136 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-cta.php' ); |
|
136 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-cta.php'); |
|
137 | 137 | $this->button_cta = new LSX_Customizer_Colour_Button_CTA(); |
138 | 138 | |
139 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-secondary.php' ); |
|
139 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-secondary.php'); |
|
140 | 140 | $this->button_secondary = new LSX_Customizer_Colour_Button_Secondary(); |
141 | 141 | |
142 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-tertiary.php' ); |
|
142 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-tertiary.php'); |
|
143 | 143 | $this->button_tertiary = new LSX_Customizer_Colour_Button_Tertiary(); |
144 | 144 | |
145 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-top-menu.php' ); |
|
145 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-top-menu.php'); |
|
146 | 146 | $this->top_menu = new LSX_Customizer_Colour_Top_Menu(); |
147 | 147 | |
148 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-header.php' ); |
|
148 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-header.php'); |
|
149 | 149 | $this->header = new LSX_Customizer_Colour_Header(); |
150 | 150 | |
151 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-main-menu.php' ); |
|
151 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-main-menu.php'); |
|
152 | 152 | $this->main_menu = new LSX_Customizer_Colour_Main_Menu(); |
153 | 153 | |
154 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-banner.php' ); |
|
154 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-banner.php'); |
|
155 | 155 | $this->banner = new LSX_Customizer_Colour_Banner(); |
156 | 156 | |
157 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-body.php' ); |
|
157 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-body.php'); |
|
158 | 158 | $this->body = new LSX_Customizer_Colour_Body(); |
159 | 159 | |
160 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer-cta.php' ); |
|
160 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer-cta.php'); |
|
161 | 161 | $this->footer_cta = new LSX_Customizer_Colour_Footer_CTA(); |
162 | 162 | |
163 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer-widgets.php' ); |
|
163 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer-widgets.php'); |
|
164 | 164 | $this->footer_widgets = new LSX_Customizer_Colour_Footer_Widgets(); |
165 | 165 | |
166 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer.php' ); |
|
166 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer.php'); |
|
167 | 167 | $this->footer = new LSX_Customizer_Colour_Footer(); |
168 | 168 | } |
169 | 169 | |
@@ -173,96 +173,96 @@ discard block |
||
173 | 173 | * @param WP_Customize_Manager $wp_customize Theme Customizer object. |
174 | 174 | * @since 1.0.0 |
175 | 175 | */ |
176 | - public function customize_register( $wp_customize ) { |
|
176 | + public function customize_register($wp_customize) { |
|
177 | 177 | global $customizer_colour_names; |
178 | 178 | global $customizer_colour_choices; |
179 | 179 | |
180 | 180 | /** |
181 | 181 | * Colors |
182 | 182 | */ |
183 | - $wp_customize->add_panel( 'colors', array( |
|
184 | - 'title' => esc_html__( 'Site Design', 'lsx-customizer' ), |
|
183 | + $wp_customize->add_panel('colors', array( |
|
184 | + 'title' => esc_html__('Site Design', 'lsx-customizer'), |
|
185 | 185 | 'priority' => 60, |
186 | - ) ); |
|
186 | + )); |
|
187 | 187 | |
188 | - $wp_customize->add_section( 'colors-palette', array( |
|
189 | - 'title' => esc_html__( 'Block Editor', 'lsx-customizer' ), |
|
190 | - 'description' => esc_html__( 'Define the block editor colour pallette.', 'lsx-customizer' ), |
|
188 | + $wp_customize->add_section('colors-palette', array( |
|
189 | + 'title' => esc_html__('Block Editor', 'lsx-customizer'), |
|
190 | + 'description' => esc_html__('Define the block editor colour pallette.', 'lsx-customizer'), |
|
191 | 191 | 'priority' => 2, |
192 | 192 | 'panel' => 'colors', |
193 | - ) ); |
|
193 | + )); |
|
194 | 194 | |
195 | - $wp_customize->add_section( 'colors-button', array( |
|
196 | - 'title' => esc_html__( 'Button', 'lsx-customizer' ), |
|
195 | + $wp_customize->add_section('colors-button', array( |
|
196 | + 'title' => esc_html__('Button', 'lsx-customizer'), |
|
197 | 197 | 'priority' => 3, |
198 | 198 | 'panel' => 'colors', |
199 | - ) ); |
|
199 | + )); |
|
200 | 200 | |
201 | - $wp_customize->add_section( 'colors-button-cta', array( |
|
202 | - 'title' => esc_html__( 'Button CTA', 'lsx-customizer' ), |
|
201 | + $wp_customize->add_section('colors-button-cta', array( |
|
202 | + 'title' => esc_html__('Button CTA', 'lsx-customizer'), |
|
203 | 203 | 'priority' => 4, |
204 | 204 | 'panel' => 'colors', |
205 | - ) ); |
|
205 | + )); |
|
206 | 206 | |
207 | - $wp_customize->add_section( 'colors-button-secondary', array( |
|
208 | - 'title' => esc_html__( 'Button Secondary', 'lsx-customizer' ), |
|
207 | + $wp_customize->add_section('colors-button-secondary', array( |
|
208 | + 'title' => esc_html__('Button Secondary', 'lsx-customizer'), |
|
209 | 209 | 'priority' => 5, |
210 | 210 | 'panel' => 'colors', |
211 | - ) ); |
|
211 | + )); |
|
212 | 212 | |
213 | - $wp_customize->add_section( 'colors-button-tertiary', array( |
|
214 | - 'title' => esc_html__( 'Button Tertiary', 'lsx-customizer' ), |
|
213 | + $wp_customize->add_section('colors-button-tertiary', array( |
|
214 | + 'title' => esc_html__('Button Tertiary', 'lsx-customizer'), |
|
215 | 215 | 'priority' => 6, |
216 | 216 | 'panel' => 'colors', |
217 | - ) ); |
|
217 | + )); |
|
218 | 218 | |
219 | - $wp_customize->add_section( 'colors-top-menu', array( |
|
220 | - 'title' => esc_html__( 'Top Menu', 'lsx-customizer' ), |
|
219 | + $wp_customize->add_section('colors-top-menu', array( |
|
220 | + 'title' => esc_html__('Top Menu', 'lsx-customizer'), |
|
221 | 221 | 'priority' => 7, |
222 | 222 | 'panel' => 'colors', |
223 | - ) ); |
|
223 | + )); |
|
224 | 224 | |
225 | - $wp_customize->add_section( 'colors-header', array( |
|
226 | - 'title' => esc_html__( 'Header', 'lsx-customizer' ), |
|
225 | + $wp_customize->add_section('colors-header', array( |
|
226 | + 'title' => esc_html__('Header', 'lsx-customizer'), |
|
227 | 227 | 'priority' => 8, |
228 | 228 | 'panel' => 'colors', |
229 | - ) ); |
|
229 | + )); |
|
230 | 230 | |
231 | - $wp_customize->add_section( 'colors-main-menu', array( |
|
232 | - 'title' => esc_html__( 'Main Menu', 'lsx-customizer' ), |
|
231 | + $wp_customize->add_section('colors-main-menu', array( |
|
232 | + 'title' => esc_html__('Main Menu', 'lsx-customizer'), |
|
233 | 233 | 'priority' => 9, |
234 | 234 | 'panel' => 'colors', |
235 | - ) ); |
|
235 | + )); |
|
236 | 236 | |
237 | - $wp_customize->add_section( 'colors-banner', array( |
|
238 | - 'title' => esc_html__( 'Banner', 'lsx-customizer' ), |
|
237 | + $wp_customize->add_section('colors-banner', array( |
|
238 | + 'title' => esc_html__('Banner', 'lsx-customizer'), |
|
239 | 239 | 'priority' => 10, |
240 | 240 | 'panel' => 'colors', |
241 | - ) ); |
|
241 | + )); |
|
242 | 242 | |
243 | - $wp_customize->add_section( 'colors-body', array( |
|
244 | - 'title' => esc_html__( 'Body', 'lsx-customizer' ), |
|
243 | + $wp_customize->add_section('colors-body', array( |
|
244 | + 'title' => esc_html__('Body', 'lsx-customizer'), |
|
245 | 245 | 'priority' => 11, |
246 | 246 | 'panel' => 'colors', |
247 | - ) ); |
|
247 | + )); |
|
248 | 248 | |
249 | - $wp_customize->add_section( 'colors-footer-cta', array( |
|
250 | - 'title' => esc_html__( 'Footer CTA', 'lsx-customizer' ), |
|
249 | + $wp_customize->add_section('colors-footer-cta', array( |
|
250 | + 'title' => esc_html__('Footer CTA', 'lsx-customizer'), |
|
251 | 251 | 'priority' => 12, |
252 | 252 | 'panel' => 'colors', |
253 | - ) ); |
|
253 | + )); |
|
254 | 254 | |
255 | - $wp_customize->add_section( 'colors-footer-widgets', array( |
|
256 | - 'title' => esc_html__( 'Footer Widgets', 'lsx-customizer' ), |
|
255 | + $wp_customize->add_section('colors-footer-widgets', array( |
|
256 | + 'title' => esc_html__('Footer Widgets', 'lsx-customizer'), |
|
257 | 257 | 'priority' => 13, |
258 | 258 | 'panel' => 'colors', |
259 | - ) ); |
|
259 | + )); |
|
260 | 260 | |
261 | - $wp_customize->add_section( 'colors-footer', array( |
|
262 | - 'title' => esc_html__( 'Footer', 'lsx-customizer' ), |
|
261 | + $wp_customize->add_section('colors-footer', array( |
|
262 | + 'title' => esc_html__('Footer', 'lsx-customizer'), |
|
263 | 263 | 'priority' => 14, |
264 | 264 | 'panel' => 'colors', |
265 | - ) ); |
|
265 | + )); |
|
266 | 266 | |
267 | 267 | /** |
268 | 268 | * Colour Palette |
@@ -270,26 +270,26 @@ discard block |
||
270 | 270 | $colors = $this->get_color_scheme(); |
271 | 271 | |
272 | 272 | $customizer_colour_defaults = array( |
273 | - __( 'Primary Colour', 'lsx-customizer' ) => get_theme_mod( 'button_background_color', $colors['button_background_color'] ), |
|
274 | - __( 'Strong Primary Colour', 'lsx-button_shadow' ) => get_theme_mod( 'button_background_hover_color', $colors['button_background_hover_color'] ), |
|
275 | - __( 'Call To Action Colour', 'lsx-customizer' ) => get_theme_mod( 'button_cta_background_color', $colors['button_cta_background_color'] ), |
|
276 | - __( 'Strong CTA Colour', 'lsx-button_shadow' ) => get_theme_mod( 'button_cta_shadow', $colors['button_cta_shadow'] ), |
|
277 | - __( 'Secondary Colour', 'lsx-customizer' ) => get_theme_mod( 'button_secondary_background_color', $colors['button_secondary_background_color'] ), |
|
278 | - __( 'Strong Secondary Colour', 'lsx-button_shadow' ) => get_theme_mod( 'button_secondary_shadow', $colors['button_secondary_shadow'] ), |
|
279 | - __( 'Tertiary Colour', 'lsx-customizer' ) => get_theme_mod( 'button_tertiary_background_color', $colors['button_tertiary_background_color'] ), |
|
280 | - __( 'Strong Tertiary Colour', 'lsx-button_shadow' ) => get_theme_mod( 'button_tertiary_shadow', $colors['button_tertiary_shadow'] ), |
|
273 | + __('Primary Colour', 'lsx-customizer') => get_theme_mod('button_background_color', $colors['button_background_color']), |
|
274 | + __('Strong Primary Colour', 'lsx-button_shadow') => get_theme_mod('button_background_hover_color', $colors['button_background_hover_color']), |
|
275 | + __('Call To Action Colour', 'lsx-customizer') => get_theme_mod('button_cta_background_color', $colors['button_cta_background_color']), |
|
276 | + __('Strong CTA Colour', 'lsx-button_shadow') => get_theme_mod('button_cta_shadow', $colors['button_cta_shadow']), |
|
277 | + __('Secondary Colour', 'lsx-customizer') => get_theme_mod('button_secondary_background_color', $colors['button_secondary_background_color']), |
|
278 | + __('Strong Secondary Colour', 'lsx-button_shadow') => get_theme_mod('button_secondary_shadow', $colors['button_secondary_shadow']), |
|
279 | + __('Tertiary Colour', 'lsx-customizer') => get_theme_mod('button_tertiary_background_color', $colors['button_tertiary_background_color']), |
|
280 | + __('Strong Tertiary Colour', 'lsx-button_shadow') => get_theme_mod('button_tertiary_shadow', $colors['button_tertiary_shadow']), |
|
281 | 281 | ); |
282 | - foreach ( $customizer_colour_defaults as $key => $value ) { |
|
282 | + foreach ($customizer_colour_defaults as $key => $value) { |
|
283 | 283 | |
284 | - $color_name = strtolower( str_replace( ' ', '_', $key ) ); |
|
284 | + $color_name = strtolower(str_replace(' ', '_', $key)); |
|
285 | 285 | $color_name = $color_name; |
286 | 286 | |
287 | - $wp_customize->add_setting( $color_name, array( |
|
287 | + $wp_customize->add_setting($color_name, array( |
|
288 | 288 | 'default' => $value, |
289 | 289 | 'type' => 'theme_mod', |
290 | 290 | 'transport' => 'postMessage', |
291 | 291 | 'sanitize_callback' => 'sanitize_hex_color', |
292 | - ) ); |
|
292 | + )); |
|
293 | 293 | $wp_customize->add_control( |
294 | 294 | new WP_Customize_Color_Control( |
295 | 295 | $wp_customize, |
@@ -306,53 +306,53 @@ discard block |
||
306 | 306 | /** |
307 | 307 | * Colors |
308 | 308 | */ |
309 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
309 | + foreach ($customizer_colour_names as $key => $value) { |
|
310 | 310 | $sanitize_callback = 'sanitize_hex_color'; |
311 | 311 | |
312 | - if ( 'background_color' === $key ) { |
|
312 | + if ('background_color' === $key) { |
|
313 | 313 | $sanitize_callback = 'sanitize_hex_color_no_hash'; |
314 | 314 | } |
315 | 315 | |
316 | 316 | $section = 'colors-core'; |
317 | 317 | |
318 | - if ( preg_match( '/^button_cta_.*/', $key ) ) { |
|
318 | + if (preg_match('/^button_cta_.*/', $key)) { |
|
319 | 319 | $section = 'colors-button-cta'; |
320 | - } elseif ( preg_match( '/^button_secondary_.*/', $key ) ) { |
|
320 | + } elseif (preg_match('/^button_secondary_.*/', $key)) { |
|
321 | 321 | $section = 'colors-button-secondary'; |
322 | - } elseif ( preg_match( '/^button_tertiary_.*/', $key ) ) { |
|
322 | + } elseif (preg_match('/^button_tertiary_.*/', $key)) { |
|
323 | 323 | $section = 'colors-button-tertiary'; |
324 | - } elseif ( preg_match( '/^button_.*/', $key ) ) { |
|
324 | + } elseif (preg_match('/^button_.*/', $key)) { |
|
325 | 325 | $section = 'colors-button'; |
326 | - } elseif ( preg_match( '/^top_menu_.*/', $key ) ) { |
|
326 | + } elseif (preg_match('/^top_menu_.*/', $key)) { |
|
327 | 327 | $section = 'colors-top-menu'; |
328 | - } elseif ( preg_match( '/^header_.*/', $key ) ) { |
|
328 | + } elseif (preg_match('/^header_.*/', $key)) { |
|
329 | 329 | $section = 'colors-header'; |
330 | - } elseif ( preg_match( '/^main_menu_.*/', $key ) ) { |
|
330 | + } elseif (preg_match('/^main_menu_.*/', $key)) { |
|
331 | 331 | $section = 'colors-main-menu'; |
332 | - } elseif ( preg_match( '/^banner_.*/', $key ) ) { |
|
332 | + } elseif (preg_match('/^banner_.*/', $key)) { |
|
333 | 333 | $section = 'colors-banner'; |
334 | - } elseif ( preg_match( '/^body_.*/', $key ) || 'background_color' === $key ) { |
|
334 | + } elseif (preg_match('/^body_.*/', $key) || 'background_color' === $key) { |
|
335 | 335 | $section = 'colors-body'; |
336 | - } elseif ( preg_match( '/^footer_cta_.*/', $key ) ) { |
|
336 | + } elseif (preg_match('/^footer_cta_.*/', $key)) { |
|
337 | 337 | $section = 'colors-footer-cta'; |
338 | - } elseif ( preg_match( '/^footer_widgets_.*/', $key ) ) { |
|
338 | + } elseif (preg_match('/^footer_widgets_.*/', $key)) { |
|
339 | 339 | $section = 'colors-footer-widgets'; |
340 | - } elseif ( preg_match( '/^footer_.*/', $key ) ) { |
|
340 | + } elseif (preg_match('/^footer_.*/', $key)) { |
|
341 | 341 | $section = 'colors-footer'; |
342 | 342 | } |
343 | 343 | |
344 | - $wp_customize->add_setting( $key, array( |
|
345 | - 'default' => $customizer_colour_choices['default']['colors'][ $key ], |
|
344 | + $wp_customize->add_setting($key, array( |
|
345 | + 'default' => $customizer_colour_choices['default']['colors'][$key], |
|
346 | 346 | 'type' => 'theme_mod', |
347 | 347 | 'transport' => 'postMessage', |
348 | 348 | 'sanitize_callback' => $sanitize_callback, |
349 | - ) ); |
|
349 | + )); |
|
350 | 350 | |
351 | - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, $key, array( |
|
351 | + $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $key, array( |
|
352 | 352 | 'label' => $value, |
353 | 353 | 'section' => $section, |
354 | 354 | 'settings' => $key, |
355 | - ) ) ); |
|
355 | + ))); |
|
356 | 356 | } |
357 | 357 | } |
358 | 358 | |
@@ -366,26 +366,26 @@ discard block |
||
366 | 366 | |
367 | 367 | $colors = array(); |
368 | 368 | |
369 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
370 | - $colors[ $key ] = 'unquote("{{ data.' . $key . ' }}")'; |
|
369 | + foreach ($customizer_colour_names as $key => $value) { |
|
370 | + $colors[$key] = 'unquote("{{ data.' . $key . ' }}")'; |
|
371 | 371 | } |
372 | 372 | ?> |
373 | 373 | <script type="text/html" id="tmpl-lsx-color-scheme"> |
374 | - <?php echo esc_attr( $this->top_menu->get_css( $colors ) ); ?> |
|
375 | - <?php echo esc_attr( $this->header->get_css( $colors ) ); ?> |
|
376 | - <?php echo esc_attr( $this->main_menu->get_css( $colors ) ); ?> |
|
374 | + <?php echo esc_attr($this->top_menu->get_css($colors)); ?> |
|
375 | + <?php echo esc_attr($this->header->get_css($colors)); ?> |
|
376 | + <?php echo esc_attr($this->main_menu->get_css($colors)); ?> |
|
377 | 377 | |
378 | - <?php echo esc_attr( $this->banner->get_css( $colors ) ); ?> |
|
379 | - <?php echo esc_attr( $this->body->get_css( $colors ) ); ?> |
|
378 | + <?php echo esc_attr($this->banner->get_css($colors)); ?> |
|
379 | + <?php echo esc_attr($this->body->get_css($colors)); ?> |
|
380 | 380 | |
381 | - <?php echo esc_attr( $this->footer_cta->get_css( $colors ) ); ?> |
|
382 | - <?php echo esc_attr( $this->footer_widgets->get_css( $colors ) ); ?> |
|
383 | - <?php echo esc_attr( $this->footer->get_css( $colors ) ); ?> |
|
381 | + <?php echo esc_attr($this->footer_cta->get_css($colors)); ?> |
|
382 | + <?php echo esc_attr($this->footer_widgets->get_css($colors)); ?> |
|
383 | + <?php echo esc_attr($this->footer->get_css($colors)); ?> |
|
384 | 384 | |
385 | - <?php echo esc_attr( $this->button->get_css( $colors ) ); ?> |
|
386 | - <?php echo esc_attr( $this->button_cta->get_css( $colors ) ); ?> |
|
387 | - <?php echo esc_attr( $this->button_secondary->get_css( $colors ) ); ?> |
|
388 | - <?php echo esc_attr( $this->button_tertiary->get_css( $colors ) ); ?> |
|
385 | + <?php echo esc_attr($this->button->get_css($colors)); ?> |
|
386 | + <?php echo esc_attr($this->button_cta->get_css($colors)); ?> |
|
387 | + <?php echo esc_attr($this->button_secondary->get_css($colors)); ?> |
|
388 | + <?php echo esc_attr($this->button_tertiary->get_css($colors)); ?> |
|
389 | 389 | </script> |
390 | 390 | <?php |
391 | 391 | } |
@@ -395,16 +395,16 @@ discard block |
||
395 | 395 | * |
396 | 396 | * @since 1.0.0 |
397 | 397 | */ |
398 | - public function scss_to_css( $scss ) { |
|
398 | + public function scss_to_css($scss) { |
|
399 | 399 | $css = ''; |
400 | 400 | $scss_php_file = LSX_CUSTOMIZER_PATH . 'vendor/leafo/scssphp/scss.inc.php'; |
401 | 401 | $lsx_theme_sass_file = get_template_directory() . '/assets/css/scss/lsx.scss'; |
402 | 402 | |
403 | - if ( ! empty( $scss ) && file_exists( $scss_php_file ) && file_exists( $lsx_theme_sass_file ) ) { |
|
403 | + if ( ! empty($scss) && file_exists($scss_php_file) && file_exists($lsx_theme_sass_file)) { |
|
404 | 404 | require_once $scss_php_file; |
405 | 405 | |
406 | 406 | $compiler = new \Leafo\ScssPhp\Compiler(); |
407 | - $compiler->setFormatter( 'Leafo\ScssPhp\Formatter\Compact' ); |
|
407 | + $compiler->setFormatter('Leafo\ScssPhp\Formatter\Compact'); |
|
408 | 408 | |
409 | 409 | try { |
410 | 410 | $scss = ' |
@@ -414,8 +414,8 @@ discard block |
||
414 | 414 | ' . $scss . ' |
415 | 415 | '; |
416 | 416 | |
417 | - $css = $compiler->compile( $scss ); |
|
418 | - } catch ( \Exception $e ) { |
|
417 | + $css = $compiler->compile($scss); |
|
418 | + } catch (\Exception $e) { |
|
419 | 419 | $error = $e->getMessage(); |
420 | 420 | return "/*\n\n\$error:\n\n{$error}\n\n\$scss:\n\n{$scss} */"; |
421 | 421 | } |
@@ -429,17 +429,17 @@ discard block |
||
429 | 429 | * |
430 | 430 | * @since 1.0.0 |
431 | 431 | */ |
432 | - public static function hex2rgb( $color ) { |
|
433 | - $color = trim( $color, '#' ); |
|
434 | - |
|
435 | - if ( strlen( $color ) === 3 ) { |
|
436 | - $r = hexdec( substr( $color, 0, 1 ) . substr( $color, 0, 1 ) ); |
|
437 | - $g = hexdec( substr( $color, 1, 1 ) . substr( $color, 1, 1 ) ); |
|
438 | - $b = hexdec( substr( $color, 2, 1 ) . substr( $color, 2, 1 ) ); |
|
439 | - } elseif ( strlen( $color ) === 6 ) { |
|
440 | - $r = hexdec( substr( $color, 0, 2 ) ); |
|
441 | - $g = hexdec( substr( $color, 2, 2 ) ); |
|
442 | - $b = hexdec( substr( $color, 4, 2 ) ); |
|
432 | + public static function hex2rgb($color) { |
|
433 | + $color = trim($color, '#'); |
|
434 | + |
|
435 | + if (strlen($color) === 3) { |
|
436 | + $r = hexdec(substr($color, 0, 1) . substr($color, 0, 1)); |
|
437 | + $g = hexdec(substr($color, 1, 1) . substr($color, 1, 1)); |
|
438 | + $b = hexdec(substr($color, 2, 1) . substr($color, 2, 1)); |
|
439 | + } elseif (strlen($color) === 6) { |
|
440 | + $r = hexdec(substr($color, 0, 2)); |
|
441 | + $g = hexdec(substr($color, 2, 2)); |
|
442 | + $b = hexdec(substr($color, 4, 2)); |
|
443 | 443 | } else { |
444 | 444 | return array(); |
445 | 445 | } |