@@ -7,70 +7,70 @@ |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
10 | - exit; |
|
10 | + exit; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | if ( ! class_exists( 'LSX_Popup_Maker' ) ) : |
14 | 14 | |
15 | - /** |
|
16 | - * The LSX Popup_Maker integration class |
|
17 | - */ |
|
18 | - class LSX_Popup_Maker { |
|
15 | + /** |
|
16 | + * The LSX Popup_Maker integration class |
|
17 | + */ |
|
18 | + class LSX_Popup_Maker { |
|
19 | 19 | |
20 | - /** |
|
21 | - * Holds class instance |
|
22 | - * |
|
23 | - * @since 1.0.0 |
|
24 | - * @var object |
|
25 | - */ |
|
26 | - protected static $instance = null; |
|
20 | + /** |
|
21 | + * Holds class instance |
|
22 | + * |
|
23 | + * @since 1.0.0 |
|
24 | + * @var object |
|
25 | + */ |
|
26 | + protected static $instance = null; |
|
27 | 27 | |
28 | - /** |
|
29 | - * Setup class. |
|
30 | - * |
|
31 | - * @since 1.0 |
|
32 | - */ |
|
33 | - public function __construct() { |
|
34 | - add_action( 'init', array( $this, 'remove_pop_up_controls_panel' ) ); |
|
35 | - add_action( 'wp_enqueue_scripts', array( $this, 'lsx_popup_maker_scripts_add_styles' ) ); |
|
36 | - } |
|
28 | + /** |
|
29 | + * Setup class. |
|
30 | + * |
|
31 | + * @since 1.0 |
|
32 | + */ |
|
33 | + public function __construct() { |
|
34 | + add_action( 'init', array( $this, 'remove_pop_up_controls_panel' ) ); |
|
35 | + add_action( 'wp_enqueue_scripts', array( $this, 'lsx_popup_maker_scripts_add_styles' ) ); |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * Return an instance of this class. |
|
40 | - * |
|
41 | - * @since 1.0.0 |
|
42 | - * @return object A single instance of this class. |
|
43 | - */ |
|
44 | - public static function get_instance() { |
|
45 | - // If the single instance hasn't been set, set it now. |
|
46 | - if ( null === self::$instance ) { |
|
47 | - self::$instance = new self(); |
|
48 | - } |
|
49 | - return self::$instance; |
|
50 | - } |
|
38 | + /** |
|
39 | + * Return an instance of this class. |
|
40 | + * |
|
41 | + * @since 1.0.0 |
|
42 | + * @return object A single instance of this class. |
|
43 | + */ |
|
44 | + public static function get_instance() { |
|
45 | + // If the single instance hasn't been set, set it now. |
|
46 | + if ( null === self::$instance ) { |
|
47 | + self::$instance = new self(); |
|
48 | + } |
|
49 | + return self::$instance; |
|
50 | + } |
|
51 | 51 | |
52 | - /** |
|
53 | - * Popup_Maker enqueue styles. |
|
54 | - * |
|
55 | - * @package lsx |
|
56 | - * @subpackage popup-maker |
|
57 | - */ |
|
58 | - public function lsx_popup_maker_scripts_add_styles() { |
|
59 | - wp_enqueue_style( 'popup-maker-lsx', get_template_directory_uri() . '/assets/css/popup-maker/popup-maker.css', array( 'lsx_main' ), LSX_VERSION ); |
|
60 | - } |
|
52 | + /** |
|
53 | + * Popup_Maker enqueue styles. |
|
54 | + * |
|
55 | + * @package lsx |
|
56 | + * @subpackage popup-maker |
|
57 | + */ |
|
58 | + public function lsx_popup_maker_scripts_add_styles() { |
|
59 | + wp_enqueue_style( 'popup-maker-lsx', get_template_directory_uri() . '/assets/css/popup-maker/popup-maker.css', array( 'lsx_main' ), LSX_VERSION ); |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * This removes the PUM pop up controls box. |
|
64 | - * |
|
65 | - * @return void |
|
66 | - */ |
|
67 | - public function remove_pop_up_controls_panel() { |
|
68 | - if ( is_admin() ) { |
|
69 | - remove_action( 'enqueue_block_editor_assets', array( 'PUM_Site_Assets', 'register_styles' ) ); |
|
70 | - remove_action( 'enqueue_block_editor_assets', array( 'PUM_Admin_BlockEditor', 'register_editor_assets' ) ); |
|
71 | - } |
|
72 | - } |
|
73 | - } |
|
62 | + /** |
|
63 | + * This removes the PUM pop up controls box. |
|
64 | + * |
|
65 | + * @return void |
|
66 | + */ |
|
67 | + public function remove_pop_up_controls_panel() { |
|
68 | + if ( is_admin() ) { |
|
69 | + remove_action( 'enqueue_block_editor_assets', array( 'PUM_Site_Assets', 'register_styles' ) ); |
|
70 | + remove_action( 'enqueue_block_editor_assets', array( 'PUM_Admin_BlockEditor', 'register_editor_assets' ) ); |
|
71 | + } |
|
72 | + } |
|
73 | + } |
|
74 | 74 | |
75 | 75 | endif; |
76 | 76 |
@@ -7,421 +7,421 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
10 | - exit; |
|
10 | + exit; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | if ( ! function_exists( 'lsx_wc_support' ) ) : |
14 | 14 | |
15 | - /** |
|
16 | - * WooCommerce support. |
|
17 | - * |
|
18 | - * @package lsx |
|
19 | - * @subpackage woocommerce |
|
20 | - */ |
|
21 | - function lsx_wc_support() { |
|
22 | - add_theme_support( 'woocommerce' ); |
|
23 | - add_theme_support( 'wc-product-gallery-zoom' ); |
|
24 | - add_theme_support( 'wc-product-gallery-lightbox' ); |
|
25 | - add_theme_support( 'wc-product-gallery-slider' ); |
|
26 | - } |
|
15 | + /** |
|
16 | + * WooCommerce support. |
|
17 | + * |
|
18 | + * @package lsx |
|
19 | + * @subpackage woocommerce |
|
20 | + */ |
|
21 | + function lsx_wc_support() { |
|
22 | + add_theme_support( 'woocommerce' ); |
|
23 | + add_theme_support( 'wc-product-gallery-zoom' ); |
|
24 | + add_theme_support( 'wc-product-gallery-lightbox' ); |
|
25 | + add_theme_support( 'wc-product-gallery-slider' ); |
|
26 | + } |
|
27 | 27 | |
28 | - add_action( 'after_setup_theme', 'lsx_wc_support' ); |
|
28 | + add_action( 'after_setup_theme', 'lsx_wc_support' ); |
|
29 | 29 | |
30 | 30 | endif; |
31 | 31 | |
32 | 32 | if ( ! function_exists( 'lsx_wc_scripts_add_styles' ) ) : |
33 | 33 | |
34 | - /** |
|
35 | - * WooCommerce enqueue styles. |
|
36 | - * |
|
37 | - * @package lsx |
|
38 | - * @subpackage woocommerce |
|
39 | - */ |
|
40 | - function lsx_wc_scripts_add_styles() { |
|
41 | - wp_enqueue_style( 'woocommerce-lsx', get_template_directory_uri() . '/assets/css/woocommerce/woocommerce.css', array( 'lsx_main' ), LSX_VERSION ); |
|
42 | - wp_style_add_data( 'woocommerce-lsx', 'rtl', 'replace' ); |
|
34 | + /** |
|
35 | + * WooCommerce enqueue styles. |
|
36 | + * |
|
37 | + * @package lsx |
|
38 | + * @subpackage woocommerce |
|
39 | + */ |
|
40 | + function lsx_wc_scripts_add_styles() { |
|
41 | + wp_enqueue_style( 'woocommerce-lsx', get_template_directory_uri() . '/assets/css/woocommerce/woocommerce.css', array( 'lsx_main' ), LSX_VERSION ); |
|
42 | + wp_style_add_data( 'woocommerce-lsx', 'rtl', 'replace' ); |
|
43 | 43 | |
44 | - // Remove WC Shipping Multiple Addresses specific script causing issues on checkout. |
|
45 | - wp_dequeue_script( 'wcms-country-select' ); |
|
46 | - } |
|
44 | + // Remove WC Shipping Multiple Addresses specific script causing issues on checkout. |
|
45 | + wp_dequeue_script( 'wcms-country-select' ); |
|
46 | + } |
|
47 | 47 | |
48 | - add_action( 'wp_enqueue_scripts', 'lsx_wc_scripts_add_styles' ); |
|
48 | + add_action( 'wp_enqueue_scripts', 'lsx_wc_scripts_add_styles' ); |
|
49 | 49 | |
50 | 50 | endif; |
51 | 51 | |
52 | 52 | if ( ! function_exists( 'lsx_wc_checkout_cart_title' ) ) : |
53 | 53 | |
54 | - /** |
|
55 | - * Add title to Woocommerce Cart page anc Checkout page. |
|
56 | - * |
|
57 | - * @package lsx |
|
58 | - * @subpackage woocommerce |
|
59 | - */ |
|
60 | - function lsx_wc_checkout_cart_title() { |
|
61 | - $default_size = 'sm'; |
|
62 | - $size = apply_filters( 'lsx_bootstrap_column_size', $default_size ); |
|
63 | - if ( function_exists( 'is_woocommerce' ) && ( is_checkout() || is_cart() ) ) { |
|
64 | - ?> |
|
54 | + /** |
|
55 | + * Add title to Woocommerce Cart page anc Checkout page. |
|
56 | + * |
|
57 | + * @package lsx |
|
58 | + * @subpackage woocommerce |
|
59 | + */ |
|
60 | + function lsx_wc_checkout_cart_title() { |
|
61 | + $default_size = 'sm'; |
|
62 | + $size = apply_filters( 'lsx_bootstrap_column_size', $default_size ); |
|
63 | + if ( function_exists( 'is_woocommerce' ) && ( is_checkout() || is_cart() ) ) { |
|
64 | + ?> |
|
65 | 65 | <div class="checkout-header-wrapper cart-checkout-page col-<?php echo esc_attr( $size ); ?>-12"> |
66 | 66 | <h1 class="archive-title"><?php the_title(); ?></h1> |
67 | 67 | </div> |
68 | 68 | <?php |
69 | - } |
|
70 | - } |
|
69 | + } |
|
70 | + } |
|
71 | 71 | |
72 | - add_action( 'lsx_entry_inside_top', 'lsx_wc_checkout_cart_title' ); |
|
72 | + add_action( 'lsx_entry_inside_top', 'lsx_wc_checkout_cart_title' ); |
|
73 | 73 | |
74 | 74 | endif; |
75 | 75 | |
76 | 76 | if ( ! function_exists( 'lsx_simple_checkout' ) ) : |
77 | 77 | |
78 | - /** |
|
79 | - * Remove footer widgets to make Checkout and Cart simpler. |
|
80 | - * |
|
81 | - * @package lsx |
|
82 | - * @subpackage config |
|
83 | - */ |
|
84 | - function lsx_simple_checkout() { |
|
78 | + /** |
|
79 | + * Remove footer widgets to make Checkout and Cart simpler. |
|
80 | + * |
|
81 | + * @package lsx |
|
82 | + * @subpackage config |
|
83 | + */ |
|
84 | + function lsx_simple_checkout() { |
|
85 | 85 | |
86 | - if ( class_exists( 'WooCommerce' ) ) { |
|
87 | - if ( is_checkout() || is_cart() ) { |
|
88 | - remove_action( 'lsx_footer_before', 'lsx_add_footer_sidebar_area' ); |
|
89 | - } |
|
90 | - } |
|
91 | - } |
|
86 | + if ( class_exists( 'WooCommerce' ) ) { |
|
87 | + if ( is_checkout() || is_cart() ) { |
|
88 | + remove_action( 'lsx_footer_before', 'lsx_add_footer_sidebar_area' ); |
|
89 | + } |
|
90 | + } |
|
91 | + } |
|
92 | 92 | |
93 | - add_action( 'wp_head', 'lsx_simple_checkout' ); |
|
93 | + add_action( 'wp_head', 'lsx_simple_checkout' ); |
|
94 | 94 | |
95 | 95 | endif; |
96 | 96 | |
97 | 97 | if ( ! function_exists( 'lsx_wc_form_field_args' ) ) : |
98 | 98 | |
99 | - /** |
|
100 | - * WooCommerce form fields. |
|
101 | - * |
|
102 | - * @package lsx |
|
103 | - * @subpackage woocommerce |
|
104 | - */ |
|
105 | - function lsx_wc_form_field_args( $args, $key, $value ) { |
|
106 | - $args['input_class'][] = 'form-control'; |
|
99 | + /** |
|
100 | + * WooCommerce form fields. |
|
101 | + * |
|
102 | + * @package lsx |
|
103 | + * @subpackage woocommerce |
|
104 | + */ |
|
105 | + function lsx_wc_form_field_args( $args, $key, $value ) { |
|
106 | + $args['input_class'][] = 'form-control'; |
|
107 | 107 | |
108 | - return $args; |
|
109 | - } |
|
108 | + return $args; |
|
109 | + } |
|
110 | 110 | |
111 | - add_action( 'woocommerce_form_field_args', 'lsx_wc_form_field_args', 10, 3 ); |
|
111 | + add_action( 'woocommerce_form_field_args', 'lsx_wc_form_field_args', 10, 3 ); |
|
112 | 112 | |
113 | 113 | endif; |
114 | 114 | |
115 | 115 | if ( ! function_exists( 'lsx_wc_theme_wrapper_start' ) ) : |
116 | 116 | |
117 | - /** |
|
118 | - * WooCommerce wrapper start. |
|
119 | - * |
|
120 | - * @package lsx |
|
121 | - * @subpackage woocommerce |
|
122 | - */ |
|
123 | - function lsx_wc_theme_wrapper_start() { |
|
124 | - lsx_content_wrap_before(); |
|
125 | - echo '<div id="primary" class="content-area ' . esc_attr( lsx_main_class() ) . '">'; |
|
126 | - lsx_content_before(); |
|
127 | - echo '<main id="main" class="site-main" role="main">'; |
|
128 | - lsx_content_top(); |
|
129 | - } |
|
117 | + /** |
|
118 | + * WooCommerce wrapper start. |
|
119 | + * |
|
120 | + * @package lsx |
|
121 | + * @subpackage woocommerce |
|
122 | + */ |
|
123 | + function lsx_wc_theme_wrapper_start() { |
|
124 | + lsx_content_wrap_before(); |
|
125 | + echo '<div id="primary" class="content-area ' . esc_attr( lsx_main_class() ) . '">'; |
|
126 | + lsx_content_before(); |
|
127 | + echo '<main id="main" class="site-main" role="main">'; |
|
128 | + lsx_content_top(); |
|
129 | + } |
|
130 | 130 | |
131 | - remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); |
|
132 | - add_action( 'woocommerce_before_main_content', 'lsx_wc_theme_wrapper_start' ); |
|
131 | + remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); |
|
132 | + add_action( 'woocommerce_before_main_content', 'lsx_wc_theme_wrapper_start' ); |
|
133 | 133 | |
134 | 134 | endif; |
135 | 135 | |
136 | 136 | if ( ! function_exists( 'lsx_wc_theme_wrapper_end' ) ) : |
137 | 137 | |
138 | - /** |
|
139 | - * WooCommerce wrapper end. |
|
140 | - * |
|
141 | - * @package lsx |
|
142 | - * @subpackage woocommerce |
|
143 | - */ |
|
144 | - function lsx_wc_theme_wrapper_end() { |
|
145 | - lsx_content_bottom(); |
|
146 | - echo '</main>'; |
|
147 | - lsx_content_after(); |
|
148 | - echo '</div>'; |
|
149 | - lsx_content_wrap_after(); |
|
150 | - } |
|
138 | + /** |
|
139 | + * WooCommerce wrapper end. |
|
140 | + * |
|
141 | + * @package lsx |
|
142 | + * @subpackage woocommerce |
|
143 | + */ |
|
144 | + function lsx_wc_theme_wrapper_end() { |
|
145 | + lsx_content_bottom(); |
|
146 | + echo '</main>'; |
|
147 | + lsx_content_after(); |
|
148 | + echo '</div>'; |
|
149 | + lsx_content_wrap_after(); |
|
150 | + } |
|
151 | 151 | |
152 | - remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); |
|
153 | - add_action( 'woocommerce_after_main_content', 'lsx_wc_theme_wrapper_end' ); |
|
152 | + remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); |
|
153 | + add_action( 'woocommerce_after_main_content', 'lsx_wc_theme_wrapper_end' ); |
|
154 | 154 | |
155 | 155 | endif; |
156 | 156 | |
157 | 157 | if ( ! function_exists( 'lsx_wc_disable_lsx_banner_plugin' ) ) : |
158 | 158 | |
159 | - /** |
|
160 | - * Disable LSX Banners plugin in some WC pages. |
|
161 | - * |
|
162 | - * @package lsx |
|
163 | - * @subpackage woocommerce |
|
164 | - */ |
|
165 | - function lsx_wc_disable_lsx_banner_plugin( $disabled ) { |
|
166 | - global $post; |
|
159 | + /** |
|
160 | + * Disable LSX Banners plugin in some WC pages. |
|
161 | + * |
|
162 | + * @package lsx |
|
163 | + * @subpackage woocommerce |
|
164 | + */ |
|
165 | + function lsx_wc_disable_lsx_banner_plugin( $disabled ) { |
|
166 | + global $post; |
|
167 | 167 | |
168 | - if ( $post && class_exists( 'WC_Wishlists_Pages' ) && WC_Wishlists_Pages::is_wishlist_page( $post->post_name ) ) { |
|
169 | - $disabled = true; |
|
170 | - } |
|
168 | + if ( $post && class_exists( 'WC_Wishlists_Pages' ) && WC_Wishlists_Pages::is_wishlist_page( $post->post_name ) ) { |
|
169 | + $disabled = true; |
|
170 | + } |
|
171 | 171 | |
172 | - return $disabled; |
|
173 | - } |
|
172 | + return $disabled; |
|
173 | + } |
|
174 | 174 | |
175 | - add_filter( 'lsx_banner_plugin_disable', 'lsx_wc_disable_lsx_banner_plugin' ); |
|
175 | + add_filter( 'lsx_banner_plugin_disable', 'lsx_wc_disable_lsx_banner_plugin' ); |
|
176 | 176 | |
177 | 177 | endif; |
178 | 178 | |
179 | 179 | if ( ! function_exists( 'lsx_wc_disable_lsx_banner' ) ) : |
180 | 180 | |
181 | - /** |
|
182 | - * Disable LSX Banners banner in some WC pages. |
|
183 | - * |
|
184 | - * @package lsx |
|
185 | - * @subpackage woocommerce |
|
186 | - */ |
|
187 | - function lsx_wc_disable_lsx_banner( $disabled ) { |
|
188 | - if ( is_shop() || is_product_category() || is_product_tag() || is_product() ) { |
|
189 | - $disabled = true; |
|
190 | - } |
|
181 | + /** |
|
182 | + * Disable LSX Banners banner in some WC pages. |
|
183 | + * |
|
184 | + * @package lsx |
|
185 | + * @subpackage woocommerce |
|
186 | + */ |
|
187 | + function lsx_wc_disable_lsx_banner( $disabled ) { |
|
188 | + if ( is_shop() || is_product_category() || is_product_tag() || is_product() ) { |
|
189 | + $disabled = true; |
|
190 | + } |
|
191 | 191 | |
192 | - return $disabled; |
|
193 | - } |
|
192 | + return $disabled; |
|
193 | + } |
|
194 | 194 | |
195 | - add_filter( 'lsx_banner_disable', 'lsx_wc_disable_lsx_banner' ); |
|
195 | + add_filter( 'lsx_banner_disable', 'lsx_wc_disable_lsx_banner' ); |
|
196 | 196 | |
197 | 197 | endif; |
198 | 198 | |
199 | 199 | if ( ! function_exists( 'lsx_wc_categories_breadcrumb_filter' ) ) : |
200 | - /** |
|
201 | - * Improves the category and taxonomy breadcrumbs for woocommerce. |
|
202 | - * |
|
203 | - * @package lsx |
|
204 | - * @subpackage woocommerce |
|
205 | - */ |
|
206 | - function lsx_wc_categories_breadcrumb_filter( $crumbs ) { |
|
207 | - |
|
208 | - $shop_page_url = get_permalink( wc_get_page_id( 'shop' ) ); |
|
209 | - |
|
210 | - if ( is_product_category() || is_product_tag() ) { |
|
211 | - $new_crumbs = array(); |
|
212 | - $new_crumbs[0] = $crumbs[0]; |
|
213 | - |
|
214 | - if ( function_exists( 'woocommerce_breadcrumb' ) ) { |
|
215 | - $new_crumbs[1] = array( |
|
216 | - 0 => __( 'Shop', 'lsx' ), |
|
217 | - 1 => $shop_page_url, |
|
218 | - ); |
|
219 | - } else { |
|
220 | - $new_crumbs[1] = array( |
|
221 | - 'text' => __( 'Shop', 'lsx' ), |
|
222 | - 'url' => $shop_page_url, |
|
223 | - ); |
|
224 | - } |
|
225 | - |
|
226 | - $new_crumbs[2] = $crumbs[1]; |
|
227 | - |
|
228 | - $crumbs = $new_crumbs; |
|
229 | - } |
|
230 | - return $crumbs; |
|
231 | - } |
|
232 | - add_filter( 'wpseo_breadcrumb_links', 'lsx_wc_categories_breadcrumb_filter', 30, 1 ); |
|
233 | - add_filter( 'woocommerce_get_breadcrumb', 'lsx_wc_categories_breadcrumb_filter', 30, 1 ); |
|
200 | + /** |
|
201 | + * Improves the category and taxonomy breadcrumbs for woocommerce. |
|
202 | + * |
|
203 | + * @package lsx |
|
204 | + * @subpackage woocommerce |
|
205 | + */ |
|
206 | + function lsx_wc_categories_breadcrumb_filter( $crumbs ) { |
|
207 | + |
|
208 | + $shop_page_url = get_permalink( wc_get_page_id( 'shop' ) ); |
|
209 | + |
|
210 | + if ( is_product_category() || is_product_tag() ) { |
|
211 | + $new_crumbs = array(); |
|
212 | + $new_crumbs[0] = $crumbs[0]; |
|
213 | + |
|
214 | + if ( function_exists( 'woocommerce_breadcrumb' ) ) { |
|
215 | + $new_crumbs[1] = array( |
|
216 | + 0 => __( 'Shop', 'lsx' ), |
|
217 | + 1 => $shop_page_url, |
|
218 | + ); |
|
219 | + } else { |
|
220 | + $new_crumbs[1] = array( |
|
221 | + 'text' => __( 'Shop', 'lsx' ), |
|
222 | + 'url' => $shop_page_url, |
|
223 | + ); |
|
224 | + } |
|
225 | + |
|
226 | + $new_crumbs[2] = $crumbs[1]; |
|
227 | + |
|
228 | + $crumbs = $new_crumbs; |
|
229 | + } |
|
230 | + return $crumbs; |
|
231 | + } |
|
232 | + add_filter( 'wpseo_breadcrumb_links', 'lsx_wc_categories_breadcrumb_filter', 30, 1 ); |
|
233 | + add_filter( 'woocommerce_get_breadcrumb', 'lsx_wc_categories_breadcrumb_filter', 30, 1 ); |
|
234 | 234 | |
235 | 235 | endif; |
236 | 236 | |
237 | 237 | if ( ! function_exists( 'lsx_wc_add_cart' ) ) : |
238 | 238 | |
239 | - /** |
|
240 | - * Adds WC cart to the header. |
|
241 | - * |
|
242 | - * @package lsx |
|
243 | - * @subpackage template-tags |
|
244 | - */ |
|
245 | - function lsx_wc_add_cart( $items, $args ) { |
|
246 | - $cart_menu_item_position = apply_filters( 'lsx_wc_cart_menu_item_position', 'primary' ); |
|
247 | - |
|
248 | - $cart_logged_out_position = $cart_menu_item_position . '_logged_out'; |
|
249 | - |
|
250 | - if ( $cart_menu_item_position === $args->theme_location || $cart_logged_out_position === $args->theme_location ) { |
|
251 | - $customizer_option = get_theme_mod( 'lsx_header_wc_cart', false ); |
|
252 | - |
|
253 | - if ( ! empty( $customizer_option ) ) { |
|
254 | - ob_start(); |
|
255 | - the_widget( 'WC_Widget_Cart', 'title=' ); |
|
256 | - $widget = ob_get_clean(); |
|
257 | - |
|
258 | - if ( is_cart() ) { |
|
259 | - $class = 'current-menu-item'; |
|
260 | - } else { |
|
261 | - $class = ''; |
|
262 | - } |
|
263 | - |
|
264 | - $item_class = 'menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children dropdown lsx-wc-cart-menu-item ' . $class; |
|
265 | - $item_class = apply_filters( 'lsx_wc_cart_menu_item_class', $item_class ); |
|
266 | - |
|
267 | - $item = '<li class="' . $item_class . '">' . |
|
268 | - '<a title="' . esc_attr__( 'View your shopping cart', 'lsx' ) . '" href="' . esc_url( wc_get_cart_url() ) . '" data-toggle="dropdown" class="dropdown-toggle" aria-haspopup="true">' . |
|
269 | - '<span class="lsx-wc-cart-amount">' . wp_kses_data( WC()->cart->get_cart_subtotal() ) . '</span>' . |
|
270 | - /* Translators: %s: items quantity */ |
|
271 | - '<span class="lsx-wc-cart-count">' . wp_kses_data( sprintf( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'lsx' ), WC()->cart->get_cart_contents_count() ) ) . '</span>' . |
|
272 | - ( ! empty( WC()->cart->get_cart_contents_count() ) ? '<span class="lsx-wc-cart-count-badge">' . wp_kses_data( WC()->cart->get_cart_contents_count() ) . '</span>' : '' ) . |
|
273 | - '</a>' . |
|
274 | - '<ul role="menu" class=" dropdown-menu lsx-wc-cart-sub-menu">' . |
|
275 | - '<li>' . |
|
276 | - '<div class="lsx-wc-cart-dropdown">' . $widget . '</div>' . |
|
277 | - '</li>' . |
|
278 | - '</ul>' . |
|
279 | - '</li>'; |
|
280 | - |
|
281 | - if ( 'top-menu' === $args->theme_location ) { |
|
282 | - $items = $item . $items; |
|
283 | - } else { |
|
284 | - $items = $items . $item; |
|
285 | - } |
|
286 | - } |
|
287 | - } |
|
288 | - |
|
289 | - return $items; |
|
290 | - } |
|
291 | - |
|
292 | - add_filter( 'wp_nav_menu_items', 'lsx_wc_add_cart', 10, 2 ); |
|
239 | + /** |
|
240 | + * Adds WC cart to the header. |
|
241 | + * |
|
242 | + * @package lsx |
|
243 | + * @subpackage template-tags |
|
244 | + */ |
|
245 | + function lsx_wc_add_cart( $items, $args ) { |
|
246 | + $cart_menu_item_position = apply_filters( 'lsx_wc_cart_menu_item_position', 'primary' ); |
|
247 | + |
|
248 | + $cart_logged_out_position = $cart_menu_item_position . '_logged_out'; |
|
249 | + |
|
250 | + if ( $cart_menu_item_position === $args->theme_location || $cart_logged_out_position === $args->theme_location ) { |
|
251 | + $customizer_option = get_theme_mod( 'lsx_header_wc_cart', false ); |
|
252 | + |
|
253 | + if ( ! empty( $customizer_option ) ) { |
|
254 | + ob_start(); |
|
255 | + the_widget( 'WC_Widget_Cart', 'title=' ); |
|
256 | + $widget = ob_get_clean(); |
|
257 | + |
|
258 | + if ( is_cart() ) { |
|
259 | + $class = 'current-menu-item'; |
|
260 | + } else { |
|
261 | + $class = ''; |
|
262 | + } |
|
263 | + |
|
264 | + $item_class = 'menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children dropdown lsx-wc-cart-menu-item ' . $class; |
|
265 | + $item_class = apply_filters( 'lsx_wc_cart_menu_item_class', $item_class ); |
|
266 | + |
|
267 | + $item = '<li class="' . $item_class . '">' . |
|
268 | + '<a title="' . esc_attr__( 'View your shopping cart', 'lsx' ) . '" href="' . esc_url( wc_get_cart_url() ) . '" data-toggle="dropdown" class="dropdown-toggle" aria-haspopup="true">' . |
|
269 | + '<span class="lsx-wc-cart-amount">' . wp_kses_data( WC()->cart->get_cart_subtotal() ) . '</span>' . |
|
270 | + /* Translators: %s: items quantity */ |
|
271 | + '<span class="lsx-wc-cart-count">' . wp_kses_data( sprintf( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'lsx' ), WC()->cart->get_cart_contents_count() ) ) . '</span>' . |
|
272 | + ( ! empty( WC()->cart->get_cart_contents_count() ) ? '<span class="lsx-wc-cart-count-badge">' . wp_kses_data( WC()->cart->get_cart_contents_count() ) . '</span>' : '' ) . |
|
273 | + '</a>' . |
|
274 | + '<ul role="menu" class=" dropdown-menu lsx-wc-cart-sub-menu">' . |
|
275 | + '<li>' . |
|
276 | + '<div class="lsx-wc-cart-dropdown">' . $widget . '</div>' . |
|
277 | + '</li>' . |
|
278 | + '</ul>' . |
|
279 | + '</li>'; |
|
280 | + |
|
281 | + if ( 'top-menu' === $args->theme_location ) { |
|
282 | + $items = $item . $items; |
|
283 | + } else { |
|
284 | + $items = $items . $item; |
|
285 | + } |
|
286 | + } |
|
287 | + } |
|
288 | + |
|
289 | + return $items; |
|
290 | + } |
|
291 | + |
|
292 | + add_filter( 'wp_nav_menu_items', 'lsx_wc_add_cart', 10, 2 ); |
|
293 | 293 | |
294 | 294 | endif; |
295 | 295 | |
296 | 296 | if ( ! function_exists( 'lsx_wc_products_widget_wrapper_before' ) ) : |
297 | 297 | |
298 | - /** |
|
299 | - * Change WC products widget wrapper (before). |
|
300 | - * |
|
301 | - * @package lsx |
|
302 | - * @subpackage woocommerce |
|
303 | - */ |
|
304 | - function lsx_wc_products_widget_wrapper_before( $html ) { |
|
305 | - $html = '<div class="lsx-woocommerce-slider lsx-woocommerce-shortcode">'; |
|
306 | - return $html; |
|
307 | - } |
|
298 | + /** |
|
299 | + * Change WC products widget wrapper (before). |
|
300 | + * |
|
301 | + * @package lsx |
|
302 | + * @subpackage woocommerce |
|
303 | + */ |
|
304 | + function lsx_wc_products_widget_wrapper_before( $html ) { |
|
305 | + $html = '<div class="lsx-woocommerce-slider lsx-woocommerce-shortcode">'; |
|
306 | + return $html; |
|
307 | + } |
|
308 | 308 | |
309 | - add_filter( 'woocommerce_before_widget_product_list', 'lsx_wc_products_widget_wrapper_before', 15 ); |
|
309 | + add_filter( 'woocommerce_before_widget_product_list', 'lsx_wc_products_widget_wrapper_before', 15 ); |
|
310 | 310 | |
311 | 311 | endif; |
312 | 312 | |
313 | 313 | if ( ! function_exists( 'lsx_wc_products_widget_wrapper_after' ) ) : |
314 | 314 | |
315 | - /** |
|
316 | - * Change WC products widget wrapper (after). |
|
317 | - * |
|
318 | - * @package lsx |
|
319 | - * @subpackage woocommerce |
|
320 | - */ |
|
321 | - function lsx_wc_products_widget_wrapper_after( $html ) { |
|
322 | - $html = '</div>'; |
|
323 | - return $html; |
|
324 | - } |
|
315 | + /** |
|
316 | + * Change WC products widget wrapper (after). |
|
317 | + * |
|
318 | + * @package lsx |
|
319 | + * @subpackage woocommerce |
|
320 | + */ |
|
321 | + function lsx_wc_products_widget_wrapper_after( $html ) { |
|
322 | + $html = '</div>'; |
|
323 | + return $html; |
|
324 | + } |
|
325 | 325 | |
326 | - add_filter( 'woocommerce_after_widget_product_list', 'lsx_wc_products_widget_wrapper_after', 15 ); |
|
326 | + add_filter( 'woocommerce_after_widget_product_list', 'lsx_wc_products_widget_wrapper_after', 15 ); |
|
327 | 327 | |
328 | 328 | endif; |
329 | 329 | |
330 | 330 | if ( ! function_exists( 'lsx_wc_reviews_widget_override' ) ) : |
331 | 331 | |
332 | - /** |
|
333 | - * Override WC ewviews widget. |
|
334 | - * |
|
335 | - * @package lsx |
|
336 | - * @subpackage woocommerce |
|
337 | - */ |
|
338 | - function lsx_wc_reviews_widget_override() { |
|
339 | - if ( class_exists( 'WC_Widget_Recent_Reviews' ) ) { |
|
340 | - unregister_widget( 'WC_Widget_Recent_Reviews' ); |
|
341 | - require get_template_directory() . '/includes/classes/class-lsx-wc-widget-recent-reviews.php'; |
|
342 | - register_widget( 'LSX_WC_Widget_Recent_Reviews' ); |
|
343 | - } |
|
344 | - } |
|
332 | + /** |
|
333 | + * Override WC ewviews widget. |
|
334 | + * |
|
335 | + * @package lsx |
|
336 | + * @subpackage woocommerce |
|
337 | + */ |
|
338 | + function lsx_wc_reviews_widget_override() { |
|
339 | + if ( class_exists( 'WC_Widget_Recent_Reviews' ) ) { |
|
340 | + unregister_widget( 'WC_Widget_Recent_Reviews' ); |
|
341 | + require get_template_directory() . '/includes/classes/class-lsx-wc-widget-recent-reviews.php'; |
|
342 | + register_widget( 'LSX_WC_Widget_Recent_Reviews' ); |
|
343 | + } |
|
344 | + } |
|
345 | 345 | |
346 | - add_action( 'widgets_init', 'lsx_wc_reviews_widget_override', 15 ); |
|
346 | + add_action( 'widgets_init', 'lsx_wc_reviews_widget_override', 15 ); |
|
347 | 347 | |
348 | 348 | endif; |
349 | 349 | |
350 | 350 | if ( ! function_exists( 'lsx_wc_change_price_html' ) ) : |
351 | 351 | |
352 | - /** |
|
353 | - * Change WC ZERO price to "free". |
|
354 | - * |
|
355 | - * @package lsx |
|
356 | - * @subpackage woocommerce |
|
357 | - * |
|
358 | - * @param $price string |
|
359 | - * @param $product WC_Product |
|
360 | - * @return string |
|
361 | - */ |
|
362 | - function lsx_wc_change_price_html( $price, $product ) { |
|
363 | - if ( empty( $product->get_price() ) ) { |
|
364 | - if ( $product->is_on_sale() && $product->get_regular_price() ) { |
|
365 | - $regular_price = wc_get_price_to_display( $product, |
|
366 | - array( |
|
367 | - 'qty' => 1, |
|
368 | - 'price' => $product->get_regular_price(), |
|
369 | - ) |
|
370 | - ); |
|
371 | - |
|
372 | - $price = wc_format_price_range( $regular_price, esc_html__( 'Free!', 'lsx' ) ); |
|
373 | - } else { |
|
374 | - $price = '<span class="amount">' . esc_html__( 'Free!', 'lsx' ) . '</span>'; |
|
375 | - } |
|
376 | - } |
|
377 | - |
|
378 | - return $price; |
|
379 | - } |
|
380 | - |
|
381 | - add_filter( 'woocommerce_get_price_html', 'lsx_wc_change_price_html', 15, 2 ); |
|
352 | + /** |
|
353 | + * Change WC ZERO price to "free". |
|
354 | + * |
|
355 | + * @package lsx |
|
356 | + * @subpackage woocommerce |
|
357 | + * |
|
358 | + * @param $price string |
|
359 | + * @param $product WC_Product |
|
360 | + * @return string |
|
361 | + */ |
|
362 | + function lsx_wc_change_price_html( $price, $product ) { |
|
363 | + if ( empty( $product->get_price() ) ) { |
|
364 | + if ( $product->is_on_sale() && $product->get_regular_price() ) { |
|
365 | + $regular_price = wc_get_price_to_display( $product, |
|
366 | + array( |
|
367 | + 'qty' => 1, |
|
368 | + 'price' => $product->get_regular_price(), |
|
369 | + ) |
|
370 | + ); |
|
371 | + |
|
372 | + $price = wc_format_price_range( $regular_price, esc_html__( 'Free!', 'lsx' ) ); |
|
373 | + } else { |
|
374 | + $price = '<span class="amount">' . esc_html__( 'Free!', 'lsx' ) . '</span>'; |
|
375 | + } |
|
376 | + } |
|
377 | + |
|
378 | + return $price; |
|
379 | + } |
|
380 | + |
|
381 | + add_filter( 'woocommerce_get_price_html', 'lsx_wc_change_price_html', 15, 2 ); |
|
382 | 382 | |
383 | 383 | endif; |
384 | 384 | |
385 | 385 | if ( ! function_exists( 'lsx_wc_cart_link_fragment' ) ) : |
386 | 386 | |
387 | - /** |
|
388 | - * Cart Fragments. |
|
389 | - * Ensure cart contents update when products are added to the cart via AJAX. |
|
390 | - * |
|
391 | - * @package lsx |
|
392 | - * @subpackage woocommerce |
|
393 | - */ |
|
394 | - function lsx_wc_cart_link_fragment( $fragments ) { |
|
395 | - global $woocommerce; |
|
387 | + /** |
|
388 | + * Cart Fragments. |
|
389 | + * Ensure cart contents update when products are added to the cart via AJAX. |
|
390 | + * |
|
391 | + * @package lsx |
|
392 | + * @subpackage woocommerce |
|
393 | + */ |
|
394 | + function lsx_wc_cart_link_fragment( $fragments ) { |
|
395 | + global $woocommerce; |
|
396 | 396 | |
397 | - ob_start(); |
|
398 | - lsx_wc_cart_link(); |
|
399 | - $fragments['li.lsx-wc-cart-menu-item > a'] = ob_get_clean(); |
|
397 | + ob_start(); |
|
398 | + lsx_wc_cart_link(); |
|
399 | + $fragments['li.lsx-wc-cart-menu-item > a'] = ob_get_clean(); |
|
400 | 400 | |
401 | - ob_start(); |
|
402 | - lsx_wc_items_counter(); |
|
403 | - $items_counter = ob_get_clean(); |
|
401 | + ob_start(); |
|
402 | + lsx_wc_items_counter(); |
|
403 | + $items_counter = ob_get_clean(); |
|
404 | 404 | |
405 | - if ( ! empty( $items_counter ) ) { |
|
406 | - $fragments['div.widget_shopping_cart_content'] = preg_replace( '/(.+)(<\/ul>)[\s\n]*(<p class="woocommerce-mini-cart__total)(.+)/', '$1' . $items_counter . '$2$3$4', $fragments['div.widget_shopping_cart_content'] ); |
|
407 | - } |
|
405 | + if ( ! empty( $items_counter ) ) { |
|
406 | + $fragments['div.widget_shopping_cart_content'] = preg_replace( '/(.+)(<\/ul>)[\s\n]*(<p class="woocommerce-mini-cart__total)(.+)/', '$1' . $items_counter . '$2$3$4', $fragments['div.widget_shopping_cart_content'] ); |
|
407 | + } |
|
408 | 408 | |
409 | - return $fragments; |
|
410 | - } |
|
409 | + return $fragments; |
|
410 | + } |
|
411 | 411 | |
412 | 412 | endif; |
413 | 413 | |
414 | 414 | if ( ! function_exists( 'lsx_wc_cart_link' ) ) : |
415 | 415 | |
416 | - /** |
|
417 | - * Cart Link. |
|
418 | - * Displayed a link to the cart including the number of items present and the cart total. |
|
419 | - * |
|
420 | - * @package lsx |
|
421 | - * @subpackage woocommerce |
|
422 | - */ |
|
423 | - function lsx_wc_cart_link() { |
|
424 | - ?> |
|
416 | + /** |
|
417 | + * Cart Link. |
|
418 | + * Displayed a link to the cart including the number of items present and the cart total. |
|
419 | + * |
|
420 | + * @package lsx |
|
421 | + * @subpackage woocommerce |
|
422 | + */ |
|
423 | + function lsx_wc_cart_link() { |
|
424 | + ?> |
|
425 | 425 | <a title="<?php esc_attr_e( 'View your shopping cart', 'lsx' ); ?>" href="<?php echo esc_url( wc_get_cart_url() ); ?>" data-toggle="dropdown" class="dropdown-toggle" aria-haspopup="true"> |
426 | 426 | <span class="lsx-wc-cart-amount"><?php echo wp_kses_data( WC()->cart->get_cart_subtotal() ); ?></span> |
427 | 427 | |
@@ -433,82 +433,82 @@ discard block |
||
433 | 433 | <?php endif; ?> |
434 | 434 | </a> |
435 | 435 | <?php |
436 | - } |
|
436 | + } |
|
437 | 437 | |
438 | 438 | endif; |
439 | 439 | |
440 | 440 | if ( ! function_exists( 'lsx_wc_items_counter' ) ) : |
441 | 441 | |
442 | - /** |
|
443 | - * Add car item hidden items counter. |
|
444 | - * |
|
445 | - * @package lsx |
|
446 | - * @subpackage woocommerce |
|
447 | - */ |
|
448 | - function lsx_wc_items_counter() { |
|
449 | - $count = (int) WC()->cart->get_cart_contents_count(); |
|
450 | - $items_counter = ''; |
|
451 | - |
|
452 | - if ( ! empty( $count ) ) { |
|
453 | - $count -= 3; |
|
454 | - |
|
455 | - if ( 1 === $count ) { |
|
456 | - $items_counter = esc_html__( '1 other item in cart', 'lsx' ); |
|
457 | - } elseif ( $count > 1 ) { |
|
458 | - /* Translators: %s: items counter */ |
|
459 | - $items_counter = sprintf( esc_html__( '%s other items in cart', 'lsx' ), $count ); |
|
460 | - } |
|
461 | - } |
|
462 | - $cart_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : WC()->cart->get_cart_url(); |
|
463 | - if ( ! empty( $items_counter ) ) : |
|
464 | - ?> |
|
442 | + /** |
|
443 | + * Add car item hidden items counter. |
|
444 | + * |
|
445 | + * @package lsx |
|
446 | + * @subpackage woocommerce |
|
447 | + */ |
|
448 | + function lsx_wc_items_counter() { |
|
449 | + $count = (int) WC()->cart->get_cart_contents_count(); |
|
450 | + $items_counter = ''; |
|
451 | + |
|
452 | + if ( ! empty( $count ) ) { |
|
453 | + $count -= 3; |
|
454 | + |
|
455 | + if ( 1 === $count ) { |
|
456 | + $items_counter = esc_html__( '1 other item in cart', 'lsx' ); |
|
457 | + } elseif ( $count > 1 ) { |
|
458 | + /* Translators: %s: items counter */ |
|
459 | + $items_counter = sprintf( esc_html__( '%s other items in cart', 'lsx' ), $count ); |
|
460 | + } |
|
461 | + } |
|
462 | + $cart_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : WC()->cart->get_cart_url(); |
|
463 | + if ( ! empty( $items_counter ) ) : |
|
464 | + ?> |
|
465 | 465 | <li class="woocommerce-mini-cart-item mini_cart_item" style="display: block;"> |
466 | 466 | <a href="<?php echo esc_url( $cart_url ); ?>"><?php echo esc_html( $items_counter ); ?></a> |
467 | 467 | </li> |
468 | 468 | <?php |
469 | - endif; |
|
470 | - } |
|
469 | + endif; |
|
470 | + } |
|
471 | 471 | |
472 | 472 | endif; |
473 | 473 | |
474 | 474 | if ( ! function_exists( 'lsx_wc_loop_shop_per_page' ) ) : |
475 | 475 | |
476 | - /** |
|
477 | - * Changes the number of products to display on shop. |
|
478 | - * |
|
479 | - * @package lsx |
|
480 | - * @subpackage woocommerce |
|
481 | - */ |
|
482 | - function lsx_wc_loop_shop_per_page( $items ) { |
|
483 | - $items = 12; |
|
484 | - return $items; |
|
485 | - } |
|
476 | + /** |
|
477 | + * Changes the number of products to display on shop. |
|
478 | + * |
|
479 | + * @package lsx |
|
480 | + * @subpackage woocommerce |
|
481 | + */ |
|
482 | + function lsx_wc_loop_shop_per_page( $items ) { |
|
483 | + $items = 12; |
|
484 | + return $items; |
|
485 | + } |
|
486 | 486 | |
487 | - add_filter( 'loop_shop_per_page', 'lsx_wc_loop_shop_per_page', 20 ); |
|
487 | + add_filter( 'loop_shop_per_page', 'lsx_wc_loop_shop_per_page', 20 ); |
|
488 | 488 | |
489 | 489 | endif; |
490 | 490 | |
491 | 491 | if ( ! function_exists( 'lsx_wc_add_to_cart_message_html' ) ) : |
492 | 492 | |
493 | - /** |
|
494 | - * Changes the "added to cart" message HTML. |
|
495 | - * |
|
496 | - * @package lsx |
|
497 | - * @subpackage woocommerce |
|
498 | - */ |
|
499 | - function lsx_wc_add_to_cart_message_html( $message, $products ) { |
|
500 | - $message = '<div class="woocommerce-message-added-to-cart">' . $message . '</div>'; |
|
501 | - return $message; |
|
502 | - } |
|
493 | + /** |
|
494 | + * Changes the "added to cart" message HTML. |
|
495 | + * |
|
496 | + * @package lsx |
|
497 | + * @subpackage woocommerce |
|
498 | + */ |
|
499 | + function lsx_wc_add_to_cart_message_html( $message, $products ) { |
|
500 | + $message = '<div class="woocommerce-message-added-to-cart">' . $message . '</div>'; |
|
501 | + return $message; |
|
502 | + } |
|
503 | 503 | |
504 | - add_filter( 'wc_add_to_cart_message_html', 'lsx_wc_add_to_cart_message_html', 20, 2 ); |
|
504 | + add_filter( 'wc_add_to_cart_message_html', 'lsx_wc_add_to_cart_message_html', 20, 2 ); |
|
505 | 505 | |
506 | 506 | endif; |
507 | 507 | |
508 | 508 | if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.3', '>=' ) ) { |
509 | - add_filter( 'woocommerce_add_to_cart_fragments', 'lsx_wc_cart_link_fragment' ); |
|
509 | + add_filter( 'woocommerce_add_to_cart_fragments', 'lsx_wc_cart_link_fragment' ); |
|
510 | 510 | } else { |
511 | - add_filter( 'add_to_cart_fragments', 'lsx_wc_cart_link_fragment' ); |
|
511 | + add_filter( 'add_to_cart_fragments', 'lsx_wc_cart_link_fragment' ); |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | remove_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 10 ); |
@@ -530,184 +530,184 @@ discard block |
||
530 | 530 | |
531 | 531 | if ( ! function_exists( 'lsx_wc_sorting_wrapper' ) ) : |
532 | 532 | |
533 | - /** |
|
534 | - * Sorting wrapper. |
|
535 | - * |
|
536 | - * @package lsx |
|
537 | - * @subpackage woocommerce |
|
538 | - */ |
|
539 | - function lsx_wc_sorting_wrapper() { |
|
540 | - echo '<div class="lsx-wc-sorting">'; |
|
541 | - } |
|
533 | + /** |
|
534 | + * Sorting wrapper. |
|
535 | + * |
|
536 | + * @package lsx |
|
537 | + * @subpackage woocommerce |
|
538 | + */ |
|
539 | + function lsx_wc_sorting_wrapper() { |
|
540 | + echo '<div class="lsx-wc-sorting">'; |
|
541 | + } |
|
542 | 542 | |
543 | 543 | endif; |
544 | 544 | |
545 | 545 | if ( ! function_exists( 'lsx_wc_sorting_wrapper_close' ) ) : |
546 | 546 | |
547 | - /** |
|
548 | - * Sorting wrapper close. |
|
549 | - * |
|
550 | - * @package lsx |
|
551 | - * @subpackage woocommerce |
|
552 | - */ |
|
553 | - function lsx_wc_sorting_wrapper_close() { |
|
554 | - echo '</div>'; |
|
555 | - } |
|
547 | + /** |
|
548 | + * Sorting wrapper close. |
|
549 | + * |
|
550 | + * @package lsx |
|
551 | + * @subpackage woocommerce |
|
552 | + */ |
|
553 | + function lsx_wc_sorting_wrapper_close() { |
|
554 | + echo '</div>'; |
|
555 | + } |
|
556 | 556 | |
557 | 557 | endif; |
558 | 558 | |
559 | 559 | if ( ! function_exists( 'lsx_wc_product_columns_wrapper_close' ) ) : |
560 | 560 | |
561 | - /** |
|
562 | - * Product columns wrapper close. |
|
563 | - * |
|
564 | - * @package lsx |
|
565 | - * @subpackage woocommerce |
|
566 | - */ |
|
567 | - function lsx_wc_product_columns_wrapper_close() { |
|
568 | - echo '</div>'; |
|
569 | - } |
|
561 | + /** |
|
562 | + * Product columns wrapper close. |
|
563 | + * |
|
564 | + * @package lsx |
|
565 | + * @subpackage woocommerce |
|
566 | + */ |
|
567 | + function lsx_wc_product_columns_wrapper_close() { |
|
568 | + echo '</div>'; |
|
569 | + } |
|
570 | 570 | |
571 | 571 | endif; |
572 | 572 | |
573 | 573 | if ( ! function_exists( 'lsx_wc_woocommerce_pagination' ) ) : |
574 | 574 | |
575 | - /** |
|
576 | - * LSX WooCommerce Pagination |
|
577 | - * WooCommerce disables the product pagination inside the woocommerce_product_subcategories() function |
|
578 | - * but since LSX adds pagination before that function is excuted we need a separate function to |
|
579 | - * determine whether or not to display the pagination. |
|
580 | - * |
|
581 | - * @package lsx |
|
582 | - * @subpackage woocommerce |
|
583 | - */ |
|
584 | - function lsx_wc_woocommerce_pagination() { |
|
585 | - if ( woocommerce_products_will_display() ) { |
|
586 | - woocommerce_pagination(); |
|
587 | - } |
|
588 | - } |
|
575 | + /** |
|
576 | + * LSX WooCommerce Pagination |
|
577 | + * WooCommerce disables the product pagination inside the woocommerce_product_subcategories() function |
|
578 | + * but since LSX adds pagination before that function is excuted we need a separate function to |
|
579 | + * determine whether or not to display the pagination. |
|
580 | + * |
|
581 | + * @package lsx |
|
582 | + * @subpackage woocommerce |
|
583 | + */ |
|
584 | + function lsx_wc_woocommerce_pagination() { |
|
585 | + if ( woocommerce_products_will_display() ) { |
|
586 | + woocommerce_pagination(); |
|
587 | + } |
|
588 | + } |
|
589 | 589 | |
590 | 590 | endif; |
591 | 591 | |
592 | 592 | if ( ! function_exists( 'lsx_customizer_wc_controls' ) ) : |
593 | 593 | |
594 | - /** |
|
595 | - * Returns an array of the core panel. |
|
596 | - * |
|
597 | - * @package lsx |
|
598 | - * @subpackage customizer |
|
599 | - * |
|
600 | - * @return $lsx_controls array() |
|
601 | - */ |
|
602 | - function lsx_customizer_wc_controls( $lsx_controls ) { |
|
603 | - $lsx_controls['panels']['woocommerce'] = array( |
|
604 | - 'title' => esc_html__( 'WooCommerce', 'lsx' ), |
|
605 | - 'description' => esc_html__( 'Change the WooCommerce settings.', 'lsx' ), |
|
606 | - 'priority' => 23, |
|
607 | - ); |
|
608 | - |
|
609 | - /** |
|
610 | - * Global. |
|
611 | - */ |
|
612 | - |
|
613 | - $lsx_controls['sections']['lsx-wc-global'] = array( |
|
614 | - 'title' => esc_html__( 'LSX Global', 'lsx' ), |
|
615 | - 'description' => esc_html__( 'Change the WooCommerce global settings.', 'lsx' ), |
|
616 | - 'panel' => 'woocommerce', |
|
617 | - 'priority' => 1, |
|
618 | - ); |
|
619 | - |
|
620 | - $lsx_controls['settings']['lsx_wc_trust_footer_bar_status'] = array( |
|
621 | - 'default' => '1', |
|
622 | - 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
623 | - ); |
|
624 | - |
|
625 | - $lsx_controls['fields']['lsx_wc_trust_footer_bar_status'] = array( |
|
626 | - 'label' => esc_html__( 'Footer Trust Factors Section', 'lsx' ), |
|
627 | - 'description' => esc_html__( 'Enable the footer trust factors section.', 'lsx' ), |
|
628 | - 'section' => 'lsx-wc-global', |
|
629 | - 'type' => 'checkbox', |
|
630 | - 'priority' => 1, |
|
631 | - ); |
|
632 | - |
|
633 | - $lsx_controls['settings']['lsx_wc_mobile_footer_bar_status'] = array( |
|
634 | - 'default' => '1', |
|
635 | - 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
636 | - ); |
|
637 | - |
|
638 | - $lsx_controls['fields']['lsx_wc_mobile_footer_bar_status'] = array( |
|
639 | - 'label' => esc_html__( 'Footer Bar', 'lsx' ), |
|
640 | - 'description' => esc_html__( 'Enable the mobile footer bar.', 'lsx' ), |
|
641 | - 'section' => 'lsx-wc-global', |
|
642 | - 'type' => 'checkbox', |
|
643 | - 'priority' => 1, |
|
644 | - ); |
|
645 | - |
|
646 | - /** |
|
647 | - * Cart. |
|
648 | - */ |
|
649 | - |
|
650 | - $lsx_controls['sections']['lsx-wc-cart'] = array( |
|
651 | - 'title' => esc_html__( 'LSX Cart', 'lsx' ), |
|
652 | - 'description' => esc_html__( 'Change the WooCommerce cart settings.', 'lsx' ), |
|
653 | - 'panel' => 'woocommerce', |
|
654 | - 'priority' => 2, |
|
655 | - ); |
|
656 | - |
|
657 | - $lsx_controls['settings']['lsx_header_wc_cart'] = array( |
|
658 | - 'default' => false, |
|
659 | - 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
660 | - ); |
|
661 | - |
|
662 | - $lsx_controls['fields']['lsx_header_wc_cart'] = array( |
|
663 | - 'label' => esc_html__( 'Menu Item', 'lsx' ), |
|
664 | - 'description' => esc_html__( 'Enable the cart menu item.', 'lsx' ), |
|
665 | - 'section' => 'lsx-wc-cart', |
|
666 | - 'type' => 'checkbox', |
|
667 | - 'priority' => 1, |
|
668 | - ); |
|
669 | - |
|
670 | - return $lsx_controls; |
|
671 | - } |
|
672 | - |
|
673 | - add_filter( 'lsx_customizer_controls', 'lsx_customizer_wc_controls' ); |
|
594 | + /** |
|
595 | + * Returns an array of the core panel. |
|
596 | + * |
|
597 | + * @package lsx |
|
598 | + * @subpackage customizer |
|
599 | + * |
|
600 | + * @return $lsx_controls array() |
|
601 | + */ |
|
602 | + function lsx_customizer_wc_controls( $lsx_controls ) { |
|
603 | + $lsx_controls['panels']['woocommerce'] = array( |
|
604 | + 'title' => esc_html__( 'WooCommerce', 'lsx' ), |
|
605 | + 'description' => esc_html__( 'Change the WooCommerce settings.', 'lsx' ), |
|
606 | + 'priority' => 23, |
|
607 | + ); |
|
608 | + |
|
609 | + /** |
|
610 | + * Global. |
|
611 | + */ |
|
612 | + |
|
613 | + $lsx_controls['sections']['lsx-wc-global'] = array( |
|
614 | + 'title' => esc_html__( 'LSX Global', 'lsx' ), |
|
615 | + 'description' => esc_html__( 'Change the WooCommerce global settings.', 'lsx' ), |
|
616 | + 'panel' => 'woocommerce', |
|
617 | + 'priority' => 1, |
|
618 | + ); |
|
619 | + |
|
620 | + $lsx_controls['settings']['lsx_wc_trust_footer_bar_status'] = array( |
|
621 | + 'default' => '1', |
|
622 | + 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
623 | + ); |
|
624 | + |
|
625 | + $lsx_controls['fields']['lsx_wc_trust_footer_bar_status'] = array( |
|
626 | + 'label' => esc_html__( 'Footer Trust Factors Section', 'lsx' ), |
|
627 | + 'description' => esc_html__( 'Enable the footer trust factors section.', 'lsx' ), |
|
628 | + 'section' => 'lsx-wc-global', |
|
629 | + 'type' => 'checkbox', |
|
630 | + 'priority' => 1, |
|
631 | + ); |
|
632 | + |
|
633 | + $lsx_controls['settings']['lsx_wc_mobile_footer_bar_status'] = array( |
|
634 | + 'default' => '1', |
|
635 | + 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
636 | + ); |
|
637 | + |
|
638 | + $lsx_controls['fields']['lsx_wc_mobile_footer_bar_status'] = array( |
|
639 | + 'label' => esc_html__( 'Footer Bar', 'lsx' ), |
|
640 | + 'description' => esc_html__( 'Enable the mobile footer bar.', 'lsx' ), |
|
641 | + 'section' => 'lsx-wc-global', |
|
642 | + 'type' => 'checkbox', |
|
643 | + 'priority' => 1, |
|
644 | + ); |
|
645 | + |
|
646 | + /** |
|
647 | + * Cart. |
|
648 | + */ |
|
649 | + |
|
650 | + $lsx_controls['sections']['lsx-wc-cart'] = array( |
|
651 | + 'title' => esc_html__( 'LSX Cart', 'lsx' ), |
|
652 | + 'description' => esc_html__( 'Change the WooCommerce cart settings.', 'lsx' ), |
|
653 | + 'panel' => 'woocommerce', |
|
654 | + 'priority' => 2, |
|
655 | + ); |
|
656 | + |
|
657 | + $lsx_controls['settings']['lsx_header_wc_cart'] = array( |
|
658 | + 'default' => false, |
|
659 | + 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
660 | + ); |
|
661 | + |
|
662 | + $lsx_controls['fields']['lsx_header_wc_cart'] = array( |
|
663 | + 'label' => esc_html__( 'Menu Item', 'lsx' ), |
|
664 | + 'description' => esc_html__( 'Enable the cart menu item.', 'lsx' ), |
|
665 | + 'section' => 'lsx-wc-cart', |
|
666 | + 'type' => 'checkbox', |
|
667 | + 'priority' => 1, |
|
668 | + ); |
|
669 | + |
|
670 | + return $lsx_controls; |
|
671 | + } |
|
672 | + |
|
673 | + add_filter( 'lsx_customizer_controls', 'lsx_customizer_wc_controls' ); |
|
674 | 674 | |
675 | 675 | endif; |
676 | 676 | |
677 | 677 | if ( ! function_exists( 'lsx_wc_global_header_title' ) ) : |
678 | 678 | |
679 | - /** |
|
680 | - * Move the shop title into the global header |
|
681 | - * |
|
682 | - * @package lsx |
|
683 | - * @subpackage the-events-calendar |
|
684 | - */ |
|
685 | - function lsx_wc_global_header_title( $title ) { |
|
679 | + /** |
|
680 | + * Move the shop title into the global header |
|
681 | + * |
|
682 | + * @package lsx |
|
683 | + * @subpackage the-events-calendar |
|
684 | + */ |
|
685 | + function lsx_wc_global_header_title( $title ) { |
|
686 | 686 | |
687 | - if ( is_woocommerce() && is_shop() ) { |
|
687 | + if ( is_woocommerce() && is_shop() ) { |
|
688 | 688 | |
689 | - $title = __( 'Shop', 'lsx' ); |
|
690 | - } |
|
689 | + $title = __( 'Shop', 'lsx' ); |
|
690 | + } |
|
691 | 691 | |
692 | - return $title; |
|
693 | - } |
|
694 | - add_filter( 'lsx_global_header_title', 'lsx_wc_global_header_title', 200, 1 ); |
|
692 | + return $title; |
|
693 | + } |
|
694 | + add_filter( 'lsx_global_header_title', 'lsx_wc_global_header_title', 200, 1 ); |
|
695 | 695 | |
696 | 696 | endif; |
697 | 697 | |
698 | 698 | |
699 | 699 | if ( ! function_exists( 'lsx_wc_footer_bar' ) ) : |
700 | 700 | |
701 | - /** |
|
702 | - * Display WC footer bar. |
|
703 | - * |
|
704 | - * @package lsx |
|
705 | - * @subpackage woocommerce |
|
706 | - */ |
|
707 | - function lsx_wc_footer_bar() { |
|
708 | - $cart_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : WC()->cart->get_cart_url(); |
|
709 | - if ( ! empty( get_theme_mod( 'lsx_wc_mobile_footer_bar_status', '1' ) ) ) : |
|
710 | - ?> |
|
701 | + /** |
|
702 | + * Display WC footer bar. |
|
703 | + * |
|
704 | + * @package lsx |
|
705 | + * @subpackage woocommerce |
|
706 | + */ |
|
707 | + function lsx_wc_footer_bar() { |
|
708 | + $cart_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : WC()->cart->get_cart_url(); |
|
709 | + if ( ! empty( get_theme_mod( 'lsx_wc_mobile_footer_bar_status', '1' ) ) ) : |
|
710 | + ?> |
|
711 | 711 | <div class="lsx-wc-footer-bar"> |
712 | 712 | <form role="search" method="get" action="<?php echo esc_url( home_url() ); ?>" class="lsx-wc-footer-bar-form"> |
713 | 713 | <fieldset> |
@@ -751,151 +751,151 @@ discard block |
||
751 | 751 | </ul> |
752 | 752 | </div> |
753 | 753 | <?php |
754 | - endif; |
|
755 | - } |
|
754 | + endif; |
|
755 | + } |
|
756 | 756 | |
757 | - add_action( 'lsx_body_bottom', 'lsx_wc_footer_bar', 15 ); |
|
757 | + add_action( 'lsx_body_bottom', 'lsx_wc_footer_bar', 15 ); |
|
758 | 758 | |
759 | 759 | endif; |
760 | 760 | |
761 | 761 | if ( ! function_exists( 'lsx_wc_body_class' ) ) : |
762 | 762 | |
763 | - /** |
|
764 | - * Changes body class. |
|
765 | - * |
|
766 | - * @package lsx |
|
767 | - * @subpackage woocommerce |
|
768 | - */ |
|
769 | - function lsx_wc_body_class( $classes ) { |
|
770 | - global $post; |
|
763 | + /** |
|
764 | + * Changes body class. |
|
765 | + * |
|
766 | + * @package lsx |
|
767 | + * @subpackage woocommerce |
|
768 | + */ |
|
769 | + function lsx_wc_body_class( $classes ) { |
|
770 | + global $post; |
|
771 | 771 | |
772 | - if ( $post && class_exists( 'WC_Wishlists_Pages' ) && WC_Wishlists_Pages::is_wishlist_page( $post->post_name ) ) { |
|
773 | - $classes[] = 'woocommerce-page woocommerce-wishlist'; |
|
774 | - } |
|
772 | + if ( $post && class_exists( 'WC_Wishlists_Pages' ) && WC_Wishlists_Pages::is_wishlist_page( $post->post_name ) ) { |
|
773 | + $classes[] = 'woocommerce-page woocommerce-wishlist'; |
|
774 | + } |
|
775 | 775 | |
776 | - if ( ! empty( get_theme_mod( 'lsx_wc_mobile_footer_bar_status', '1' ) ) ) { |
|
777 | - $classes[] = 'lsx-wc-has-footer-bar'; |
|
778 | - } |
|
776 | + if ( ! empty( get_theme_mod( 'lsx_wc_mobile_footer_bar_status', '1' ) ) ) { |
|
777 | + $classes[] = 'lsx-wc-has-footer-bar'; |
|
778 | + } |
|
779 | 779 | |
780 | - return $classes; |
|
781 | - } |
|
780 | + return $classes; |
|
781 | + } |
|
782 | 782 | |
783 | - add_filter( 'body_class', 'lsx_wc_body_class', 2999 ); |
|
783 | + add_filter( 'body_class', 'lsx_wc_body_class', 2999 ); |
|
784 | 784 | |
785 | 785 | endif; |
786 | 786 | |
787 | 787 | if ( ! function_exists( 'lsx_wc_downloadable_products' ) ) : |
788 | 788 | |
789 | - /** |
|
790 | - * Changes downloads "download" button text. |
|
791 | - * |
|
792 | - * @package lsx |
|
793 | - * @subpackage woocommerce |
|
794 | - */ |
|
795 | - function lsx_wc_downloadable_products( $downloads ) { |
|
796 | - foreach ( $downloads as $i => $download ) { |
|
797 | - $downloads[ $i ]['download_name'] = esc_html__( 'Download', 'lsx' ); |
|
798 | - } |
|
789 | + /** |
|
790 | + * Changes downloads "download" button text. |
|
791 | + * |
|
792 | + * @package lsx |
|
793 | + * @subpackage woocommerce |
|
794 | + */ |
|
795 | + function lsx_wc_downloadable_products( $downloads ) { |
|
796 | + foreach ( $downloads as $i => $download ) { |
|
797 | + $downloads[ $i ]['download_name'] = esc_html__( 'Download', 'lsx' ); |
|
798 | + } |
|
799 | 799 | |
800 | - return $downloads; |
|
801 | - } |
|
800 | + return $downloads; |
|
801 | + } |
|
802 | 802 | |
803 | - add_filter( 'woocommerce_customer_get_downloadable_products', 'lsx_wc_downloadable_products', 2999 ); |
|
803 | + add_filter( 'woocommerce_customer_get_downloadable_products', 'lsx_wc_downloadable_products', 2999 ); |
|
804 | 804 | |
805 | 805 | endif; |
806 | 806 | |
807 | 807 | if ( ! function_exists( 'lsx_wc_move_bundle_products' ) ) : |
808 | 808 | |
809 | - /** |
|
810 | - * WooCommerce - Move the bundle products to a tab. |
|
811 | - * |
|
812 | - * @package lsx |
|
813 | - * @subpackage woocommerce |
|
814 | - */ |
|
815 | - function lsx_wc_move_bundle_products( $tabs ) { |
|
816 | - global $product, $post; |
|
809 | + /** |
|
810 | + * WooCommerce - Move the bundle products to a tab. |
|
811 | + * |
|
812 | + * @package lsx |
|
813 | + * @subpackage woocommerce |
|
814 | + */ |
|
815 | + function lsx_wc_move_bundle_products( $tabs ) { |
|
816 | + global $product, $post; |
|
817 | 817 | |
818 | - if ( method_exists( $product, 'get_bundled_items' ) ) { |
|
819 | - $bundled_items = $product->get_bundled_items(); |
|
818 | + if ( method_exists( $product, 'get_bundled_items' ) ) { |
|
819 | + $bundled_items = $product->get_bundled_items(); |
|
820 | 820 | |
821 | - if ( ! empty( $bundled_items ) ) { |
|
822 | - $tabs['bundled_products'] = array( |
|
823 | - 'title' => __( 'Included Products', 'lsx' ), |
|
824 | - 'priority' => 10, |
|
825 | - 'callback' => 'lsx_wc_bundle_products', |
|
826 | - ); |
|
827 | - } |
|
828 | - } |
|
821 | + if ( ! empty( $bundled_items ) ) { |
|
822 | + $tabs['bundled_products'] = array( |
|
823 | + 'title' => __( 'Included Products', 'lsx' ), |
|
824 | + 'priority' => 10, |
|
825 | + 'callback' => 'lsx_wc_bundle_products', |
|
826 | + ); |
|
827 | + } |
|
828 | + } |
|
829 | 829 | |
830 | - if ( isset( $tabs['description'] ) ) { |
|
831 | - $tabs['description']['priority'] = 5; |
|
832 | - } |
|
830 | + if ( isset( $tabs['description'] ) ) { |
|
831 | + $tabs['description']['priority'] = 5; |
|
832 | + } |
|
833 | 833 | |
834 | - if ( isset( $tabs['reviews'] ) ) { |
|
835 | - $tabs['reviews']['priority'] = 15; |
|
836 | - } |
|
834 | + if ( isset( $tabs['reviews'] ) ) { |
|
835 | + $tabs['reviews']['priority'] = 15; |
|
836 | + } |
|
837 | 837 | |
838 | - if ( isset( $tabs['product_enquiry'] ) ) { |
|
839 | - $tabs['product_enquiry']['priority'] = 20; |
|
840 | - } |
|
838 | + if ( isset( $tabs['product_enquiry'] ) ) { |
|
839 | + $tabs['product_enquiry']['priority'] = 20; |
|
840 | + } |
|
841 | 841 | |
842 | - return $tabs; |
|
843 | - } |
|
842 | + return $tabs; |
|
843 | + } |
|
844 | 844 | |
845 | - add_action( 'woocommerce_product_tabs', 'lsx_wc_move_bundle_products', 50 ); |
|
845 | + add_action( 'woocommerce_product_tabs', 'lsx_wc_move_bundle_products', 50 ); |
|
846 | 846 | |
847 | 847 | endif; |
848 | 848 | |
849 | 849 | if ( ! function_exists( 'lsx_wc_bundle_products' ) ) : |
850 | 850 | |
851 | - function lsx_wc_bundle_products() { |
|
852 | - global $product, $post; |
|
851 | + function lsx_wc_bundle_products() { |
|
852 | + global $product, $post; |
|
853 | 853 | |
854 | - if ( method_exists( $product, 'get_bundled_items' ) ) { |
|
855 | - $bundled_items = $product->get_bundled_items(); |
|
854 | + if ( method_exists( $product, 'get_bundled_items' ) ) { |
|
855 | + $bundled_items = $product->get_bundled_items(); |
|
856 | 856 | |
857 | - // do_action( 'woocommerce_before_bundled_items', $product ); |
|
857 | + // do_action( 'woocommerce_before_bundled_items', $product ); |
|
858 | 858 | |
859 | - // foreach ( $bundled_items as $bundled_item ) { |
|
860 | - // do_action( 'woocommerce_bundled_item_details', $bundled_item, $product ); |
|
861 | - // } |
|
859 | + // foreach ( $bundled_items as $bundled_item ) { |
|
860 | + // do_action( 'woocommerce_bundled_item_details', $bundled_item, $product ); |
|
861 | + // } |
|
862 | 862 | |
863 | - // do_action( 'woocommerce_after_bundled_items', $product ); |
|
863 | + // do_action( 'woocommerce_after_bundled_items', $product ); |
|
864 | 864 | |
865 | - $product_original = $product; |
|
865 | + $product_original = $product; |
|
866 | 866 | |
867 | - // $this->widget_start( $args, $instance ); |
|
867 | + // $this->widget_start( $args, $instance ); |
|
868 | 868 | |
869 | - // @codingStandardsIgnoreLine |
|
870 | - echo apply_filters( 'woocommerce_before_widget_product_list', '<ul class="product_list_widget">' ); |
|
869 | + // @codingStandardsIgnoreLine |
|
870 | + echo apply_filters( 'woocommerce_before_widget_product_list', '<ul class="product_list_widget">' ); |
|
871 | 871 | |
872 | - foreach ( $bundled_items as $bundled_item ) { |
|
873 | - $product = wc_get_product( $bundled_item->item_data['product_id'] ); |
|
874 | - wc_get_template( 'content-widget-product.php' ); |
|
875 | - $product = $product_original; |
|
876 | - } |
|
872 | + foreach ( $bundled_items as $bundled_item ) { |
|
873 | + $product = wc_get_product( $bundled_item->item_data['product_id'] ); |
|
874 | + wc_get_template( 'content-widget-product.php' ); |
|
875 | + $product = $product_original; |
|
876 | + } |
|
877 | 877 | |
878 | - // @codingStandardsIgnoreLine |
|
879 | - echo apply_filters( 'woocommerce_after_widget_product_list', '</ul>' ); |
|
880 | - } |
|
878 | + // @codingStandardsIgnoreLine |
|
879 | + echo apply_filters( 'woocommerce_after_widget_product_list', '</ul>' ); |
|
880 | + } |
|
881 | 881 | |
882 | - // $this->widget_end( $args ); |
|
883 | - } |
|
882 | + // $this->widget_end( $args ); |
|
883 | + } |
|
884 | 884 | |
885 | 885 | endif; |
886 | 886 | |
887 | 887 | |
888 | 888 | if ( ! function_exists( 'lsx_wc_product_searchform' ) ) : |
889 | - /** |
|
890 | - * woo_custom_product_searchform |
|
891 | - * |
|
892 | - * @access public |
|
893 | - * @since 1.0 |
|
894 | - * @return void |
|
895 | - */ |
|
896 | - function lsx_wc_product_searchform( $form ) { |
|
897 | - |
|
898 | - $form = ' |
|
889 | + /** |
|
890 | + * woo_custom_product_searchform |
|
891 | + * |
|
892 | + * @access public |
|
893 | + * @since 1.0 |
|
894 | + * @return void |
|
895 | + */ |
|
896 | + function lsx_wc_product_searchform( $form ) { |
|
897 | + |
|
898 | + $form = ' |
|
899 | 899 | <form role="search" method="get" class="search-form form-inline" id="searchform" action="<?php echo esc_url( home_url( \'/\' ) ); ?>"> |
900 | 900 | <div class="input-group"> |
901 | 901 | <input type="search" value="<?php if ( is_search() ) { echo get_search_query(); } ?>" name="s" class="search-field form-control" placeholder="<?php esc_attr_e( \'Search\', \'lsx\' ); ?> <?php echo esc_attr( get_bloginfo( \'name\' ) ); ?>"> |
@@ -910,44 +910,44 @@ discard block |
||
910 | 910 | </form> |
911 | 911 | '; |
912 | 912 | |
913 | - return $form; |
|
913 | + return $form; |
|
914 | 914 | |
915 | - } |
|
915 | + } |
|
916 | 916 | endif; |
917 | 917 | add_filter( 'get_product_search_form', 'lsx_wc_product_searchform', 10, 1 ); |
918 | 918 | |
919 | - /** |
|
920 | - * Output the pagination. |
|
921 | - */ |
|
919 | + /** |
|
920 | + * Output the pagination. |
|
921 | + */ |
|
922 | 922 | function woocommerce_pagination() { |
923 | - if ( ! wc_get_loop_prop( 'is_paginated' ) || ! woocommerce_products_will_display() ) { |
|
924 | - return; |
|
925 | - } |
|
926 | - $args = array( |
|
927 | - 'total' => wc_get_loop_prop( 'total_pages' ), |
|
928 | - 'current' => wc_get_loop_prop( 'current_page' ), |
|
929 | - ); |
|
930 | - |
|
931 | - if ( wc_get_loop_prop( 'is_shortcode' ) ) { |
|
932 | - $args['base'] = esc_url_raw( add_query_arg( 'product-page', '%#%', false ) ); |
|
933 | - $args['format'] = '?product-page = %#%'; |
|
934 | - } else { |
|
935 | - $args['base'] = esc_url_raw( str_replace( 999999999, '%#%', remove_query_arg( 'add-to-cart', get_pagenum_link( 999999999, false ) ) ) ); |
|
936 | - $args['format'] = ''; |
|
937 | - } |
|
938 | - |
|
939 | - echo wp_kses_post( '<div class="lsx-pagination-wrapper">' ); |
|
940 | - $template = wc_get_template_html( 'loop/pagination.php', $args ); |
|
941 | - $template = str_replace( 'woocommerce-pagination', 'lsx-pagination', $template ); |
|
942 | - echo wp_kses_post( $template ); |
|
943 | - echo wp_kses_post( '</div>' ); |
|
923 | + if ( ! wc_get_loop_prop( 'is_paginated' ) || ! woocommerce_products_will_display() ) { |
|
924 | + return; |
|
925 | + } |
|
926 | + $args = array( |
|
927 | + 'total' => wc_get_loop_prop( 'total_pages' ), |
|
928 | + 'current' => wc_get_loop_prop( 'current_page' ), |
|
929 | + ); |
|
930 | + |
|
931 | + if ( wc_get_loop_prop( 'is_shortcode' ) ) { |
|
932 | + $args['base'] = esc_url_raw( add_query_arg( 'product-page', '%#%', false ) ); |
|
933 | + $args['format'] = '?product-page = %#%'; |
|
934 | + } else { |
|
935 | + $args['base'] = esc_url_raw( str_replace( 999999999, '%#%', remove_query_arg( 'add-to-cart', get_pagenum_link( 999999999, false ) ) ) ); |
|
936 | + $args['format'] = ''; |
|
937 | + } |
|
938 | + |
|
939 | + echo wp_kses_post( '<div class="lsx-pagination-wrapper">' ); |
|
940 | + $template = wc_get_template_html( 'loop/pagination.php', $args ); |
|
941 | + $template = str_replace( 'woocommerce-pagination', 'lsx-pagination', $template ); |
|
942 | + echo wp_kses_post( $template ); |
|
943 | + echo wp_kses_post( '</div>' ); |
|
944 | 944 | } |
945 | 945 | |
946 | 946 | function lsx_wc_pagination_args( $args ) { |
947 | - $args['prev_text'] = '<span class="meta-nav">←</span> ' . esc_html__( 'Previous', 'lsx' ); |
|
948 | - $args['next_text'] = esc_html__( 'Next', 'lsx' ) . ' <span class="meta-nav">→</span>'; |
|
949 | - $args['type'] = 'plain'; |
|
950 | - return $args; |
|
947 | + $args['prev_text'] = '<span class="meta-nav">←</span> ' . esc_html__( 'Previous', 'lsx' ); |
|
948 | + $args['next_text'] = esc_html__( 'Next', 'lsx' ) . ' <span class="meta-nav">→</span>'; |
|
949 | + $args['type'] = 'plain'; |
|
950 | + return $args; |
|
951 | 951 | } |
952 | 952 | add_filter( 'woocommerce_pagination_args', 'lsx_wc_pagination_args', 10, 1 ); |
953 | 953 | |
@@ -961,33 +961,33 @@ discard block |
||
961 | 961 | * @return array |
962 | 962 | */ |
963 | 963 | function lsx_wc_product_widget_template( $located, $template_name ) { |
964 | - if ( 'content-widget-product.php' === $template_name || 'content-widget-review.php' === $template_name ) { |
|
965 | - |
|
966 | - $new_location = get_stylesheet_directory() . '/partials/' . $template_name; |
|
967 | - if ( file_exists( $new_location ) ) { |
|
968 | - $located = $new_location; |
|
969 | - } else { |
|
970 | - $new_location = get_parent_theme_file_path() . '/partials/' . $template_name; |
|
971 | - if ( file_exists( $new_location ) ) { |
|
972 | - $located = $new_location; |
|
973 | - } |
|
974 | - } |
|
975 | - } |
|
976 | - return $located; |
|
964 | + if ( 'content-widget-product.php' === $template_name || 'content-widget-review.php' === $template_name ) { |
|
965 | + |
|
966 | + $new_location = get_stylesheet_directory() . '/partials/' . $template_name; |
|
967 | + if ( file_exists( $new_location ) ) { |
|
968 | + $located = $new_location; |
|
969 | + } else { |
|
970 | + $new_location = get_parent_theme_file_path() . '/partials/' . $template_name; |
|
971 | + if ( file_exists( $new_location ) ) { |
|
972 | + $located = $new_location; |
|
973 | + } |
|
974 | + } |
|
975 | + } |
|
976 | + return $located; |
|
977 | 977 | } |
978 | 978 | add_filter( 'wc_get_template', 'lsx_wc_product_widget_template', 90, 2 ); |
979 | 979 | |
980 | 980 | if ( ! function_exists( 'lsx_payment_gateway_logos' ) ) { |
981 | - /** |
|
982 | - * Add Lets Encrypt and PayFast logos to cart. |
|
983 | - **/ |
|
984 | - function lsx_payment_gateway_logos() { |
|
985 | - $encript_image = get_template_directory_uri() . '/assets/images/lets-encript.svg'; |
|
986 | - $payfast_image = get_template_directory_uri() . '/assets/images/payfast-footer-logo.svg'; |
|
987 | - $payment_logos = get_template_directory_uri() . '/assets/images/payment-logos.svg'; |
|
988 | - $payment_logos_mobile = get_template_directory_uri() . '/assets/images/payment-logos-mobile.svg'; |
|
989 | - if ( ( is_checkout() || is_cart() ) && ( ! empty( get_theme_mod( 'lsx_wc_trust_footer_bar_status', '1' ) ) ) ) { |
|
990 | - ?> |
|
981 | + /** |
|
982 | + * Add Lets Encrypt and PayFast logos to cart. |
|
983 | + **/ |
|
984 | + function lsx_payment_gateway_logos() { |
|
985 | + $encript_image = get_template_directory_uri() . '/assets/images/lets-encript.svg'; |
|
986 | + $payfast_image = get_template_directory_uri() . '/assets/images/payfast-footer-logo.svg'; |
|
987 | + $payment_logos = get_template_directory_uri() . '/assets/images/payment-logos.svg'; |
|
988 | + $payment_logos_mobile = get_template_directory_uri() . '/assets/images/payment-logos-mobile.svg'; |
|
989 | + if ( ( is_checkout() || is_cart() ) && ( ! empty( get_theme_mod( 'lsx_wc_trust_footer_bar_status', '1' ) ) ) ) { |
|
990 | + ?> |
|
991 | 991 | <div class="row text-center vertical-align lsx-full-width-base-small checkout-cta-bottom"> |
992 | 992 | <div class="col-md-12 img-payfast"> |
993 | 993 | <img src="<?php echo esc_url( $payfast_image ); ?>" alt="payfast"/> |
@@ -1004,12 +1004,12 @@ discard block |
||
1004 | 1004 | </div> |
1005 | 1005 | |
1006 | 1006 | <?php |
1007 | - } |
|
1008 | - } |
|
1009 | - include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
1010 | - |
|
1011 | - // check for plugin using plugin name. |
|
1012 | - if ( ! is_plugin_active( 'lsx-health-plan/lsx-health-plan.php' ) ) { |
|
1013 | - add_action( 'lsx_footer_before', 'lsx_payment_gateway_logos' ); |
|
1014 | - } |
|
1007 | + } |
|
1008 | + } |
|
1009 | + include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
1010 | + |
|
1011 | + // check for plugin using plugin name. |
|
1012 | + if ( ! is_plugin_active( 'lsx-health-plan/lsx-health-plan.php' ) ) { |
|
1013 | + add_action( 'lsx_footer_before', 'lsx_payment_gateway_logos' ); |
|
1014 | + } |
|
1015 | 1015 | } |
@@ -7,62 +7,62 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
10 | - exit; |
|
10 | + exit; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | if ( ! function_exists( 'lsx_widget_area_init' ) ) : |
14 | 14 | |
15 | - /** |
|
16 | - * Register widgetized area and update sidebar with default widgets. |
|
17 | - * |
|
18 | - * @package lsx |
|
19 | - * @subpackage widgets |
|
20 | - */ |
|
21 | - function lsx_widget_area_init() { |
|
22 | - register_sidebar( |
|
23 | - array( |
|
24 | - 'name' => esc_html__( 'Home', 'lsx' ), |
|
25 | - 'id' => 'sidebar-home', |
|
26 | - 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
|
27 | - 'after_widget' => '</aside>', |
|
28 | - 'before_title' => '<h3 class="widget-title">', |
|
29 | - 'after_title' => '</h3>', |
|
30 | - ) |
|
31 | - ); |
|
15 | + /** |
|
16 | + * Register widgetized area and update sidebar with default widgets. |
|
17 | + * |
|
18 | + * @package lsx |
|
19 | + * @subpackage widgets |
|
20 | + */ |
|
21 | + function lsx_widget_area_init() { |
|
22 | + register_sidebar( |
|
23 | + array( |
|
24 | + 'name' => esc_html__( 'Home', 'lsx' ), |
|
25 | + 'id' => 'sidebar-home', |
|
26 | + 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
|
27 | + 'after_widget' => '</aside>', |
|
28 | + 'before_title' => '<h3 class="widget-title">', |
|
29 | + 'after_title' => '</h3>', |
|
30 | + ) |
|
31 | + ); |
|
32 | 32 | |
33 | - register_sidebar( |
|
34 | - array( |
|
35 | - 'name' => esc_html__( 'Sidebar', 'lsx' ), |
|
36 | - 'id' => 'sidebar-1', |
|
37 | - 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
|
38 | - 'after_widget' => '</aside>', |
|
39 | - 'before_title' => '<h3 class="widget-title">', |
|
40 | - 'after_title' => '</h3>', |
|
41 | - ) |
|
42 | - ); |
|
33 | + register_sidebar( |
|
34 | + array( |
|
35 | + 'name' => esc_html__( 'Sidebar', 'lsx' ), |
|
36 | + 'id' => 'sidebar-1', |
|
37 | + 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
|
38 | + 'after_widget' => '</aside>', |
|
39 | + 'before_title' => '<h3 class="widget-title">', |
|
40 | + 'after_title' => '</h3>', |
|
41 | + ) |
|
42 | + ); |
|
43 | 43 | |
44 | - register_sidebar( |
|
45 | - array( |
|
46 | - 'name' => esc_html__( 'Footer', 'lsx' ), |
|
47 | - 'id' => 'sidebar-footer', |
|
48 | - 'before_widget' => '<div class="styler"><aside id="%1$s" class="widget %2$s">', |
|
49 | - 'after_widget' => '</aside></div>', |
|
50 | - 'before_title' => '<h3 class="widget-title">', |
|
51 | - 'after_title' => '</h3>', |
|
52 | - ) |
|
53 | - ); |
|
44 | + register_sidebar( |
|
45 | + array( |
|
46 | + 'name' => esc_html__( 'Footer', 'lsx' ), |
|
47 | + 'id' => 'sidebar-footer', |
|
48 | + 'before_widget' => '<div class="styler"><aside id="%1$s" class="widget %2$s">', |
|
49 | + 'after_widget' => '</aside></div>', |
|
50 | + 'before_title' => '<h3 class="widget-title">', |
|
51 | + 'after_title' => '</h3>', |
|
52 | + ) |
|
53 | + ); |
|
54 | 54 | |
55 | - register_sidebar( |
|
56 | - array( |
|
57 | - 'name' => esc_html__( 'Footer Call to Action', 'lsx' ), |
|
58 | - 'id' => 'sidebar-footer-cta', |
|
59 | - 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
|
60 | - 'after_widget' => '</aside>', |
|
61 | - 'before_title' => '<h3 class="widget-title">', |
|
62 | - 'after_title' => '</h3>', |
|
63 | - ) |
|
64 | - ); |
|
65 | - } |
|
55 | + register_sidebar( |
|
56 | + array( |
|
57 | + 'name' => esc_html__( 'Footer Call to Action', 'lsx' ), |
|
58 | + 'id' => 'sidebar-footer-cta', |
|
59 | + 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
|
60 | + 'after_widget' => '</aside>', |
|
61 | + 'before_title' => '<h3 class="widget-title">', |
|
62 | + 'after_title' => '</h3>', |
|
63 | + ) |
|
64 | + ); |
|
65 | + } |
|
66 | 66 | |
67 | 67 | endif; |
68 | 68 | |
@@ -70,24 +70,24 @@ discard block |
||
70 | 70 | |
71 | 71 | if ( ! function_exists( 'lsx_sidebar_footer_params' ) ) : |
72 | 72 | |
73 | - /** |
|
74 | - * Register widgetized area and update sidebar with default widgets. |
|
75 | - * |
|
76 | - * @package lsx |
|
77 | - * @subpackage widgets |
|
78 | - * @return $params |
|
79 | - */ |
|
80 | - function lsx_sidebar_footer_params( $params ) { |
|
81 | - $sidebar_id = $params[0]['id']; |
|
73 | + /** |
|
74 | + * Register widgetized area and update sidebar with default widgets. |
|
75 | + * |
|
76 | + * @package lsx |
|
77 | + * @subpackage widgets |
|
78 | + * @return $params |
|
79 | + */ |
|
80 | + function lsx_sidebar_footer_params( $params ) { |
|
81 | + $sidebar_id = $params[0]['id']; |
|
82 | 82 | |
83 | - if ( 'sidebar-footer' === $sidebar_id ) { |
|
84 | - $total_widgets = wp_get_sidebars_widgets(); |
|
85 | - $sidebar_widgets = count( $total_widgets[ $sidebar_id ] ); |
|
86 | - $params[0]['before_widget'] = str_replace( 'class="styler', 'class="col-md-' . floor( 12 / $sidebar_widgets ), $params[0]['before_widget'] ); |
|
87 | - } |
|
83 | + if ( 'sidebar-footer' === $sidebar_id ) { |
|
84 | + $total_widgets = wp_get_sidebars_widgets(); |
|
85 | + $sidebar_widgets = count( $total_widgets[ $sidebar_id ] ); |
|
86 | + $params[0]['before_widget'] = str_replace( 'class="styler', 'class="col-md-' . floor( 12 / $sidebar_widgets ), $params[0]['before_widget'] ); |
|
87 | + } |
|
88 | 88 | |
89 | - return $params; |
|
90 | - } |
|
89 | + return $params; |
|
90 | + } |
|
91 | 91 | |
92 | 92 | endif; |
93 | 93 |
@@ -7,52 +7,52 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
10 | - exit; |
|
10 | + exit; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | if ( ! function_exists( 'lsx_customizer_core_controls' ) ) : |
14 | 14 | |
15 | - /** |
|
16 | - * Returns an array of the core panel. |
|
17 | - * |
|
18 | - * @package lsx |
|
19 | - * @subpackage customizer |
|
20 | - * |
|
21 | - * @return $lsx_controls array() |
|
22 | - */ |
|
23 | - function lsx_customizer_core_controls( $lsx_controls ) { |
|
24 | - $lsx_controls['sections']['lsx-core'] = array( |
|
25 | - 'title' => esc_html__( 'Core Settings', 'lsx' ), |
|
26 | - 'description' => esc_html__( 'Change the core settings.', 'lsx' ), |
|
27 | - 'priority' => 21, |
|
28 | - ); |
|
29 | - |
|
30 | - $lsx_controls['settings']['lsx_preloader_content_status'] = array( |
|
31 | - 'default' => '1', |
|
32 | - 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
33 | - 'transport' => 'postMessage', |
|
34 | - ); |
|
35 | - |
|
36 | - $lsx_controls['fields']['lsx_preloader_content_status'] = array( |
|
37 | - 'label' => esc_html__( 'Preloader Content', 'lsx' ), |
|
38 | - 'section' => 'lsx-core', |
|
39 | - 'type' => 'checkbox', |
|
40 | - ); |
|
41 | - |
|
42 | - $lsx_controls['settings']['lsx_disable_fonts'] = array( |
|
43 | - 'default' => 0, |
|
44 | - 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
45 | - 'transport' => 'postMessage', |
|
46 | - ); |
|
47 | - |
|
48 | - $lsx_controls['fields']['lsx_disable_fonts'] = array( |
|
49 | - 'label' => esc_html__( 'Disable Fonts', 'lsx' ), |
|
50 | - 'section' => 'lsx-core', |
|
51 | - 'type' => 'checkbox', |
|
52 | - ); |
|
53 | - |
|
54 | - return $lsx_controls; |
|
55 | - } |
|
15 | + /** |
|
16 | + * Returns an array of the core panel. |
|
17 | + * |
|
18 | + * @package lsx |
|
19 | + * @subpackage customizer |
|
20 | + * |
|
21 | + * @return $lsx_controls array() |
|
22 | + */ |
|
23 | + function lsx_customizer_core_controls( $lsx_controls ) { |
|
24 | + $lsx_controls['sections']['lsx-core'] = array( |
|
25 | + 'title' => esc_html__( 'Core Settings', 'lsx' ), |
|
26 | + 'description' => esc_html__( 'Change the core settings.', 'lsx' ), |
|
27 | + 'priority' => 21, |
|
28 | + ); |
|
29 | + |
|
30 | + $lsx_controls['settings']['lsx_preloader_content_status'] = array( |
|
31 | + 'default' => '1', |
|
32 | + 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
33 | + 'transport' => 'postMessage', |
|
34 | + ); |
|
35 | + |
|
36 | + $lsx_controls['fields']['lsx_preloader_content_status'] = array( |
|
37 | + 'label' => esc_html__( 'Preloader Content', 'lsx' ), |
|
38 | + 'section' => 'lsx-core', |
|
39 | + 'type' => 'checkbox', |
|
40 | + ); |
|
41 | + |
|
42 | + $lsx_controls['settings']['lsx_disable_fonts'] = array( |
|
43 | + 'default' => 0, |
|
44 | + 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
45 | + 'transport' => 'postMessage', |
|
46 | + ); |
|
47 | + |
|
48 | + $lsx_controls['fields']['lsx_disable_fonts'] = array( |
|
49 | + 'label' => esc_html__( 'Disable Fonts', 'lsx' ), |
|
50 | + 'section' => 'lsx-core', |
|
51 | + 'type' => 'checkbox', |
|
52 | + ); |
|
53 | + |
|
54 | + return $lsx_controls; |
|
55 | + } |
|
56 | 56 | |
57 | 57 | endif; |
58 | 58 | |
@@ -60,110 +60,110 @@ discard block |
||
60 | 60 | |
61 | 61 | if ( ! function_exists( 'lsx_customizer_layout_controls' ) ) : |
62 | 62 | |
63 | - /** |
|
64 | - * Returns an array of the layout panel. |
|
65 | - * |
|
66 | - * @package lsx |
|
67 | - * @subpackage customizer |
|
68 | - * |
|
69 | - * @return $lsx_controls array() |
|
70 | - */ |
|
71 | - function lsx_customizer_layout_controls( $lsx_controls ) { |
|
72 | - $lsx_controls['sections']['lsx-layout'] = array( |
|
73 | - 'title' => esc_html__( 'Layout', 'lsx' ), |
|
74 | - 'description' => esc_html__( 'Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx' ), |
|
75 | - 'priority' => 22, |
|
76 | - ); |
|
77 | - |
|
78 | - $lsx_controls['settings']['lsx_header_layout'] = array( |
|
79 | - 'default' => 'inline', |
|
80 | - 'type' => 'theme_mod', |
|
81 | - 'transport' => 'postMessage', |
|
82 | - ); |
|
83 | - |
|
84 | - $lsx_controls['fields']['lsx_header_layout'] = array( |
|
85 | - 'label' => esc_html__( 'Header', 'lsx' ), |
|
86 | - 'section' => 'lsx-layout', |
|
87 | - 'control' => 'LSX_Customize_Header_Layout_Control', |
|
88 | - 'choices' => array( |
|
89 | - 'central', |
|
90 | - 'expanded', |
|
91 | - 'inline', |
|
92 | - ), |
|
93 | - ); |
|
94 | - |
|
95 | - $lsx_controls['settings']['lsx_header_mobile_layout'] = array( |
|
96 | - 'default' => 'navigation-bar', |
|
97 | - 'type' => 'theme_mod', |
|
98 | - 'transport' => 'postMessage', |
|
99 | - ); |
|
100 | - |
|
101 | - $lsx_controls['fields']['lsx_header_mobile_layout'] = array( |
|
102 | - 'label' => esc_html__( 'Mobile Header', 'lsx' ), |
|
103 | - 'section' => 'lsx-layout', |
|
104 | - 'control' => 'LSX_Customize_Mobile_Header_Layout_Control', |
|
105 | - 'choices' => array( |
|
106 | - 'navigation-bar', |
|
107 | - 'hamburger', |
|
108 | - ), |
|
109 | - ); |
|
110 | - |
|
111 | - $lsx_controls['settings']['lsx_layout'] = array( |
|
112 | - 'default' => '1c', |
|
113 | - 'type' => 'theme_mod', |
|
114 | - 'transport' => 'refresh', |
|
115 | - ); |
|
116 | - |
|
117 | - $lsx_controls['fields']['lsx_layout'] = array( |
|
118 | - 'label' => esc_html__( 'Body', 'lsx' ), |
|
119 | - 'section' => 'lsx-layout', |
|
120 | - 'control' => 'LSX_Customize_Layout_Control', |
|
121 | - 'choices' => array( |
|
122 | - '1c', |
|
123 | - '2cr', |
|
124 | - '2cl', |
|
125 | - ), |
|
126 | - ); |
|
127 | - |
|
128 | - $lsx_controls['settings']['lsx_header_fixed'] = array( |
|
129 | - 'default' => false, |
|
130 | - 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
131 | - 'transport' => 'postMessage', |
|
132 | - ); |
|
133 | - |
|
134 | - $lsx_controls['fields']['lsx_header_fixed'] = array( |
|
135 | - 'label' => esc_html__( 'Fixed Header', 'lsx' ), |
|
136 | - 'section' => 'lsx-layout', |
|
137 | - 'type' => 'checkbox', |
|
138 | - ); |
|
139 | - |
|
140 | - $lsx_controls['settings']['lsx_header_search'] = array( |
|
141 | - 'default' => false, |
|
142 | - 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
143 | - 'transport' => 'postMessage', |
|
144 | - ); |
|
145 | - |
|
146 | - $lsx_controls['fields']['lsx_header_search'] = array( |
|
147 | - 'label' => esc_html__( 'Search Box in Header', 'lsx' ), |
|
148 | - 'section' => 'lsx-layout', |
|
149 | - 'type' => 'checkbox', |
|
150 | - ); |
|
151 | - |
|
152 | - $lsx_controls['selective_refresh']['lsx_header_search'] = array( |
|
153 | - 'selector' => '#lsx-header-search-css', |
|
154 | - 'render_callback' => function() { |
|
155 | - $search_form = get_theme_mod( 'lsx_header_search' ); |
|
156 | - |
|
157 | - if ( false !== $search_form ) { |
|
158 | - echo 'body #searchform { display: block; }'; |
|
159 | - } else { |
|
160 | - echo 'body #searchform { display: none; }'; |
|
161 | - } |
|
162 | - }, |
|
163 | - ); |
|
164 | - |
|
165 | - return $lsx_controls; |
|
166 | - } |
|
63 | + /** |
|
64 | + * Returns an array of the layout panel. |
|
65 | + * |
|
66 | + * @package lsx |
|
67 | + * @subpackage customizer |
|
68 | + * |
|
69 | + * @return $lsx_controls array() |
|
70 | + */ |
|
71 | + function lsx_customizer_layout_controls( $lsx_controls ) { |
|
72 | + $lsx_controls['sections']['lsx-layout'] = array( |
|
73 | + 'title' => esc_html__( 'Layout', 'lsx' ), |
|
74 | + 'description' => esc_html__( 'Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx' ), |
|
75 | + 'priority' => 22, |
|
76 | + ); |
|
77 | + |
|
78 | + $lsx_controls['settings']['lsx_header_layout'] = array( |
|
79 | + 'default' => 'inline', |
|
80 | + 'type' => 'theme_mod', |
|
81 | + 'transport' => 'postMessage', |
|
82 | + ); |
|
83 | + |
|
84 | + $lsx_controls['fields']['lsx_header_layout'] = array( |
|
85 | + 'label' => esc_html__( 'Header', 'lsx' ), |
|
86 | + 'section' => 'lsx-layout', |
|
87 | + 'control' => 'LSX_Customize_Header_Layout_Control', |
|
88 | + 'choices' => array( |
|
89 | + 'central', |
|
90 | + 'expanded', |
|
91 | + 'inline', |
|
92 | + ), |
|
93 | + ); |
|
94 | + |
|
95 | + $lsx_controls['settings']['lsx_header_mobile_layout'] = array( |
|
96 | + 'default' => 'navigation-bar', |
|
97 | + 'type' => 'theme_mod', |
|
98 | + 'transport' => 'postMessage', |
|
99 | + ); |
|
100 | + |
|
101 | + $lsx_controls['fields']['lsx_header_mobile_layout'] = array( |
|
102 | + 'label' => esc_html__( 'Mobile Header', 'lsx' ), |
|
103 | + 'section' => 'lsx-layout', |
|
104 | + 'control' => 'LSX_Customize_Mobile_Header_Layout_Control', |
|
105 | + 'choices' => array( |
|
106 | + 'navigation-bar', |
|
107 | + 'hamburger', |
|
108 | + ), |
|
109 | + ); |
|
110 | + |
|
111 | + $lsx_controls['settings']['lsx_layout'] = array( |
|
112 | + 'default' => '1c', |
|
113 | + 'type' => 'theme_mod', |
|
114 | + 'transport' => 'refresh', |
|
115 | + ); |
|
116 | + |
|
117 | + $lsx_controls['fields']['lsx_layout'] = array( |
|
118 | + 'label' => esc_html__( 'Body', 'lsx' ), |
|
119 | + 'section' => 'lsx-layout', |
|
120 | + 'control' => 'LSX_Customize_Layout_Control', |
|
121 | + 'choices' => array( |
|
122 | + '1c', |
|
123 | + '2cr', |
|
124 | + '2cl', |
|
125 | + ), |
|
126 | + ); |
|
127 | + |
|
128 | + $lsx_controls['settings']['lsx_header_fixed'] = array( |
|
129 | + 'default' => false, |
|
130 | + 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
131 | + 'transport' => 'postMessage', |
|
132 | + ); |
|
133 | + |
|
134 | + $lsx_controls['fields']['lsx_header_fixed'] = array( |
|
135 | + 'label' => esc_html__( 'Fixed Header', 'lsx' ), |
|
136 | + 'section' => 'lsx-layout', |
|
137 | + 'type' => 'checkbox', |
|
138 | + ); |
|
139 | + |
|
140 | + $lsx_controls['settings']['lsx_header_search'] = array( |
|
141 | + 'default' => false, |
|
142 | + 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
143 | + 'transport' => 'postMessage', |
|
144 | + ); |
|
145 | + |
|
146 | + $lsx_controls['fields']['lsx_header_search'] = array( |
|
147 | + 'label' => esc_html__( 'Search Box in Header', 'lsx' ), |
|
148 | + 'section' => 'lsx-layout', |
|
149 | + 'type' => 'checkbox', |
|
150 | + ); |
|
151 | + |
|
152 | + $lsx_controls['selective_refresh']['lsx_header_search'] = array( |
|
153 | + 'selector' => '#lsx-header-search-css', |
|
154 | + 'render_callback' => function() { |
|
155 | + $search_form = get_theme_mod( 'lsx_header_search' ); |
|
156 | + |
|
157 | + if ( false !== $search_form ) { |
|
158 | + echo 'body #searchform { display: block; }'; |
|
159 | + } else { |
|
160 | + echo 'body #searchform { display: none; }'; |
|
161 | + } |
|
162 | + }, |
|
163 | + ); |
|
164 | + |
|
165 | + return $lsx_controls; |
|
166 | + } |
|
167 | 167 | |
168 | 168 | endif; |
169 | 169 | |
@@ -171,80 +171,80 @@ discard block |
||
171 | 171 | |
172 | 172 | if ( ! function_exists( 'lsx_customizer_template_cover_controls' ) ) : |
173 | 173 | |
174 | - /** |
|
175 | - * Returns an array of the Cover Template panel. |
|
176 | - * |
|
177 | - * @package lsx |
|
178 | - * @subpackage customizer |
|
179 | - * |
|
180 | - * @return $lsx_controls array() |
|
181 | - */ |
|
182 | - function lsx_customizer_template_cover_controls( $lsx_controls ) { |
|
183 | - $lsx_controls['sections']['lsx-cover-template'] = array( |
|
184 | - 'title' => esc_html__( 'Cover Template Settings', 'lsx' ), |
|
185 | - 'description' => esc_html__( 'Change the cover template settings.', 'lsx' ), |
|
186 | - 'priority' => 23, |
|
187 | - ); |
|
188 | - |
|
189 | - $lsx_controls['settings']['lsx_cover_template_fixed_background'] = array( |
|
190 | - 'default' => '1', |
|
191 | - 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
192 | - 'transport' => 'postMessage', |
|
193 | - ); |
|
194 | - |
|
195 | - $lsx_controls['fields']['lsx_cover_template_fixed_background'] = array( |
|
196 | - 'label' => esc_html__( 'Fixed Background Image', 'lsx' ), |
|
197 | - 'section' => 'lsx-cover-template', |
|
198 | - 'type' => 'checkbox', |
|
199 | - ); |
|
200 | - |
|
201 | - $lsx_controls['settings']['lsx_cover_template_overlay_background_color'] = array( |
|
202 | - 'default' => '#000000', |
|
203 | - 'sanitize_callback' => 'sanitize_hex_color', |
|
204 | - 'type' => 'theme_mod', |
|
205 | - 'transport' => 'postMessage', |
|
206 | - ); |
|
207 | - |
|
208 | - $lsx_controls['fields']['lsx_cover_template_overlay_background_color'] = array( |
|
209 | - 'label' => esc_html__( 'Overlay Background Color', 'lsx' ), |
|
210 | - 'description' => __( 'The color used for the overlay. Defaults to black.', 'lsx' ), |
|
211 | - 'section' => 'lsx-cover-template', |
|
212 | - 'control' => 'WP_Customize_Color_Control', |
|
213 | - ); |
|
214 | - |
|
215 | - $lsx_controls['settings']['lsx_cover_template_overlay_text_color'] = array( |
|
216 | - 'default' => '#ffffff', |
|
217 | - 'sanitize_callback' => 'sanitize_hex_color', |
|
218 | - 'type' => 'theme_mod', |
|
219 | - 'transport' => 'postMessage', |
|
220 | - ); |
|
221 | - |
|
222 | - $lsx_controls['fields']['lsx_cover_template_overlay_text_color'] = ( |
|
223 | - array( |
|
224 | - 'label' => __( 'Overlay Text Color', 'lsx' ), |
|
225 | - 'description' => __( 'The color used for the text in the overlay.', 'lsx' ), |
|
226 | - 'section' => 'lsx-cover-template', |
|
227 | - 'control' => 'WP_Customize_Color_Control', |
|
228 | - ) |
|
229 | - ); |
|
230 | - |
|
231 | - $lsx_controls['settings']['lsx_cover_template_overlay_opacity'] = array( |
|
232 | - 'default' => 80, |
|
233 | - 'sanitize_callback' => 'absint', |
|
234 | - 'transport' => 'postMessage', |
|
235 | - ); |
|
236 | - |
|
237 | - $lsx_controls['fields']['lsx_cover_template_overlay_opacity'] = ( |
|
238 | - array( |
|
239 | - 'label' => __( 'Overlay Opacity', 'lsx' ), |
|
240 | - 'description' => __( 'Make sure that the contrast is high enough so that the text is readable.', 'lsx' ), |
|
241 | - 'section' => 'lsx-cover-template', |
|
242 | - 'type' => 'range', |
|
243 | - ) |
|
244 | - ); |
|
245 | - |
|
246 | - return $lsx_controls; |
|
247 | - } |
|
174 | + /** |
|
175 | + * Returns an array of the Cover Template panel. |
|
176 | + * |
|
177 | + * @package lsx |
|
178 | + * @subpackage customizer |
|
179 | + * |
|
180 | + * @return $lsx_controls array() |
|
181 | + */ |
|
182 | + function lsx_customizer_template_cover_controls( $lsx_controls ) { |
|
183 | + $lsx_controls['sections']['lsx-cover-template'] = array( |
|
184 | + 'title' => esc_html__( 'Cover Template Settings', 'lsx' ), |
|
185 | + 'description' => esc_html__( 'Change the cover template settings.', 'lsx' ), |
|
186 | + 'priority' => 23, |
|
187 | + ); |
|
188 | + |
|
189 | + $lsx_controls['settings']['lsx_cover_template_fixed_background'] = array( |
|
190 | + 'default' => '1', |
|
191 | + 'sanitize_callback' => 'lsx_sanitize_checkbox', |
|
192 | + 'transport' => 'postMessage', |
|
193 | + ); |
|
194 | + |
|
195 | + $lsx_controls['fields']['lsx_cover_template_fixed_background'] = array( |
|
196 | + 'label' => esc_html__( 'Fixed Background Image', 'lsx' ), |
|
197 | + 'section' => 'lsx-cover-template', |
|
198 | + 'type' => 'checkbox', |
|
199 | + ); |
|
200 | + |
|
201 | + $lsx_controls['settings']['lsx_cover_template_overlay_background_color'] = array( |
|
202 | + 'default' => '#000000', |
|
203 | + 'sanitize_callback' => 'sanitize_hex_color', |
|
204 | + 'type' => 'theme_mod', |
|
205 | + 'transport' => 'postMessage', |
|
206 | + ); |
|
207 | + |
|
208 | + $lsx_controls['fields']['lsx_cover_template_overlay_background_color'] = array( |
|
209 | + 'label' => esc_html__( 'Overlay Background Color', 'lsx' ), |
|
210 | + 'description' => __( 'The color used for the overlay. Defaults to black.', 'lsx' ), |
|
211 | + 'section' => 'lsx-cover-template', |
|
212 | + 'control' => 'WP_Customize_Color_Control', |
|
213 | + ); |
|
214 | + |
|
215 | + $lsx_controls['settings']['lsx_cover_template_overlay_text_color'] = array( |
|
216 | + 'default' => '#ffffff', |
|
217 | + 'sanitize_callback' => 'sanitize_hex_color', |
|
218 | + 'type' => 'theme_mod', |
|
219 | + 'transport' => 'postMessage', |
|
220 | + ); |
|
221 | + |
|
222 | + $lsx_controls['fields']['lsx_cover_template_overlay_text_color'] = ( |
|
223 | + array( |
|
224 | + 'label' => __( 'Overlay Text Color', 'lsx' ), |
|
225 | + 'description' => __( 'The color used for the text in the overlay.', 'lsx' ), |
|
226 | + 'section' => 'lsx-cover-template', |
|
227 | + 'control' => 'WP_Customize_Color_Control', |
|
228 | + ) |
|
229 | + ); |
|
230 | + |
|
231 | + $lsx_controls['settings']['lsx_cover_template_overlay_opacity'] = array( |
|
232 | + 'default' => 80, |
|
233 | + 'sanitize_callback' => 'absint', |
|
234 | + 'transport' => 'postMessage', |
|
235 | + ); |
|
236 | + |
|
237 | + $lsx_controls['fields']['lsx_cover_template_overlay_opacity'] = ( |
|
238 | + array( |
|
239 | + 'label' => __( 'Overlay Opacity', 'lsx' ), |
|
240 | + 'description' => __( 'Make sure that the contrast is high enough so that the text is readable.', 'lsx' ), |
|
241 | + 'section' => 'lsx-cover-template', |
|
242 | + 'type' => 'range', |
|
243 | + ) |
|
244 | + ); |
|
245 | + |
|
246 | + return $lsx_controls; |
|
247 | + } |
|
248 | 248 | |
249 | 249 | endif; |
250 | 250 | |
@@ -253,19 +253,19 @@ discard block |
||
253 | 253 | |
254 | 254 | if ( ! function_exists( 'lsx_get_customizer_controls' ) ) : |
255 | 255 | |
256 | - /** |
|
257 | - * Returns an array of $controls for the customizer class to generate. |
|
258 | - * |
|
259 | - * @package lsx |
|
260 | - * @subpackage customizer |
|
261 | - * |
|
262 | - * @return $lsx_controls array() |
|
263 | - */ |
|
264 | - function lsx_get_customizer_controls() { |
|
265 | - $lsx_controls = array(); |
|
266 | - $lsx_controls = apply_filters( 'lsx_customizer_controls', $lsx_controls ); |
|
267 | - return $lsx_controls; |
|
268 | - } |
|
256 | + /** |
|
257 | + * Returns an array of $controls for the customizer class to generate. |
|
258 | + * |
|
259 | + * @package lsx |
|
260 | + * @subpackage customizer |
|
261 | + * |
|
262 | + * @return $lsx_controls array() |
|
263 | + */ |
|
264 | + function lsx_get_customizer_controls() { |
|
265 | + $lsx_controls = array(); |
|
266 | + $lsx_controls = apply_filters( 'lsx_customizer_controls', $lsx_controls ); |
|
267 | + return $lsx_controls; |
|
268 | + } |
|
269 | 269 | |
270 | 270 | endif; |
271 | 271 |
@@ -7,112 +7,112 @@ |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
10 | - exit; |
|
10 | + exit; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | if ( ! function_exists( 'lsx_sanitize_choices' ) ) : |
14 | 14 | |
15 | - /** |
|
16 | - * Sanitize a value from a list of allowed values. |
|
17 | - * |
|
18 | - * @package lsx |
|
19 | - * @subpackage sanitize |
|
20 | - * |
|
21 | - * @param mixed $value The value to sanitize. |
|
22 | - * @param mixed $setting The setting for which the sanitizing is occurring. |
|
23 | - * @return mixed The sanitized value. |
|
24 | - */ |
|
25 | - function lsx_sanitize_choices( $value, $setting ) { |
|
26 | - if ( is_object( $setting ) ) { |
|
27 | - $setting = $setting->id; |
|
28 | - } |
|
29 | - |
|
30 | - $choices = lsx_customizer_sanitize_get_choices( $setting ); |
|
31 | - |
|
32 | - if ( ! is_wp_error( $choices ) && ! empty( $choices ) ) { |
|
33 | - $allowed_choices = array_keys( $choices ); |
|
34 | - |
|
35 | - if ( ! in_array( $value, $allowed_choices ) ) { |
|
36 | - $value = lsx_customizer_sanitize_get_default( $setting ); |
|
37 | - } |
|
38 | - |
|
39 | - return $value; |
|
40 | - } else { |
|
41 | - return $choices; |
|
42 | - } |
|
43 | - } |
|
15 | + /** |
|
16 | + * Sanitize a value from a list of allowed values. |
|
17 | + * |
|
18 | + * @package lsx |
|
19 | + * @subpackage sanitize |
|
20 | + * |
|
21 | + * @param mixed $value The value to sanitize. |
|
22 | + * @param mixed $setting The setting for which the sanitizing is occurring. |
|
23 | + * @return mixed The sanitized value. |
|
24 | + */ |
|
25 | + function lsx_sanitize_choices( $value, $setting ) { |
|
26 | + if ( is_object( $setting ) ) { |
|
27 | + $setting = $setting->id; |
|
28 | + } |
|
29 | + |
|
30 | + $choices = lsx_customizer_sanitize_get_choices( $setting ); |
|
31 | + |
|
32 | + if ( ! is_wp_error( $choices ) && ! empty( $choices ) ) { |
|
33 | + $allowed_choices = array_keys( $choices ); |
|
34 | + |
|
35 | + if ( ! in_array( $value, $allowed_choices ) ) { |
|
36 | + $value = lsx_customizer_sanitize_get_default( $setting ); |
|
37 | + } |
|
38 | + |
|
39 | + return $value; |
|
40 | + } else { |
|
41 | + return $choices; |
|
42 | + } |
|
43 | + } |
|
44 | 44 | |
45 | 45 | endif; |
46 | 46 | |
47 | 47 | if ( ! function_exists( 'lsx_customizer_sanitize_get_choices' ) ) : |
48 | 48 | |
49 | - /** |
|
50 | - * Helper function to return the choices for a field. |
|
51 | - * |
|
52 | - * @package lsx |
|
53 | - * @subpackage sanitize |
|
54 | - * |
|
55 | - * @param string |
|
56 | - * @return mixed $field |
|
57 | - */ |
|
58 | - function lsx_customizer_sanitize_get_choices( $id ) { |
|
59 | - global $lsx_customizer; |
|
49 | + /** |
|
50 | + * Helper function to return the choices for a field. |
|
51 | + * |
|
52 | + * @package lsx |
|
53 | + * @subpackage sanitize |
|
54 | + * |
|
55 | + * @param string |
|
56 | + * @return mixed $field |
|
57 | + */ |
|
58 | + function lsx_customizer_sanitize_get_choices( $id ) { |
|
59 | + global $lsx_customizer; |
|
60 | 60 | |
61 | - $can_validate = method_exists( 'WP_Customize_Setting', 'validate' ); |
|
62 | - $field = $lsx_customizer->get_control( $id ); |
|
61 | + $can_validate = method_exists( 'WP_Customize_Setting', 'validate' ); |
|
62 | + $field = $lsx_customizer->get_control( $id ); |
|
63 | 63 | |
64 | - if ( ! isset( $field['choices'] ) ) { |
|
65 | - return $can_validate ? new WP_Error( 'notexists', esc_html__( 'Choice doesn\'t exist', 'lsx' ) ) : false; |
|
66 | - } |
|
64 | + if ( ! isset( $field['choices'] ) ) { |
|
65 | + return $can_validate ? new WP_Error( 'notexists', esc_html__( 'Choice doesn\'t exist', 'lsx' ) ) : false; |
|
66 | + } |
|
67 | 67 | |
68 | - return $field['choices']; |
|
69 | - } |
|
68 | + return $field['choices']; |
|
69 | + } |
|
70 | 70 | |
71 | 71 | endif; |
72 | 72 | |
73 | 73 | if ( ! function_exists( 'lsx_customizer_sanitize_get_default' ) ) : |
74 | 74 | |
75 | - /** |
|
76 | - * Helper function to return defaults. |
|
77 | - * |
|
78 | - * @package lsx |
|
79 | - * @subpackage sanitize |
|
80 | - * |
|
81 | - * @param string |
|
82 | - * @return mixed $default |
|
83 | - */ |
|
84 | - function lsx_customizer_sanitize_get_default( $id ) { |
|
85 | - global $lsx_customizer; |
|
86 | - $setting = $lsx_customizer->get_setting( $id ); |
|
87 | - |
|
88 | - if ( isset( $setting['default'] ) ) { |
|
89 | - return $setting['default']; |
|
90 | - } |
|
91 | - |
|
92 | - return false; |
|
93 | - } |
|
75 | + /** |
|
76 | + * Helper function to return defaults. |
|
77 | + * |
|
78 | + * @package lsx |
|
79 | + * @subpackage sanitize |
|
80 | + * |
|
81 | + * @param string |
|
82 | + * @return mixed $default |
|
83 | + */ |
|
84 | + function lsx_customizer_sanitize_get_default( $id ) { |
|
85 | + global $lsx_customizer; |
|
86 | + $setting = $lsx_customizer->get_setting( $id ); |
|
87 | + |
|
88 | + if ( isset( $setting['default'] ) ) { |
|
89 | + return $setting['default']; |
|
90 | + } |
|
91 | + |
|
92 | + return false; |
|
93 | + } |
|
94 | 94 | |
95 | 95 | endif; |
96 | 96 | |
97 | 97 | if ( ! function_exists( 'lsx_sanitize_checkbox' ) ) : |
98 | 98 | |
99 | - /** |
|
100 | - * Sanitizes an single or multiple checkbox input. |
|
101 | - * |
|
102 | - * @package lsx |
|
103 | - * @subpackage sanitize |
|
104 | - * |
|
105 | - * @param array $input |
|
106 | - * @return array $output |
|
107 | - */ |
|
108 | - function lsx_sanitize_checkbox( $input ) { |
|
109 | - $can_validate = method_exists( 'WP_Customize_Setting', 'validate' ); |
|
110 | - |
|
111 | - if ( ! is_bool( $input ) ) { |
|
112 | - return $can_validate ? new WP_Error( 'notboolean', esc_html__( 'Not a boolean', 'lsx' ) ) : false; |
|
113 | - } |
|
114 | - |
|
115 | - return $input; |
|
116 | - } |
|
99 | + /** |
|
100 | + * Sanitizes an single or multiple checkbox input. |
|
101 | + * |
|
102 | + * @package lsx |
|
103 | + * @subpackage sanitize |
|
104 | + * |
|
105 | + * @param array $input |
|
106 | + * @return array $output |
|
107 | + */ |
|
108 | + function lsx_sanitize_checkbox( $input ) { |
|
109 | + $can_validate = method_exists( 'WP_Customize_Setting', 'validate' ); |
|
110 | + |
|
111 | + if ( ! is_bool( $input ) ) { |
|
112 | + return $can_validate ? new WP_Error( 'notboolean', esc_html__( 'Not a boolean', 'lsx' ) ) : false; |
|
113 | + } |
|
114 | + |
|
115 | + return $input; |
|
116 | + } |
|
117 | 117 | |
118 | 118 | endif; |
@@ -7,59 +7,59 @@ |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
10 | - exit; |
|
10 | + exit; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | if ( ! class_exists( 'LSX_Yoast' ) ) : |
14 | 14 | |
15 | - /** |
|
16 | - * The LSX Yoast integration class |
|
17 | - */ |
|
18 | - class LSX_Yoast { |
|
15 | + /** |
|
16 | + * The LSX Yoast integration class |
|
17 | + */ |
|
18 | + class LSX_Yoast { |
|
19 | 19 | |
20 | - /** |
|
21 | - * Holds class instance |
|
22 | - * |
|
23 | - * @since 1.0.0 |
|
24 | - * @var object |
|
25 | - */ |
|
26 | - protected static $instance = null; |
|
20 | + /** |
|
21 | + * Holds class instance |
|
22 | + * |
|
23 | + * @since 1.0.0 |
|
24 | + * @var object |
|
25 | + */ |
|
26 | + protected static $instance = null; |
|
27 | 27 | |
28 | - /** |
|
29 | - * Setup class. |
|
30 | - * |
|
31 | - * @since 1.0 |
|
32 | - */ |
|
33 | - public function __construct() { |
|
28 | + /** |
|
29 | + * Setup class. |
|
30 | + * |
|
31 | + * @since 1.0 |
|
32 | + */ |
|
33 | + public function __construct() { |
|
34 | 34 | |
35 | - add_action( 'wp_enqueue_scripts', array( $this, 'lsx_yoast_scripts_add_styles' ) ); |
|
36 | - } |
|
35 | + add_action( 'wp_enqueue_scripts', array( $this, 'lsx_yoast_scripts_add_styles' ) ); |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * Return an instance of this class. |
|
40 | - * |
|
41 | - * @since 1.0.0 |
|
42 | - * @return object A single instance of this class. |
|
43 | - */ |
|
44 | - public static function get_instance() { |
|
45 | - // If the single instance hasn't been set, set it now. |
|
46 | - if ( null === self::$instance ) { |
|
47 | - self::$instance = new self(); |
|
48 | - } |
|
49 | - return self::$instance; |
|
50 | - } |
|
38 | + /** |
|
39 | + * Return an instance of this class. |
|
40 | + * |
|
41 | + * @since 1.0.0 |
|
42 | + * @return object A single instance of this class. |
|
43 | + */ |
|
44 | + public static function get_instance() { |
|
45 | + // If the single instance hasn't been set, set it now. |
|
46 | + if ( null === self::$instance ) { |
|
47 | + self::$instance = new self(); |
|
48 | + } |
|
49 | + return self::$instance; |
|
50 | + } |
|
51 | 51 | |
52 | - /** |
|
53 | - * Yoast enqueue styles. |
|
54 | - * |
|
55 | - * @package lsx |
|
56 | - * @subpackage yoast |
|
57 | - */ |
|
58 | - public function lsx_yoast_scripts_add_styles() { |
|
59 | - wp_enqueue_script( 'lsx_yoast_js', get_template_directory_uri() . '/assets/js/yoast/yoast.js', array( 'jquery' ), LSX_VERSION, true ); |
|
60 | - wp_enqueue_style( 'lsx_yoast_css', get_template_directory_uri() . '/assets/css/yoast/yoast.css', array( 'lsx_main' ), LSX_VERSION ); |
|
61 | - } |
|
62 | - } |
|
52 | + /** |
|
53 | + * Yoast enqueue styles. |
|
54 | + * |
|
55 | + * @package lsx |
|
56 | + * @subpackage yoast |
|
57 | + */ |
|
58 | + public function lsx_yoast_scripts_add_styles() { |
|
59 | + wp_enqueue_script( 'lsx_yoast_js', get_template_directory_uri() . '/assets/js/yoast/yoast.js', array( 'jquery' ), LSX_VERSION, true ); |
|
60 | + wp_enqueue_style( 'lsx_yoast_css', get_template_directory_uri() . '/assets/css/yoast/yoast.css', array( 'lsx_main' ), LSX_VERSION ); |
|
61 | + } |
|
62 | + } |
|
63 | 63 | |
64 | 64 | endif; |
65 | 65 |
@@ -7,210 +7,210 @@ |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
10 | - exit; |
|
10 | + exit; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | if ( ! function_exists( 'lsx_tec_scripts_add_styles' ) ) : |
14 | 14 | |
15 | - /** |
|
16 | - * The Events Calendar enqueue styles. |
|
17 | - * |
|
18 | - * @package lsx |
|
19 | - * @subpackage the-events-calendar |
|
20 | - */ |
|
21 | - function lsx_tec_scripts_add_styles() { |
|
22 | - |
|
23 | - // Get plugin version. |
|
24 | - $plugin = 'the-events-calendar/the-events-calendar.php'; |
|
25 | - $data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); |
|
26 | - $version = $data['Version']; |
|
27 | - |
|
28 | - if ( substr( $version, 0, 1 ) >= '5' ) { |
|
29 | - // New Version 5.0 and up. |
|
30 | - wp_enqueue_style( 'the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar-5.css', array( 'lsx_main' ), LSX_VERSION ); |
|
31 | - } else { |
|
32 | - // Old Version. |
|
33 | - wp_enqueue_style( 'the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar.css', array( 'lsx_main' ), LSX_VERSION ); |
|
34 | - } |
|
35 | - |
|
36 | - wp_enqueue_style( 'the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar.css', array( 'lsx_main' ), LSX_VERSION ); |
|
37 | - wp_style_add_data( 'the-events-calendar-lsx', 'rtl', 'replace' ); |
|
38 | - } |
|
39 | - |
|
40 | - add_action( 'wp_enqueue_scripts', 'lsx_tec_scripts_add_styles' ); |
|
15 | + /** |
|
16 | + * The Events Calendar enqueue styles. |
|
17 | + * |
|
18 | + * @package lsx |
|
19 | + * @subpackage the-events-calendar |
|
20 | + */ |
|
21 | + function lsx_tec_scripts_add_styles() { |
|
22 | + |
|
23 | + // Get plugin version. |
|
24 | + $plugin = 'the-events-calendar/the-events-calendar.php'; |
|
25 | + $data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); |
|
26 | + $version = $data['Version']; |
|
27 | + |
|
28 | + if ( substr( $version, 0, 1 ) >= '5' ) { |
|
29 | + // New Version 5.0 and up. |
|
30 | + wp_enqueue_style( 'the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar-5.css', array( 'lsx_main' ), LSX_VERSION ); |
|
31 | + } else { |
|
32 | + // Old Version. |
|
33 | + wp_enqueue_style( 'the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar.css', array( 'lsx_main' ), LSX_VERSION ); |
|
34 | + } |
|
35 | + |
|
36 | + wp_enqueue_style( 'the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar/the-events-calendar.css', array( 'lsx_main' ), LSX_VERSION ); |
|
37 | + wp_style_add_data( 'the-events-calendar-lsx', 'rtl', 'replace' ); |
|
38 | + } |
|
39 | + |
|
40 | + add_action( 'wp_enqueue_scripts', 'lsx_tec_scripts_add_styles' ); |
|
41 | 41 | |
42 | 42 | endif; |
43 | 43 | |
44 | 44 | if ( ! function_exists( 'lsx_tec_theme_wrapper_start' ) ) : |
45 | 45 | |
46 | - /** |
|
47 | - * The Events Calendar wrapper start. |
|
48 | - * |
|
49 | - * @package lsx |
|
50 | - * @subpackage the-events-calendar |
|
51 | - */ |
|
52 | - function lsx_tec_theme_wrapper_start() { |
|
53 | - if ( function_exists( 'lsx_is_rest_api_request' ) && lsx_is_rest_api_request() ) { |
|
54 | - return; |
|
55 | - } |
|
56 | - lsx_content_wrap_before(); |
|
57 | - echo '<div id="primary" class="content-area ' . esc_attr( lsx_main_class() ) . '">'; |
|
58 | - lsx_content_before(); |
|
59 | - echo '<main id="main" class="site-main" role="main">'; |
|
60 | - lsx_content_top(); |
|
61 | - } |
|
62 | - |
|
63 | - add_action( 'tribe_events_before_html', 'lsx_tec_theme_wrapper_start', 9 ); |
|
46 | + /** |
|
47 | + * The Events Calendar wrapper start. |
|
48 | + * |
|
49 | + * @package lsx |
|
50 | + * @subpackage the-events-calendar |
|
51 | + */ |
|
52 | + function lsx_tec_theme_wrapper_start() { |
|
53 | + if ( function_exists( 'lsx_is_rest_api_request' ) && lsx_is_rest_api_request() ) { |
|
54 | + return; |
|
55 | + } |
|
56 | + lsx_content_wrap_before(); |
|
57 | + echo '<div id="primary" class="content-area ' . esc_attr( lsx_main_class() ) . '">'; |
|
58 | + lsx_content_before(); |
|
59 | + echo '<main id="main" class="site-main" role="main">'; |
|
60 | + lsx_content_top(); |
|
61 | + } |
|
62 | + |
|
63 | + add_action( 'tribe_events_before_html', 'lsx_tec_theme_wrapper_start', 9 ); |
|
64 | 64 | |
65 | 65 | endif; |
66 | 66 | |
67 | 67 | if ( ! function_exists( 'lsx_tec_theme_wrapper_end' ) ) : |
68 | 68 | |
69 | - /** |
|
70 | - * The Events Calendar wrapper end. |
|
71 | - * |
|
72 | - * @package lsx |
|
73 | - * @subpackage the-events-calendar |
|
74 | - */ |
|
75 | - function lsx_tec_theme_wrapper_end() { |
|
76 | - if ( function_exists( 'lsx_is_rest_api_request' ) && lsx_is_rest_api_request() ) { |
|
77 | - return; |
|
78 | - } |
|
79 | - lsx_content_bottom(); |
|
80 | - echo '</main>'; |
|
81 | - lsx_content_after(); |
|
82 | - echo '</div>'; |
|
83 | - lsx_content_wrap_after(); |
|
84 | - } |
|
85 | - |
|
86 | - add_action( 'tribe_events_after_html', 'lsx_tec_theme_wrapper_end', 11 ); |
|
69 | + /** |
|
70 | + * The Events Calendar wrapper end. |
|
71 | + * |
|
72 | + * @package lsx |
|
73 | + * @subpackage the-events-calendar |
|
74 | + */ |
|
75 | + function lsx_tec_theme_wrapper_end() { |
|
76 | + if ( function_exists( 'lsx_is_rest_api_request' ) && lsx_is_rest_api_request() ) { |
|
77 | + return; |
|
78 | + } |
|
79 | + lsx_content_bottom(); |
|
80 | + echo '</main>'; |
|
81 | + lsx_content_after(); |
|
82 | + echo '</div>'; |
|
83 | + lsx_content_wrap_after(); |
|
84 | + } |
|
85 | + |
|
86 | + add_action( 'tribe_events_after_html', 'lsx_tec_theme_wrapper_end', 11 ); |
|
87 | 87 | |
88 | 88 | endif; |
89 | 89 | |
90 | 90 | if ( ! function_exists( 'lsx_tec_global_header_title' ) ) : |
91 | 91 | |
92 | - /** |
|
93 | - * Move the events title into the global header |
|
94 | - * |
|
95 | - * @package lsx |
|
96 | - * @subpackage the-events-calendar |
|
97 | - */ |
|
98 | - function lsx_tec_global_header_title( $title ) { |
|
99 | - |
|
100 | - if ( tribe_is_community_edit_event_page() ) { |
|
101 | - |
|
102 | - $is_route = get_query_var( 'WP_Route' ); |
|
103 | - switch ( $is_route ) { |
|
104 | - case 'ce-edit-route': |
|
105 | - $title = apply_filters( 'tribe_ce_edit_event_page_title', __( 'Edit an Event', 'lsx' ) ); |
|
106 | - break; |
|
107 | - |
|
108 | - case 'ce-edit-organizer-route': |
|
109 | - $title = __( 'Edit an Organizer', 'lsx' ); |
|
110 | - break; |
|
111 | - |
|
112 | - case 'ce-edit-venue-route': |
|
113 | - $title = __( 'Edit a Venue', 'lsx' ); |
|
114 | - break; |
|
115 | - |
|
116 | - default: |
|
117 | - $title = apply_filters( 'tribe_ce_submit_event_page_title', __( 'Submit an Event', 'lsx' ) ); |
|
118 | - break; |
|
119 | - } |
|
120 | - } elseif ( tribe_is_community_my_events_page() ) { |
|
121 | - $title = apply_filters( 'tribe_ce_submit_event_page_title', __( 'My Events', 'lsx' ) ); |
|
122 | - } elseif ( tribe_is_event() ) { |
|
123 | - $title = tribe_get_events_title(); |
|
124 | - } |
|
125 | - |
|
126 | - // Only disable the title after we have retrieved it. |
|
127 | - add_filter( 'tribe_get_events_title', 'lsx_text_disable_body_title', 200, 1 ); |
|
128 | - |
|
129 | - if ( is_singular( 'tribe_events' ) ) { |
|
130 | - add_filter( 'the_title', 'lsx_text_disable_body_title', 200, 1 ); |
|
131 | - } |
|
132 | - |
|
133 | - if ( class_exists( 'LSX_Banners' ) ) { |
|
134 | - if ( is_archive() && is_post_type_archive( 'tribe_events' ) ) { |
|
135 | - $options = get_option( '_lsx_settings', false ); |
|
136 | - if ( is_array( $options ) && isset( $options['tribe_events'] ) && isset( $options['tribe_events']['title'] ) && '' !== $options['tribe_events']['title'] ) { |
|
137 | - $title = $options['tribe_events']['title']; |
|
138 | - } |
|
139 | - } |
|
140 | - $title = '<h1 class="page-title">' . $title . '</h1>'; |
|
141 | - } |
|
142 | - return $title; |
|
143 | - } |
|
144 | - add_filter( 'lsx_banner_title', 'lsx_tec_global_header_title', 200, 1 ); |
|
145 | - add_filter( 'lsx_global_header_title', 'lsx_tec_global_header_title', 200, 1 ); |
|
92 | + /** |
|
93 | + * Move the events title into the global header |
|
94 | + * |
|
95 | + * @package lsx |
|
96 | + * @subpackage the-events-calendar |
|
97 | + */ |
|
98 | + function lsx_tec_global_header_title( $title ) { |
|
99 | + |
|
100 | + if ( tribe_is_community_edit_event_page() ) { |
|
101 | + |
|
102 | + $is_route = get_query_var( 'WP_Route' ); |
|
103 | + switch ( $is_route ) { |
|
104 | + case 'ce-edit-route': |
|
105 | + $title = apply_filters( 'tribe_ce_edit_event_page_title', __( 'Edit an Event', 'lsx' ) ); |
|
106 | + break; |
|
107 | + |
|
108 | + case 'ce-edit-organizer-route': |
|
109 | + $title = __( 'Edit an Organizer', 'lsx' ); |
|
110 | + break; |
|
111 | + |
|
112 | + case 'ce-edit-venue-route': |
|
113 | + $title = __( 'Edit a Venue', 'lsx' ); |
|
114 | + break; |
|
115 | + |
|
116 | + default: |
|
117 | + $title = apply_filters( 'tribe_ce_submit_event_page_title', __( 'Submit an Event', 'lsx' ) ); |
|
118 | + break; |
|
119 | + } |
|
120 | + } elseif ( tribe_is_community_my_events_page() ) { |
|
121 | + $title = apply_filters( 'tribe_ce_submit_event_page_title', __( 'My Events', 'lsx' ) ); |
|
122 | + } elseif ( tribe_is_event() ) { |
|
123 | + $title = tribe_get_events_title(); |
|
124 | + } |
|
125 | + |
|
126 | + // Only disable the title after we have retrieved it. |
|
127 | + add_filter( 'tribe_get_events_title', 'lsx_text_disable_body_title', 200, 1 ); |
|
128 | + |
|
129 | + if ( is_singular( 'tribe_events' ) ) { |
|
130 | + add_filter( 'the_title', 'lsx_text_disable_body_title', 200, 1 ); |
|
131 | + } |
|
132 | + |
|
133 | + if ( class_exists( 'LSX_Banners' ) ) { |
|
134 | + if ( is_archive() && is_post_type_archive( 'tribe_events' ) ) { |
|
135 | + $options = get_option( '_lsx_settings', false ); |
|
136 | + if ( is_array( $options ) && isset( $options['tribe_events'] ) && isset( $options['tribe_events']['title'] ) && '' !== $options['tribe_events']['title'] ) { |
|
137 | + $title = $options['tribe_events']['title']; |
|
138 | + } |
|
139 | + } |
|
140 | + $title = '<h1 class="page-title">' . $title . '</h1>'; |
|
141 | + } |
|
142 | + return $title; |
|
143 | + } |
|
144 | + add_filter( 'lsx_banner_title', 'lsx_tec_global_header_title', 200, 1 ); |
|
145 | + add_filter( 'lsx_global_header_title', 'lsx_tec_global_header_title', 200, 1 ); |
|
146 | 146 | |
147 | 147 | endif; |
148 | 148 | |
149 | 149 | if ( ! function_exists( 'lsx_text_disable_body_title' ) ) : |
150 | - /** |
|
151 | - * Disable the events title for the post archive if the dynamic setting is active. |
|
152 | - * |
|
153 | - * @param $title |
|
154 | - * @return string |
|
155 | - */ |
|
156 | - function lsx_text_disable_body_title( $title ) { |
|
157 | - $title = ''; |
|
158 | - remove_filter( 'the_title', 'lsx_text_disable_body_title', 200, 1 ); |
|
159 | - return $title; |
|
160 | - } |
|
150 | + /** |
|
151 | + * Disable the events title for the post archive if the dynamic setting is active. |
|
152 | + * |
|
153 | + * @param $title |
|
154 | + * @return string |
|
155 | + */ |
|
156 | + function lsx_text_disable_body_title( $title ) { |
|
157 | + $title = ''; |
|
158 | + remove_filter( 'the_title', 'lsx_text_disable_body_title', 200, 1 ); |
|
159 | + return $title; |
|
160 | + } |
|
161 | 161 | |
162 | 162 | endif; |
163 | 163 | |
164 | 164 | if ( ! function_exists( 'lsx_tec_breadcrumb_filter' ) ) : |
165 | - /** |
|
166 | - * Fixes the community events breadcrumb |
|
167 | - * |
|
168 | - * @package lsx |
|
169 | - * @subpackage the-events-calendar |
|
170 | - */ |
|
171 | - function lsx_tec_breadcrumb_filter( $crumbs ) { |
|
172 | - |
|
173 | - if ( tribe_is_venue() || tribe_is_organizer() || tribe_is_community_edit_event_page() || tribe_is_community_my_events_page() ) { |
|
174 | - $new_crumbs = array(); |
|
175 | - $new_crumbs[0] = $crumbs[0]; |
|
176 | - |
|
177 | - if ( function_exists( 'woocommerce_breadcrumb' ) ) { |
|
178 | - $new_crumbs[1] = array( |
|
179 | - 0 => __( 'Events', 'lsx' ), |
|
180 | - 1 => get_post_type_archive_link( 'tribe_events' ), |
|
181 | - ); |
|
182 | - } else { |
|
183 | - $new_crumbs[1] = array( |
|
184 | - 'text' => __( 'Events', 'lsx' ), |
|
185 | - 'url' => get_post_type_archive_link( 'tribe_events' ), |
|
186 | - ); |
|
187 | - } |
|
188 | - |
|
189 | - if ( tribe_is_community_my_events_page() ) { |
|
190 | - $new_crumbs[2] = $crumbs[2]; |
|
191 | - } elseif ( tribe_is_community_edit_event_page() ) { |
|
192 | - |
|
193 | - if ( function_exists( 'woocommerce_breadcrumb' ) ) { |
|
194 | - $new_crumbs[2] = array( |
|
195 | - 0 => apply_filters( 'tribe_ce_submit_event_page_title', __( 'My Events', 'lsx' ) ), |
|
196 | - 1 => tribe_community_events_list_events_link(), |
|
197 | - ); |
|
198 | - } else { |
|
199 | - $new_crumbs[2] = array( |
|
200 | - 'text' => apply_filters( 'tribe_ce_submit_event_page_title', __( 'My Events', 'lsx' ) ), |
|
201 | - 'url' => tribe_community_events_list_events_link(), |
|
202 | - ); |
|
203 | - } |
|
204 | - |
|
205 | - $new_crumbs[3] = $crumbs[2]; |
|
206 | - } else { |
|
207 | - $new_crumbs[2] = $crumbs[1]; |
|
208 | - } |
|
209 | - $crumbs = $new_crumbs; |
|
210 | - } |
|
211 | - return $crumbs; |
|
212 | - } |
|
213 | - add_filter( 'wpseo_breadcrumb_links', 'lsx_tec_breadcrumb_filter', 30, 1 ); |
|
214 | - add_filter( 'woocommerce_get_breadcrumb', 'lsx_tec_breadcrumb_filter', 30, 1 ); |
|
165 | + /** |
|
166 | + * Fixes the community events breadcrumb |
|
167 | + * |
|
168 | + * @package lsx |
|
169 | + * @subpackage the-events-calendar |
|
170 | + */ |
|
171 | + function lsx_tec_breadcrumb_filter( $crumbs ) { |
|
172 | + |
|
173 | + if ( tribe_is_venue() || tribe_is_organizer() || tribe_is_community_edit_event_page() || tribe_is_community_my_events_page() ) { |
|
174 | + $new_crumbs = array(); |
|
175 | + $new_crumbs[0] = $crumbs[0]; |
|
176 | + |
|
177 | + if ( function_exists( 'woocommerce_breadcrumb' ) ) { |
|
178 | + $new_crumbs[1] = array( |
|
179 | + 0 => __( 'Events', 'lsx' ), |
|
180 | + 1 => get_post_type_archive_link( 'tribe_events' ), |
|
181 | + ); |
|
182 | + } else { |
|
183 | + $new_crumbs[1] = array( |
|
184 | + 'text' => __( 'Events', 'lsx' ), |
|
185 | + 'url' => get_post_type_archive_link( 'tribe_events' ), |
|
186 | + ); |
|
187 | + } |
|
188 | + |
|
189 | + if ( tribe_is_community_my_events_page() ) { |
|
190 | + $new_crumbs[2] = $crumbs[2]; |
|
191 | + } elseif ( tribe_is_community_edit_event_page() ) { |
|
192 | + |
|
193 | + if ( function_exists( 'woocommerce_breadcrumb' ) ) { |
|
194 | + $new_crumbs[2] = array( |
|
195 | + 0 => apply_filters( 'tribe_ce_submit_event_page_title', __( 'My Events', 'lsx' ) ), |
|
196 | + 1 => tribe_community_events_list_events_link(), |
|
197 | + ); |
|
198 | + } else { |
|
199 | + $new_crumbs[2] = array( |
|
200 | + 'text' => apply_filters( 'tribe_ce_submit_event_page_title', __( 'My Events', 'lsx' ) ), |
|
201 | + 'url' => tribe_community_events_list_events_link(), |
|
202 | + ); |
|
203 | + } |
|
204 | + |
|
205 | + $new_crumbs[3] = $crumbs[2]; |
|
206 | + } else { |
|
207 | + $new_crumbs[2] = $crumbs[1]; |
|
208 | + } |
|
209 | + $crumbs = $new_crumbs; |
|
210 | + } |
|
211 | + return $crumbs; |
|
212 | + } |
|
213 | + add_filter( 'wpseo_breadcrumb_links', 'lsx_tec_breadcrumb_filter', 30, 1 ); |
|
214 | + add_filter( 'woocommerce_get_breadcrumb', 'lsx_tec_breadcrumb_filter', 30, 1 ); |
|
215 | 215 | |
216 | 216 | endif; |
@@ -7,14 +7,14 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
10 | - exit; |
|
10 | + exit; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | /** |
14 | 14 | * This is the 1st action in the theme that fires after <head>. |
15 | 15 | */ |
16 | 16 | function lsx_head_top() { |
17 | - do_action( 'lsx_head_top' ); |
|
17 | + do_action( 'lsx_head_top' ); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
@@ -23,14 +23,14 @@ discard block |
||
23 | 23 | * @return void |
24 | 24 | */ |
25 | 25 | function lsx_head_bottom() { |
26 | - do_action( 'lsx_head_bottom' ); |
|
26 | + do_action( 'lsx_head_bottom' ); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
30 | 30 | * The 3rd action thta fires after <body> |
31 | 31 | */ |
32 | 32 | function lsx_body_top() { |
33 | - do_action( 'lsx_body_top' ); |
|
33 | + do_action( 'lsx_body_top' ); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * $lsx_supports[] = 'header'; |
40 | 40 | */ |
41 | 41 | function lsx_header_before() { |
42 | - do_action( 'lsx_header_before' ); |
|
42 | + do_action( 'lsx_header_before' ); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @return void |
49 | 49 | */ |
50 | 50 | function lsx_header_top() { |
51 | - do_action( 'lsx_header_top' ); |
|
51 | + do_action( 'lsx_header_top' ); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @return void |
58 | 58 | */ |
59 | 59 | function lsx_nav_before() { |
60 | - do_action( 'lsx_nav_before' ); |
|
60 | + do_action( 'lsx_nav_before' ); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * @return void |
67 | 67 | */ |
68 | 68 | function lsx_nav_after() { |
69 | - do_action( 'lsx_nav_after' ); |
|
69 | + do_action( 'lsx_nav_after' ); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @return void |
76 | 76 | */ |
77 | 77 | function lsx_header_bottom() { |
78 | - do_action( 'lsx_header_bottom' ); |
|
78 | + do_action( 'lsx_header_bottom' ); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @return void |
85 | 85 | */ |
86 | 86 | function lsx_header_after() { |
87 | - do_action( 'lsx_header_after' ); |
|
87 | + do_action( 'lsx_header_after' ); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @return void |
94 | 94 | */ |
95 | 95 | function lsx_header_wrap_after() { |
96 | - do_action( 'lsx_header_wrap_after' ); |
|
96 | + do_action( 'lsx_header_wrap_after' ); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @return void |
103 | 103 | */ |
104 | 104 | function lsx_header_wrap_container_top() { |
105 | - do_action( 'lsx_header_wrap_container_top' ); |
|
105 | + do_action( 'lsx_header_wrap_container_top' ); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @return void |
112 | 112 | */ |
113 | 113 | function lsx_body_bottom() { |
114 | - do_action( 'lsx_body_bottom' ); |
|
114 | + do_action( 'lsx_body_bottom' ); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * $lsx_supports[] = 'banner'; |
121 | 121 | */ |
122 | 122 | function lsx_banner_content() { |
123 | - do_action( 'lsx_banner_content' ); |
|
123 | + do_action( 'lsx_banner_content' ); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * @return void |
130 | 130 | */ |
131 | 131 | function lsx_banner_inner_top() { |
132 | - do_action( 'lsx_banner_inner_top' ); |
|
132 | + do_action( 'lsx_banner_inner_top' ); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | * @return void |
139 | 139 | */ |
140 | 140 | function lsx_banner_inner_bottom() { |
141 | - do_action( 'lsx_banner_inner_bottom' ); |
|
141 | + do_action( 'lsx_banner_inner_bottom' ); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * $lsx_supports[] = 'global_header'; |
148 | 148 | */ |
149 | 149 | function lsx_global_header_inner_bottom() { |
150 | - do_action( 'lsx_global_header_inner_bottom' ); |
|
150 | + do_action( 'lsx_global_header_inner_bottom' ); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | * $lsx_supports[] = 'content'; |
157 | 157 | */ |
158 | 158 | function lsx_content_wrap_before() { |
159 | - do_action( 'lsx_content_wrap_before' ); |
|
159 | + do_action( 'lsx_content_wrap_before' ); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * @return void |
166 | 166 | */ |
167 | 167 | function lsx_content_wrap_after() { |
168 | - do_action( 'lsx_content_wrap_after' ); |
|
168 | + do_action( 'lsx_content_wrap_after' ); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | * @return void |
175 | 175 | */ |
176 | 176 | function lsx_content_before() { |
177 | - do_action( 'lsx_content_before' ); |
|
177 | + do_action( 'lsx_content_before' ); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * @return void |
184 | 184 | */ |
185 | 185 | function lsx_content_after() { |
186 | - do_action( 'lsx_content_after' ); |
|
186 | + do_action( 'lsx_content_after' ); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | /** |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * @return void |
193 | 193 | */ |
194 | 194 | function lsx_content_top() { |
195 | - do_action( 'lsx_content_top' ); |
|
195 | + do_action( 'lsx_content_top' ); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | * @return void |
202 | 202 | */ |
203 | 203 | function lsx_content_bottom() { |
204 | - do_action( 'lsx_content_bottom' ); |
|
204 | + do_action( 'lsx_content_bottom' ); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * @return void |
211 | 211 | */ |
212 | 212 | function lsx_content_post_tags() { |
213 | - do_action( 'lsx_content_post_tags' ); |
|
213 | + do_action( 'lsx_content_post_tags' ); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * @return void |
220 | 220 | */ |
221 | 221 | function lsx_content_sharing() { |
222 | - do_action( 'lsx_content_sharing' ); |
|
222 | + do_action( 'lsx_content_sharing' ); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | /** |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | * $lsx_supports[] = 'entry'; |
229 | 229 | */ |
230 | 230 | function lsx_entry_before() { |
231 | - do_action( 'lsx_entry_before' ); |
|
231 | + do_action( 'lsx_entry_before' ); |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | /** |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * @return void |
238 | 238 | */ |
239 | 239 | function lsx_entry_after() { |
240 | - do_action( 'lsx_entry_after' ); |
|
240 | + do_action( 'lsx_entry_after' ); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | * @return void |
247 | 247 | */ |
248 | 248 | function lsx_entry_top() { |
249 | - do_action( 'lsx_entry_top' ); |
|
249 | + do_action( 'lsx_entry_top' ); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | * @return void |
256 | 256 | */ |
257 | 257 | function lsx_entry_inside_top() { |
258 | - do_action( 'lsx_entry_inside_top' ); |
|
258 | + do_action( 'lsx_entry_inside_top' ); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
@@ -264,14 +264,14 @@ discard block |
||
264 | 264 | * @return void |
265 | 265 | */ |
266 | 266 | function lsx_entry_bottom() { |
267 | - do_action( 'lsx_entry_bottom' ); |
|
267 | + do_action( 'lsx_entry_bottom' ); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | /** |
271 | 271 | * Semantic <entry> hooks |
272 | 272 | */ |
273 | 273 | function lsx_post_meta_top() { |
274 | - do_action( 'lsx_post_meta_top' ); |
|
274 | + do_action( 'lsx_post_meta_top' ); |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | /** |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | * $lsx_supports[] = 'entry'; |
281 | 281 | */ |
282 | 282 | function lsx_widget_entry_before() { |
283 | - do_action( 'lsx_widget_entry_before' ); |
|
283 | + do_action( 'lsx_widget_entry_before' ); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | /** |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | * @return void |
290 | 290 | */ |
291 | 291 | function lsx_widget_entry_after() { |
292 | - do_action( 'lsx_widget_entry_after' ); |
|
292 | + do_action( 'lsx_widget_entry_after' ); |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | /** |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | * @return void |
299 | 299 | */ |
300 | 300 | function lsx_widget_entry_top() { |
301 | - do_action( 'lsx_widget_entry_top' ); |
|
301 | + do_action( 'lsx_widget_entry_top' ); |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | /** |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | * @return void |
308 | 308 | */ |
309 | 309 | function lsx_widget_entry_bottom() { |
310 | - do_action( 'lsx_widget_entry_bottom' ); |
|
310 | + do_action( 'lsx_widget_entry_bottom' ); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | * @return void |
317 | 317 | */ |
318 | 318 | function lsx_widget_entry_content_top() { |
319 | - do_action( 'lsx_widget_entry_content_top' ); |
|
319 | + do_action( 'lsx_widget_entry_content_top' ); |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | /** |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | * @return void |
326 | 326 | */ |
327 | 327 | function lsx_widget_entry_content_bottom() { |
328 | - do_action( 'lsx_widget_entry_content_bottom' ); |
|
328 | + do_action( 'lsx_widget_entry_content_bottom' ); |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | /** |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | * $lsx_supports[] = 'comments'; |
335 | 335 | */ |
336 | 336 | function lsx_comments_before() { |
337 | - do_action( 'lsx_comments_before' ); |
|
337 | + do_action( 'lsx_comments_before' ); |
|
338 | 338 | } |
339 | 339 | |
340 | 340 | /** |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | * @return void |
344 | 344 | */ |
345 | 345 | function lsx_comments_after() { |
346 | - do_action( 'lsx_comments_after' ); |
|
346 | + do_action( 'lsx_comments_after' ); |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | /** |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | * $lsx_supports[] = 'sidebar'; |
353 | 353 | */ |
354 | 354 | function lsx_sidebars_before() { |
355 | - do_action( 'lsx_sidebars_before' ); |
|
355 | + do_action( 'lsx_sidebars_before' ); |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | /** |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | * @return void |
362 | 362 | */ |
363 | 363 | function lsx_sidebars_after() { |
364 | - do_action( 'lsx_sidebars_after' ); |
|
364 | + do_action( 'lsx_sidebars_after' ); |
|
365 | 365 | } |
366 | 366 | |
367 | 367 | /** |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | * @return void |
371 | 371 | */ |
372 | 372 | function lsx_sidebar_top() { |
373 | - do_action( 'lsx_sidebar_top' ); |
|
373 | + do_action( 'lsx_sidebar_top' ); |
|
374 | 374 | } |
375 | 375 | |
376 | 376 | /** |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | * @return void |
380 | 380 | */ |
381 | 381 | function lsx_sidebar_bottom() { |
382 | - do_action( 'lsx_sidebar_bottom' ); |
|
382 | + do_action( 'lsx_sidebar_bottom' ); |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | /** |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | * $lsx_supports[] = 'footer'; |
389 | 389 | */ |
390 | 390 | function lsx_footer_before() { |
391 | - do_action( 'lsx_footer_before' ); |
|
391 | + do_action( 'lsx_footer_before' ); |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | /** |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | * @return void |
398 | 398 | */ |
399 | 399 | function lsx_footer_after() { |
400 | - do_action( 'lsx_footer_after' ); |
|
400 | + do_action( 'lsx_footer_after' ); |
|
401 | 401 | } |
402 | 402 | |
403 | 403 | /** |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | * @return void |
407 | 407 | */ |
408 | 408 | function lsx_footer_top() { |
409 | - do_action( 'lsx_footer_top' ); |
|
409 | + do_action( 'lsx_footer_top' ); |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | /** |
@@ -415,5 +415,5 @@ discard block |
||
415 | 415 | * @return void |
416 | 416 | */ |
417 | 417 | function lsx_footer_bottom() { |
418 | - do_action( 'lsx_footer_bottom' ); |
|
418 | + do_action( 'lsx_footer_bottom' ); |
|
419 | 419 | } |
@@ -7,273 +7,273 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
10 | - exit; |
|
10 | + exit; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | if ( ! function_exists( 'lsx_setup' ) ) : |
14 | 14 | |
15 | - /** |
|
16 | - * Theme after_setup_theme action. |
|
17 | - * |
|
18 | - * @package lsx |
|
19 | - * @subpackage config |
|
20 | - */ |
|
21 | - function lsx_setup() { |
|
22 | - global $content_width; |
|
23 | - $content_width = 1140; |
|
24 | - |
|
25 | - load_theme_textdomain( 'lsx', get_template_directory() . '/languages' ); |
|
26 | - |
|
27 | - add_image_size( 'lsx-thumbnail-carousel', 350, 230, true ); |
|
28 | - add_image_size( 'lsx-thumbnail-wide', 360, 168, true ); |
|
29 | - add_image_size( 'lsx-thumbnail-square', 350, 350, true ); |
|
30 | - add_image_size( 'lsx-thumbnail-single', 750, 350, true ); |
|
31 | - add_image_size( 'lsx-banner', 1920, 600, true ); |
|
32 | - |
|
33 | - register_nav_menus( |
|
34 | - array( |
|
35 | - 'primary' => esc_html__( 'Primary Menu', 'lsx' ), |
|
36 | - 'top-menu' => esc_html__( 'Top Menu (right)', 'lsx' ), |
|
37 | - 'top-menu-left' => esc_html__( 'Top Menu (left)', 'lsx' ), |
|
38 | - 'social' => esc_html__( 'Social Menu', 'lsx' ), |
|
39 | - 'footer' => esc_html__( 'Footer Menu', 'lsx' ), |
|
40 | - ) |
|
41 | - ); |
|
42 | - |
|
43 | - add_theme_support( 'automatic-feed-links' ); |
|
44 | - add_theme_support( 'custom-background' ); |
|
45 | - |
|
46 | - add_theme_support( |
|
47 | - 'custom-logo', |
|
48 | - array( |
|
49 | - 'height' => 50, |
|
50 | - 'width' => 160, |
|
51 | - 'flex-width' => true, |
|
52 | - 'flex-height' => true, |
|
53 | - ) |
|
54 | - ); |
|
55 | - |
|
56 | - add_theme_support( 'html5', array( 'caption' ) ); |
|
57 | - |
|
58 | - add_theme_support( |
|
59 | - 'post-formats', |
|
60 | - array( |
|
61 | - 'image', |
|
62 | - 'video', |
|
63 | - 'gallery', |
|
64 | - 'audio', |
|
65 | - 'quote', |
|
66 | - ) |
|
67 | - ); |
|
68 | - |
|
69 | - add_theme_support( 'post-thumbnails' ); |
|
70 | - add_theme_support( 'sensei' ); |
|
71 | - |
|
72 | - add_theme_support( |
|
73 | - 'site-logo', |
|
74 | - array( |
|
75 | - 'header-text' => array( |
|
76 | - 'site-title', |
|
77 | - 'site-description', |
|
78 | - ), |
|
79 | - 'size' => 'medium', |
|
80 | - ) |
|
81 | - ); |
|
82 | - |
|
83 | - add_theme_support( 'title-tag' ); |
|
84 | - |
|
85 | - /* |
|
15 | + /** |
|
16 | + * Theme after_setup_theme action. |
|
17 | + * |
|
18 | + * @package lsx |
|
19 | + * @subpackage config |
|
20 | + */ |
|
21 | + function lsx_setup() { |
|
22 | + global $content_width; |
|
23 | + $content_width = 1140; |
|
24 | + |
|
25 | + load_theme_textdomain( 'lsx', get_template_directory() . '/languages' ); |
|
26 | + |
|
27 | + add_image_size( 'lsx-thumbnail-carousel', 350, 230, true ); |
|
28 | + add_image_size( 'lsx-thumbnail-wide', 360, 168, true ); |
|
29 | + add_image_size( 'lsx-thumbnail-square', 350, 350, true ); |
|
30 | + add_image_size( 'lsx-thumbnail-single', 750, 350, true ); |
|
31 | + add_image_size( 'lsx-banner', 1920, 600, true ); |
|
32 | + |
|
33 | + register_nav_menus( |
|
34 | + array( |
|
35 | + 'primary' => esc_html__( 'Primary Menu', 'lsx' ), |
|
36 | + 'top-menu' => esc_html__( 'Top Menu (right)', 'lsx' ), |
|
37 | + 'top-menu-left' => esc_html__( 'Top Menu (left)', 'lsx' ), |
|
38 | + 'social' => esc_html__( 'Social Menu', 'lsx' ), |
|
39 | + 'footer' => esc_html__( 'Footer Menu', 'lsx' ), |
|
40 | + ) |
|
41 | + ); |
|
42 | + |
|
43 | + add_theme_support( 'automatic-feed-links' ); |
|
44 | + add_theme_support( 'custom-background' ); |
|
45 | + |
|
46 | + add_theme_support( |
|
47 | + 'custom-logo', |
|
48 | + array( |
|
49 | + 'height' => 50, |
|
50 | + 'width' => 160, |
|
51 | + 'flex-width' => true, |
|
52 | + 'flex-height' => true, |
|
53 | + ) |
|
54 | + ); |
|
55 | + |
|
56 | + add_theme_support( 'html5', array( 'caption' ) ); |
|
57 | + |
|
58 | + add_theme_support( |
|
59 | + 'post-formats', |
|
60 | + array( |
|
61 | + 'image', |
|
62 | + 'video', |
|
63 | + 'gallery', |
|
64 | + 'audio', |
|
65 | + 'quote', |
|
66 | + ) |
|
67 | + ); |
|
68 | + |
|
69 | + add_theme_support( 'post-thumbnails' ); |
|
70 | + add_theme_support( 'sensei' ); |
|
71 | + |
|
72 | + add_theme_support( |
|
73 | + 'site-logo', |
|
74 | + array( |
|
75 | + 'header-text' => array( |
|
76 | + 'site-title', |
|
77 | + 'site-description', |
|
78 | + ), |
|
79 | + 'size' => 'medium', |
|
80 | + ) |
|
81 | + ); |
|
82 | + |
|
83 | + add_theme_support( 'title-tag' ); |
|
84 | + |
|
85 | + /* |
|
86 | 86 | * @TODO - Necessary to test it |
87 | 87 | */ |
88 | 88 | |
89 | - // add_theme_support( 'woocommerce' );. |
|
90 | - add_theme_support( 'starter-content', array( |
|
91 | - 'widgets' => array( |
|
92 | - 'sidebar-home' => array( |
|
93 | - 'custom_widget_1' => array( |
|
94 | - 'text', |
|
95 | - |
|
96 | - array( |
|
97 | - 'title' => '', |
|
98 | - 'text' => wp_kses_post( '<div class="row"><div class="col-sm-12 text-center"><h3>Build your perfect website <small>with the LSX theme</small></h3></div></div><div class="row"><div class="col-sm-4 text-center"><h4>Fast</h4><p>"Quick" isn\'t a word most people use when describing their website building experience.</p></div><div class="col-sm-4 text-center"><h4>Easy</h4><p>We\'ve built websites for countless clients, and we know what kind of back-end makes sense easily.</p></div><div class="col-sm-4 text-center"><h4>Comprehensive</h4><p>The LSX extensions come with features out the box that are essential.</p></div></div>' ), |
|
99 | - ), |
|
100 | - ), |
|
101 | - |
|
102 | - 'custom_widget_2' => array( |
|
103 | - 'text', |
|
104 | - |
|
105 | - array( |
|
106 | - 'title' => '', |
|
107 | - 'text' => wp_kses_post( '<div class="lsx-full-width-alt"><div class="row"><div class="col-xs-12"><h3>A big CTA title</h3><p class="text-center"><a class="btn cta-btn" href="http://www.lsdeb.biz/" target="_blank" rel="noreferrer noopener">Hire Us</a><p></div></div></div>' ), |
|
108 | - ), |
|
109 | - ), |
|
110 | - |
|
111 | - 'custom_widget_3' => array( |
|
112 | - 'text', |
|
113 | - |
|
114 | - array( |
|
115 | - 'title' => '', |
|
116 | - 'text' => wp_kses_post( '<div class="row"><div class="col-xs-12"><h3>Homepage Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.</p></div></div>' ), |
|
117 | - ), |
|
118 | - ), |
|
119 | - ), |
|
120 | - |
|
121 | - 'sidebar-footer' => array( |
|
122 | - 'custom_widget_1' => array( |
|
123 | - 'text', |
|
124 | - |
|
125 | - array( |
|
126 | - 'title' => esc_html__( 'Space for Footer Widgets', 'lsx' ), |
|
127 | - 'text' => esc_html__( 'This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx' ), |
|
128 | - ), |
|
129 | - ), |
|
130 | - |
|
131 | - 'custom_widget_2' => array( |
|
132 | - 'text', |
|
133 | - |
|
134 | - array( |
|
135 | - 'title' => esc_html__( 'Space for Footer Widgets', 'lsx' ), |
|
136 | - 'text' => esc_html__( 'This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx' ), |
|
137 | - ), |
|
138 | - ), |
|
139 | - |
|
140 | - 'custom_widget_3' => array( |
|
141 | - 'text', |
|
142 | - |
|
143 | - array( |
|
144 | - 'title' => esc_html__( 'Contact us:', 'lsx' ), |
|
145 | - 'text' => wp_kses_post( '<a href="mailto:[email protected]><i class="fa fa-envelope fa-fw"></i> [email protected]</a><br><a href="tel:+27214489843"><i class="fa fa-phone fa-fw"></i> +27 21 448 9843</a><br><i class="fa fa-skype fa-fw"></i> /lightspeeddevelopment' ), |
|
146 | - ), |
|
147 | - ), |
|
148 | - ), |
|
149 | - |
|
150 | - 'sidebar-footer-cta' => array( |
|
151 | - 'custom_widget_1' => array( |
|
152 | - 'text', |
|
153 | - |
|
154 | - array( |
|
155 | - 'title' => esc_html__( 'A Footer Call to Action', 'lsx' ), |
|
156 | - 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.', 'lsx' ), |
|
157 | - ), |
|
158 | - ), |
|
159 | - ), |
|
160 | - ), |
|
161 | - |
|
162 | - 'posts' => array( |
|
163 | - 'home' => array( |
|
164 | - 'template' => 'page-templates/template-front-page.php', |
|
165 | - 'thumbnail' => '{{image-banner-example-01}}', |
|
166 | - 'post_title' => esc_html__( 'LSX is a free WordPress theme', 'lsx' ), |
|
167 | - 'post_content' => '', |
|
168 | - ), |
|
169 | - |
|
170 | - 'about' => array( |
|
171 | - 'thumbnail' => '{{image-banner-example-02}}', |
|
172 | - ), |
|
173 | - |
|
174 | - 'blog', |
|
175 | - |
|
176 | - 'contact' => array( |
|
177 | - 'thumbnail' => '{{image-banner-example-03}}', |
|
178 | - ), |
|
179 | - ), |
|
180 | - |
|
181 | - 'attachments' => array( |
|
182 | - 'image-banner-example-01' => array( |
|
183 | - 'post_title' => esc_html_x( 'Banner Example 01', 'Theme starter content', 'lsx' ), |
|
184 | - 'file' => 'assets/images/admin/banner-example-01.jpg', |
|
185 | - ), |
|
186 | - |
|
187 | - 'image-banner-example-02' => array( |
|
188 | - 'post_title' => esc_html_x( 'Banner Example 02', 'Theme starter content', 'lsx' ), |
|
189 | - 'file' => 'assets/images/admin/banner-example-02.jpg', |
|
190 | - ), |
|
191 | - |
|
192 | - 'image-banner-example-03' => array( |
|
193 | - 'post_title' => esc_html_x( 'Banner Example 03', 'Theme starter content', 'lsx' ), |
|
194 | - 'file' => 'assets/images/admin/banner-example-03.jpg', |
|
195 | - ), |
|
196 | - ), |
|
197 | - |
|
198 | - 'options' => array( |
|
199 | - 'show_on_front' => 'page', |
|
200 | - 'page_on_front' => '{{home}}', |
|
201 | - 'page_for_posts' => '{{blog}}', |
|
202 | - 'blogdescription' => esc_html__( 'LSX starter content example', 'lsx' ), |
|
203 | - ), |
|
204 | - |
|
205 | - 'nav_menus' => array( |
|
206 | - 'primary' => array( |
|
207 | - 'name' => esc_html__( 'Primary Menu', 'lsx' ), |
|
208 | - |
|
209 | - 'items' => array( |
|
210 | - 'page_home', |
|
211 | - 'page_about', |
|
212 | - 'page_blog', |
|
213 | - 'page_contact', |
|
214 | - ), |
|
215 | - ), |
|
216 | - |
|
217 | - 'top-menu' => array( |
|
218 | - 'name' => esc_html__( 'Top Menu', 'lsx' ), |
|
219 | - |
|
220 | - 'items' => array( |
|
221 | - 'custom_link_1' => array( |
|
222 | - 'title' => 'View Map', |
|
223 | - 'url' => 'https://www.google.com/maps/place/LightSpeed+WordPress+Development/@-33.92945,18.45345,17z/data=!3m1!4b1!4m2!3m1!1s0x1dcc5da1b2446d25:0xc8ecdb1cc8afd170', |
|
224 | - 'classes' => 'map', |
|
225 | - ), |
|
226 | - |
|
227 | - 'custom_link_2' => array( |
|
228 | - 'title' => '+27 21 448 9843', |
|
229 | - 'url' => 'tel:+27214489843', |
|
230 | - 'classes' => 'tel', |
|
231 | - ), |
|
232 | - |
|
233 | - 'custom_link_3' => array( |
|
234 | - 'title' => '[email protected]', |
|
235 | - 'url' => 'mailto:[email protected]', |
|
236 | - 'classes' => 'email', |
|
237 | - ), |
|
238 | - |
|
239 | - 'page_contact' => array( |
|
240 | - 'classes' => 'cta', |
|
241 | - ), |
|
242 | - ), |
|
243 | - ), |
|
244 | - |
|
245 | - 'social' => array( |
|
246 | - 'name' => esc_html__( 'Social Menu', 'lsx' ), |
|
247 | - |
|
248 | - 'items' => array( |
|
249 | - 'link_facebook', |
|
250 | - 'link_foursquare', |
|
251 | - 'link_github', |
|
252 | - 'link_instagram', |
|
253 | - 'link_linkedin', |
|
254 | - 'link_pinterest', |
|
255 | - 'link_twitter', |
|
256 | - 'link_youtube', |
|
257 | - ), |
|
258 | - ), |
|
259 | - |
|
260 | - 'footer' => array( |
|
261 | - 'name' => esc_html__( 'Footer Menu', 'lsx' ), |
|
262 | - |
|
263 | - 'items' => array( |
|
264 | - 'page_about', |
|
265 | - 'page_contact', |
|
266 | - ), |
|
267 | - ), |
|
268 | - ), |
|
269 | - |
|
270 | - 'theme_mods' => array( |
|
271 | - 'lsx_header_fixed' => true, |
|
272 | - 'lsx_header_search' => false, |
|
273 | - 'lsx_layout' => '1c', |
|
274 | - ), |
|
275 | - ) ); |
|
276 | - } |
|
89 | + // add_theme_support( 'woocommerce' );. |
|
90 | + add_theme_support( 'starter-content', array( |
|
91 | + 'widgets' => array( |
|
92 | + 'sidebar-home' => array( |
|
93 | + 'custom_widget_1' => array( |
|
94 | + 'text', |
|
95 | + |
|
96 | + array( |
|
97 | + 'title' => '', |
|
98 | + 'text' => wp_kses_post( '<div class="row"><div class="col-sm-12 text-center"><h3>Build your perfect website <small>with the LSX theme</small></h3></div></div><div class="row"><div class="col-sm-4 text-center"><h4>Fast</h4><p>"Quick" isn\'t a word most people use when describing their website building experience.</p></div><div class="col-sm-4 text-center"><h4>Easy</h4><p>We\'ve built websites for countless clients, and we know what kind of back-end makes sense easily.</p></div><div class="col-sm-4 text-center"><h4>Comprehensive</h4><p>The LSX extensions come with features out the box that are essential.</p></div></div>' ), |
|
99 | + ), |
|
100 | + ), |
|
101 | + |
|
102 | + 'custom_widget_2' => array( |
|
103 | + 'text', |
|
104 | + |
|
105 | + array( |
|
106 | + 'title' => '', |
|
107 | + 'text' => wp_kses_post( '<div class="lsx-full-width-alt"><div class="row"><div class="col-xs-12"><h3>A big CTA title</h3><p class="text-center"><a class="btn cta-btn" href="http://www.lsdeb.biz/" target="_blank" rel="noreferrer noopener">Hire Us</a><p></div></div></div>' ), |
|
108 | + ), |
|
109 | + ), |
|
110 | + |
|
111 | + 'custom_widget_3' => array( |
|
112 | + 'text', |
|
113 | + |
|
114 | + array( |
|
115 | + 'title' => '', |
|
116 | + 'text' => wp_kses_post( '<div class="row"><div class="col-xs-12"><h3>Homepage Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.</p></div></div>' ), |
|
117 | + ), |
|
118 | + ), |
|
119 | + ), |
|
120 | + |
|
121 | + 'sidebar-footer' => array( |
|
122 | + 'custom_widget_1' => array( |
|
123 | + 'text', |
|
124 | + |
|
125 | + array( |
|
126 | + 'title' => esc_html__( 'Space for Footer Widgets', 'lsx' ), |
|
127 | + 'text' => esc_html__( 'This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx' ), |
|
128 | + ), |
|
129 | + ), |
|
130 | + |
|
131 | + 'custom_widget_2' => array( |
|
132 | + 'text', |
|
133 | + |
|
134 | + array( |
|
135 | + 'title' => esc_html__( 'Space for Footer Widgets', 'lsx' ), |
|
136 | + 'text' => esc_html__( 'This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx' ), |
|
137 | + ), |
|
138 | + ), |
|
139 | + |
|
140 | + 'custom_widget_3' => array( |
|
141 | + 'text', |
|
142 | + |
|
143 | + array( |
|
144 | + 'title' => esc_html__( 'Contact us:', 'lsx' ), |
|
145 | + 'text' => wp_kses_post( '<a href="mailto:[email protected]><i class="fa fa-envelope fa-fw"></i> [email protected]</a><br><a href="tel:+27214489843"><i class="fa fa-phone fa-fw"></i> +27 21 448 9843</a><br><i class="fa fa-skype fa-fw"></i> /lightspeeddevelopment' ), |
|
146 | + ), |
|
147 | + ), |
|
148 | + ), |
|
149 | + |
|
150 | + 'sidebar-footer-cta' => array( |
|
151 | + 'custom_widget_1' => array( |
|
152 | + 'text', |
|
153 | + |
|
154 | + array( |
|
155 | + 'title' => esc_html__( 'A Footer Call to Action', 'lsx' ), |
|
156 | + 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.', 'lsx' ), |
|
157 | + ), |
|
158 | + ), |
|
159 | + ), |
|
160 | + ), |
|
161 | + |
|
162 | + 'posts' => array( |
|
163 | + 'home' => array( |
|
164 | + 'template' => 'page-templates/template-front-page.php', |
|
165 | + 'thumbnail' => '{{image-banner-example-01}}', |
|
166 | + 'post_title' => esc_html__( 'LSX is a free WordPress theme', 'lsx' ), |
|
167 | + 'post_content' => '', |
|
168 | + ), |
|
169 | + |
|
170 | + 'about' => array( |
|
171 | + 'thumbnail' => '{{image-banner-example-02}}', |
|
172 | + ), |
|
173 | + |
|
174 | + 'blog', |
|
175 | + |
|
176 | + 'contact' => array( |
|
177 | + 'thumbnail' => '{{image-banner-example-03}}', |
|
178 | + ), |
|
179 | + ), |
|
180 | + |
|
181 | + 'attachments' => array( |
|
182 | + 'image-banner-example-01' => array( |
|
183 | + 'post_title' => esc_html_x( 'Banner Example 01', 'Theme starter content', 'lsx' ), |
|
184 | + 'file' => 'assets/images/admin/banner-example-01.jpg', |
|
185 | + ), |
|
186 | + |
|
187 | + 'image-banner-example-02' => array( |
|
188 | + 'post_title' => esc_html_x( 'Banner Example 02', 'Theme starter content', 'lsx' ), |
|
189 | + 'file' => 'assets/images/admin/banner-example-02.jpg', |
|
190 | + ), |
|
191 | + |
|
192 | + 'image-banner-example-03' => array( |
|
193 | + 'post_title' => esc_html_x( 'Banner Example 03', 'Theme starter content', 'lsx' ), |
|
194 | + 'file' => 'assets/images/admin/banner-example-03.jpg', |
|
195 | + ), |
|
196 | + ), |
|
197 | + |
|
198 | + 'options' => array( |
|
199 | + 'show_on_front' => 'page', |
|
200 | + 'page_on_front' => '{{home}}', |
|
201 | + 'page_for_posts' => '{{blog}}', |
|
202 | + 'blogdescription' => esc_html__( 'LSX starter content example', 'lsx' ), |
|
203 | + ), |
|
204 | + |
|
205 | + 'nav_menus' => array( |
|
206 | + 'primary' => array( |
|
207 | + 'name' => esc_html__( 'Primary Menu', 'lsx' ), |
|
208 | + |
|
209 | + 'items' => array( |
|
210 | + 'page_home', |
|
211 | + 'page_about', |
|
212 | + 'page_blog', |
|
213 | + 'page_contact', |
|
214 | + ), |
|
215 | + ), |
|
216 | + |
|
217 | + 'top-menu' => array( |
|
218 | + 'name' => esc_html__( 'Top Menu', 'lsx' ), |
|
219 | + |
|
220 | + 'items' => array( |
|
221 | + 'custom_link_1' => array( |
|
222 | + 'title' => 'View Map', |
|
223 | + 'url' => 'https://www.google.com/maps/place/LightSpeed+WordPress+Development/@-33.92945,18.45345,17z/data=!3m1!4b1!4m2!3m1!1s0x1dcc5da1b2446d25:0xc8ecdb1cc8afd170', |
|
224 | + 'classes' => 'map', |
|
225 | + ), |
|
226 | + |
|
227 | + 'custom_link_2' => array( |
|
228 | + 'title' => '+27 21 448 9843', |
|
229 | + 'url' => 'tel:+27214489843', |
|
230 | + 'classes' => 'tel', |
|
231 | + ), |
|
232 | + |
|
233 | + 'custom_link_3' => array( |
|
234 | + 'title' => '[email protected]', |
|
235 | + 'url' => 'mailto:[email protected]', |
|
236 | + 'classes' => 'email', |
|
237 | + ), |
|
238 | + |
|
239 | + 'page_contact' => array( |
|
240 | + 'classes' => 'cta', |
|
241 | + ), |
|
242 | + ), |
|
243 | + ), |
|
244 | + |
|
245 | + 'social' => array( |
|
246 | + 'name' => esc_html__( 'Social Menu', 'lsx' ), |
|
247 | + |
|
248 | + 'items' => array( |
|
249 | + 'link_facebook', |
|
250 | + 'link_foursquare', |
|
251 | + 'link_github', |
|
252 | + 'link_instagram', |
|
253 | + 'link_linkedin', |
|
254 | + 'link_pinterest', |
|
255 | + 'link_twitter', |
|
256 | + 'link_youtube', |
|
257 | + ), |
|
258 | + ), |
|
259 | + |
|
260 | + 'footer' => array( |
|
261 | + 'name' => esc_html__( 'Footer Menu', 'lsx' ), |
|
262 | + |
|
263 | + 'items' => array( |
|
264 | + 'page_about', |
|
265 | + 'page_contact', |
|
266 | + ), |
|
267 | + ), |
|
268 | + ), |
|
269 | + |
|
270 | + 'theme_mods' => array( |
|
271 | + 'lsx_header_fixed' => true, |
|
272 | + 'lsx_header_search' => false, |
|
273 | + 'lsx_layout' => '1c', |
|
274 | + ), |
|
275 | + ) ); |
|
276 | + } |
|
277 | 277 | |
278 | 278 | endif; |
279 | 279 | |
@@ -281,21 +281,21 @@ discard block |
||
281 | 281 | |
282 | 282 | if ( ! function_exists( 'lsx_init' ) ) : |
283 | 283 | |
284 | - /** |
|
285 | - * Theme init action. |
|
286 | - * |
|
287 | - * @package lsx |
|
288 | - * @subpackage config |
|
289 | - */ |
|
290 | - function lsx_init() { |
|
291 | - add_post_type_support( 'page', 'excerpt' ); |
|
284 | + /** |
|
285 | + * Theme init action. |
|
286 | + * |
|
287 | + * @package lsx |
|
288 | + * @subpackage config |
|
289 | + */ |
|
290 | + function lsx_init() { |
|
291 | + add_post_type_support( 'page', 'excerpt' ); |
|
292 | 292 | |
293 | - if ( class_exists( 'WooCommerce' ) ) { |
|
294 | - remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 ); |
|
295 | - } |
|
293 | + if ( class_exists( 'WooCommerce' ) ) { |
|
294 | + remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 ); |
|
295 | + } |
|
296 | 296 | |
297 | - remove_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce', 10 ); |
|
298 | - } |
|
297 | + remove_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce', 10 ); |
|
298 | + } |
|
299 | 299 | |
300 | 300 | endif; |
301 | 301 | |
@@ -303,22 +303,22 @@ discard block |
||
303 | 303 | |
304 | 304 | if ( ! function_exists( 'lsx_process_content_width' ) ) : |
305 | 305 | |
306 | - /** |
|
307 | - * Overwrite the $content_width var, based on the layout of the page. |
|
308 | - * |
|
309 | - * @package lsx |
|
310 | - * @subpackage config |
|
311 | - */ |
|
312 | - function lsx_process_content_width() { |
|
313 | - global $content_width; |
|
314 | - |
|
315 | - if ( |
|
316 | - is_page_template( 'page-templates/template-front-page.php' ) || |
|
317 | - is_page_template( 'page-templates/template-full-width.php' ) |
|
318 | - ) { |
|
319 | - $content_width = 1140; |
|
320 | - } |
|
321 | - } |
|
306 | + /** |
|
307 | + * Overwrite the $content_width var, based on the layout of the page. |
|
308 | + * |
|
309 | + * @package lsx |
|
310 | + * @subpackage config |
|
311 | + */ |
|
312 | + function lsx_process_content_width() { |
|
313 | + global $content_width; |
|
314 | + |
|
315 | + if ( |
|
316 | + is_page_template( 'page-templates/template-front-page.php' ) || |
|
317 | + is_page_template( 'page-templates/template-full-width.php' ) |
|
318 | + ) { |
|
319 | + $content_width = 1140; |
|
320 | + } |
|
321 | + } |
|
322 | 322 | |
323 | 323 | endif; |
324 | 324 | |
@@ -326,31 +326,31 @@ discard block |
||
326 | 326 | |
327 | 327 | if ( ! function_exists( 'lsx_file_get_contents' ) ) : |
328 | 328 | |
329 | - /** |
|
330 | - * Get file contents. |
|
331 | - * |
|
332 | - * @package lsx |
|
333 | - * @subpackage config |
|
334 | - */ |
|
335 | - function lsx_file_get_contents( $file ) { |
|
336 | - if ( file_exists( $file ) ) { |
|
337 | - global $wp_filesystem; |
|
338 | - |
|
339 | - if ( empty( $wp_filesystem ) ) { |
|
340 | - require_once ABSPATH . 'wp-admin/includes/file.php'; |
|
341 | - WP_Filesystem(); |
|
342 | - } |
|
343 | - |
|
344 | - if ( $wp_filesystem ) { |
|
345 | - $contents = $wp_filesystem->get_contents( $file ); |
|
346 | - |
|
347 | - if ( ! empty( $contents ) ) { |
|
348 | - return $contents; |
|
349 | - } |
|
350 | - } |
|
351 | - } |
|
352 | - |
|
353 | - return ''; |
|
354 | - } |
|
329 | + /** |
|
330 | + * Get file contents. |
|
331 | + * |
|
332 | + * @package lsx |
|
333 | + * @subpackage config |
|
334 | + */ |
|
335 | + function lsx_file_get_contents( $file ) { |
|
336 | + if ( file_exists( $file ) ) { |
|
337 | + global $wp_filesystem; |
|
338 | + |
|
339 | + if ( empty( $wp_filesystem ) ) { |
|
340 | + require_once ABSPATH . 'wp-admin/includes/file.php'; |
|
341 | + WP_Filesystem(); |
|
342 | + } |
|
343 | + |
|
344 | + if ( $wp_filesystem ) { |
|
345 | + $contents = $wp_filesystem->get_contents( $file ); |
|
346 | + |
|
347 | + if ( ! empty( $contents ) ) { |
|
348 | + return $contents; |
|
349 | + } |
|
350 | + } |
|
351 | + } |
|
352 | + |
|
353 | + return ''; |
|
354 | + } |
|
355 | 355 | |
356 | 356 | endif; |