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