@@ -15,14 +15,14 @@ |
||
15 | 15 | */ |
16 | 16 | |
17 | 17 | // If this file is called directly, abort. |
18 | -if ( ! defined( 'WPINC' ) ) { |
|
18 | +if ( ! defined('WPINC')) { |
|
19 | 19 | die; |
20 | 20 | } |
21 | 21 | |
22 | -define( 'LSX_CUSTOMIZER_PATH', plugin_dir_path( __FILE__ ) ); |
|
23 | -define( 'LSX_CUSTOMIZER_CORE', __FILE__ ); |
|
24 | -define( 'LSX_CUSTOMIZER_URL', plugin_dir_url( __FILE__ ) ); |
|
25 | -define( 'LSX_CUSTOMIZER_VER', '1.4.0' ); |
|
22 | +define('LSX_CUSTOMIZER_PATH', plugin_dir_path(__FILE__)); |
|
23 | +define('LSX_CUSTOMIZER_CORE', __FILE__); |
|
24 | +define('LSX_CUSTOMIZER_URL', plugin_dir_url(__FILE__)); |
|
25 | +define('LSX_CUSTOMIZER_VER', '1.4.0'); |
|
26 | 26 | |
27 | 27 | |
28 | 28 | /* ======================= Below is the Plugin Class init ========================= */ |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! class_exists( 'LSX_Customizer_Wysiwyg_Control' ) ) { |
|
2 | +if ( ! class_exists('LSX_Customizer_Wysiwyg_Control')) { |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * LSX Customizer Wysiwyg Control Class |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | public function render_content() { |
23 | 23 | ?> |
24 | 24 | <label> |
25 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
26 | - <span class="customize-control-title"><?php echo esc_html( $this->label ) ?></span> |
|
25 | + <?php if ( ! empty($this->label)) { ?> |
|
26 | + <span class="customize-control-title"><?php echo esc_html($this->label) ?></span> |
|
27 | 27 | <?php } ?> |
28 | 28 | <?php |
29 | 29 | $settings = array( |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | ); |
33 | 33 | |
34 | 34 | $this->filter_editor_setting_link(); |
35 | - wp_editor( $this->value(), $this->id, $settings ); |
|
35 | + wp_editor($this->value(), $this->id, $settings); |
|
36 | 36 | ?> |
37 | 37 | </label> |
38 | 38 | <?php |
39 | - do_action( 'admin_footer' ); |
|
40 | - do_action( 'admin_print_footer_scripts' ); |
|
39 | + do_action('admin_footer'); |
|
40 | + do_action('admin_print_footer_scripts'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | * @since 1.1.1 |
47 | 47 | */ |
48 | 48 | private function filter_editor_setting_link() { |
49 | - add_filter( 'the_editor', function( $output ) { |
|
50 | - return preg_replace( '/<textarea/', '<textarea ' . $this->get_link(), $output, 1 ); |
|
49 | + add_filter('the_editor', function($output) { |
|
50 | + return preg_replace('/<textarea/', '<textarea ' . $this->get_link(), $output, 1); |
|
51 | 51 | } ); |
52 | 52 | } |
53 | 53 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! class_exists( 'LSX_Customizer_Colour_Footer_Widgets' ) ) { |
|
2 | +if ( ! class_exists('LSX_Customizer_Colour_Footer_Widgets')) { |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * LSX Customizer Colour Footer Widgets 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__footer_widgets_theme_mod', $styles ); |
|
36 | + set_theme_mod('lsx_customizer_colour__footer_widgets_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__footer_widgets_theme_mod' ); |
|
45 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__footer_widgets_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__footer_widgets_theme_mod', $styles ); |
|
51 | + if (false === $styles_from_theme_mod) { |
|
52 | + set_theme_mod('lsx_customizer_colour__footer_widgets_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,12 +66,12 @@ discard block |
||
66 | 66 | public function get_theme_mods() { |
67 | 67 | $colors = parent::get_color_scheme(); |
68 | 68 | |
69 | - return apply_filters( 'lsx_customizer_colours_footer_widgets', array( |
|
70 | - 'footer_widgets_background_color' => get_theme_mod( 'footer_widgets_background_color', $colors['footer_widgets_background_color'] ), |
|
71 | - 'footer_widgets_text_color' => get_theme_mod( 'footer_widgets_text_color', $colors['footer_widgets_text_color'] ), |
|
72 | - 'footer_widgets_link_color' => get_theme_mod( 'footer_widgets_link_color', $colors['footer_widgets_link_color'] ), |
|
73 | - 'footer_widgets_link_hover_color' => get_theme_mod( 'footer_widgets_link_hover_color', $colors['footer_widgets_link_hover_color'] ), |
|
74 | - ) ); |
|
69 | + return apply_filters('lsx_customizer_colours_footer_widgets', array( |
|
70 | + 'footer_widgets_background_color' => get_theme_mod('footer_widgets_background_color', $colors['footer_widgets_background_color']), |
|
71 | + 'footer_widgets_text_color' => get_theme_mod('footer_widgets_text_color', $colors['footer_widgets_text_color']), |
|
72 | + 'footer_widgets_link_color' => get_theme_mod('footer_widgets_link_color', $colors['footer_widgets_link_color']), |
|
73 | + 'footer_widgets_link_hover_color' => get_theme_mod('footer_widgets_link_hover_color', $colors['footer_widgets_link_hover_color']), |
|
74 | + )); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -79,21 +79,21 @@ discard block |
||
79 | 79 | * |
80 | 80 | * @since 1.0.0 |
81 | 81 | */ |
82 | - function get_css( $colors ) { |
|
82 | + function get_css($colors) { |
|
83 | 83 | global $customizer_colour_names; |
84 | 84 | |
85 | 85 | $colors_template = array(); |
86 | 86 | |
87 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
88 | - $colors_template[ $key ] = ''; |
|
87 | + foreach ($customizer_colour_names as $key => $value) { |
|
88 | + $colors_template[$key] = ''; |
|
89 | 89 | } |
90 | 90 | |
91 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
91 | + $colors = wp_parse_args($colors, $colors_template); |
|
92 | 92 | |
93 | - if ( empty( $colors['footer_widgets_background_color'] ) |
|
94 | - || empty( $colors['footer_widgets_text_color'] ) |
|
95 | - || empty( $colors['footer_widgets_link_color'] ) |
|
96 | - || empty( $colors['footer_widgets_link_hover_color'] ) ) { |
|
93 | + if (empty($colors['footer_widgets_background_color']) |
|
94 | + || empty($colors['footer_widgets_text_color']) |
|
95 | + || empty($colors['footer_widgets_link_color']) |
|
96 | + || empty($colors['footer_widgets_link_hover_color'])) { |
|
97 | 97 | return ''; |
98 | 98 | } |
99 | 99 | |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | ); |
112 | 112 | '; |
113 | 113 | |
114 | - $css = apply_filters( 'lsx_customizer_colour_selectors_footer_widgets', $css, $colors ); |
|
115 | - $css = parent::scss_to_css( $css ); |
|
114 | + $css = apply_filters('lsx_customizer_colour_selectors_footer_widgets', $css, $colors); |
|
115 | + $css = parent::scss_to_css($css); |
|
116 | 116 | |
117 | 117 | return $css; |
118 | 118 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! class_exists( 'LSX_Customizer_Core' ) ) { |
|
2 | +if ( ! class_exists('LSX_Customizer_Core')) { |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * LSX Customizer Core Class |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @since 1.0.0 |
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 | 23 | |
24 | 24 | /** |
@@ -27,23 +27,23 @@ discard block |
||
27 | 27 | * @param WP_Customize_Manager $wp_customize Theme Customizer object. |
28 | 28 | * @since 1.0.0 |
29 | 29 | */ |
30 | - public function customize_register( $wp_customize ) { |
|
30 | + public function customize_register($wp_customize) { |
|
31 | 31 | /** |
32 | 32 | * Core section: Theme Credit |
33 | 33 | */ |
34 | - $wp_customize->add_setting( 'lsx_theme_credit_status', array( |
|
34 | + $wp_customize->add_setting('lsx_theme_credit_status', array( |
|
35 | 35 | 'default' => true, |
36 | - 'sanitize_callback' => array( $this, 'sanitize_checkbox' ), |
|
37 | - ) ); |
|
36 | + 'sanitize_callback' => array($this, 'sanitize_checkbox'), |
|
37 | + )); |
|
38 | 38 | |
39 | - $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_theme_credit_status', array( |
|
40 | - 'label' => esc_html__( 'Theme Credit', 'lsx-customizer' ), |
|
39 | + $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'lsx_theme_credit_status', array( |
|
40 | + 'label' => esc_html__('Theme Credit', 'lsx-customizer'), |
|
41 | 41 | // 'description' => esc_html__( 'Displays theme credit in footer.', 'lsx-customizer' ), |
42 | 42 | 'section' => 'lsx-core', |
43 | 43 | 'settings' => 'lsx_theme_credit_status', |
44 | 44 | 'type' => 'checkbox', |
45 | 45 | 'priority' => 10, |
46 | - ) ) ); |
|
46 | + ))); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | } |
@@ -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,21 +18,21 @@ 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 ); |
|
26 | - add_action( 'lsx_entry_inside_top', array( $this, 'checkout_steps' ), 15 ); |
|
25 | + add_action('template_redirect', array($this, 'thankyou_page'), 2999); |
|
26 | + add_action('lsx_entry_inside_top', array($this, 'checkout_steps'), 15); |
|
27 | 27 | |
28 | - add_action( 'wp', array( $this, 'cart_extra_html' ), 2999 ); |
|
29 | - add_action( 'wp', array( $this, 'checkout_extra_html' ), 2999 ); |
|
30 | - add_action( 'lsx_wc_cart_menu_item_position', array( $this, 'cart_menu_item_position' ) ); |
|
31 | - add_action( 'lsx_wc_cart_menu_item_class', array( $this, 'cart_menu_item_class' ) ); |
|
28 | + add_action('wp', array($this, 'cart_extra_html'), 2999); |
|
29 | + add_action('wp', array($this, 'checkout_extra_html'), 2999); |
|
30 | + add_action('lsx_wc_cart_menu_item_position', array($this, 'cart_menu_item_position')); |
|
31 | + add_action('lsx_wc_cart_menu_item_class', array($this, 'cart_menu_item_class')); |
|
32 | 32 | |
33 | - add_filter( 'wp_nav_menu_items', array( $this, 'my_account_menu_item' ), 9, 2 ); |
|
34 | - add_action( 'lsx_wc_my_account_menu_item_position', array( $this, 'my_account_menu_item_position' ) ); |
|
35 | - add_action( 'lsx_wc_my_account_menu_item_class', array( $this, 'my_account_menu_item_class' ) ); |
|
33 | + add_filter('wp_nav_menu_items', array($this, 'my_account_menu_item'), 9, 2); |
|
34 | + add_action('lsx_wc_my_account_menu_item_position', array($this, 'my_account_menu_item_position')); |
|
35 | + add_action('lsx_wc_my_account_menu_item_class', array($this, 'my_account_menu_item_class')); |
|
36 | 36 | |
37 | 37 | // Shop Layout Switcher. |
38 | 38 | //add_action( 'wp_head', array( $this, 'show_layout_switcher' ), 1 ); |
@@ -45,208 +45,208 @@ discard block |
||
45 | 45 | * @param WP_Customize_Manager $wp_customize Theme Customizer object. |
46 | 46 | * @since 1.1.1 |
47 | 47 | */ |
48 | - public function customize_register( $wp_customize ) { |
|
48 | + public function customize_register($wp_customize) { |
|
49 | 49 | /** |
50 | 50 | * Checkout. |
51 | 51 | */ |
52 | 52 | |
53 | - $wp_customize->add_section( 'lsx-wc-checkout' , array( |
|
54 | - 'title' => esc_html__( 'LSX Checkout', 'lsx-customizer' ), |
|
55 | - 'description' => esc_html__( 'Change the WooCommerce checkout settings.', 'lsx-customizer' ), |
|
53 | + $wp_customize->add_section('lsx-wc-checkout', array( |
|
54 | + 'title' => esc_html__('LSX Checkout', 'lsx-customizer'), |
|
55 | + 'description' => esc_html__('Change the WooCommerce checkout settings.', 'lsx-customizer'), |
|
56 | 56 | 'panel' => 'woocommerce', |
57 | 57 | 'priority' => 3, |
58 | - ) ); |
|
58 | + )); |
|
59 | 59 | |
60 | - $wp_customize->add_setting( 'lsx_checkout_steps', array( |
|
60 | + $wp_customize->add_setting('lsx_checkout_steps', array( |
|
61 | 61 | 'default' => true, |
62 | - 'sanitize_callback' => array( $this, 'sanitize_checkbox' ), |
|
63 | - ) ); |
|
62 | + 'sanitize_callback' => array($this, 'sanitize_checkbox'), |
|
63 | + )); |
|
64 | 64 | |
65 | - $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_checkout_steps', array( |
|
66 | - 'label' => esc_html__( 'Steps', 'lsx-customizer' ), |
|
67 | - 'description' => esc_html__( 'Enable the checkout steps header.', 'lsx-customizer' ), |
|
65 | + $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'lsx_checkout_steps', array( |
|
66 | + 'label' => esc_html__('Steps', 'lsx-customizer'), |
|
67 | + 'description' => esc_html__('Enable the checkout steps header.', 'lsx-customizer'), |
|
68 | 68 | 'section' => 'lsx-wc-checkout', |
69 | 69 | 'settings' => 'lsx_checkout_steps', |
70 | 70 | 'type' => 'checkbox', |
71 | 71 | 'priority' => 1, |
72 | - ) ) ); |
|
72 | + ))); |
|
73 | 73 | |
74 | - $wp_customize->add_setting( 'lsx_wc_checkout_layout', array( |
|
74 | + $wp_customize->add_setting('lsx_wc_checkout_layout', array( |
|
75 | 75 | 'default' => 'default', |
76 | - 'sanitize_callback' => array( $this, 'sanitize_select' ), |
|
77 | - ) ); |
|
76 | + 'sanitize_callback' => array($this, 'sanitize_select'), |
|
77 | + )); |
|
78 | 78 | |
79 | - $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_checkout_layout', array( |
|
80 | - 'label' => esc_html__( 'Layout', 'lsx-customizer' ), |
|
81 | - 'description' => esc_html__( 'WooCommerce checkout layout.', 'lsx-customizer' ), |
|
79 | + $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'lsx_wc_checkout_layout', array( |
|
80 | + 'label' => esc_html__('Layout', 'lsx-customizer'), |
|
81 | + 'description' => esc_html__('WooCommerce checkout layout.', 'lsx-customizer'), |
|
82 | 82 | 'section' => 'lsx-wc-checkout', |
83 | 83 | 'settings' => 'lsx_wc_checkout_layout', |
84 | 84 | 'type' => 'select', |
85 | 85 | 'priority' => 2, |
86 | 86 | 'choices' => array( |
87 | - 'default' => esc_html__( 'Default', 'lsx-customizer' ), |
|
88 | - 'stacked' => esc_html__( 'Stacked', 'lsx-customizer' ), |
|
89 | - 'columns' => esc_html__( 'Columns', 'lsx-customizer' ), |
|
87 | + 'default' => esc_html__('Default', 'lsx-customizer'), |
|
88 | + 'stacked' => esc_html__('Stacked', 'lsx-customizer'), |
|
89 | + 'columns' => esc_html__('Columns', 'lsx-customizer'), |
|
90 | 90 | ), |
91 | - ) ) ); |
|
91 | + ))); |
|
92 | 92 | |
93 | - $wp_customize->add_setting( 'lsx_wc_checkout_thankyou_page', array( |
|
93 | + $wp_customize->add_setting('lsx_wc_checkout_thankyou_page', array( |
|
94 | 94 | 'default' => '0', |
95 | - 'sanitize_callback' => array( $this, 'sanitize_select' ), |
|
96 | - ) ); |
|
95 | + 'sanitize_callback' => array($this, 'sanitize_select'), |
|
96 | + )); |
|
97 | 97 | |
98 | 98 | $choices = array( |
99 | - '0' => esc_html__( 'Default', 'lsx-customizer' ), |
|
99 | + '0' => esc_html__('Default', 'lsx-customizer'), |
|
100 | 100 | ); |
101 | 101 | |
102 | 102 | $pages = get_pages(); |
103 | 103 | |
104 | - foreach ( $pages as $key => $page ) { |
|
105 | - $choices[ $page->ID ] = $page->post_title; |
|
104 | + foreach ($pages as $key => $page) { |
|
105 | + $choices[$page->ID] = $page->post_title; |
|
106 | 106 | } |
107 | 107 | |
108 | - $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_checkout_thankyou_page', array( |
|
109 | - 'label' => esc_html__( 'Thank You Page', 'lsx-customizer' ), |
|
110 | - 'description' => esc_html__( 'WooCommerce checkout thank you page.', 'lsx-customizer' ), |
|
108 | + $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'lsx_wc_checkout_thankyou_page', array( |
|
109 | + 'label' => esc_html__('Thank You Page', 'lsx-customizer'), |
|
110 | + 'description' => esc_html__('WooCommerce checkout thank you page.', 'lsx-customizer'), |
|
111 | 111 | 'section' => 'lsx-wc-checkout', |
112 | 112 | 'settings' => 'lsx_wc_checkout_thankyou_page', |
113 | 113 | 'type' => 'select', |
114 | 114 | 'priority' => 3, |
115 | 115 | 'choices' => $choices, |
116 | - ) ) ); |
|
116 | + ))); |
|
117 | 117 | |
118 | - $wp_customize->add_setting( 'lsx_wc_checkout_extra_html', array( |
|
118 | + $wp_customize->add_setting('lsx_wc_checkout_extra_html', array( |
|
119 | 119 | 'default' => '', |
120 | 120 | 'sanitize_callback' => 'wp_kses_post', |
121 | - ) ); |
|
121 | + )); |
|
122 | 122 | |
123 | - $wp_customize->add_control( new LSX_Customizer_Wysiwyg_Control( $wp_customize, 'lsx_wc_checkout_extra_html', array( |
|
124 | - 'label' => esc_html__( 'Extra HTML', 'lsx-customizer' ), |
|
125 | - 'description' => esc_html__( 'Extra HTML to display at checkout page (bottom/right).', 'lsx-customizer' ), |
|
123 | + $wp_customize->add_control(new LSX_Customizer_Wysiwyg_Control($wp_customize, 'lsx_wc_checkout_extra_html', array( |
|
124 | + 'label' => esc_html__('Extra HTML', 'lsx-customizer'), |
|
125 | + 'description' => esc_html__('Extra HTML to display at checkout page (bottom/right).', 'lsx-customizer'), |
|
126 | 126 | 'section' => 'lsx-wc-checkout', |
127 | 127 | 'settings' => 'lsx_wc_checkout_extra_html', |
128 | 128 | 'priority' => 4, |
129 | 129 | 'type' => 'wysiwyg', |
130 | - ) ) ); |
|
130 | + ))); |
|
131 | 131 | |
132 | 132 | /** |
133 | 133 | * Cart. |
134 | 134 | */ |
135 | 135 | |
136 | - $wp_customize->add_setting( 'lsx_wc_cart_menu_item_style', array( |
|
136 | + $wp_customize->add_setting('lsx_wc_cart_menu_item_style', array( |
|
137 | 137 | 'default' => 'extended', |
138 | - 'sanitize_callback' => array( $this, 'sanitize_select' ), |
|
139 | - ) ); |
|
138 | + 'sanitize_callback' => array($this, 'sanitize_select'), |
|
139 | + )); |
|
140 | 140 | |
141 | - $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_cart_menu_item_style', array( |
|
142 | - 'label' => esc_html__( 'Menu Item Style', 'lsx-customizer' ), |
|
143 | - 'description' => esc_html__( 'WooCommerce menu item cart style.', 'lsx-customizer' ), |
|
141 | + $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'lsx_wc_cart_menu_item_style', array( |
|
142 | + 'label' => esc_html__('Menu Item Style', 'lsx-customizer'), |
|
143 | + 'description' => esc_html__('WooCommerce menu item cart style.', 'lsx-customizer'), |
|
144 | 144 | 'section' => 'lsx-wc-cart', |
145 | 145 | 'settings' => 'lsx_wc_cart_menu_item_style', |
146 | 146 | 'type' => 'select', |
147 | 147 | 'priority' => 2, |
148 | 148 | 'choices' => array( |
149 | - 'simple' => esc_html__( 'Simple', 'lsx-customizer' ), |
|
150 | - 'extended' => esc_html__( 'Extended', 'lsx-customizer' ), |
|
149 | + 'simple' => esc_html__('Simple', 'lsx-customizer'), |
|
150 | + 'extended' => esc_html__('Extended', 'lsx-customizer'), |
|
151 | 151 | ), |
152 | - ) ) ); |
|
152 | + ))); |
|
153 | 153 | |
154 | - $wp_customize->add_setting( 'lsx_wc_cart_menu_item_position', array( |
|
154 | + $wp_customize->add_setting('lsx_wc_cart_menu_item_position', array( |
|
155 | 155 | 'default' => 'main-menu-in', |
156 | - 'sanitize_callback' => array( $this, 'sanitize_select' ), |
|
157 | - ) ); |
|
156 | + 'sanitize_callback' => array($this, 'sanitize_select'), |
|
157 | + )); |
|
158 | 158 | |
159 | - $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_cart_menu_item_position', array( |
|
160 | - 'label' => esc_html__( 'Menu Item Position', 'lsx-customizer' ), |
|
161 | - 'description' => esc_html__( 'WooCommerce menu item cart position.', 'lsx-customizer' ), |
|
159 | + $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'lsx_wc_cart_menu_item_position', array( |
|
160 | + 'label' => esc_html__('Menu Item Position', 'lsx-customizer'), |
|
161 | + 'description' => esc_html__('WooCommerce menu item cart position.', 'lsx-customizer'), |
|
162 | 162 | 'section' => 'lsx-wc-cart', |
163 | 163 | 'settings' => 'lsx_wc_cart_menu_item_position', |
164 | 164 | 'type' => 'select', |
165 | 165 | 'priority' => 3, |
166 | 166 | 'choices' => array( |
167 | - 'main-menu-in' => esc_html__( 'Main Menu (as last item)', 'lsx-customizer' ), |
|
168 | - 'main-menu-out' => esc_html__( 'Main Menu (as last item, right aligned)', 'lsx-customizer' ), |
|
169 | - 'top-menu-left' => esc_html__( 'Top Menu (left)', 'lsx-customizer' ), |
|
170 | - 'top-menu-right' => esc_html__( 'Top Menu (right)', 'lsx-customizer' ), |
|
167 | + 'main-menu-in' => esc_html__('Main Menu (as last item)', 'lsx-customizer'), |
|
168 | + 'main-menu-out' => esc_html__('Main Menu (as last item, right aligned)', 'lsx-customizer'), |
|
169 | + 'top-menu-left' => esc_html__('Top Menu (left)', 'lsx-customizer'), |
|
170 | + 'top-menu-right' => esc_html__('Top Menu (right)', 'lsx-customizer'), |
|
171 | 171 | ), |
172 | - ) ) ); |
|
172 | + ))); |
|
173 | 173 | |
174 | - $wp_customize->add_setting( 'lsx_wc_cart_extra_html', array( |
|
174 | + $wp_customize->add_setting('lsx_wc_cart_extra_html', array( |
|
175 | 175 | 'default' => '', |
176 | 176 | 'sanitize_callback' => 'wp_kses_post', |
177 | - ) ); |
|
177 | + )); |
|
178 | 178 | |
179 | - $wp_customize->add_control( new LSX_Customizer_Wysiwyg_Control( $wp_customize, 'lsx_wc_cart_extra_html', array( |
|
180 | - 'label' => esc_html__( 'Extra HTML', 'lsx-customizer' ), |
|
181 | - 'description' => esc_html__( 'Extra HTML to display at cart page (bottom/left).', 'lsx-customizer' ), |
|
179 | + $wp_customize->add_control(new LSX_Customizer_Wysiwyg_Control($wp_customize, 'lsx_wc_cart_extra_html', array( |
|
180 | + 'label' => esc_html__('Extra HTML', 'lsx-customizer'), |
|
181 | + 'description' => esc_html__('Extra HTML to display at cart page (bottom/left).', 'lsx-customizer'), |
|
182 | 182 | 'section' => 'lsx-wc-cart', |
183 | 183 | 'settings' => 'lsx_wc_cart_extra_html', |
184 | 184 | 'priority' => 4, |
185 | 185 | 'type' => 'wysiwyg', |
186 | - ) ) ); |
|
186 | + ))); |
|
187 | 187 | |
188 | 188 | /** |
189 | 189 | * My Account. |
190 | 190 | */ |
191 | 191 | |
192 | - $wp_customize->add_section( 'lsx-wc-my-account' , array( |
|
193 | - 'title' => esc_html__( 'LSX My Account', 'lsx-customizer' ), |
|
194 | - 'description' => esc_html__( 'Change the WooCommerce My Account settings.', 'lsx-customizer' ), |
|
192 | + $wp_customize->add_section('lsx-wc-my-account', array( |
|
193 | + 'title' => esc_html__('LSX My Account', 'lsx-customizer'), |
|
194 | + 'description' => esc_html__('Change the WooCommerce My Account settings.', 'lsx-customizer'), |
|
195 | 195 | 'panel' => 'woocommerce', |
196 | 196 | 'priority' => 4, |
197 | - ) ); |
|
197 | + )); |
|
198 | 198 | |
199 | - $wp_customize->add_setting( 'lsx_wc_my_account_menu_item', array( |
|
199 | + $wp_customize->add_setting('lsx_wc_my_account_menu_item', array( |
|
200 | 200 | 'default' => false, |
201 | - 'sanitize_callback' => array( $this, 'sanitize_checkbox' ), |
|
202 | - ) ); |
|
201 | + 'sanitize_callback' => array($this, 'sanitize_checkbox'), |
|
202 | + )); |
|
203 | 203 | |
204 | - $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_my_account_menu_item', array( |
|
205 | - 'label' => esc_html__( 'Menu Item', 'lsx-customizer' ), |
|
206 | - 'description' => esc_html__( 'Enable the My Account menu item.', 'lsx-customizer' ), |
|
204 | + $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'lsx_wc_my_account_menu_item', array( |
|
205 | + 'label' => esc_html__('Menu Item', 'lsx-customizer'), |
|
206 | + 'description' => esc_html__('Enable the My Account menu item.', 'lsx-customizer'), |
|
207 | 207 | 'section' => 'lsx-wc-my-account', |
208 | 208 | 'settings' => 'lsx_wc_my_account_menu_item', |
209 | 209 | 'type' => 'checkbox', |
210 | 210 | 'priority' => 1, |
211 | - ) ) ); |
|
211 | + ))); |
|
212 | 212 | |
213 | - $wp_customize->add_setting( 'lsx_wc_my_account_menu_item_style', array( |
|
213 | + $wp_customize->add_setting('lsx_wc_my_account_menu_item_style', array( |
|
214 | 214 | 'default' => 'extended', |
215 | - 'sanitize_callback' => array( $this, 'sanitize_select' ), |
|
216 | - ) ); |
|
215 | + 'sanitize_callback' => array($this, 'sanitize_select'), |
|
216 | + )); |
|
217 | 217 | |
218 | - $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_my_account_menu_item_style', array( |
|
219 | - 'label' => esc_html__( 'Menu Item Style', 'lsx-customizer' ), |
|
220 | - 'description' => esc_html__( 'WooCommerce menu item My Account style.', 'lsx-customizer' ), |
|
218 | + $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'lsx_wc_my_account_menu_item_style', array( |
|
219 | + 'label' => esc_html__('Menu Item Style', 'lsx-customizer'), |
|
220 | + 'description' => esc_html__('WooCommerce menu item My Account style.', 'lsx-customizer'), |
|
221 | 221 | 'section' => 'lsx-wc-my-account', |
222 | 222 | 'settings' => 'lsx_wc_my_account_menu_item_style', |
223 | 223 | 'type' => 'select', |
224 | 224 | 'priority' => 2, |
225 | 225 | 'choices' => array( |
226 | - 'simple' => esc_html__( 'Simple', 'lsx-customizer' ), |
|
227 | - 'extended' => esc_html__( 'Extended', 'lsx-customizer' ), |
|
226 | + 'simple' => esc_html__('Simple', 'lsx-customizer'), |
|
227 | + 'extended' => esc_html__('Extended', 'lsx-customizer'), |
|
228 | 228 | ), |
229 | - ) ) ); |
|
229 | + ))); |
|
230 | 230 | |
231 | - $wp_customize->add_setting( 'lsx_wc_my_account_menu_item_position', array( |
|
231 | + $wp_customize->add_setting('lsx_wc_my_account_menu_item_position', array( |
|
232 | 232 | 'default' => 'main-menu-in', |
233 | - 'sanitize_callback' => array( $this, 'sanitize_select' ), |
|
234 | - ) ); |
|
233 | + 'sanitize_callback' => array($this, 'sanitize_select'), |
|
234 | + )); |
|
235 | 235 | |
236 | - $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'lsx_wc_my_account_menu_item_position', array( |
|
237 | - 'label' => esc_html__( 'Menu Item Position', 'lsx-customizer' ), |
|
238 | - 'description' => esc_html__( 'WooCommerce menu item My Account position.', 'lsx-customizer' ), |
|
236 | + $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'lsx_wc_my_account_menu_item_position', array( |
|
237 | + 'label' => esc_html__('Menu Item Position', 'lsx-customizer'), |
|
238 | + 'description' => esc_html__('WooCommerce menu item My Account position.', 'lsx-customizer'), |
|
239 | 239 | 'section' => 'lsx-wc-my-account', |
240 | 240 | 'settings' => 'lsx_wc_my_account_menu_item_position', |
241 | 241 | 'type' => 'select', |
242 | 242 | 'priority' => 3, |
243 | 243 | 'choices' => array( |
244 | - 'main-menu-in' => esc_html__( 'Main Menu (as last item)', 'lsx-customizer' ), |
|
245 | - 'main-menu-out' => esc_html__( 'Main Menu (as last item, right aligned)', 'lsx-customizer' ), |
|
246 | - 'top-menu-left' => esc_html__( 'Top Menu (left)', 'lsx-customizer' ), |
|
247 | - 'top-menu-right' => esc_html__( 'Top Menu (right)', 'lsx-customizer' ), |
|
244 | + 'main-menu-in' => esc_html__('Main Menu (as last item)', 'lsx-customizer'), |
|
245 | + 'main-menu-out' => esc_html__('Main Menu (as last item, right aligned)', 'lsx-customizer'), |
|
246 | + 'top-menu-left' => esc_html__('Top Menu (left)', 'lsx-customizer'), |
|
247 | + 'top-menu-right' => esc_html__('Top Menu (right)', 'lsx-customizer'), |
|
248 | 248 | ), |
249 | - ) ) ); |
|
249 | + ))); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
@@ -254,13 +254,13 @@ discard block |
||
254 | 254 | * |
255 | 255 | * @since 1.1.1 |
256 | 256 | */ |
257 | - public function body_class( $classes ) { |
|
258 | - if ( is_checkout() ) { |
|
259 | - $layout = get_theme_mod( 'lsx_wc_checkout_layout', 'default' ); |
|
257 | + public function body_class($classes) { |
|
258 | + if (is_checkout()) { |
|
259 | + $layout = get_theme_mod('lsx_wc_checkout_layout', 'default'); |
|
260 | 260 | |
261 | - if ( 'stacked' === $layout ) { |
|
261 | + if ('stacked' === $layout) { |
|
262 | 262 | $classes[] = 'lsx-wc-checkout-layout-stacked'; |
263 | - } elseif ( 'columns' === $layout ) { |
|
263 | + } elseif ('columns' === $layout) { |
|
264 | 264 | $classes[] = 'lsx-wc-checkout-layout-two-column-addreses'; |
265 | 265 | } |
266 | 266 | } |
@@ -276,15 +276,15 @@ discard block |
||
276 | 276 | public function thankyou_page() { |
277 | 277 | global $wp; |
278 | 278 | |
279 | - if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) { |
|
280 | - $thankyou_page = get_theme_mod( 'lsx_wc_checkout_thankyou_page', '0' ); |
|
279 | + if (is_checkout() && ! empty($wp->query_vars['order-received'])) { |
|
280 | + $thankyou_page = get_theme_mod('lsx_wc_checkout_thankyou_page', '0'); |
|
281 | 281 | |
282 | - if ( ! empty( $thankyou_page ) && ! is_page( $thankyou_page ) ) { |
|
283 | - $order_id = apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ) ); |
|
284 | - $order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) ); |
|
282 | + if ( ! empty($thankyou_page) && ! is_page($thankyou_page)) { |
|
283 | + $order_id = apply_filters('woocommerce_thankyou_order_id', absint($wp->query_vars['order-received'])); |
|
284 | + $order_key = apply_filters('woocommerce_thankyou_order_key', empty($_GET['key']) ? '' : wc_clean($_GET['key'])); |
|
285 | 285 | |
286 | - if ( $order_id > 0 ) { |
|
287 | - wp_safe_redirect( get_permalink( $thankyou_page ) . '?order-received=' . $order_id . '&key=' . $order_key, 302 ); |
|
286 | + if ($order_id > 0) { |
|
287 | + wp_safe_redirect(get_permalink($thankyou_page) . '?order-received=' . $order_id . '&key=' . $order_key, 302); |
|
288 | 288 | exit; |
289 | 289 | } |
290 | 290 | } |
@@ -297,95 +297,95 @@ discard block |
||
297 | 297 | * @since 1.1.1 |
298 | 298 | */ |
299 | 299 | public function checkout_steps() { |
300 | - $cart_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : WC()->cart->get_cart_url(); |
|
301 | - if ( ( is_checkout() || is_cart() ) && ! empty( get_theme_mod( 'lsx_checkout_steps', '1' ) ) ) : |
|
300 | + $cart_url = function_exists('wc_get_cart_url') ? wc_get_cart_url() : WC()->cart->get_cart_url(); |
|
301 | + if ((is_checkout() || is_cart()) && ! empty(get_theme_mod('lsx_checkout_steps', '1'))) : |
|
302 | 302 | global $wp; |
303 | 303 | ?> |
304 | 304 | <div class="lsx-wc-checkout-steps"> |
305 | 305 | <ul class="lsx-wc-checkout-steps-items"> |
306 | 306 | |
307 | - <?php if ( is_cart() ) : ?> |
|
307 | + <?php if (is_cart()) : ?> |
|
308 | 308 | |
309 | 309 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-done"> |
310 | - <a href="<?php echo esc_url( get_permalink( wc_get_page_id( 'shop' ) ) ); ?>" class="lsx-wc-checkout-steps-link"> |
|
310 | + <a href="<?php echo esc_url(get_permalink(wc_get_page_id('shop'))); ?>" class="lsx-wc-checkout-steps-link"> |
|
311 | 311 | <i class="fa fa-check-circle" aria-hidden="true"></i> |
312 | - <span><span><?php esc_html_e( 'Shop', 'lsx-customizer' ); ?></span></span> |
|
312 | + <span><span><?php esc_html_e('Shop', 'lsx-customizer'); ?></span></span> |
|
313 | 313 | </a> |
314 | 314 | |
315 | 315 | <i class="fa fa-angle-right" aria-hidden="true"></i> |
316 | 316 | </li> |
317 | 317 | |
318 | 318 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-current lsx-wc-checkout-steps-item-cart"> |
319 | - <i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e( '2', 'lsx-customizer' ); ?></i> |
|
320 | - <span><span><?php esc_html_e( 'My Cart', 'lsx-customizer' ); ?></span></span> |
|
319 | + <i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e('2', 'lsx-customizer'); ?></i> |
|
320 | + <span><span><?php esc_html_e('My Cart', 'lsx-customizer'); ?></span></span> |
|
321 | 321 | <i class="fa fa-angle-right" aria-hidden="true"></i> |
322 | 322 | </li> |
323 | 323 | |
324 | 324 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-disabled lsx-wc-checkout-steps-item-payment"> |
325 | - <i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e( '3', 'lsx-customizer' ); ?></i> |
|
326 | - <span><span><?php esc_html_e( 'Billing details', 'lsx-customizer' ); ?></span></span> |
|
325 | + <i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e('3', 'lsx-customizer'); ?></i> |
|
326 | + <span><span><?php esc_html_e('Billing details', 'lsx-customizer'); ?></span></span> |
|
327 | 327 | <i class="fa fa-angle-right" aria-hidden="true"></i> |
328 | 328 | </li> |
329 | 329 | |
330 | 330 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-disabled lsx-wc-checkout-steps-item-thankyou"> |
331 | - <i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e( '4', 'lsx-customizer' ); ?></i> |
|
332 | - <span><span><?php esc_html_e( 'Payment', 'lsx-customizer' ); ?></span></span> |
|
331 | + <i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e('4', 'lsx-customizer'); ?></i> |
|
332 | + <span><span><?php esc_html_e('Payment', 'lsx-customizer'); ?></span></span> |
|
333 | 333 | </li> |
334 | 334 | |
335 | - <?php elseif ( is_checkout() && empty( $wp->query_vars['order-received'] ) ) : ?> |
|
335 | + <?php elseif (is_checkout() && empty($wp->query_vars['order-received'])) : ?> |
|
336 | 336 | |
337 | 337 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-done"> |
338 | - <a href="<?php echo esc_url( get_permalink( wc_get_page_id( 'shop' ) ) ); ?>" class="lsx-wc-checkout-steps-link"> |
|
338 | + <a href="<?php echo esc_url(get_permalink(wc_get_page_id('shop'))); ?>" class="lsx-wc-checkout-steps-link"> |
|
339 | 339 | <i class="fa fa-check-circle" aria-hidden="true"></i> |
340 | - <span><span><?php esc_html_e( 'Shop', 'lsx-customizer' ); ?></span></span> |
|
340 | + <span><span><?php esc_html_e('Shop', 'lsx-customizer'); ?></span></span> |
|
341 | 341 | </a> |
342 | 342 | |
343 | 343 | <i class="fa fa-angle-right" aria-hidden="true"></i> |
344 | 344 | </li> |
345 | 345 | |
346 | 346 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-done lsx-wc-checkout-steps-item-cart"> |
347 | - <a href="<?php echo esc_url( $cart_url ); ?>" class="lsx-wc-checkout-steps-link"> |
|
347 | + <a href="<?php echo esc_url($cart_url); ?>" class="lsx-wc-checkout-steps-link"> |
|
348 | 348 | <i class="fa fa-check-circle" aria-hidden="true"></i> |
349 | - <span><span><?php esc_html_e( 'My Cart', 'lsx-customizer' ); ?></span></span> |
|
349 | + <span><span><?php esc_html_e('My Cart', 'lsx-customizer'); ?></span></span> |
|
350 | 350 | </a> |
351 | 351 | |
352 | 352 | <i class="fa fa-angle-right" aria-hidden="true"></i> |
353 | 353 | </li> |
354 | 354 | |
355 | 355 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-current lsx-wc-checkout-steps-item-payment"> |
356 | - <i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e( '3', 'lsx-customizer' ); ?></i> |
|
357 | - <span><span><?php esc_html_e( 'Billing details', 'lsx-customizer' ); ?></span></span> |
|
356 | + <i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e('3', 'lsx-customizer'); ?></i> |
|
357 | + <span><span><?php esc_html_e('Billing details', 'lsx-customizer'); ?></span></span> |
|
358 | 358 | <i class="fa fa-angle-right" aria-hidden="true"></i> |
359 | 359 | </li> |
360 | 360 | |
361 | 361 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-disabled lsx-wc-checkout-steps-item-thankyou"> |
362 | - <i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e( '4', 'lsx-customizer' ); ?></i> |
|
363 | - <span><span><?php esc_html_e( 'Payment', 'lsx-customizer' ); ?></span></span> |
|
362 | + <i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e('4', 'lsx-customizer'); ?></i> |
|
363 | + <span><span><?php esc_html_e('Payment', 'lsx-customizer'); ?></span></span> |
|
364 | 364 | </li> |
365 | 365 | |
366 | - <?php elseif ( is_checkout() ) : ?> |
|
366 | + <?php elseif (is_checkout()) : ?> |
|
367 | 367 | |
368 | 368 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-done"> |
369 | 369 | <i class="fa fa-check-circle" aria-hidden="true"></i> |
370 | - <span><span><?php esc_html_e( 'Shop', 'lsx-customizer' ); ?></span></span> |
|
370 | + <span><span><?php esc_html_e('Shop', 'lsx-customizer'); ?></span></span> |
|
371 | 371 | <i class="fa fa-angle-right" aria-hidden="true"></i> |
372 | 372 | </li> |
373 | 373 | |
374 | 374 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-done lsx-wc-checkout-steps-item-cart"> |
375 | 375 | <i class="fa fa-check-circle" aria-hidden="true"></i> |
376 | - <span><span><?php esc_html_e( 'My Cart', 'lsx-customizer' ); ?></span></span> |
|
376 | + <span><span><?php esc_html_e('My Cart', 'lsx-customizer'); ?></span></span> |
|
377 | 377 | <i class="fa fa-angle-right" aria-hidden="true"></i> |
378 | 378 | </li> |
379 | 379 | |
380 | 380 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-done lsx-wc-checkout-steps-item-payment"> |
381 | 381 | <i class="fa fa-check-circle" aria-hidden="true"></i> |
382 | - <span><span><?php esc_html_e( 'Billing details', 'lsx-customizer' ); ?></span></span> |
|
382 | + <span><span><?php esc_html_e('Billing details', 'lsx-customizer'); ?></span></span> |
|
383 | 383 | <i class="fa fa-angle-right" aria-hidden="true"></i> |
384 | 384 | </li> |
385 | 385 | |
386 | 386 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-current lsx-wc-checkout-steps-item-thankyou"> |
387 | - <i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e( '4', 'lsx-customizer' ); ?></i> |
|
388 | - <span><span><?php esc_html_e( 'Payment', 'lsx-customizer' ); ?></span></span> |
|
387 | + <i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e('4', 'lsx-customizer'); ?></i> |
|
388 | + <span><span><?php esc_html_e('Payment', 'lsx-customizer'); ?></span></span> |
|
389 | 389 | </li> |
390 | 390 | |
391 | 391 | <?php endif; ?> |
@@ -402,11 +402,11 @@ discard block |
||
402 | 402 | * @since 1.1.1 |
403 | 403 | */ |
404 | 404 | public function checkout_extra_html() { |
405 | - if ( is_checkout() ) { |
|
406 | - $checkout_extra_html = get_theme_mod( 'lsx_wc_checkout_extra_html', '' ); |
|
405 | + if (is_checkout()) { |
|
406 | + $checkout_extra_html = get_theme_mod('lsx_wc_checkout_extra_html', ''); |
|
407 | 407 | |
408 | - if ( ! empty( $checkout_extra_html ) ) { |
|
409 | - add_action( 'woocommerce_review_order_after_payment', array( $this, 'checkout_extra_html_echo' ), 9 ); |
|
408 | + if ( ! empty($checkout_extra_html)) { |
|
409 | + add_action('woocommerce_review_order_after_payment', array($this, 'checkout_extra_html_echo'), 9); |
|
410 | 410 | } |
411 | 411 | } |
412 | 412 | } |
@@ -417,13 +417,13 @@ discard block |
||
417 | 417 | * @since 1.1.1 |
418 | 418 | */ |
419 | 419 | public function checkout_extra_html_echo() { |
420 | - if ( is_checkout() ) { |
|
421 | - $checkout_extra_html = get_theme_mod( 'lsx_wc_checkout_extra_html', '' ); |
|
420 | + if (is_checkout()) { |
|
421 | + $checkout_extra_html = get_theme_mod('lsx_wc_checkout_extra_html', ''); |
|
422 | 422 | |
423 | - if ( ! empty( $checkout_extra_html ) ) { |
|
423 | + if ( ! empty($checkout_extra_html)) { |
|
424 | 424 | ?> |
425 | 425 | <div class="lsx-wc-checkout-extra-html"> |
426 | - <?php echo wp_kses_post( $checkout_extra_html ); ?> |
|
426 | + <?php echo wp_kses_post($checkout_extra_html); ?> |
|
427 | 427 | </div> |
428 | 428 | <?php |
429 | 429 | } |
@@ -436,12 +436,12 @@ discard block |
||
436 | 436 | * @since 1.1.1 |
437 | 437 | */ |
438 | 438 | public function cart_extra_html() { |
439 | - if ( is_cart() ) { |
|
440 | - $cart_extra_html = get_theme_mod( 'lsx_wc_cart_extra_html', '' ); |
|
439 | + if (is_cart()) { |
|
440 | + $cart_extra_html = get_theme_mod('lsx_wc_cart_extra_html', ''); |
|
441 | 441 | |
442 | - if ( ! empty( $cart_extra_html ) ) { |
|
443 | - remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' ); |
|
444 | - add_action( 'woocommerce_cart_collaterals', array( $this, 'cart_extra_html_echo' ), 9 ); |
|
442 | + if ( ! empty($cart_extra_html)) { |
|
443 | + remove_action('woocommerce_cart_collaterals', 'woocommerce_cross_sell_display'); |
|
444 | + add_action('woocommerce_cart_collaterals', array($this, 'cart_extra_html_echo'), 9); |
|
445 | 445 | } |
446 | 446 | } |
447 | 447 | } |
@@ -452,12 +452,12 @@ discard block |
||
452 | 452 | * @since 1.1.1 |
453 | 453 | */ |
454 | 454 | public function cart_extra_html_echo() { |
455 | - if ( is_cart() ) { |
|
456 | - $cart_extra_html = get_theme_mod( 'lsx_wc_cart_extra_html', '' ); |
|
455 | + if (is_cart()) { |
|
456 | + $cart_extra_html = get_theme_mod('lsx_wc_cart_extra_html', ''); |
|
457 | 457 | |
458 | - if ( ! empty( $cart_extra_html ) ) { ?> |
|
458 | + if ( ! empty($cart_extra_html)) { ?> |
|
459 | 459 | <div class="lsx-wc-cart-extra-html"> |
460 | - <?php echo wp_kses_post( $cart_extra_html ); ?> |
|
460 | + <?php echo wp_kses_post($cart_extra_html); ?> |
|
461 | 461 | </div> |
462 | 462 | <?php } |
463 | 463 | } |
@@ -468,11 +468,11 @@ discard block |
||
468 | 468 | * |
469 | 469 | * @since 1.1.1 |
470 | 470 | */ |
471 | - public function cart_menu_item_position( $menu_position ) { |
|
472 | - $position = get_theme_mod( 'lsx_wc_cart_menu_item_position', '' ); |
|
471 | + public function cart_menu_item_position($menu_position) { |
|
472 | + $position = get_theme_mod('lsx_wc_cart_menu_item_position', ''); |
|
473 | 473 | |
474 | - if ( ! empty( $position ) ) { |
|
475 | - switch ( $position ) { |
|
474 | + if ( ! empty($position)) { |
|
475 | + switch ($position) { |
|
476 | 476 | case 'main-menu-in': |
477 | 477 | case 'main-menu-out': |
478 | 478 | $menu_position = 'primary'; |
@@ -496,16 +496,16 @@ discard block |
||
496 | 496 | * |
497 | 497 | * @since 1.1.1 |
498 | 498 | */ |
499 | - public function cart_menu_item_class( $item_class ) { |
|
500 | - $position = get_theme_mod( 'lsx_wc_cart_menu_item_position', '' ); |
|
499 | + public function cart_menu_item_class($item_class) { |
|
500 | + $position = get_theme_mod('lsx_wc_cart_menu_item_position', ''); |
|
501 | 501 | |
502 | - if ( 'main-menu-out' === $position ) { |
|
502 | + if ('main-menu-out' === $position) { |
|
503 | 503 | $item_class .= ' lsx-wc-cart-menu-item-right-aligned'; |
504 | 504 | } |
505 | 505 | |
506 | - $style = get_theme_mod( 'lsx_wc_cart_menu_item_style', '' ); |
|
506 | + $style = get_theme_mod('lsx_wc_cart_menu_item_style', ''); |
|
507 | 507 | |
508 | - if ( 'simple' === $style ) { |
|
508 | + if ('simple' === $style) { |
|
509 | 509 | $item_class .= ' lsx-wc-cart-menu-item-simple'; |
510 | 510 | } |
511 | 511 | |
@@ -517,47 +517,47 @@ discard block |
||
517 | 517 | * |
518 | 518 | * @since 1.1.1 |
519 | 519 | */ |
520 | - public function my_account_menu_item( $items, $args ) { |
|
521 | - $my_account_menu_item_position = apply_filters( 'lsx_wc_my_account_menu_item_position', 'primary' ); |
|
520 | + public function my_account_menu_item($items, $args) { |
|
521 | + $my_account_menu_item_position = apply_filters('lsx_wc_my_account_menu_item_position', 'primary'); |
|
522 | 522 | |
523 | - if ( $my_account_menu_item_position === $args->theme_location || ( 'primary_logged_out' === $args->theme_location && 'primary' === $my_account_menu_item_position ) ) { |
|
524 | - $customizer_option = get_theme_mod( 'lsx_wc_my_account_menu_item', false ); |
|
523 | + if ($my_account_menu_item_position === $args->theme_location || ('primary_logged_out' === $args->theme_location && 'primary' === $my_account_menu_item_position)) { |
|
524 | + $customizer_option = get_theme_mod('lsx_wc_my_account_menu_item', false); |
|
525 | 525 | |
526 | - if ( ! empty( $customizer_option ) ) { |
|
527 | - if ( is_account_page() ) { |
|
526 | + if ( ! empty($customizer_option)) { |
|
527 | + if (is_account_page()) { |
|
528 | 528 | $class = 'current-menu-item'; |
529 | 529 | } else { |
530 | 530 | $class = ''; |
531 | 531 | } |
532 | 532 | |
533 | 533 | $item_class = 'menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children dropdown lsx-wc-my-account-menu-item ' . $class; |
534 | - $item_class = apply_filters( 'lsx_wc_my_account_menu_item_class', $item_class ); |
|
534 | + $item_class = apply_filters('lsx_wc_my_account_menu_item_class', $item_class); |
|
535 | 535 | |
536 | 536 | $endpoints = WC()->query->get_query_vars(); |
537 | 537 | |
538 | - if ( is_user_logged_in() ) { |
|
538 | + if (is_user_logged_in()) { |
|
539 | 539 | $item = '<li class="' . $item_class . '">'; |
540 | - $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>'; |
|
540 | + $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>'; |
|
541 | 541 | $item .= '<ul role="menu" class=" dropdown-menu lsx-wc-my-account-sub-menu">'; |
542 | - foreach ( wc_get_account_menu_items() as $endpoint => $label ) { |
|
542 | + foreach (wc_get_account_menu_items() as $endpoint => $label) { |
|
543 | 543 | $slug = $endpoint; |
544 | - if ( isset( $endpoints[ $endpoint ] ) && '' !== $endpoints[ $endpoint ] ) { |
|
545 | - $slug = $endpoints[ $endpoint ]; |
|
544 | + if (isset($endpoints[$endpoint]) && '' !== $endpoints[$endpoint]) { |
|
545 | + $slug = $endpoints[$endpoint]; |
|
546 | 546 | } |
547 | - if ( 'dashboard' === $slug ) { |
|
547 | + if ('dashboard' === $slug) { |
|
548 | 548 | $slug = ''; |
549 | 549 | } |
550 | - $item .= '<li class="menu-item"><a title="" href="' . esc_url( get_permalink( wc_get_page_id( 'myaccount' ) ) . $slug ) . '">' . $label . '</a></li>'; |
|
550 | + $item .= '<li class="menu-item"><a title="" href="' . esc_url(get_permalink(wc_get_page_id('myaccount')) . $slug) . '">' . $label . '</a></li>'; |
|
551 | 551 | } |
552 | 552 | $item .= '</ul></li>'; |
553 | 553 | |
554 | 554 | } else { |
555 | 555 | $item = '<li class="' . $item_class . '">' . |
556 | - '<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>' . |
|
556 | + '<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>' . |
|
557 | 557 | '</li>'; |
558 | 558 | } |
559 | 559 | |
560 | - if ( 'top-menu' === $args->theme_location ) { |
|
560 | + if ('top-menu' === $args->theme_location) { |
|
561 | 561 | $items = $item . $items; |
562 | 562 | } else { |
563 | 563 | $items = $items . $item; |
@@ -573,11 +573,11 @@ discard block |
||
573 | 573 | * |
574 | 574 | * @since 1.1.1 |
575 | 575 | */ |
576 | - public function my_account_menu_item_position( $menu_position ) { |
|
577 | - $position = get_theme_mod( 'lsx_wc_my_account_menu_item_position', '' ); |
|
576 | + public function my_account_menu_item_position($menu_position) { |
|
577 | + $position = get_theme_mod('lsx_wc_my_account_menu_item_position', ''); |
|
578 | 578 | |
579 | - if ( ! empty( $position ) ) { |
|
580 | - switch ( $position ) { |
|
579 | + if ( ! empty($position)) { |
|
580 | + switch ($position) { |
|
581 | 581 | case 'main-menu-in': |
582 | 582 | case 'main-menu-out': |
583 | 583 | $menu_position = 'primary'; |
@@ -601,20 +601,20 @@ discard block |
||
601 | 601 | * |
602 | 602 | * @since 1.1.1 |
603 | 603 | */ |
604 | - public function my_account_menu_item_class( $item_class ) { |
|
605 | - $position = get_theme_mod( 'lsx_wc_my_account_menu_item_position', '' ); |
|
604 | + public function my_account_menu_item_class($item_class) { |
|
605 | + $position = get_theme_mod('lsx_wc_my_account_menu_item_position', ''); |
|
606 | 606 | |
607 | - if ( 'main-menu-out' === $position ) { |
|
607 | + if ('main-menu-out' === $position) { |
|
608 | 608 | $item_class .= ' lsx-wc-my-account-menu-item-right-aligned'; |
609 | 609 | } |
610 | 610 | |
611 | - if ( ! is_user_logged_in() ) { |
|
611 | + if ( ! is_user_logged_in()) { |
|
612 | 612 | $item_class .= ' lsx-wc-my-account-login'; |
613 | 613 | } |
614 | 614 | |
615 | - $style = get_theme_mod( 'lsx_wc_my_account_menu_item_style', '' ); |
|
615 | + $style = get_theme_mod('lsx_wc_my_account_menu_item_style', ''); |
|
616 | 616 | |
617 | - if ( 'simple' === $style ) { |
|
617 | + if ('simple' === $style) { |
|
618 | 618 | $item_class .= ' lsx-wc-my-account-menu-item-simple'; |
619 | 619 | } |
620 | 620 | |
@@ -625,13 +625,13 @@ discard block |
||
625 | 625 | */ |
626 | 626 | public function show_layout_switcher() { |
627 | 627 | $body_classes = get_body_class(); |
628 | - if ( in_array( 'post-type-archive-product', $body_classes ) ) { |
|
628 | + if (in_array('post-type-archive-product', $body_classes)) { |
|
629 | 629 | global $WC_List_Grid; |
630 | - if ( null !== $WC_List_Grid ) { |
|
631 | - remove_action( 'woocommerce_before_shop_loop', array( $WC_List_Grid, 'gridlist_toggle_button' ), 30 ); |
|
632 | - add_action( 'lsx_banner_inner_bottom', array( $this, 'shop_gridlist_toggle_button' ), 90 ); |
|
633 | - add_action( 'lsx_global_header_inner_bottom', array( $this, 'shop_gridlist_toggle_button' ), 90 ); |
|
634 | - wp_deregister_style( 'grid-list-button' ); |
|
630 | + if (null !== $WC_List_Grid) { |
|
631 | + remove_action('woocommerce_before_shop_loop', array($WC_List_Grid, 'gridlist_toggle_button'), 30); |
|
632 | + add_action('lsx_banner_inner_bottom', array($this, 'shop_gridlist_toggle_button'), 90); |
|
633 | + add_action('lsx_global_header_inner_bottom', array($this, 'shop_gridlist_toggle_button'), 90); |
|
634 | + wp_deregister_style('grid-list-button'); |
|
635 | 635 | } |
636 | 636 | } |
637 | 637 | } |
@@ -642,13 +642,13 @@ discard block |
||
642 | 642 | global $WC_List_Grid; |
643 | 643 | ?> |
644 | 644 | <div class="lsx-layout-switcher"> |
645 | - <span class="lsx-layout-switcher-label"><?php esc_html_e( 'Select view:', 'lsx-blog-customizer' ); ?></span> |
|
645 | + <span class="lsx-layout-switcher-label"><?php esc_html_e('Select view:', 'lsx-blog-customizer'); ?></span> |
|
646 | 646 | <?php $WC_List_Grid->gridlist_toggle_button(); ?> |
647 | 647 | </div> |
648 | 648 | <?php |
649 | 649 | } |
650 | - public function gridlist_toggle_button_output( $output, $grid_view, $list_view ) { |
|
651 | - $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 ); |
|
650 | + public function gridlist_toggle_button_output($output, $grid_view, $list_view) { |
|
651 | + $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); |
|
652 | 652 | return $output; |
653 | 653 | } |
654 | 654 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! class_exists( 'LSX_Customizer_Colour_Top_Menu' ) ) { |
|
2 | +if ( ! class_exists('LSX_Customizer_Colour_Top_Menu')) { |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * LSX Customizer Colour Top Menu 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__top_menu_theme_mod', $styles ); |
|
36 | + set_theme_mod('lsx_customizer_colour__top_menu_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__top_menu_theme_mod' ); |
|
45 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__top_menu_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__top_menu_theme_mod', $styles ); |
|
51 | + if (false === $styles_from_theme_mod) { |
|
52 | + set_theme_mod('lsx_customizer_colour__top_menu_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,17 +66,17 @@ discard block |
||
66 | 66 | public function get_theme_mods() { |
67 | 67 | $colors = parent::get_color_scheme(); |
68 | 68 | |
69 | - return apply_filters( 'lsx_customizer_colours_top_menu', array( |
|
70 | - 'top_menu_background_color' => get_theme_mod( 'top_menu_background_color', $colors['top_menu_background_color'] ), |
|
71 | - 'top_menu_link_color' => get_theme_mod( 'top_menu_link_color', $colors['top_menu_link_color'] ), |
|
72 | - 'top_menu_link_hover_color' => get_theme_mod( 'top_menu_link_hover_color', $colors['top_menu_link_hover_color'] ), |
|
73 | - 'top_menu_icon_color' => get_theme_mod( 'top_menu_icon_color', $colors['top_menu_icon_color'] ), |
|
74 | - 'top_menu_icon_hover_color' => get_theme_mod( 'top_menu_icon_hover_color', $colors['top_menu_icon_hover_color'] ), |
|
75 | - 'top_menu_dropdown_color' => get_theme_mod( 'top_menu_dropdown_color', $colors['top_menu_dropdown_color'] ), |
|
76 | - 'top_menu_dropdown_hover_color' => get_theme_mod( 'top_menu_dropdown_hover_color', $colors['top_menu_dropdown_hover_color'] ), |
|
77 | - 'top_menu_dropdown_link_color' => get_theme_mod( 'top_menu_dropdown_link_color', $colors['top_menu_dropdown_link_color'] ), |
|
78 | - 'top_menu_dropdown_link_hover_color' => get_theme_mod( 'top_menu_dropdown_link_hover_color', $colors['top_menu_dropdown_link_hover_color'] ), |
|
79 | - ) ); |
|
69 | + return apply_filters('lsx_customizer_colours_top_menu', array( |
|
70 | + 'top_menu_background_color' => get_theme_mod('top_menu_background_color', $colors['top_menu_background_color']), |
|
71 | + 'top_menu_link_color' => get_theme_mod('top_menu_link_color', $colors['top_menu_link_color']), |
|
72 | + 'top_menu_link_hover_color' => get_theme_mod('top_menu_link_hover_color', $colors['top_menu_link_hover_color']), |
|
73 | + 'top_menu_icon_color' => get_theme_mod('top_menu_icon_color', $colors['top_menu_icon_color']), |
|
74 | + 'top_menu_icon_hover_color' => get_theme_mod('top_menu_icon_hover_color', $colors['top_menu_icon_hover_color']), |
|
75 | + 'top_menu_dropdown_color' => get_theme_mod('top_menu_dropdown_color', $colors['top_menu_dropdown_color']), |
|
76 | + 'top_menu_dropdown_hover_color' => get_theme_mod('top_menu_dropdown_hover_color', $colors['top_menu_dropdown_hover_color']), |
|
77 | + 'top_menu_dropdown_link_color' => get_theme_mod('top_menu_dropdown_link_color', $colors['top_menu_dropdown_link_color']), |
|
78 | + 'top_menu_dropdown_link_hover_color' => get_theme_mod('top_menu_dropdown_link_hover_color', $colors['top_menu_dropdown_link_hover_color']), |
|
79 | + )); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -84,26 +84,26 @@ discard block |
||
84 | 84 | * |
85 | 85 | * @since 1.0.0 |
86 | 86 | */ |
87 | - function get_css( $colors ) { |
|
87 | + function get_css($colors) { |
|
88 | 88 | global $customizer_colour_names; |
89 | 89 | |
90 | 90 | $colors_template = array(); |
91 | 91 | |
92 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
93 | - $colors_template[ $key ] = ''; |
|
92 | + foreach ($customizer_colour_names as $key => $value) { |
|
93 | + $colors_template[$key] = ''; |
|
94 | 94 | } |
95 | 95 | |
96 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
97 | - |
|
98 | - if ( empty( $colors['top_menu_background_color'] ) |
|
99 | - || empty( $colors['top_menu_link_color'] ) |
|
100 | - || empty( $colors['top_menu_link_hover_color'] ) |
|
101 | - || empty( $colors['top_menu_icon_color'] ) |
|
102 | - || empty( $colors['top_menu_icon_hover_color'] ) |
|
103 | - || empty( $colors['top_menu_dropdown_color'] ) |
|
104 | - || empty( $colors['top_menu_dropdown_hover_color'] ) |
|
105 | - || empty( $colors['top_menu_dropdown_link_color'] ) |
|
106 | - || empty( $colors['top_menu_dropdown_link_hover_color'] ) ) { |
|
96 | + $colors = wp_parse_args($colors, $colors_template); |
|
97 | + |
|
98 | + if (empty($colors['top_menu_background_color']) |
|
99 | + || empty($colors['top_menu_link_color']) |
|
100 | + || empty($colors['top_menu_link_hover_color']) |
|
101 | + || empty($colors['top_menu_icon_color']) |
|
102 | + || empty($colors['top_menu_icon_hover_color']) |
|
103 | + || empty($colors['top_menu_dropdown_color']) |
|
104 | + || empty($colors['top_menu_dropdown_hover_color']) |
|
105 | + || empty($colors['top_menu_dropdown_link_color']) |
|
106 | + || empty($colors['top_menu_dropdown_link_hover_color'])) { |
|
107 | 107 | return ''; |
108 | 108 | } |
109 | 109 | |
@@ -126,8 +126,8 @@ discard block |
||
126 | 126 | ); |
127 | 127 | '; |
128 | 128 | |
129 | - $css = apply_filters( 'lsx_customizer_colour_selectors_top_menu', $css, $colors ); |
|
130 | - $css = parent::scss_to_css( $css ); |
|
129 | + $css = apply_filters('lsx_customizer_colour_selectors_top_menu', $css, $colors); |
|
130 | + $css = parent::scss_to_css($css); |
|
131 | 131 | |
132 | 132 | return $css; |
133 | 133 | } |
@@ -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 Customiser. |
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,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,47 +126,47 @@ 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' ); |
|
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 | 131 | |
132 | - if ( class_exists( 'WP_Customize_Control' ) ) { |
|
133 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-control.php' ); |
|
132 | + if (class_exists('WP_Customize_Control')) { |
|
133 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-control.php'); |
|
134 | 134 | } |
135 | 135 | |
136 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button.php' ); |
|
136 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button.php'); |
|
137 | 137 | $this->button = new LSX_Customizer_Colour_Button; |
138 | 138 | |
139 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-cta.php' ); |
|
139 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-cta.php'); |
|
140 | 140 | $this->button_cta = new LSX_Customizer_Colour_Button_CTA; |
141 | 141 | |
142 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-secondary.php' ); |
|
142 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-secondary.php'); |
|
143 | 143 | $this->button_secondary = new LSX_Customizer_Colour_Button_Secondary; |
144 | 144 | |
145 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-tertiary.php' ); |
|
145 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-button-tertiary.php'); |
|
146 | 146 | $this->button_tertiary = new LSX_Customizer_Colour_Button_Tertiary; |
147 | 147 | |
148 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-top-menu.php' ); |
|
148 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-top-menu.php'); |
|
149 | 149 | $this->top_menu = new LSX_Customizer_Colour_Top_Menu; |
150 | 150 | |
151 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-header.php' ); |
|
151 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-header.php'); |
|
152 | 152 | $this->header = new LSX_Customizer_Colour_Header; |
153 | 153 | |
154 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-main-menu.php' ); |
|
154 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-main-menu.php'); |
|
155 | 155 | $this->main_menu = new LSX_Customizer_Colour_Main_Menu; |
156 | 156 | |
157 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-banner.php' ); |
|
157 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-banner.php'); |
|
158 | 158 | $this->banner = new LSX_Customizer_Colour_Banner; |
159 | 159 | |
160 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-body.php' ); |
|
160 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-body.php'); |
|
161 | 161 | $this->body = new LSX_Customizer_Colour_Body; |
162 | 162 | |
163 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer-cta.php' ); |
|
163 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer-cta.php'); |
|
164 | 164 | $this->footer_cta = new LSX_Customizer_Colour_Footer_CTA; |
165 | 165 | |
166 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer-widgets.php' ); |
|
166 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer-widgets.php'); |
|
167 | 167 | $this->footer_widgets = new LSX_Customizer_Colour_Footer_Widgets; |
168 | 168 | |
169 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer.php' ); |
|
169 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour-footer.php'); |
|
170 | 170 | $this->footer = new LSX_Customizer_Colour_Footer; |
171 | 171 | } |
172 | 172 | |
@@ -176,124 +176,124 @@ discard block |
||
176 | 176 | * @param WP_Customize_Manager $wp_customize Theme Customizer object. |
177 | 177 | * @since 1.0.0 |
178 | 178 | */ |
179 | - public function customize_register( $wp_customize ) { |
|
179 | + public function customize_register($wp_customize) { |
|
180 | 180 | global $customizer_colour_names; |
181 | 181 | global $customizer_colour_choices; |
182 | 182 | |
183 | 183 | /** |
184 | 184 | * Colors |
185 | 185 | */ |
186 | - $wp_customize->add_panel( 'colors' , array( |
|
187 | - 'title' => esc_html__( 'Colors', 'lsx-customizer' ), |
|
186 | + $wp_customize->add_panel('colors', array( |
|
187 | + 'title' => esc_html__('Colors', 'lsx-customizer'), |
|
188 | 188 | 'priority' => 60, |
189 | - ) ); |
|
189 | + )); |
|
190 | 190 | |
191 | 191 | /** |
192 | 192 | * Colors - Sections |
193 | 193 | */ |
194 | - $wp_customize->add_section( 'colors-core' , array( |
|
195 | - 'title' => esc_html__( 'Color Scheme', 'lsx-customizer' ), |
|
194 | + $wp_customize->add_section('colors-core', array( |
|
195 | + 'title' => esc_html__('Color Scheme', 'lsx-customizer'), |
|
196 | 196 | 'priority' => 1, |
197 | 197 | 'panel' => 'colors', |
198 | - ) ); |
|
198 | + )); |
|
199 | 199 | |
200 | - $wp_customize->add_section( 'colors-palette' , array( |
|
201 | - 'title' => esc_html__( 'Block Editor Color Palette', 'lsx-customizer' ), |
|
202 | - 'description' => esc_html__( 'Add colors to use within the Gutenberg editor color palette.', 'lsx-customizer' ), |
|
200 | + $wp_customize->add_section('colors-palette', array( |
|
201 | + 'title' => esc_html__('Block Editor Color Palette', 'lsx-customizer'), |
|
202 | + 'description' => esc_html__('Add colors to use within the Gutenberg editor color palette.', 'lsx-customizer'), |
|
203 | 203 | 'priority' => 2, |
204 | 204 | 'panel' => 'colors', |
205 | - ) ); |
|
205 | + )); |
|
206 | 206 | |
207 | - $wp_customize->add_section( 'colors-button' , array( |
|
208 | - 'title' => esc_html__( 'Button', 'lsx-customizer' ), |
|
207 | + $wp_customize->add_section('colors-button', array( |
|
208 | + 'title' => esc_html__('Button', 'lsx-customizer'), |
|
209 | 209 | 'priority' => 3, |
210 | 210 | 'panel' => 'colors', |
211 | - ) ); |
|
211 | + )); |
|
212 | 212 | |
213 | - $wp_customize->add_section( 'colors-button-cta' , array( |
|
214 | - 'title' => esc_html__( 'Button CTA', 'lsx-customizer' ), |
|
213 | + $wp_customize->add_section('colors-button-cta', array( |
|
214 | + 'title' => esc_html__('Button CTA', 'lsx-customizer'), |
|
215 | 215 | 'priority' => 4, |
216 | 216 | 'panel' => 'colors', |
217 | - ) ); |
|
217 | + )); |
|
218 | 218 | |
219 | - $wp_customize->add_section( 'colors-button-secondary' , array( |
|
220 | - 'title' => esc_html__( 'Button Secondary', 'lsx-customizer' ), |
|
219 | + $wp_customize->add_section('colors-button-secondary', array( |
|
220 | + 'title' => esc_html__('Button Secondary', 'lsx-customizer'), |
|
221 | 221 | 'priority' => 5, |
222 | 222 | 'panel' => 'colors', |
223 | - ) ); |
|
223 | + )); |
|
224 | 224 | |
225 | - $wp_customize->add_section( 'colors-button-tertiary' , array( |
|
226 | - 'title' => esc_html__( 'Button Tertiary', 'lsx-customizer' ), |
|
225 | + $wp_customize->add_section('colors-button-tertiary', array( |
|
226 | + 'title' => esc_html__('Button Tertiary', 'lsx-customizer'), |
|
227 | 227 | 'priority' => 6, |
228 | 228 | 'panel' => 'colors', |
229 | - ) ); |
|
229 | + )); |
|
230 | 230 | |
231 | - $wp_customize->add_section( 'colors-top-menu' , array( |
|
232 | - 'title' => esc_html__( 'Top Menu', 'lsx-customizer' ), |
|
231 | + $wp_customize->add_section('colors-top-menu', array( |
|
232 | + 'title' => esc_html__('Top Menu', 'lsx-customizer'), |
|
233 | 233 | 'priority' => 7, |
234 | 234 | 'panel' => 'colors', |
235 | - ) ); |
|
235 | + )); |
|
236 | 236 | |
237 | - $wp_customize->add_section( 'colors-header' , array( |
|
238 | - 'title' => esc_html__( 'Header', 'lsx-customizer' ), |
|
237 | + $wp_customize->add_section('colors-header', array( |
|
238 | + 'title' => esc_html__('Header', 'lsx-customizer'), |
|
239 | 239 | 'priority' => 8, |
240 | 240 | 'panel' => 'colors', |
241 | - ) ); |
|
241 | + )); |
|
242 | 242 | |
243 | - $wp_customize->add_section( 'colors-main-menu' , array( |
|
244 | - 'title' => esc_html__( 'Main Menu', 'lsx-customizer' ), |
|
243 | + $wp_customize->add_section('colors-main-menu', array( |
|
244 | + 'title' => esc_html__('Main Menu', 'lsx-customizer'), |
|
245 | 245 | 'priority' => 9, |
246 | 246 | 'panel' => 'colors', |
247 | - ) ); |
|
247 | + )); |
|
248 | 248 | |
249 | - $wp_customize->add_section( 'colors-banner' , array( |
|
250 | - 'title' => esc_html__( 'Banner', 'lsx-customizer' ), |
|
249 | + $wp_customize->add_section('colors-banner', array( |
|
250 | + 'title' => esc_html__('Banner', 'lsx-customizer'), |
|
251 | 251 | 'priority' => 10, |
252 | 252 | 'panel' => 'colors', |
253 | - ) ); |
|
253 | + )); |
|
254 | 254 | |
255 | - $wp_customize->add_section( 'colors-body' , array( |
|
256 | - 'title' => esc_html__( 'Body', 'lsx-customizer' ), |
|
255 | + $wp_customize->add_section('colors-body', array( |
|
256 | + 'title' => esc_html__('Body', 'lsx-customizer'), |
|
257 | 257 | 'priority' => 11, |
258 | 258 | 'panel' => 'colors', |
259 | - ) ); |
|
259 | + )); |
|
260 | 260 | |
261 | - $wp_customize->add_section( 'colors-footer-cta' , array( |
|
262 | - 'title' => esc_html__( 'Footer CTA', 'lsx-customizer' ), |
|
261 | + $wp_customize->add_section('colors-footer-cta', array( |
|
262 | + 'title' => esc_html__('Footer CTA', 'lsx-customizer'), |
|
263 | 263 | 'priority' => 12, |
264 | 264 | 'panel' => 'colors', |
265 | - ) ); |
|
265 | + )); |
|
266 | 266 | |
267 | - $wp_customize->add_section( 'colors-footer-widgets' , array( |
|
268 | - 'title' => esc_html__( 'Footer Widgets', 'lsx-customizer' ), |
|
267 | + $wp_customize->add_section('colors-footer-widgets', array( |
|
268 | + 'title' => esc_html__('Footer Widgets', 'lsx-customizer'), |
|
269 | 269 | 'priority' => 13, |
270 | 270 | 'panel' => 'colors', |
271 | - ) ); |
|
271 | + )); |
|
272 | 272 | |
273 | - $wp_customize->add_section( 'colors-footer' , array( |
|
274 | - 'title' => esc_html__( 'Footer', 'lsx-customizer' ), |
|
273 | + $wp_customize->add_section('colors-footer', array( |
|
274 | + 'title' => esc_html__('Footer', 'lsx-customizer'), |
|
275 | 275 | 'priority' => 14, |
276 | 276 | 'panel' => 'colors', |
277 | - ) ); |
|
277 | + )); |
|
278 | 278 | |
279 | 279 | /** |
280 | 280 | * Color Scheme |
281 | 281 | */ |
282 | - $wp_customize->add_setting( 'color_scheme', array( |
|
282 | + $wp_customize->add_setting('color_scheme', array( |
|
283 | 283 | 'default' => 'default', |
284 | 284 | 'type' => 'theme_mod', |
285 | 285 | 'transport' => 'postMessage', |
286 | - ) ); |
|
286 | + )); |
|
287 | 287 | |
288 | - $wp_customize->add_control( new LSX_Customizer_Colour_Control( |
|
288 | + $wp_customize->add_control(new LSX_Customizer_Colour_Control( |
|
289 | 289 | $wp_customize, 'color_scheme', array( |
290 | - 'label' => esc_html__( 'Base Color Scheme', 'lsx-customizer' ), |
|
290 | + 'label' => esc_html__('Base Color Scheme', 'lsx-customizer'), |
|
291 | 291 | 'section' => 'colors-core', |
292 | 292 | 'type' => 'select', |
293 | 293 | 'priority' => 1, |
294 | 294 | 'choices' => $customizer_colour_choices, |
295 | 295 | ) |
296 | - ) ); |
|
296 | + )); |
|
297 | 297 | |
298 | 298 | /** |
299 | 299 | * Color Palette |
@@ -301,30 +301,30 @@ discard block |
||
301 | 301 | $colors = $this->get_color_scheme(); |
302 | 302 | |
303 | 303 | $customizer_colour_defaults = array( |
304 | - __( 'Primary', 'lsx-customizer' ) => get_theme_mod( 'button_background_color', $colors['button_background_color'] ), |
|
305 | - __( 'Strong Primary', 'lsx-button_shadow' ) => get_theme_mod( 'button_shadow', $colors['body_link_color'] ), |
|
306 | - __( 'Call To Action', 'lsx-customizer' ) => get_theme_mod( 'button_cta_background_color', $colors['button_cta_background_color'] ), |
|
307 | - __( 'Strong CTA', 'lsx-button_shadow' ) => get_theme_mod( 'button_cta_shadow', $colors['button_cta_shadow'] ), |
|
308 | - __( 'Secondary', 'lsx-customizer' ) => get_theme_mod( 'button_secondary_background_color', $colors['button_secondary_background_color'] ), |
|
309 | - __( 'Strong Secondary', 'lsx-button_shadow' ) => get_theme_mod( 'button_secondary_shadow', $colors['button_secondary_shadow'] ), |
|
310 | - __( 'Tertiary', 'lsx-customizer' ) => get_theme_mod( 'button_tertiary_background_color', $colors['button_tertiary_background_color'] ), |
|
311 | - __( 'Strong Tertiary', 'lsx-button_shadow' ) => get_theme_mod( 'button_tertiary_shadow', $colors['button_tertiary_shadow'] ), |
|
312 | - __( 'Heading Color', 'lsx-customizer' ) => get_theme_mod( 'body_text_heading_color', $colors['body_text_heading_color'] ), |
|
313 | - __( 'Body Text color', 'lsx-button_shadow' ) => get_theme_mod( 'body_text_color', $colors['body_text_color'] ), |
|
314 | - __( 'White', 'lsx-button_shadow' ) => '#ffffff', |
|
315 | - __( 'Black', 'lsx-button_shadow' ) => '#000000', |
|
304 | + __('Primary', 'lsx-customizer') => get_theme_mod('button_background_color', $colors['button_background_color']), |
|
305 | + __('Strong Primary', 'lsx-button_shadow') => get_theme_mod('button_shadow', $colors['body_link_color']), |
|
306 | + __('Call To Action', 'lsx-customizer') => get_theme_mod('button_cta_background_color', $colors['button_cta_background_color']), |
|
307 | + __('Strong CTA', 'lsx-button_shadow') => get_theme_mod('button_cta_shadow', $colors['button_cta_shadow']), |
|
308 | + __('Secondary', 'lsx-customizer') => get_theme_mod('button_secondary_background_color', $colors['button_secondary_background_color']), |
|
309 | + __('Strong Secondary', 'lsx-button_shadow') => get_theme_mod('button_secondary_shadow', $colors['button_secondary_shadow']), |
|
310 | + __('Tertiary', 'lsx-customizer') => get_theme_mod('button_tertiary_background_color', $colors['button_tertiary_background_color']), |
|
311 | + __('Strong Tertiary', 'lsx-button_shadow') => get_theme_mod('button_tertiary_shadow', $colors['button_tertiary_shadow']), |
|
312 | + __('Heading Color', 'lsx-customizer') => get_theme_mod('body_text_heading_color', $colors['body_text_heading_color']), |
|
313 | + __('Body Text color', 'lsx-button_shadow') => get_theme_mod('body_text_color', $colors['body_text_color']), |
|
314 | + __('White', 'lsx-button_shadow') => '#ffffff', |
|
315 | + __('Black', 'lsx-button_shadow') => '#000000', |
|
316 | 316 | ); |
317 | - foreach ( $customizer_colour_defaults as $key => $value ) { |
|
317 | + foreach ($customizer_colour_defaults as $key => $value) { |
|
318 | 318 | |
319 | - $color_name = strtolower( str_replace( ' ', '_', $key ) ); |
|
319 | + $color_name = strtolower(str_replace(' ', '_', $key)); |
|
320 | 320 | $color_name = $color_name . '_color'; |
321 | 321 | |
322 | - $wp_customize->add_setting( $color_name, array( |
|
322 | + $wp_customize->add_setting($color_name, array( |
|
323 | 323 | 'default' => $value, |
324 | 324 | 'type' => 'theme_mod', |
325 | 325 | 'transport' => 'postMessage', |
326 | 326 | 'sanitize_callback' => 'sanitize_hex_color', |
327 | - ) ); |
|
327 | + )); |
|
328 | 328 | $wp_customize->add_control( |
329 | 329 | new WP_Customize_Color_Control( |
330 | 330 | $wp_customize, |
@@ -341,53 +341,53 @@ discard block |
||
341 | 341 | /** |
342 | 342 | * Colors |
343 | 343 | */ |
344 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
344 | + foreach ($customizer_colour_names as $key => $value) { |
|
345 | 345 | $sanitize_callback = 'sanitize_hex_color'; |
346 | 346 | |
347 | - if ( 'background_color' === $key ) { |
|
347 | + if ('background_color' === $key) { |
|
348 | 348 | $sanitize_callback = 'sanitize_hex_color_no_hash'; |
349 | 349 | } |
350 | 350 | |
351 | 351 | $section = 'colors-core'; |
352 | 352 | |
353 | - if ( preg_match( '/^button_cta_.*/', $key ) ) { |
|
353 | + if (preg_match('/^button_cta_.*/', $key)) { |
|
354 | 354 | $section = 'colors-button-cta'; |
355 | - } elseif ( preg_match( '/^button_secondary_.*/', $key ) ) { |
|
355 | + } elseif (preg_match('/^button_secondary_.*/', $key)) { |
|
356 | 356 | $section = 'colors-button-secondary'; |
357 | - } elseif ( preg_match( '/^button_tertiary_.*/', $key ) ) { |
|
357 | + } elseif (preg_match('/^button_tertiary_.*/', $key)) { |
|
358 | 358 | $section = 'colors-button-tertiary'; |
359 | - } elseif ( preg_match( '/^button_.*/', $key ) ) { |
|
359 | + } elseif (preg_match('/^button_.*/', $key)) { |
|
360 | 360 | $section = 'colors-button'; |
361 | - } elseif ( preg_match( '/^top_menu_.*/', $key ) ) { |
|
361 | + } elseif (preg_match('/^top_menu_.*/', $key)) { |
|
362 | 362 | $section = 'colors-top-menu'; |
363 | - } elseif ( preg_match( '/^header_.*/', $key ) ) { |
|
363 | + } elseif (preg_match('/^header_.*/', $key)) { |
|
364 | 364 | $section = 'colors-header'; |
365 | - } elseif ( preg_match( '/^main_menu_.*/', $key ) ) { |
|
365 | + } elseif (preg_match('/^main_menu_.*/', $key)) { |
|
366 | 366 | $section = 'colors-main-menu'; |
367 | - } elseif ( preg_match( '/^banner_.*/', $key ) ) { |
|
367 | + } elseif (preg_match('/^banner_.*/', $key)) { |
|
368 | 368 | $section = 'colors-banner'; |
369 | - } elseif ( preg_match( '/^body_.*/', $key ) || 'background_color' === $key ) { |
|
369 | + } elseif (preg_match('/^body_.*/', $key) || 'background_color' === $key) { |
|
370 | 370 | $section = 'colors-body'; |
371 | - } elseif ( preg_match( '/^footer_cta_.*/', $key ) ) { |
|
371 | + } elseif (preg_match('/^footer_cta_.*/', $key)) { |
|
372 | 372 | $section = 'colors-footer-cta'; |
373 | - } elseif ( preg_match( '/^footer_widgets_.*/', $key ) ) { |
|
373 | + } elseif (preg_match('/^footer_widgets_.*/', $key)) { |
|
374 | 374 | $section = 'colors-footer-widgets'; |
375 | - } elseif ( preg_match( '/^footer_.*/', $key ) ) { |
|
375 | + } elseif (preg_match('/^footer_.*/', $key)) { |
|
376 | 376 | $section = 'colors-footer'; |
377 | 377 | } |
378 | 378 | |
379 | - $wp_customize->add_setting( $key, array( |
|
380 | - 'default' => $customizer_colour_choices['default']['colors'][ $key ], |
|
379 | + $wp_customize->add_setting($key, array( |
|
380 | + 'default' => $customizer_colour_choices['default']['colors'][$key], |
|
381 | 381 | 'type' => 'theme_mod', |
382 | 382 | 'transport' => 'postMessage', |
383 | 383 | 'sanitize_callback' => $sanitize_callback, |
384 | - ) ); |
|
384 | + )); |
|
385 | 385 | |
386 | - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, $key, array( |
|
386 | + $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $key, array( |
|
387 | 387 | 'label' => $value, |
388 | 388 | 'section' => $section, |
389 | 389 | 'settings' => $key, |
390 | - ) ) ); |
|
390 | + ))); |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | |
@@ -401,26 +401,26 @@ discard block |
||
401 | 401 | |
402 | 402 | $colors = array(); |
403 | 403 | |
404 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
405 | - $colors[ $key ] = 'unquote("{{ data.' . $key . ' }}")'; |
|
404 | + foreach ($customizer_colour_names as $key => $value) { |
|
405 | + $colors[$key] = 'unquote("{{ data.' . $key . ' }}")'; |
|
406 | 406 | } |
407 | 407 | ?> |
408 | 408 | <script type="text/html" id="tmpl-lsx-color-scheme"> |
409 | - <?php echo esc_attr( $this->top_menu->get_css( $colors ) ); ?> |
|
410 | - <?php echo esc_attr( $this->header->get_css( $colors ) ); ?> |
|
411 | - <?php echo esc_attr( $this->main_menu->get_css( $colors ) ); ?> |
|
409 | + <?php echo esc_attr($this->top_menu->get_css($colors)); ?> |
|
410 | + <?php echo esc_attr($this->header->get_css($colors)); ?> |
|
411 | + <?php echo esc_attr($this->main_menu->get_css($colors)); ?> |
|
412 | 412 | |
413 | - <?php echo esc_attr( $this->banner->get_css( $colors ) ); ?> |
|
414 | - <?php echo esc_attr( $this->body->get_css( $colors ) ); ?> |
|
413 | + <?php echo esc_attr($this->banner->get_css($colors)); ?> |
|
414 | + <?php echo esc_attr($this->body->get_css($colors)); ?> |
|
415 | 415 | |
416 | - <?php echo esc_attr( $this->footer_cta->get_css( $colors ) ); ?> |
|
417 | - <?php echo esc_attr( $this->footer_widgets->get_css( $colors ) ); ?> |
|
418 | - <?php echo esc_attr( $this->footer->get_css( $colors ) ); ?> |
|
416 | + <?php echo esc_attr($this->footer_cta->get_css($colors)); ?> |
|
417 | + <?php echo esc_attr($this->footer_widgets->get_css($colors)); ?> |
|
418 | + <?php echo esc_attr($this->footer->get_css($colors)); ?> |
|
419 | 419 | |
420 | - <?php echo esc_attr( $this->button->get_css( $colors ) ); ?> |
|
421 | - <?php echo esc_attr( $this->button_cta->get_css( $colors ) ); ?> |
|
422 | - <?php echo esc_attr( $this->button_secondary->get_css( $colors ) ); ?> |
|
423 | - <?php echo esc_attr( $this->button_tertiary->get_css( $colors ) ); ?> |
|
420 | + <?php echo esc_attr($this->button->get_css($colors)); ?> |
|
421 | + <?php echo esc_attr($this->button_cta->get_css($colors)); ?> |
|
422 | + <?php echo esc_attr($this->button_secondary->get_css($colors)); ?> |
|
423 | + <?php echo esc_attr($this->button_tertiary->get_css($colors)); ?> |
|
424 | 424 | </script> |
425 | 425 | <?php |
426 | 426 | } |
@@ -430,16 +430,16 @@ discard block |
||
430 | 430 | * |
431 | 431 | * @since 1.0.0 |
432 | 432 | */ |
433 | - public function scss_to_css( $scss ) { |
|
433 | + public function scss_to_css($scss) { |
|
434 | 434 | $css = ''; |
435 | 435 | $scss_php_file = LSX_CUSTOMIZER_PATH . 'vendor/leafo/scssphp/scss.inc.php'; |
436 | 436 | $lsx_theme_sass_file = get_template_directory() . '/assets/css/scss/lsx.scss'; |
437 | 437 | |
438 | - if ( ! empty( $scss ) && file_exists( $scss_php_file ) && file_exists( $lsx_theme_sass_file ) ) { |
|
438 | + if ( ! empty($scss) && file_exists($scss_php_file) && file_exists($lsx_theme_sass_file)) { |
|
439 | 439 | require_once $scss_php_file; |
440 | 440 | |
441 | 441 | $compiler = new \Leafo\ScssPhp\Compiler(); |
442 | - $compiler->setFormatter( 'Leafo\ScssPhp\Formatter\Compact' ); |
|
442 | + $compiler->setFormatter('Leafo\ScssPhp\Formatter\Compact'); |
|
443 | 443 | |
444 | 444 | try { |
445 | 445 | $scss = ' |
@@ -449,8 +449,8 @@ discard block |
||
449 | 449 | ' . $scss . ' |
450 | 450 | '; |
451 | 451 | |
452 | - $css = $compiler->compile( $scss ); |
|
453 | - } catch ( \Exception $e ) { |
|
452 | + $css = $compiler->compile($scss); |
|
453 | + } catch (\Exception $e) { |
|
454 | 454 | $error = $e->getMessage(); |
455 | 455 | return "/*\n\n\$error:\n\n{$error}\n\n\$scss:\n\n{$scss} */"; |
456 | 456 | } |
@@ -464,17 +464,17 @@ discard block |
||
464 | 464 | * |
465 | 465 | * @since 1.0.0 |
466 | 466 | */ |
467 | - public static function hex2rgb( $color ) { |
|
468 | - $color = trim( $color, '#' ); |
|
469 | - |
|
470 | - if ( strlen( $color ) === 3 ) { |
|
471 | - $r = hexdec( substr( $color, 0, 1 ) . substr( $color, 0, 1 ) ); |
|
472 | - $g = hexdec( substr( $color, 1, 1 ) . substr( $color, 1, 1 ) ); |
|
473 | - $b = hexdec( substr( $color, 2, 1 ) . substr( $color, 2, 1 ) ); |
|
474 | - } elseif ( strlen( $color ) === 6 ) { |
|
475 | - $r = hexdec( substr( $color, 0, 2 ) ); |
|
476 | - $g = hexdec( substr( $color, 2, 2 ) ); |
|
477 | - $b = hexdec( substr( $color, 4, 2 ) ); |
|
467 | + public static function hex2rgb($color) { |
|
468 | + $color = trim($color, '#'); |
|
469 | + |
|
470 | + if (strlen($color) === 3) { |
|
471 | + $r = hexdec(substr($color, 0, 1) . substr($color, 0, 1)); |
|
472 | + $g = hexdec(substr($color, 1, 1) . substr($color, 1, 1)); |
|
473 | + $b = hexdec(substr($color, 2, 1) . substr($color, 2, 1)); |
|
474 | + } elseif (strlen($color) === 6) { |
|
475 | + $r = hexdec(substr($color, 0, 2)); |
|
476 | + $g = hexdec(substr($color, 2, 2)); |
|
477 | + $b = hexdec(substr($color, 4, 2)); |
|
478 | 478 | } else { |
479 | 479 | return array(); |
480 | 480 | } |
@@ -494,11 +494,11 @@ discard block |
||
494 | 494 | public function get_color_scheme() { |
495 | 495 | global $customizer_colour_choices; |
496 | 496 | |
497 | - $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); |
|
497 | + $color_scheme_option = get_theme_mod('color_scheme', 'default'); |
|
498 | 498 | $color_schemes = $customizer_colour_choices; |
499 | 499 | |
500 | - if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { |
|
501 | - return $color_schemes[ $color_scheme_option ]['colors']; |
|
500 | + if (array_key_exists($color_scheme_option, $color_schemes)) { |
|
501 | + return $color_schemes[$color_scheme_option]['colors']; |
|
502 | 502 | } |
503 | 503 | |
504 | 504 | return $color_schemes['default']['colors']; |
@@ -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 ); |
|
22 | - wp_localize_script( 'lsx_customizer_colour_admin', 'color_scheme', $this->choices ); |
|
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 | 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> |