@@ -6,97 +6,97 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | if ( ! function_exists( 'lsx_customizer_checkout_form_wrapper_div' ) ) { |
9 | - /** |
|
10 | - * Used to wrap the checkout form in a div and include navigation links |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - function lsx_customizer_checkout_form_wrapper_div() { |
|
15 | - echo '<div class="lsx-checkout-slides">'; ?> |
|
9 | + /** |
|
10 | + * Used to wrap the checkout form in a div and include navigation links |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + function lsx_customizer_checkout_form_wrapper_div() { |
|
15 | + echo '<div class="lsx-checkout-slides">'; ?> |
|
16 | 16 | <ul class="lsx-checkout-control-nav"> |
17 | 17 | <li><a href="#"><?php esc_html_e( 'Your Details', 'lsx-customizer' ); ?></a></li> |
18 | 18 | <li><a href="#"><?php esc_html_e( 'Your Order', 'lsx-customizer' ); ?></a></li> |
19 | 19 | </ul> |
20 | 20 | <?php |
21 | - } |
|
21 | + } |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | if ( ! function_exists( 'lsx_customizer_close_div' ) ) { |
25 | - /** |
|
26 | - * Close a div |
|
27 | - * |
|
28 | - * @return void |
|
29 | - */ |
|
30 | - function lsx_customizer_close_div() { |
|
31 | - echo '</div>'; |
|
32 | - } |
|
25 | + /** |
|
26 | + * Close a div |
|
27 | + * |
|
28 | + * @return void |
|
29 | + */ |
|
30 | + function lsx_customizer_close_div() { |
|
31 | + echo '</div>'; |
|
32 | + } |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | if ( ! function_exists( 'lsx_customizer_checkout_form_wrapper' ) ) { |
36 | - /** |
|
37 | - * Used to wrap the checkout form in a ul |
|
38 | - * |
|
39 | - * @return void |
|
40 | - */ |
|
41 | - function lsx_customizer_checkout_form_wrapper() { |
|
42 | - echo '<ul class="lsx-two-step-checkout">'; |
|
43 | - } |
|
36 | + /** |
|
37 | + * Used to wrap the checkout form in a ul |
|
38 | + * |
|
39 | + * @return void |
|
40 | + */ |
|
41 | + function lsx_customizer_checkout_form_wrapper() { |
|
42 | + echo '<ul class="lsx-two-step-checkout">'; |
|
43 | + } |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | if ( ! function_exists( 'lsx_customizer_close_ul' ) ) { |
47 | - /** |
|
48 | - * Close the ul that wraps the checkout form |
|
49 | - * |
|
50 | - * @return void |
|
51 | - */ |
|
52 | - function lsx_customizer_close_ul() { |
|
53 | - echo '</ul>'; |
|
54 | - } |
|
47 | + /** |
|
48 | + * Close the ul that wraps the checkout form |
|
49 | + * |
|
50 | + * @return void |
|
51 | + */ |
|
52 | + function lsx_customizer_close_ul() { |
|
53 | + echo '</ul>'; |
|
54 | + } |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
58 | 58 | if ( ! function_exists( 'lsx_customizer_address_wrapper' ) ) { |
59 | - /** |
|
60 | - * Used to wrap the address fields on the ckecout in an li |
|
61 | - * |
|
62 | - * @return void |
|
63 | - */ |
|
64 | - function lsx_customizer_address_wrapper() { |
|
65 | - echo '<li class="lsx-customizer-addresses">'; |
|
66 | - } |
|
59 | + /** |
|
60 | + * Used to wrap the address fields on the ckecout in an li |
|
61 | + * |
|
62 | + * @return void |
|
63 | + */ |
|
64 | + function lsx_customizer_address_wrapper() { |
|
65 | + echo '<li class="lsx-customizer-addresses">'; |
|
66 | + } |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | if ( ! function_exists( 'lsx_customizer_close_li' ) ) { |
70 | - /** |
|
71 | - * Close an li |
|
72 | - * |
|
73 | - * @return void |
|
74 | - */ |
|
75 | - function lsx_customizer_close_li() { |
|
76 | - echo '</li>'; |
|
77 | - } |
|
70 | + /** |
|
71 | + * Close an li |
|
72 | + * |
|
73 | + * @return void |
|
74 | + */ |
|
75 | + function lsx_customizer_close_li() { |
|
76 | + echo '</li>'; |
|
77 | + } |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | if ( ! function_exists( 'lsx_customizer_order_review_wrap' ) ) { |
81 | - /** |
|
82 | - * Used to wrap the order review in an li |
|
83 | - * |
|
84 | - * @return void |
|
85 | - */ |
|
86 | - function lsx_customizer_order_review_wrap() { |
|
87 | - echo '<li class="order-review">'; |
|
88 | - echo '<h3 id="order_review_heading">' . esc_html__( 'Your order', 'lsx-customizer' ) . '</h3>'; |
|
89 | - } |
|
81 | + /** |
|
82 | + * Used to wrap the order review in an li |
|
83 | + * |
|
84 | + * @return void |
|
85 | + */ |
|
86 | + function lsx_customizer_order_review_wrap() { |
|
87 | + echo '<li class="order-review">'; |
|
88 | + echo '<h3 id="order_review_heading">' . esc_html__( 'Your order', 'lsx-customizer' ) . '</h3>'; |
|
89 | + } |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | if ( ! function_exists( 'lsx_customizer_fire_flexslider' ) ) { |
93 | - /** |
|
94 | - * Fire FlexSlider |
|
95 | - * |
|
96 | - * @return void |
|
97 | - */ |
|
98 | - function lsx_customizer_fire_flexslider() { |
|
99 | - ?> |
|
93 | + /** |
|
94 | + * Fire FlexSlider |
|
95 | + * |
|
96 | + * @return void |
|
97 | + */ |
|
98 | + function lsx_customizer_fire_flexslider() { |
|
99 | + ?> |
|
100 | 100 | <script> |
101 | 101 | jQuery( window ).load(function() { |
102 | 102 | jQuery( '.lsx-checkout-slides' ).flexslider({ |
@@ -127,5 +127,5 @@ discard block |
||
127 | 127 | }); |
128 | 128 | </script> |
129 | 129 | <?php |
130 | - } |
|
130 | + } |
|
131 | 131 | } |
@@ -13,5 +13,5 @@ |
||
13 | 13 | * Converts a HEX value to RGB. |
14 | 14 | */ |
15 | 15 | function lsx_customizer_colour__hex2rgb( $color ) { |
16 | - return LSX_Customizer_Colour::hex2rgb( $color ); |
|
16 | + return LSX_Customizer_Colour::hex2rgb( $color ); |
|
17 | 17 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | |
17 | 17 | // If this file is called directly, abort. |
18 | 18 | if ( ! defined( 'WPINC' ) ) { |
19 | - die; |
|
19 | + die; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | define( 'LSX_CUSTOMIZER_PATH', plugin_dir_path( __FILE__ ) ); |
@@ -1,113 +1,113 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if ( ! class_exists( 'LSX_Customizer_Colour_Top_Menu' ) ) { |
3 | 3 | |
4 | - /** |
|
5 | - * LSX Customizer Colour Top 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_Top_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__top_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__top_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__top_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_top_menu', array( |
|
70 | - 'top_menu_background_color' => get_theme_mod( 'top_menu_background_color', $colors['top_menu_background_color'] ), |
|
71 | - 'top_menu_link_color' => get_theme_mod( 'top_menu_link_color', $colors['top_menu_link_color'] ), |
|
72 | - 'top_menu_link_hover_color' => get_theme_mod( 'top_menu_link_hover_color', $colors['top_menu_link_hover_color'] ), |
|
73 | - 'top_menu_icon_color' => get_theme_mod( 'top_menu_icon_color', $colors['top_menu_icon_color'] ), |
|
74 | - 'top_menu_icon_hover_color' => get_theme_mod( 'top_menu_icon_hover_color', $colors['top_menu_icon_hover_color'] ), |
|
75 | - 'top_menu_dropdown_color' => get_theme_mod( 'top_menu_dropdown_color', $colors['top_menu_dropdown_color'] ), |
|
76 | - 'top_menu_dropdown_hover_color' => get_theme_mod( 'top_menu_dropdown_hover_color', $colors['top_menu_dropdown_hover_color'] ), |
|
77 | - 'top_menu_dropdown_link_color' => get_theme_mod( 'top_menu_dropdown_link_color', $colors['top_menu_dropdown_link_color'] ), |
|
78 | - 'top_menu_dropdown_link_hover_color' => get_theme_mod( 'top_menu_dropdown_link_hover_color', $colors['top_menu_dropdown_link_hover_color'] ), |
|
79 | - ) ); |
|
80 | - } |
|
81 | - |
|
82 | - /** |
|
83 | - * Returns CSS. |
|
84 | - * |
|
85 | - * @since 1.0.0 |
|
86 | - */ |
|
87 | - function get_css( $colors ) { |
|
88 | - global $customizer_colour_names; |
|
89 | - |
|
90 | - $colors_template = array(); |
|
91 | - |
|
92 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
93 | - $colors_template[ $key ] = ''; |
|
94 | - } |
|
95 | - |
|
96 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
97 | - |
|
98 | - if ( empty( $colors['top_menu_background_color'] ) |
|
99 | - || empty( $colors['top_menu_link_color'] ) |
|
100 | - || empty( $colors['top_menu_link_hover_color'] ) |
|
101 | - || empty( $colors['top_menu_icon_color'] ) |
|
102 | - || empty( $colors['top_menu_icon_hover_color'] ) |
|
103 | - || empty( $colors['top_menu_dropdown_color'] ) |
|
104 | - || empty( $colors['top_menu_dropdown_hover_color'] ) |
|
105 | - || empty( $colors['top_menu_dropdown_link_color'] ) |
|
106 | - || empty( $colors['top_menu_dropdown_link_hover_color'] ) ) { |
|
107 | - return ''; |
|
108 | - } |
|
109 | - |
|
110 | - $css = ' |
|
4 | + /** |
|
5 | + * LSX Customizer Colour Top 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_Top_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__top_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__top_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__top_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_top_menu', array( |
|
70 | + 'top_menu_background_color' => get_theme_mod( 'top_menu_background_color', $colors['top_menu_background_color'] ), |
|
71 | + 'top_menu_link_color' => get_theme_mod( 'top_menu_link_color', $colors['top_menu_link_color'] ), |
|
72 | + 'top_menu_link_hover_color' => get_theme_mod( 'top_menu_link_hover_color', $colors['top_menu_link_hover_color'] ), |
|
73 | + 'top_menu_icon_color' => get_theme_mod( 'top_menu_icon_color', $colors['top_menu_icon_color'] ), |
|
74 | + 'top_menu_icon_hover_color' => get_theme_mod( 'top_menu_icon_hover_color', $colors['top_menu_icon_hover_color'] ), |
|
75 | + 'top_menu_dropdown_color' => get_theme_mod( 'top_menu_dropdown_color', $colors['top_menu_dropdown_color'] ), |
|
76 | + 'top_menu_dropdown_hover_color' => get_theme_mod( 'top_menu_dropdown_hover_color', $colors['top_menu_dropdown_hover_color'] ), |
|
77 | + 'top_menu_dropdown_link_color' => get_theme_mod( 'top_menu_dropdown_link_color', $colors['top_menu_dropdown_link_color'] ), |
|
78 | + 'top_menu_dropdown_link_hover_color' => get_theme_mod( 'top_menu_dropdown_link_hover_color', $colors['top_menu_dropdown_link_hover_color'] ), |
|
79 | + ) ); |
|
80 | + } |
|
81 | + |
|
82 | + /** |
|
83 | + * Returns CSS. |
|
84 | + * |
|
85 | + * @since 1.0.0 |
|
86 | + */ |
|
87 | + function get_css( $colors ) { |
|
88 | + global $customizer_colour_names; |
|
89 | + |
|
90 | + $colors_template = array(); |
|
91 | + |
|
92 | + foreach ( $customizer_colour_names as $key => $value ) { |
|
93 | + $colors_template[ $key ] = ''; |
|
94 | + } |
|
95 | + |
|
96 | + $colors = wp_parse_args( $colors, $colors_template ); |
|
97 | + |
|
98 | + if ( empty( $colors['top_menu_background_color'] ) |
|
99 | + || empty( $colors['top_menu_link_color'] ) |
|
100 | + || empty( $colors['top_menu_link_hover_color'] ) |
|
101 | + || empty( $colors['top_menu_icon_color'] ) |
|
102 | + || empty( $colors['top_menu_icon_hover_color'] ) |
|
103 | + || empty( $colors['top_menu_dropdown_color'] ) |
|
104 | + || empty( $colors['top_menu_dropdown_hover_color'] ) |
|
105 | + || empty( $colors['top_menu_dropdown_link_color'] ) |
|
106 | + || empty( $colors['top_menu_dropdown_link_hover_color'] ) ) { |
|
107 | + return ''; |
|
108 | + } |
|
109 | + |
|
110 | + $css = ' |
|
111 | 111 | @import "' . get_template_directory() . '/assets/css/scss/global/mixins/top-menu"; |
112 | 112 | |
113 | 113 | /** |
@@ -126,12 +126,12 @@ discard block |
||
126 | 126 | ); |
127 | 127 | '; |
128 | 128 | |
129 | - $css = apply_filters( 'lsx_customizer_colour_selectors_top_menu', $css, $colors ); |
|
130 | - $css = parent::scss_to_css( $css ); |
|
129 | + $css = apply_filters( 'lsx_customizer_colour_selectors_top_menu', $css, $colors ); |
|
130 | + $css = parent::scss_to_css( $css ); |
|
131 | 131 | |
132 | - return $css; |
|
133 | - } |
|
132 | + return $css; |
|
133 | + } |
|
134 | 134 | |
135 | - } |
|
135 | + } |
|
136 | 136 | |
137 | 137 | } |
@@ -1,105 +1,105 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if ( ! class_exists( 'LSX_Customizer_Colour_Button_Tertiary' ) ) { |
3 | 3 | |
4 | - /** |
|
5 | - * LSX Customizer Colour Button Tertiary 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_Tertiary 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_tertiary_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_tertiary_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_tertiary_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_tertiary', array( |
|
70 | - 'button_tertiary_background_color' => get_theme_mod( 'button_tertiary_background_color', $colors['button_tertiary_background_color'] ), |
|
71 | - 'button_tertiary_background_hover_color' => get_theme_mod( 'button_tertiary_background_hover_color', $colors['button_tertiary_background_hover_color'] ), |
|
72 | - 'button_tertiary_text_color' => get_theme_mod( 'button_tertiary_text_color', $colors['button_tertiary_text_color'] ), |
|
73 | - 'button_tertiary_text_color_hover' => get_theme_mod( 'button_tertiary_text_color_hover', $colors['button_tertiary_text_color_hover'] ), |
|
74 | - 'button_tertiary_shadow' => get_theme_mod( 'button_tertiary_shadow', $colors['button_tertiary_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_tertiary_text_color'] ) |
|
95 | - || empty( $colors['button_tertiary_text_color_hover'] ) |
|
96 | - || empty( $colors['button_tertiary_background_color'] ) |
|
97 | - || empty( $colors['button_tertiary_background_hover_color'] ) |
|
98 | - || empty( $colors['button_tertiary_shadow'] ) ) { |
|
99 | - return ''; |
|
100 | - } |
|
101 | - |
|
102 | - $css = ' |
|
4 | + /** |
|
5 | + * LSX Customizer Colour Button Tertiary 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_Tertiary 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_tertiary_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_tertiary_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_tertiary_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_tertiary', array( |
|
70 | + 'button_tertiary_background_color' => get_theme_mod( 'button_tertiary_background_color', $colors['button_tertiary_background_color'] ), |
|
71 | + 'button_tertiary_background_hover_color' => get_theme_mod( 'button_tertiary_background_hover_color', $colors['button_tertiary_background_hover_color'] ), |
|
72 | + 'button_tertiary_text_color' => get_theme_mod( 'button_tertiary_text_color', $colors['button_tertiary_text_color'] ), |
|
73 | + 'button_tertiary_text_color_hover' => get_theme_mod( 'button_tertiary_text_color_hover', $colors['button_tertiary_text_color_hover'] ), |
|
74 | + 'button_tertiary_shadow' => get_theme_mod( 'button_tertiary_shadow', $colors['button_tertiary_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_tertiary_text_color'] ) |
|
95 | + || empty( $colors['button_tertiary_text_color_hover'] ) |
|
96 | + || empty( $colors['button_tertiary_background_color'] ) |
|
97 | + || empty( $colors['button_tertiary_background_hover_color'] ) |
|
98 | + || empty( $colors['button_tertiary_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 |
||
114 | 114 | ); |
115 | 115 | '; |
116 | 116 | |
117 | - $css = apply_filters( 'lsx_customizer_colour_selectors_button_tertiary', $css, $colors ); |
|
118 | - $css = parent::scss_to_css( $css ); |
|
117 | + $css = apply_filters( 'lsx_customizer_colour_selectors_button_tertiary', $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 | } |
@@ -1,105 +1,105 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if ( ! class_exists( 'LSX_Customizer_Colour_Button_Secondary' ) ) { |
3 | 3 | |
4 | - /** |
|
5 | - * LSX Customizer Colour Button Secondary 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_Secondary 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_secondary_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_secondary_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_secondary_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_secondary', array( |
|
70 | - 'button_secondary_background_color' => get_theme_mod( 'button_secondary_background_color', $colors['button_secondary_background_color'] ), |
|
71 | - 'button_secondary_background_hover_color' => get_theme_mod( 'button_secondary_background_hover_color', $colors['button_secondary_background_hover_color'] ), |
|
72 | - 'button_secondary_text_color' => get_theme_mod( 'button_secondary_text_color', $colors['button_secondary_text_color'] ), |
|
73 | - 'button_secondary_text_color_hover' => get_theme_mod( 'button_secondary_text_color_hover', $colors['button_secondary_text_color_hover'] ), |
|
74 | - 'button_secondary_shadow' => get_theme_mod( 'button_secondary_shadow', $colors['button_secondary_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_secondary_text_color'] ) |
|
95 | - || empty( $colors['button_secondary_text_color_hover'] ) |
|
96 | - || empty( $colors['button_secondary_background_color'] ) |
|
97 | - || empty( $colors['button_secondary_background_hover_color'] ) |
|
98 | - || empty( $colors['button_secondary_shadow'] ) ) { |
|
99 | - return ''; |
|
100 | - } |
|
101 | - |
|
102 | - $css = ' |
|
4 | + /** |
|
5 | + * LSX Customizer Colour Button Secondary 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_Secondary 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_secondary_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_secondary_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_secondary_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_secondary', array( |
|
70 | + 'button_secondary_background_color' => get_theme_mod( 'button_secondary_background_color', $colors['button_secondary_background_color'] ), |
|
71 | + 'button_secondary_background_hover_color' => get_theme_mod( 'button_secondary_background_hover_color', $colors['button_secondary_background_hover_color'] ), |
|
72 | + 'button_secondary_text_color' => get_theme_mod( 'button_secondary_text_color', $colors['button_secondary_text_color'] ), |
|
73 | + 'button_secondary_text_color_hover' => get_theme_mod( 'button_secondary_text_color_hover', $colors['button_secondary_text_color_hover'] ), |
|
74 | + 'button_secondary_shadow' => get_theme_mod( 'button_secondary_shadow', $colors['button_secondary_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_secondary_text_color'] ) |
|
95 | + || empty( $colors['button_secondary_text_color_hover'] ) |
|
96 | + || empty( $colors['button_secondary_background_color'] ) |
|
97 | + || empty( $colors['button_secondary_background_hover_color'] ) |
|
98 | + || empty( $colors['button_secondary_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 |
||
114 | 114 | ); |
115 | 115 | '; |
116 | 116 | |
117 | - $css = apply_filters( 'lsx_customizer_colour_selectors_button_secondary', $css, $colors ); |
|
118 | - $css = parent::scss_to_css( $css ); |
|
117 | + $css = apply_filters( 'lsx_customizer_colour_selectors_button_secondary', $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 | } |
@@ -1,105 +1,105 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if ( ! class_exists( 'LSX_Customizer_Colour_Button_CTA' ) ) { |
3 | 3 | |
4 | - /** |
|
5 | - * LSX Customizer Colour Button CTA 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_CTA 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_cta_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_cta_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_cta_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_cta', array( |
|
70 | - 'button_cta_background_color' => get_theme_mod( 'button_cta_background_color', $colors['button_cta_background_color'] ), |
|
71 | - 'button_cta_background_hover_color' => get_theme_mod( 'button_cta_background_hover_color', $colors['button_cta_background_hover_color'] ), |
|
72 | - 'button_cta_text_color' => get_theme_mod( 'button_cta_text_color', $colors['button_cta_text_color'] ), |
|
73 | - 'button_cta_text_color_hover' => get_theme_mod( 'button_cta_text_color_hover', $colors['button_cta_text_color_hover'] ), |
|
74 | - 'button_cta_shadow' => get_theme_mod( 'button_cta_shadow', $colors['button_cta_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_cta_text_color'] ) |
|
95 | - || empty( $colors['button_cta_text_color_hover'] ) |
|
96 | - || empty( $colors['button_cta_background_color'] ) |
|
97 | - || empty( $colors['button_cta_background_hover_color'] ) |
|
98 | - || empty( $colors['button_cta_shadow'] ) ) { |
|
99 | - return ''; |
|
100 | - } |
|
101 | - |
|
102 | - $css = ' |
|
4 | + /** |
|
5 | + * LSX Customizer Colour Button CTA 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_CTA 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_cta_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_cta_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_cta_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_cta', array( |
|
70 | + 'button_cta_background_color' => get_theme_mod( 'button_cta_background_color', $colors['button_cta_background_color'] ), |
|
71 | + 'button_cta_background_hover_color' => get_theme_mod( 'button_cta_background_hover_color', $colors['button_cta_background_hover_color'] ), |
|
72 | + 'button_cta_text_color' => get_theme_mod( 'button_cta_text_color', $colors['button_cta_text_color'] ), |
|
73 | + 'button_cta_text_color_hover' => get_theme_mod( 'button_cta_text_color_hover', $colors['button_cta_text_color_hover'] ), |
|
74 | + 'button_cta_shadow' => get_theme_mod( 'button_cta_shadow', $colors['button_cta_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_cta_text_color'] ) |
|
95 | + || empty( $colors['button_cta_text_color_hover'] ) |
|
96 | + || empty( $colors['button_cta_background_color'] ) |
|
97 | + || empty( $colors['button_cta_background_hover_color'] ) |
|
98 | + || empty( $colors['button_cta_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 |
||
114 | 114 | ); |
115 | 115 | '; |
116 | 116 | |
117 | - $css = apply_filters( 'lsx_customizer_colour_selectors_button_cta', $css, $colors ); |
|
118 | - $css = parent::scss_to_css( $css ); |
|
117 | + $css = apply_filters( 'lsx_customizer_colour_selectors_button_cta', $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 | } |
@@ -1,102 +1,102 @@ |
||
1 | 1 | <?php |
2 | 2 | if ( ! class_exists( 'LSX_Customizer' ) ) { |
3 | 3 | |
4 | - /** |
|
5 | - * LSX Customizer Main Class |
|
6 | - * |
|
7 | - * @package LSX Customizer |
|
8 | - * @author LightSpeed |
|
9 | - * @license GPL3 |
|
10 | - * @link |
|
11 | - * @copyright 2016 LightSpeed |
|
12 | - */ |
|
13 | - class LSX_Customizer { |
|
4 | + /** |
|
5 | + * LSX Customizer Main Class |
|
6 | + * |
|
7 | + * @package LSX Customizer |
|
8 | + * @author LightSpeed |
|
9 | + * @license GPL3 |
|
10 | + * @link |
|
11 | + * @copyright 2016 LightSpeed |
|
12 | + */ |
|
13 | + class LSX_Customizer { |
|
14 | 14 | |
15 | - /** |
|
16 | - * Plugin slug. |
|
17 | - * |
|
18 | - * @var string |
|
19 | - * @since 1.0.0 |
|
20 | - */ |
|
21 | - public $plugin_slug = 'lsx-customizer'; |
|
15 | + /** |
|
16 | + * Plugin slug. |
|
17 | + * |
|
18 | + * @var string |
|
19 | + * @since 1.0.0 |
|
20 | + */ |
|
21 | + public $plugin_slug = 'lsx-customizer'; |
|
22 | 22 | |
23 | - /** |
|
24 | - * Constructor. |
|
25 | - * |
|
26 | - * @since 1.0.0 |
|
27 | - */ |
|
28 | - public function __construct() { |
|
29 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-admin.php' ); |
|
30 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-frontend.php' ); |
|
31 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-core.php' ); |
|
32 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour.php' ); |
|
33 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-login.php' ); |
|
23 | + /** |
|
24 | + * Constructor. |
|
25 | + * |
|
26 | + * @since 1.0.0 |
|
27 | + */ |
|
28 | + public function __construct() { |
|
29 | + require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-admin.php' ); |
|
30 | + require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-frontend.php' ); |
|
31 | + require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-core.php' ); |
|
32 | + require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour.php' ); |
|
33 | + require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-login.php' ); |
|
34 | 34 | |
35 | - add_action( 'plugins_loaded', array( $this, 'woocommerce' ) ); |
|
36 | - add_action( 'after_setup_theme', array( $this, 'wysiwyg_editor_control' ), 20 ); |
|
37 | - add_filter( 'login_headerurl', array( $this, 'custom_login_url' ) ); |
|
38 | - } |
|
35 | + add_action( 'plugins_loaded', array( $this, 'woocommerce' ) ); |
|
36 | + add_action( 'after_setup_theme', array( $this, 'wysiwyg_editor_control' ), 20 ); |
|
37 | + add_filter( 'login_headerurl', array( $this, 'custom_login_url' ) ); |
|
38 | + } |
|
39 | 39 | |
40 | - /** |
|
41 | - * Check if WooCommerce is installed to load the related file. |
|
42 | - * |
|
43 | - * @since 1.1.1 |
|
44 | - */ |
|
45 | - public function woocommerce() { |
|
46 | - if ( class_exists( 'WooCommerce' ) ) { |
|
47 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-woocommerce.php' ); |
|
48 | - } |
|
49 | - } |
|
40 | + /** |
|
41 | + * Check if WooCommerce is installed to load the related file. |
|
42 | + * |
|
43 | + * @since 1.1.1 |
|
44 | + */ |
|
45 | + public function woocommerce() { |
|
46 | + if ( class_exists( 'WooCommerce' ) ) { |
|
47 | + require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-woocommerce.php' ); |
|
48 | + } |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * Customizer Controls and Settings. |
|
53 | - * |
|
54 | - * @param WP_Customize_Manager $wp_customize Theme Customizer object. |
|
55 | - * @since 1.1.1 |
|
56 | - */ |
|
57 | - public function wysiwyg_editor_control() { |
|
58 | - if ( class_exists( 'WP_Customize_Control' ) ) { |
|
59 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-wysiwyg-control.php' ); |
|
60 | - } |
|
61 | - } |
|
51 | + /** |
|
52 | + * Customizer Controls and Settings. |
|
53 | + * |
|
54 | + * @param WP_Customize_Manager $wp_customize Theme Customizer object. |
|
55 | + * @since 1.1.1 |
|
56 | + */ |
|
57 | + public function wysiwyg_editor_control() { |
|
58 | + if ( class_exists( 'WP_Customize_Control' ) ) { |
|
59 | + require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-wysiwyg-control.php' ); |
|
60 | + } |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * Sanitize checkbox. |
|
65 | - * |
|
66 | - * @since 1.0.0 |
|
67 | - */ |
|
68 | - public function sanitize_checkbox( $input ) { |
|
69 | - return ( 1 === absint( $input ) ) ? 1 : 0; |
|
70 | - } |
|
63 | + /** |
|
64 | + * Sanitize checkbox. |
|
65 | + * |
|
66 | + * @since 1.0.0 |
|
67 | + */ |
|
68 | + public function sanitize_checkbox( $input ) { |
|
69 | + return ( 1 === absint( $input ) ) ? 1 : 0; |
|
70 | + } |
|
71 | 71 | |
72 | - /** |
|
73 | - * Sanitize select. |
|
74 | - * |
|
75 | - * @since 1.1.1 |
|
76 | - */ |
|
77 | - public function sanitize_select( $input ) { |
|
78 | - if ( is_string( $input ) || is_integer( $input ) || is_bool( $input ) ) { |
|
79 | - return $input; |
|
80 | - } else { |
|
81 | - return ''; |
|
82 | - } |
|
83 | - } |
|
72 | + /** |
|
73 | + * Sanitize select. |
|
74 | + * |
|
75 | + * @since 1.1.1 |
|
76 | + */ |
|
77 | + public function sanitize_select( $input ) { |
|
78 | + if ( is_string( $input ) || is_integer( $input ) || is_bool( $input ) ) { |
|
79 | + return $input; |
|
80 | + } else { |
|
81 | + return ''; |
|
82 | + } |
|
83 | + } |
|
84 | 84 | |
85 | - /** |
|
86 | - * Sanitize textarea. |
|
87 | - * |
|
88 | - * @since 1.1.1 |
|
89 | - */ |
|
90 | - public function sanitize_textarea( $input ) { |
|
91 | - return wp_kses_post( $input ); |
|
92 | - } |
|
85 | + /** |
|
86 | + * Sanitize textarea. |
|
87 | + * |
|
88 | + * @since 1.1.1 |
|
89 | + */ |
|
90 | + public function sanitize_textarea( $input ) { |
|
91 | + return wp_kses_post( $input ); |
|
92 | + } |
|
93 | 93 | |
94 | - function custom_login_url() { |
|
95 | - return home_url(); |
|
96 | - } |
|
94 | + function custom_login_url() { |
|
95 | + return home_url(); |
|
96 | + } |
|
97 | 97 | |
98 | - } |
|
98 | + } |
|
99 | 99 | |
100 | - new LSX_Customizer(); |
|
100 | + new LSX_Customizer(); |
|
101 | 101 | |
102 | 102 | } |
@@ -1,103 +1,103 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if ( ! class_exists( 'LSX_Customizer_Colour_Header' ) ) { |
3 | 3 | |
4 | - /** |
|
5 | - * LSX Customizer Colour Header Class |
|
6 | - * |
|
7 | - * @package LSX Customizer |
|
8 | - * @author LightSpeed |
|
9 | - * @license GPL3 |
|
10 | - * @link |
|
11 | - * @copyright 2016 LightSpeed |
|
12 | - */ |
|
13 | - class LSX_Customizer_Colour_Header 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__header_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__header_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__header_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_header', array( |
|
70 | - 'header_background_color' => get_theme_mod( 'header_background_color', $colors['header_background_color'] ), |
|
71 | - 'header_link_color' => get_theme_mod( 'header_link_color', $colors['header_link_color'] ), |
|
72 | - 'header_link_hover_color' => get_theme_mod( 'header_link_hover_color', $colors['header_link_hover_color'] ), |
|
73 | - 'header_description_color' => get_theme_mod( 'header_description_color', $colors['header_description_color'] ), |
|
74 | - ) ); |
|
75 | - } |
|
76 | - |
|
77 | - /** |
|
78 | - * Returns CSS. |
|
79 | - * |
|
80 | - * @since 1.0.0 |
|
81 | - */ |
|
82 | - function get_css( $colors ) { |
|
83 | - global $customizer_colour_names; |
|
84 | - |
|
85 | - $colors_template = array(); |
|
86 | - |
|
87 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
88 | - $colors_template[ $key ] = ''; |
|
89 | - } |
|
90 | - |
|
91 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
92 | - |
|
93 | - if ( empty( $colors['header_background_color'] ) |
|
94 | - || empty( $colors['header_link_color'] ) |
|
95 | - || empty( $colors['header_link_hover_color'] ) |
|
96 | - || empty( $colors['header_description_color'] ) ) { |
|
97 | - return ''; |
|
98 | - } |
|
99 | - |
|
100 | - $css = ' |
|
4 | + /** |
|
5 | + * LSX Customizer Colour Header Class |
|
6 | + * |
|
7 | + * @package LSX Customizer |
|
8 | + * @author LightSpeed |
|
9 | + * @license GPL3 |
|
10 | + * @link |
|
11 | + * @copyright 2016 LightSpeed |
|
12 | + */ |
|
13 | + class LSX_Customizer_Colour_Header 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__header_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__header_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__header_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_header', array( |
|
70 | + 'header_background_color' => get_theme_mod( 'header_background_color', $colors['header_background_color'] ), |
|
71 | + 'header_link_color' => get_theme_mod( 'header_link_color', $colors['header_link_color'] ), |
|
72 | + 'header_link_hover_color' => get_theme_mod( 'header_link_hover_color', $colors['header_link_hover_color'] ), |
|
73 | + 'header_description_color' => get_theme_mod( 'header_description_color', $colors['header_description_color'] ), |
|
74 | + ) ); |
|
75 | + } |
|
76 | + |
|
77 | + /** |
|
78 | + * Returns CSS. |
|
79 | + * |
|
80 | + * @since 1.0.0 |
|
81 | + */ |
|
82 | + function get_css( $colors ) { |
|
83 | + global $customizer_colour_names; |
|
84 | + |
|
85 | + $colors_template = array(); |
|
86 | + |
|
87 | + foreach ( $customizer_colour_names as $key => $value ) { |
|
88 | + $colors_template[ $key ] = ''; |
|
89 | + } |
|
90 | + |
|
91 | + $colors = wp_parse_args( $colors, $colors_template ); |
|
92 | + |
|
93 | + if ( empty( $colors['header_background_color'] ) |
|
94 | + || empty( $colors['header_link_color'] ) |
|
95 | + || empty( $colors['header_link_hover_color'] ) |
|
96 | + || empty( $colors['header_description_color'] ) ) { |
|
97 | + return ''; |
|
98 | + } |
|
99 | + |
|
100 | + $css = ' |
|
101 | 101 | @import "' . get_template_directory() . '/assets/css/scss/global/mixins/header"; |
102 | 102 | |
103 | 103 | /** |
@@ -111,12 +111,12 @@ discard block |
||
111 | 111 | ); |
112 | 112 | '; |
113 | 113 | |
114 | - $css = apply_filters( 'lsx_customizer_colour_selectors_header', $css, $colors ); |
|
115 | - $css = parent::scss_to_css( $css ); |
|
114 | + $css = apply_filters( 'lsx_customizer_colour_selectors_header', $css, $colors ); |
|
115 | + $css = parent::scss_to_css( $css ); |
|
116 | 116 | |
117 | - return $css; |
|
118 | - } |
|
117 | + return $css; |
|
118 | + } |
|
119 | 119 | |
120 | - } |
|
120 | + } |
|
121 | 121 | |
122 | 122 | } |