@@ -6,11 +6,11 @@ discard block |
||
6 | 6 | * @subpackage layout |
7 | 7 | */ |
8 | 8 | |
9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
9 | +if ( ! defined('ABSPATH')) { |
|
10 | 10 | exit; |
11 | 11 | } |
12 | 12 | |
13 | -if ( ! function_exists( 'lsx_wc_support' ) ) : |
|
13 | +if ( ! function_exists('lsx_wc_support')) : |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * WooCommerce support. |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | * @subpackage woocommerce |
20 | 20 | */ |
21 | 21 | function lsx_wc_support() { |
22 | - add_theme_support( 'woocommerce' ); |
|
22 | + add_theme_support('woocommerce'); |
|
23 | 23 | } |
24 | 24 | |
25 | - add_action( 'after_setup_theme', 'lsx_wc_support' ); |
|
25 | + add_action('after_setup_theme', 'lsx_wc_support'); |
|
26 | 26 | |
27 | 27 | endif; |
28 | 28 | |
29 | -if ( ! function_exists( 'lsx_wc_scripts_add_styles' ) ) : |
|
29 | +if ( ! function_exists('lsx_wc_scripts_add_styles')) : |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * WooCommerce enqueue styles. |
@@ -35,25 +35,25 @@ discard block |
||
35 | 35 | * @subpackage woocommerce |
36 | 36 | */ |
37 | 37 | function lsx_wc_scripts_add_styles() { |
38 | - wp_enqueue_style( 'woocommerce-lsx', get_template_directory_uri() . '/assets/css/woocommerce.css', array( 'lsx_main' ), LSX_VERSION ); |
|
39 | - wp_style_add_data( 'woocommerce-lsx', 'rtl', 'replace' ); |
|
38 | + wp_enqueue_style('woocommerce-lsx', get_template_directory_uri() . '/assets/css/woocommerce.css', array('lsx_main'), LSX_VERSION); |
|
39 | + wp_style_add_data('woocommerce-lsx', 'rtl', 'replace'); |
|
40 | 40 | |
41 | 41 | // Remove select2 added by WooCommerce |
42 | 42 | |
43 | - if ( ! is_admin() ) { |
|
44 | - wp_dequeue_style( 'select2' ); |
|
45 | - wp_deregister_style( 'select2' ); |
|
43 | + if ( ! is_admin()) { |
|
44 | + wp_dequeue_style('select2'); |
|
45 | + wp_deregister_style('select2'); |
|
46 | 46 | |
47 | - wp_dequeue_script( 'select2' ); |
|
47 | + wp_dequeue_script('select2'); |
|
48 | 48 | //wp_deregister_script( 'select2' ); |
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
52 | - add_action( 'wp_enqueue_scripts', 'lsx_wc_scripts_add_styles' ); |
|
52 | + add_action('wp_enqueue_scripts', 'lsx_wc_scripts_add_styles'); |
|
53 | 53 | |
54 | 54 | endif; |
55 | 55 | |
56 | -if ( ! function_exists( 'lsx_wc_form_field_args' ) ) : |
|
56 | +if ( ! function_exists('lsx_wc_form_field_args')) : |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * WooCommerce form fields. |
@@ -61,17 +61,17 @@ discard block |
||
61 | 61 | * @package lsx |
62 | 62 | * @subpackage woocommerce |
63 | 63 | */ |
64 | - function lsx_wc_form_field_args( $args, $key, $value ) { |
|
64 | + function lsx_wc_form_field_args($args, $key, $value) { |
|
65 | 65 | $args['input_class'][] = 'form-control'; |
66 | 66 | |
67 | 67 | return $args; |
68 | 68 | } |
69 | 69 | |
70 | - add_action( 'woocommerce_form_field_args', 'lsx_wc_form_field_args', 10, 3 ); |
|
70 | + add_action('woocommerce_form_field_args', 'lsx_wc_form_field_args', 10, 3); |
|
71 | 71 | |
72 | 72 | endif; |
73 | 73 | |
74 | -if ( ! function_exists( 'lsx_wc_theme_wrapper_start' ) ) : |
|
74 | +if ( ! function_exists('lsx_wc_theme_wrapper_start')) : |
|
75 | 75 | |
76 | 76 | /** |
77 | 77 | * WooCommerce wrapper start. |
@@ -81,18 +81,18 @@ discard block |
||
81 | 81 | */ |
82 | 82 | function lsx_wc_theme_wrapper_start() { |
83 | 83 | lsx_content_wrap_before(); |
84 | - echo '<div id="primary" class="content-area ' . esc_attr( lsx_main_class() ) . '">'; |
|
84 | + echo '<div id="primary" class="content-area ' . esc_attr(lsx_main_class()) . '">'; |
|
85 | 85 | lsx_content_before(); |
86 | 86 | echo '<main id="main" class="site-main" role="main">'; |
87 | 87 | lsx_content_top(); |
88 | 88 | } |
89 | 89 | |
90 | - remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); |
|
91 | - add_action( 'woocommerce_before_main_content', 'lsx_wc_theme_wrapper_start' ); |
|
90 | + remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); |
|
91 | + add_action('woocommerce_before_main_content', 'lsx_wc_theme_wrapper_start'); |
|
92 | 92 | |
93 | 93 | endif; |
94 | 94 | |
95 | -if ( ! function_exists( 'lsx_wc_theme_wrapper_end' ) ) : |
|
95 | +if ( ! function_exists('lsx_wc_theme_wrapper_end')) : |
|
96 | 96 | |
97 | 97 | /** |
98 | 98 | * WooCommerce wrapper end. |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | lsx_content_wrap_after(); |
109 | 109 | } |
110 | 110 | |
111 | - remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); |
|
112 | - add_action( 'woocommerce_after_main_content', 'lsx_wc_theme_wrapper_end' ); |
|
111 | + remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); |
|
112 | + add_action('woocommerce_after_main_content', 'lsx_wc_theme_wrapper_end'); |
|
113 | 113 | |
114 | 114 | endif; |
115 | 115 | |
116 | -if ( ! function_exists( 'lsx_wc_disable_lsx_banner_plugin' ) ) : |
|
116 | +if ( ! function_exists('lsx_wc_disable_lsx_banner_plugin')) : |
|
117 | 117 | |
118 | 118 | /** |
119 | 119 | * Disable LSX Banners plugin in some WC pages. |
@@ -121,19 +121,19 @@ discard block |
||
121 | 121 | * @package lsx |
122 | 122 | * @subpackage woocommerce |
123 | 123 | */ |
124 | - function lsx_wc_disable_lsx_banner_plugin( $disabled ) { |
|
125 | - if ( is_cart() || is_checkout() || is_account_page() ) { |
|
124 | + function lsx_wc_disable_lsx_banner_plugin($disabled) { |
|
125 | + if (is_cart() || is_checkout() || is_account_page()) { |
|
126 | 126 | $disabled = true; |
127 | 127 | } |
128 | 128 | |
129 | 129 | return $disabled; |
130 | 130 | } |
131 | 131 | |
132 | - add_filter( 'lsx_banner_plugin_disable', 'lsx_wc_disable_lsx_banner_plugin' ); |
|
132 | + add_filter('lsx_banner_plugin_disable', 'lsx_wc_disable_lsx_banner_plugin'); |
|
133 | 133 | |
134 | 134 | endif; |
135 | 135 | |
136 | -if ( ! function_exists( 'lsx_wc_disable_lsx_banner' ) ) : |
|
136 | +if ( ! function_exists('lsx_wc_disable_lsx_banner')) : |
|
137 | 137 | |
138 | 138 | /** |
139 | 139 | * Disable LSX Banners banner in some WC pages. |
@@ -141,19 +141,19 @@ discard block |
||
141 | 141 | * @package lsx |
142 | 142 | * @subpackage woocommerce |
143 | 143 | */ |
144 | - function lsx_wc_disable_lsx_banner( $disabled ) { |
|
145 | - if ( is_shop() || is_product_category() || is_product_tag() || is_product() ) { |
|
144 | + function lsx_wc_disable_lsx_banner($disabled) { |
|
145 | + if (is_shop() || is_product_category() || is_product_tag() || is_product()) { |
|
146 | 146 | $disabled = true; |
147 | 147 | } |
148 | 148 | |
149 | 149 | return $disabled; |
150 | 150 | } |
151 | 151 | |
152 | - add_filter( 'lsx_banner_disable', 'lsx_wc_disable_lsx_banner' ); |
|
152 | + add_filter('lsx_banner_disable', 'lsx_wc_disable_lsx_banner'); |
|
153 | 153 | |
154 | 154 | endif; |
155 | 155 | |
156 | -if ( ! function_exists( 'lsx_wc_add_cart' ) ) : |
|
156 | +if ( ! function_exists('lsx_wc_add_cart')) : |
|
157 | 157 | |
158 | 158 | /** |
159 | 159 | * Adds WC cart to the header. |
@@ -161,32 +161,32 @@ discard block |
||
161 | 161 | * @package lsx |
162 | 162 | * @subpackage template-tags |
163 | 163 | */ |
164 | - function lsx_wc_add_cart( $items, $args ) { |
|
165 | - $cart_menu_item_position = apply_filters( 'lsx_wc_cart_menu_item_position', 'primary' ); |
|
164 | + function lsx_wc_add_cart($items, $args) { |
|
165 | + $cart_menu_item_position = apply_filters('lsx_wc_cart_menu_item_position', 'primary'); |
|
166 | 166 | |
167 | - if ( $cart_menu_item_position === $args->theme_location ) { |
|
168 | - $customizer_option = get_theme_mod( 'lsx_header_wc_cart', false ); |
|
167 | + if ($cart_menu_item_position === $args->theme_location) { |
|
168 | + $customizer_option = get_theme_mod('lsx_header_wc_cart', false); |
|
169 | 169 | |
170 | - if ( ! empty( $customizer_option ) ) { |
|
170 | + if ( ! empty($customizer_option)) { |
|
171 | 171 | ob_start(); |
172 | - the_widget( 'WC_Widget_Cart', 'title=' ); |
|
172 | + the_widget('WC_Widget_Cart', 'title='); |
|
173 | 173 | $widget = ob_get_clean(); |
174 | 174 | |
175 | - if ( is_cart() ) { |
|
175 | + if (is_cart()) { |
|
176 | 176 | $item_class = 'current-menu-item'; |
177 | 177 | } else { |
178 | 178 | $item_class = ''; |
179 | 179 | } |
180 | 180 | |
181 | 181 | $item_class = 'menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children dropdown lsx-wc-cart-menu-item ' . $class; |
182 | - $item_class = apply_filters( 'lsx_wc_cart_menu_item_class', $item_class ); |
|
182 | + $item_class = apply_filters('lsx_wc_cart_menu_item_class', $item_class); |
|
183 | 183 | |
184 | 184 | $item = '<li class="' . $item_class . '">' . |
185 | - '<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">' . |
|
186 | - '<span class="lsx-wc-cart-amount">' . wp_kses_data( WC()->cart->get_cart_subtotal() ) . '</span>' . |
|
185 | + '<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">' . |
|
186 | + '<span class="lsx-wc-cart-amount">' . wp_kses_data(WC()->cart->get_cart_subtotal()) . '</span>' . |
|
187 | 187 | /* Translators: %s: items quantity */ |
188 | - '<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>' . |
|
189 | - ( ! empty( WC()->cart->get_cart_contents_count() ) ? '<span class="lsx-wc-cart-count-badge">' . wp_kses_data( WC()->cart->get_cart_contents_count() ) . '</span>' : '' ) . |
|
188 | + '<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>' . |
|
189 | + ( ! empty(WC()->cart->get_cart_contents_count()) ? '<span class="lsx-wc-cart-count-badge">' . wp_kses_data(WC()->cart->get_cart_contents_count()) . '</span>' : '') . |
|
190 | 190 | '</a>' . |
191 | 191 | '<ul role="menu" class=" dropdown-menu lsx-wc-cart-sub-menu">' . |
192 | 192 | '<li>' . |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | '</ul>' . |
196 | 196 | '</li>'; |
197 | 197 | |
198 | - if ( 'top-menu' === $args->theme_location ) { |
|
198 | + if ('top-menu' === $args->theme_location) { |
|
199 | 199 | $items = $item . $items; |
200 | 200 | } else { |
201 | 201 | $items = $items . $item; |
@@ -206,11 +206,11 @@ discard block |
||
206 | 206 | return $items; |
207 | 207 | } |
208 | 208 | |
209 | - add_filter( 'wp_nav_menu_items', 'lsx_wc_add_cart', 10, 2 ); |
|
209 | + add_filter('wp_nav_menu_items', 'lsx_wc_add_cart', 10, 2); |
|
210 | 210 | |
211 | 211 | endif; |
212 | 212 | |
213 | -if ( ! function_exists( 'lsx_wc_products_widget_wrapper_before' ) ) : |
|
213 | +if ( ! function_exists('lsx_wc_products_widget_wrapper_before')) : |
|
214 | 214 | |
215 | 215 | /** |
216 | 216 | * Change WC products widget wrapper (before). |
@@ -218,16 +218,16 @@ discard block |
||
218 | 218 | * @package lsx |
219 | 219 | * @subpackage woocommerce |
220 | 220 | */ |
221 | - function lsx_wc_products_widget_wrapper_before( $html ) { |
|
221 | + function lsx_wc_products_widget_wrapper_before($html) { |
|
222 | 222 | $html = '<div class="lsx-woocommerce-slider lsx-woocommerce-shortcode">'; |
223 | 223 | return $html; |
224 | 224 | } |
225 | 225 | |
226 | - add_filter( 'woocommerce_before_widget_product_list', 'lsx_wc_products_widget_wrapper_before', 15 ); |
|
226 | + add_filter('woocommerce_before_widget_product_list', 'lsx_wc_products_widget_wrapper_before', 15); |
|
227 | 227 | |
228 | 228 | endif; |
229 | 229 | |
230 | -if ( ! function_exists( 'lsx_wc_products_widget_wrapper_after' ) ) : |
|
230 | +if ( ! function_exists('lsx_wc_products_widget_wrapper_after')) : |
|
231 | 231 | |
232 | 232 | /** |
233 | 233 | * Change WC products widget wrapper (after). |
@@ -235,16 +235,16 @@ discard block |
||
235 | 235 | * @package lsx |
236 | 236 | * @subpackage woocommerce |
237 | 237 | */ |
238 | - function lsx_wc_products_widget_wrapper_after( $html ) { |
|
238 | + function lsx_wc_products_widget_wrapper_after($html) { |
|
239 | 239 | $html = '</div>'; |
240 | 240 | return $html; |
241 | 241 | } |
242 | 242 | |
243 | - add_filter( 'woocommerce_after_widget_product_list', 'lsx_wc_products_widget_wrapper_after', 15 ); |
|
243 | + add_filter('woocommerce_after_widget_product_list', 'lsx_wc_products_widget_wrapper_after', 15); |
|
244 | 244 | |
245 | 245 | endif; |
246 | 246 | |
247 | -if ( ! function_exists( 'lsx_wc_reviews_widget_override' ) ) : |
|
247 | +if ( ! function_exists('lsx_wc_reviews_widget_override')) : |
|
248 | 248 | |
249 | 249 | /** |
250 | 250 | * Override WC ewviews widget. |
@@ -253,18 +253,18 @@ discard block |
||
253 | 253 | * @subpackage woocommerce |
254 | 254 | */ |
255 | 255 | function lsx_wc_reviews_widget_override() { |
256 | - if ( class_exists( 'WC_Widget_Recent_Reviews' ) ) { |
|
257 | - unregister_widget( 'WC_Widget_Recent_Reviews' ); |
|
256 | + if (class_exists('WC_Widget_Recent_Reviews')) { |
|
257 | + unregister_widget('WC_Widget_Recent_Reviews'); |
|
258 | 258 | require get_template_directory() . '/includes/classes/class-lsx-wc-widget-recent-reviews.php'; |
259 | - register_widget( 'LSX_WC_Widget_Recent_Reviews' ); |
|
259 | + register_widget('LSX_WC_Widget_Recent_Reviews'); |
|
260 | 260 | } |
261 | 261 | } |
262 | 262 | |
263 | - add_action( 'widgets_init', 'lsx_wc_reviews_widget_override', 15 ); |
|
263 | + add_action('widgets_init', 'lsx_wc_reviews_widget_override', 15); |
|
264 | 264 | |
265 | 265 | endif; |
266 | 266 | |
267 | -if ( ! function_exists( 'lsx_wc_change_price_html' ) ) : |
|
267 | +if ( ! function_exists('lsx_wc_change_price_html')) : |
|
268 | 268 | |
269 | 269 | /** |
270 | 270 | * Change WC ZERO price to "free". |
@@ -272,28 +272,28 @@ discard block |
||
272 | 272 | * @package lsx |
273 | 273 | * @subpackage woocommerce |
274 | 274 | */ |
275 | - function lsx_wc_change_price_html( $price, $product ) { |
|
276 | - if ( empty( $product->get_price() ) ) { |
|
277 | - if ( $product->is_on_sale() && $product->get_regular_price() ) { |
|
278 | - $regular_price = wc_get_price_to_display( $product, array( |
|
275 | + function lsx_wc_change_price_html($price, $product) { |
|
276 | + if (empty($product->get_price())) { |
|
277 | + if ($product->is_on_sale() && $product->get_regular_price()) { |
|
278 | + $regular_price = wc_get_price_to_display($product, array( |
|
279 | 279 | 'qty' => 1, |
280 | 280 | 'price' => $product->get_regular_price(), |
281 | - ) ); |
|
281 | + )); |
|
282 | 282 | |
283 | - $price = wc_format_price_range( $regular_price, esc_html__( 'Free!', 'lsx' ) ); |
|
283 | + $price = wc_format_price_range($regular_price, esc_html__('Free!', 'lsx')); |
|
284 | 284 | } else { |
285 | - $price = '<span class="amount">' . esc_html__( 'Free!', 'lsx' ) . '</span>'; |
|
285 | + $price = '<span class="amount">' . esc_html__('Free!', 'lsx') . '</span>'; |
|
286 | 286 | } |
287 | 287 | } |
288 | 288 | |
289 | 289 | return $price; |
290 | 290 | } |
291 | 291 | |
292 | - add_filter( 'woocommerce_get_price_html', 'lsx_wc_change_price_html', 15, 2 ); |
|
292 | + add_filter('woocommerce_get_price_html', 'lsx_wc_change_price_html', 15, 2); |
|
293 | 293 | |
294 | 294 | endif; |
295 | 295 | |
296 | -if ( ! function_exists( 'lsx_wc_cart_link_fragment' ) ) : |
|
296 | +if ( ! function_exists('lsx_wc_cart_link_fragment')) : |
|
297 | 297 | |
298 | 298 | /** |
299 | 299 | * Cart Fragments. |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | * @package lsx |
303 | 303 | * @subpackage woocommerce |
304 | 304 | */ |
305 | - function lsx_wc_cart_link_fragment( $fragments ) { |
|
305 | + function lsx_wc_cart_link_fragment($fragments) { |
|
306 | 306 | global $woocommerce; |
307 | 307 | |
308 | 308 | ob_start(); |
@@ -313,8 +313,8 @@ discard block |
||
313 | 313 | lsx_wc_items_counter(); |
314 | 314 | $items_counter = ob_get_clean(); |
315 | 315 | |
316 | - if ( ! empty( $items_counter ) ) { |
|
317 | - $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'] ); |
|
316 | + if ( ! empty($items_counter)) { |
|
317 | + $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']); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | return $fragments; |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | |
323 | 323 | endif; |
324 | 324 | |
325 | -if ( ! function_exists( 'lsx_wc_cart_link' ) ) : |
|
325 | +if ( ! function_exists('lsx_wc_cart_link')) : |
|
326 | 326 | |
327 | 327 | /** |
328 | 328 | * Cart Link. |
@@ -333,14 +333,14 @@ discard block |
||
333 | 333 | */ |
334 | 334 | function lsx_wc_cart_link() { |
335 | 335 | ?> |
336 | - <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"> |
|
337 | - <span class="lsx-wc-cart-amount"><?php echo wp_kses_data( WC()->cart->get_cart_subtotal() ); ?></span> |
|
336 | + <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"> |
|
337 | + <span class="lsx-wc-cart-amount"><?php echo wp_kses_data(WC()->cart->get_cart_subtotal()); ?></span> |
|
338 | 338 | |
339 | 339 | <?php /* Translators: %s: items quantity */ ?> |
340 | - <span class="lsx-wc-cart-count"><?php echo wp_kses_data( sprintf( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'lsx' ), WC()->cart->get_cart_contents_count() ) );?></span> |
|
340 | + <span class="lsx-wc-cart-count"><?php echo wp_kses_data(sprintf(_n('%d item', '%d items', WC()->cart->get_cart_contents_count(), 'lsx'), WC()->cart->get_cart_contents_count())); ?></span> |
|
341 | 341 | |
342 | - <?php if ( ! empty( WC()->cart->get_cart_contents_count() ) ) : ?> |
|
343 | - <span class="lsx-wc-cart-count-badge"><?php echo wp_kses_data( WC()->cart->get_cart_contents_count() );?></span> |
|
342 | + <?php if ( ! empty(WC()->cart->get_cart_contents_count())) : ?> |
|
343 | + <span class="lsx-wc-cart-count-badge"><?php echo wp_kses_data(WC()->cart->get_cart_contents_count()); ?></span> |
|
344 | 344 | <?php endif; ?> |
345 | 345 | </a> |
346 | 346 | <?php |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | |
349 | 349 | endif; |
350 | 350 | |
351 | -if ( ! function_exists( 'lsx_wc_items_counter' ) ) : |
|
351 | +if ( ! function_exists('lsx_wc_items_counter')) : |
|
352 | 352 | |
353 | 353 | /** |
354 | 354 | * Add car item hidden items counter. |
@@ -360,21 +360,21 @@ discard block |
||
360 | 360 | $count = (int) WC()->cart->get_cart_contents_count(); |
361 | 361 | $items_counter = ''; |
362 | 362 | |
363 | - if ( ! empty( $count ) ) { |
|
363 | + if ( ! empty($count)) { |
|
364 | 364 | $count -= 3; |
365 | 365 | |
366 | - if ( 1 === $count ) { |
|
367 | - $items_counter = esc_html__( '1 other item in cart', 'lsx' ); |
|
368 | - } elseif ( $count > 1 ) { |
|
366 | + if (1 === $count) { |
|
367 | + $items_counter = esc_html__('1 other item in cart', 'lsx'); |
|
368 | + } elseif ($count > 1) { |
|
369 | 369 | /* Translators: %s: items counter */ |
370 | - $items_counter = sprintf( esc_html__( '%s other items in cart', 'lsx' ), $count ); |
|
370 | + $items_counter = sprintf(esc_html__('%s other items in cart', 'lsx'), $count); |
|
371 | 371 | } |
372 | 372 | } |
373 | 373 | |
374 | - if ( ! empty( $items_counter ) ) : |
|
374 | + if ( ! empty($items_counter)) : |
|
375 | 375 | ?> |
376 | 376 | <li class="woocommerce-mini-cart-item mini_cart_item" style="display: block;"> |
377 | - <a href="<?php echo esc_url( WC()->cart->get_cart_url() ); ?>"><?php echo esc_html( $items_counter ); ?></a> |
|
377 | + <a href="<?php echo esc_url(WC()->cart->get_cart_url()); ?>"><?php echo esc_html($items_counter); ?></a> |
|
378 | 378 | </li> |
379 | 379 | <?php |
380 | 380 | endif; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | |
383 | 383 | endif; |
384 | 384 | |
385 | -if ( ! function_exists( 'lsx_wc_loop_shop_per_page' ) ) : |
|
385 | +if ( ! function_exists('lsx_wc_loop_shop_per_page')) : |
|
386 | 386 | |
387 | 387 | /** |
388 | 388 | * Changes the number of products to display on shop. |
@@ -390,16 +390,16 @@ discard block |
||
390 | 390 | * @package lsx |
391 | 391 | * @subpackage woocommerce |
392 | 392 | */ |
393 | - function lsx_wc_loop_shop_per_page( $items ) { |
|
393 | + function lsx_wc_loop_shop_per_page($items) { |
|
394 | 394 | $items = 20; |
395 | 395 | return $items; |
396 | 396 | } |
397 | 397 | |
398 | - add_filter( 'loop_shop_per_page', 'lsx_wc_loop_shop_per_page', 20 ); |
|
398 | + add_filter('loop_shop_per_page', 'lsx_wc_loop_shop_per_page', 20); |
|
399 | 399 | |
400 | 400 | endif; |
401 | 401 | |
402 | -if ( ! function_exists( 'lsx_wc_add_to_cart_message_html' ) ) : |
|
402 | +if ( ! function_exists('lsx_wc_add_to_cart_message_html')) : |
|
403 | 403 | |
404 | 404 | /** |
405 | 405 | * Changes the "added to cart" message HTML. |
@@ -407,39 +407,39 @@ discard block |
||
407 | 407 | * @package lsx |
408 | 408 | * @subpackage woocommerce |
409 | 409 | */ |
410 | - function lsx_wc_add_to_cart_message_html( $message, $products ) { |
|
410 | + function lsx_wc_add_to_cart_message_html($message, $products) { |
|
411 | 411 | $message = '<div class="woocommerce-message-added-to-cart">' . $message . '</div>'; |
412 | 412 | return $message; |
413 | 413 | } |
414 | 414 | |
415 | - add_filter( 'wc_add_to_cart_message_html', 'lsx_wc_add_to_cart_message_html', 20, 2 ); |
|
415 | + add_filter('wc_add_to_cart_message_html', 'lsx_wc_add_to_cart_message_html', 20, 2); |
|
416 | 416 | |
417 | 417 | endif; |
418 | 418 | |
419 | -if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.3', '>=' ) ) { |
|
420 | - add_filter( 'woocommerce_add_to_cart_fragments', 'lsx_wc_cart_link_fragment' ); |
|
419 | +if (defined('WC_VERSION') && version_compare(WC_VERSION, '2.3', '>=')) { |
|
420 | + add_filter('woocommerce_add_to_cart_fragments', 'lsx_wc_cart_link_fragment'); |
|
421 | 421 | } else { |
422 | - add_filter( 'add_to_cart_fragments', 'lsx_wc_cart_link_fragment' ); |
|
422 | + add_filter('add_to_cart_fragments', 'lsx_wc_cart_link_fragment'); |
|
423 | 423 | } |
424 | 424 | |
425 | -remove_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 10 ); |
|
425 | +remove_action('woocommerce_after_shop_loop', 'woocommerce_pagination', 10); |
|
426 | 426 | |
427 | -add_action( 'woocommerce_after_shop_loop', 'lsx_wc_sorting_wrapper', 9 ); |
|
428 | -add_action( 'woocommerce_after_shop_loop', 'woocommerce_catalog_ordering', 10 ); |
|
429 | -add_action( 'woocommerce_after_shop_loop', 'woocommerce_result_count', 20 ); |
|
430 | -add_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 30 ); |
|
431 | -add_action( 'woocommerce_after_shop_loop', 'lsx_wc_sorting_wrapper_close', 31 ); |
|
427 | +add_action('woocommerce_after_shop_loop', 'lsx_wc_sorting_wrapper', 9); |
|
428 | +add_action('woocommerce_after_shop_loop', 'woocommerce_catalog_ordering', 10); |
|
429 | +add_action('woocommerce_after_shop_loop', 'woocommerce_result_count', 20); |
|
430 | +add_action('woocommerce_after_shop_loop', 'woocommerce_pagination', 30); |
|
431 | +add_action('woocommerce_after_shop_loop', 'lsx_wc_sorting_wrapper_close', 31); |
|
432 | 432 | |
433 | -remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 ); |
|
434 | -remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); |
|
433 | +remove_action('woocommerce_before_shop_loop', 'woocommerce_result_count', 20); |
|
434 | +remove_action('woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30); |
|
435 | 435 | |
436 | -add_action( 'woocommerce_before_shop_loop', 'lsx_wc_sorting_wrapper', 9 ); |
|
437 | -add_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 ); |
|
438 | -add_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 ); |
|
439 | -add_action( 'woocommerce_before_shop_loop', 'lsx_wc_woocommerce_pagination', 30 ); |
|
440 | -add_action( 'woocommerce_before_shop_loop', 'lsx_wc_sorting_wrapper_close', 31 ); |
|
436 | +add_action('woocommerce_before_shop_loop', 'lsx_wc_sorting_wrapper', 9); |
|
437 | +add_action('woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10); |
|
438 | +add_action('woocommerce_before_shop_loop', 'woocommerce_result_count', 20); |
|
439 | +add_action('woocommerce_before_shop_loop', 'lsx_wc_woocommerce_pagination', 30); |
|
440 | +add_action('woocommerce_before_shop_loop', 'lsx_wc_sorting_wrapper_close', 31); |
|
441 | 441 | |
442 | -if ( ! function_exists( 'lsx_wc_sorting_wrapper' ) ) : |
|
442 | +if ( ! function_exists('lsx_wc_sorting_wrapper')) : |
|
443 | 443 | |
444 | 444 | /** |
445 | 445 | * Sorting wrapper. |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | |
454 | 454 | endif; |
455 | 455 | |
456 | -if ( ! function_exists( 'lsx_wc_sorting_wrapper_close' ) ) : |
|
456 | +if ( ! function_exists('lsx_wc_sorting_wrapper_close')) : |
|
457 | 457 | |
458 | 458 | /** |
459 | 459 | * Sorting wrapper close. |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | |
468 | 468 | endif; |
469 | 469 | |
470 | -if ( ! function_exists( 'lsx_wc_product_columns_wrapper_close' ) ) : |
|
470 | +if ( ! function_exists('lsx_wc_product_columns_wrapper_close')) : |
|
471 | 471 | |
472 | 472 | /** |
473 | 473 | * Product columns wrapper close. |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | |
482 | 482 | endif; |
483 | 483 | |
484 | -if ( ! function_exists( 'lsx_wc_woocommerce_pagination' ) ) : |
|
484 | +if ( ! function_exists('lsx_wc_woocommerce_pagination')) : |
|
485 | 485 | |
486 | 486 | /** |
487 | 487 | * LSX WooCommerce Pagination |
@@ -493,14 +493,14 @@ discard block |
||
493 | 493 | * @subpackage woocommerce |
494 | 494 | */ |
495 | 495 | function lsx_wc_woocommerce_pagination() { |
496 | - if ( woocommerce_products_will_display() ) { |
|
496 | + if (woocommerce_products_will_display()) { |
|
497 | 497 | woocommerce_pagination(); |
498 | 498 | } |
499 | 499 | } |
500 | 500 | |
501 | 501 | endif; |
502 | 502 | |
503 | -if ( ! function_exists( 'lsx_customizer_wc_controls' ) ) : |
|
503 | +if ( ! function_exists('lsx_customizer_wc_controls')) : |
|
504 | 504 | |
505 | 505 | /** |
506 | 506 | * Returns an array of the core panel. |
@@ -510,10 +510,10 @@ discard block |
||
510 | 510 | * |
511 | 511 | * @return $lsx_controls array() |
512 | 512 | */ |
513 | - function lsx_customizer_wc_controls( $lsx_controls ) { |
|
513 | + function lsx_customizer_wc_controls($lsx_controls) { |
|
514 | 514 | $lsx_controls['panels']['lsx-wc'] = array( |
515 | - 'title' => esc_html__( 'WooCommerce', 'lsx' ), |
|
516 | - 'description' => esc_html__( 'Change the WooCommerce settings.', 'lsx' ), |
|
515 | + 'title' => esc_html__('WooCommerce', 'lsx'), |
|
516 | + 'description' => esc_html__('Change the WooCommerce settings.', 'lsx'), |
|
517 | 517 | 'priority' => 23, |
518 | 518 | ); |
519 | 519 | |
@@ -522,8 +522,8 @@ discard block |
||
522 | 522 | */ |
523 | 523 | |
524 | 524 | $lsx_controls['sections']['lsx-wc-global'] = array( |
525 | - 'title' => esc_html__( 'Global', 'lsx' ), |
|
526 | - 'description' => esc_html__( 'Change the WooCommerce global settings.', 'lsx' ), |
|
525 | + 'title' => esc_html__('Global', 'lsx'), |
|
526 | + 'description' => esc_html__('Change the WooCommerce global settings.', 'lsx'), |
|
527 | 527 | 'panel' => 'lsx-wc', |
528 | 528 | 'priority' => 1, |
529 | 529 | ); |
@@ -534,8 +534,8 @@ discard block |
||
534 | 534 | ); |
535 | 535 | |
536 | 536 | $lsx_controls['fields']['lsx_wc_mobile_footer_bar_status'] = array( |
537 | - 'label' => esc_html__( 'Footer Bar', 'lsx' ), |
|
538 | - 'description' => esc_html__( 'Enable the mobile footer bar.', 'lsx' ), |
|
537 | + 'label' => esc_html__('Footer Bar', 'lsx'), |
|
538 | + 'description' => esc_html__('Enable the mobile footer bar.', 'lsx'), |
|
539 | 539 | 'section' => 'lsx-wc-global', |
540 | 540 | 'type' => 'checkbox', |
541 | 541 | 'priority' => 1, |
@@ -546,8 +546,8 @@ discard block |
||
546 | 546 | */ |
547 | 547 | |
548 | 548 | $lsx_controls['sections']['lsx-wc-cart'] = array( |
549 | - 'title' => esc_html__( 'Cart', 'lsx' ), |
|
550 | - 'description' => esc_html__( 'Change the WooCommerce cart settings.', 'lsx' ), |
|
549 | + 'title' => esc_html__('Cart', 'lsx'), |
|
550 | + 'description' => esc_html__('Change the WooCommerce cart settings.', 'lsx'), |
|
551 | 551 | 'panel' => 'lsx-wc', |
552 | 552 | 'priority' => 2, |
553 | 553 | ); |
@@ -558,8 +558,8 @@ discard block |
||
558 | 558 | ); |
559 | 559 | |
560 | 560 | $lsx_controls['fields']['lsx_header_wc_cart'] = array( |
561 | - 'label' => esc_html__( 'Menu Item', 'lsx' ), |
|
562 | - 'description' => esc_html__( 'Enable the cart menu item.', 'lsx' ), |
|
561 | + 'label' => esc_html__('Menu Item', 'lsx'), |
|
562 | + 'description' => esc_html__('Enable the cart menu item.', 'lsx'), |
|
563 | 563 | 'section' => 'lsx-wc-cart', |
564 | 564 | 'type' => 'checkbox', |
565 | 565 | 'priority' => 1, |
@@ -570,9 +570,9 @@ discard block |
||
570 | 570 | |
571 | 571 | endif; |
572 | 572 | |
573 | -add_filter( 'lsx_customizer_controls', 'lsx_customizer_wc_controls' ); |
|
573 | +add_filter('lsx_customizer_controls', 'lsx_customizer_wc_controls'); |
|
574 | 574 | |
575 | -if ( ! function_exists( 'lsx_wc_footer_bar' ) ) : |
|
575 | +if ( ! function_exists('lsx_wc_footer_bar')) : |
|
576 | 576 | |
577 | 577 | /** |
578 | 578 | * Display WC footer bar. |
@@ -581,46 +581,46 @@ discard block |
||
581 | 581 | * @subpackage woocommerce |
582 | 582 | */ |
583 | 583 | function lsx_wc_footer_bar() { |
584 | - if ( ! empty( get_theme_mod( 'lsx_wc_mobile_footer_bar_status', '1' ) ) ) : |
|
584 | + if ( ! empty(get_theme_mod('lsx_wc_mobile_footer_bar_status', '1'))) : |
|
585 | 585 | ?> |
586 | 586 | <div class="lsx-wc-footer-bar"> |
587 | - <form role="search" method="get" action="<?php echo esc_url( home_url() ); ?>" class="lsx-wc-footer-bar-form"> |
|
587 | + <form role="search" method="get" action="<?php echo esc_url(home_url()); ?>" class="lsx-wc-footer-bar-form"> |
|
588 | 588 | <fieldset> |
589 | - <legend class="screen-reader-text"><?php esc_html_e( 'Search products', 'lsx' ); ?></legend> |
|
590 | - <input type="search" name="s" placeholder="<?php esc_attr_e( 'Search products…', 'lsx' ); ?>" class="form-control"> |
|
589 | + <legend class="screen-reader-text"><?php esc_html_e('Search products', 'lsx'); ?></legend> |
|
590 | + <input type="search" name="s" placeholder="<?php esc_attr_e('Search products…', 'lsx'); ?>" class="form-control"> |
|
591 | 591 | </fieldset> |
592 | 592 | </form> |
593 | 593 | |
594 | 594 | <ul class="lsx-wc-footer-bar-items"> |
595 | 595 | <li class="lsx-wc-footer-bar-item"> |
596 | - <a href="<?php echo esc_url( home_url() ); ?>" class="lsx-wc-footer-bar-link"> |
|
596 | + <a href="<?php echo esc_url(home_url()); ?>" class="lsx-wc-footer-bar-link"> |
|
597 | 597 | <i class="fa fa-home" aria-hidden="true"></i> |
598 | - <span><?php esc_html_e( 'Home', 'lsx' ); ?></span> |
|
598 | + <span><?php esc_html_e('Home', 'lsx'); ?></span> |
|
599 | 599 | </a> |
600 | 600 | </li> |
601 | 601 | |
602 | 602 | <li class="lsx-wc-footer-bar-item"> |
603 | - <a href="<?php echo esc_url( get_permalink( get_option( 'woocommerce_myaccount_page_id' ) ) ); ?>" class="lsx-wc-footer-bar-link"> |
|
603 | + <a href="<?php echo esc_url(get_permalink(get_option('woocommerce_myaccount_page_id'))); ?>" class="lsx-wc-footer-bar-link"> |
|
604 | 604 | <i class="fa fa-user" aria-hidden="true"></i> |
605 | - <span><?php esc_html_e( 'Account', 'lsx' ); ?></span> |
|
605 | + <span><?php esc_html_e('Account', 'lsx'); ?></span> |
|
606 | 606 | </a> |
607 | 607 | </li> |
608 | 608 | |
609 | 609 | <li class="lsx-wc-footer-bar-item"> |
610 | 610 | <a href="#" class="lsx-wc-footer-bar-link lsx-wc-footer-bar-link-toogle"> |
611 | 611 | <i class="fa fa-search" aria-hidden="true"></i> |
612 | - <span><?php esc_html_e( 'Search', 'lsx' ); ?></span> |
|
612 | + <span><?php esc_html_e('Search', 'lsx'); ?></span> |
|
613 | 613 | </a> |
614 | 614 | </li> |
615 | 615 | |
616 | 616 | <li class="lsx-wc-footer-bar-item"> |
617 | - <a href="<?php echo esc_url( WC()->cart->get_cart_url() ); ?>" class="lsx-wc-footer-bar-link"> |
|
617 | + <a href="<?php echo esc_url(WC()->cart->get_cart_url()); ?>" class="lsx-wc-footer-bar-link"> |
|
618 | 618 | <i class="fa fa-shopping-basket" aria-hidden="true"></i> |
619 | 619 | <?php $count = WC()->cart->get_cart_contents_count(); ?> |
620 | - <?php if ( ! empty( $count ) ) : ?> |
|
621 | - <span class="lsx-wc-footer-bar-count"><?php echo wp_kses_data( $count ); ?></span> |
|
620 | + <?php if ( ! empty($count)) : ?> |
|
621 | + <span class="lsx-wc-footer-bar-count"><?php echo wp_kses_data($count); ?></span> |
|
622 | 622 | <?php endif; ?> |
623 | - <span><?php esc_html_e( 'Cart', 'lsx' ); ?></span> |
|
623 | + <span><?php esc_html_e('Cart', 'lsx'); ?></span> |
|
624 | 624 | </a> |
625 | 625 | </li> |
626 | 626 | </ul> |
@@ -629,6 +629,6 @@ discard block |
||
629 | 629 | endif; |
630 | 630 | } |
631 | 631 | |
632 | - add_action( 'lsx_body_bottom', 'lsx_wc_footer_bar', 15 ); |
|
632 | + add_action('lsx_body_bottom', 'lsx_wc_footer_bar', 15); |
|
633 | 633 | |
634 | 634 | endif; |
@@ -6,11 +6,11 @@ discard block |
||
6 | 6 | * @subpackage customizer |
7 | 7 | */ |
8 | 8 | |
9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
9 | +if ( ! defined('ABSPATH')) { |
|
10 | 10 | exit; |
11 | 11 | } |
12 | 12 | |
13 | -if ( ! function_exists( 'lsx_customizer_core_controls' ) ) : |
|
13 | +if ( ! function_exists('lsx_customizer_core_controls')) : |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * Returns an array of the core panel. |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | * |
21 | 21 | * @return $lsx_controls array() |
22 | 22 | */ |
23 | - function lsx_customizer_core_controls( $lsx_controls ) { |
|
23 | + function lsx_customizer_core_controls($lsx_controls) { |
|
24 | 24 | $lsx_controls['sections']['lsx-core'] = array( |
25 | - 'title' => esc_html__( 'Core Settings', 'lsx' ), |
|
26 | - 'description' => esc_html__( 'Change the core settings.', 'lsx' ), |
|
25 | + 'title' => esc_html__('Core Settings', 'lsx'), |
|
26 | + 'description' => esc_html__('Change the core settings.', 'lsx'), |
|
27 | 27 | 'priority' => 21, |
28 | 28 | ); |
29 | 29 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | ); |
35 | 35 | |
36 | 36 | $lsx_controls['fields']['lsx_lazyload_status'] = array( |
37 | - 'label' => esc_html__( 'Lazy Loading Images', 'lsx' ), |
|
37 | + 'label' => esc_html__('Lazy Loading Images', 'lsx'), |
|
38 | 38 | 'section' => 'lsx-core', |
39 | 39 | 'type' => 'checkbox', |
40 | 40 | ); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | ); |
47 | 47 | |
48 | 48 | $lsx_controls['fields']['lsx_preloader_content_status'] = array( |
49 | - 'label' => esc_html__( 'Preloader Content', 'lsx' ), |
|
49 | + 'label' => esc_html__('Preloader Content', 'lsx'), |
|
50 | 50 | 'section' => 'lsx-core', |
51 | 51 | 'type' => 'checkbox', |
52 | 52 | ); |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | |
57 | 57 | endif; |
58 | 58 | |
59 | -add_filter( 'lsx_customizer_controls', 'lsx_customizer_core_controls' ); |
|
59 | +add_filter('lsx_customizer_controls', 'lsx_customizer_core_controls'); |
|
60 | 60 | |
61 | -if ( ! function_exists( 'lsx_customizer_layout_controls' ) ) : |
|
61 | +if ( ! function_exists('lsx_customizer_layout_controls')) : |
|
62 | 62 | |
63 | 63 | /** |
64 | 64 | * Returns an array of the layout panel. |
@@ -68,21 +68,21 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @return $lsx_controls array() |
70 | 70 | */ |
71 | - function lsx_customizer_layout_controls( $lsx_controls ) { |
|
71 | + function lsx_customizer_layout_controls($lsx_controls) { |
|
72 | 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' ), |
|
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 | 75 | 'priority' => 22, |
76 | 76 | ); |
77 | 77 | |
78 | - $lsx_controls['settings']['lsx_header_layout'] = array( |
|
78 | + $lsx_controls['settings']['lsx_header_layout'] = array( |
|
79 | 79 | 'default' => 'inline', |
80 | 80 | 'type' => 'theme_mod', |
81 | 81 | 'transport' => 'postMessage', |
82 | 82 | ); |
83 | 83 | |
84 | 84 | $lsx_controls['fields']['lsx_header_layout'] = array( |
85 | - 'label' => esc_html__( 'Header','lsx' ), |
|
85 | + 'label' => esc_html__('Header', 'lsx'), |
|
86 | 86 | 'section' => 'lsx-layout', |
87 | 87 | 'control' => 'LSX_Customize_Header_Layout_Control', |
88 | 88 | 'choices' => array( |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | ); |
100 | 100 | |
101 | 101 | $lsx_controls['fields']['lsx_layout'] = array( |
102 | - 'label' => esc_html__( 'Body', 'lsx' ), |
|
102 | + 'label' => esc_html__('Body', 'lsx'), |
|
103 | 103 | 'section' => 'lsx-layout', |
104 | 104 | 'control' => 'LSX_Customize_Layout_Control', |
105 | 105 | 'choices' => array( |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | ); |
117 | 117 | |
118 | 118 | $lsx_controls['fields']['lsx_header_fixed'] = array( |
119 | - 'label' => esc_html__( 'Fixed Header', 'lsx' ), |
|
119 | + 'label' => esc_html__('Fixed Header', 'lsx'), |
|
120 | 120 | 'section' => 'lsx-layout', |
121 | 121 | 'type' => 'checkbox', |
122 | 122 | ); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | ); |
129 | 129 | |
130 | 130 | $lsx_controls['fields']['lsx_header_search'] = array( |
131 | - 'label' => esc_html__( 'Search Box in Header', 'lsx' ), |
|
131 | + 'label' => esc_html__('Search Box in Header', 'lsx'), |
|
132 | 132 | 'section' => 'lsx-layout', |
133 | 133 | 'type' => 'checkbox', |
134 | 134 | ); |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | $lsx_controls['selective_refresh']['lsx_header_search'] = array( |
137 | 137 | 'selector' => '#lsx-header-search-css', |
138 | 138 | 'render_callback' => function() { |
139 | - $search_form = get_theme_mod( 'lsx_header_search' ); |
|
139 | + $search_form = get_theme_mod('lsx_header_search'); |
|
140 | 140 | |
141 | - if ( false !== $search_form ) { |
|
141 | + if (false !== $search_form) { |
|
142 | 142 | echo 'body #searchform { display: block; }'; |
143 | 143 | } else { |
144 | 144 | echo 'body #searchform { display: none; }'; |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | |
152 | 152 | endif; |
153 | 153 | |
154 | -add_filter( 'lsx_customizer_controls', 'lsx_customizer_layout_controls' ); |
|
154 | +add_filter('lsx_customizer_controls', 'lsx_customizer_layout_controls'); |
|
155 | 155 | |
156 | -if ( ! function_exists( 'lsx_customizer_font_controls' ) ) : |
|
156 | +if ( ! function_exists('lsx_customizer_font_controls')) : |
|
157 | 157 | |
158 | 158 | /** |
159 | 159 | * Returns an array of the font controls. |
@@ -163,21 +163,21 @@ discard block |
||
163 | 163 | * |
164 | 164 | * @return $lsx_controls array() |
165 | 165 | */ |
166 | - function lsx_customizer_font_controls( $lsx_controls ) { |
|
166 | + function lsx_customizer_font_controls($lsx_controls) { |
|
167 | 167 | $data_fonts_file = get_template_directory() . '/assets/jsons/lsx-fonts.json'; |
168 | - $data_fonts = lsx_file_get_contents( $data_fonts_file ); |
|
169 | - $data_fonts = apply_filters( 'lsx_fonts_json', $data_fonts ); |
|
168 | + $data_fonts = lsx_file_get_contents($data_fonts_file); |
|
169 | + $data_fonts = apply_filters('lsx_fonts_json', $data_fonts); |
|
170 | 170 | |
171 | 171 | $data_fonts = '{' . $data_fonts . '}'; |
172 | - $data_fonts = json_decode( $data_fonts, true ); |
|
172 | + $data_fonts = json_decode($data_fonts, true); |
|
173 | 173 | |
174 | 174 | $lsx_controls['sections']['lsx-font'] = array( |
175 | - 'title' => esc_html__( 'Font', 'lsx' ), |
|
176 | - 'description' => esc_html__( 'Change the fonts sitewide.', 'lsx' ), |
|
175 | + 'title' => esc_html__('Font', 'lsx'), |
|
176 | + 'description' => esc_html__('Change the fonts sitewide.', 'lsx'), |
|
177 | 177 | 'priority' => 41, |
178 | 178 | ); |
179 | 179 | |
180 | - $lsx_controls['settings']['lsx_font'] = array( |
|
180 | + $lsx_controls['settings']['lsx_font'] = array( |
|
181 | 181 | 'default' => 'lora_noto_sans', |
182 | 182 | 'type' => 'theme_mod', |
183 | 183 | 'transport' => 'refresh', |
@@ -197,9 +197,9 @@ discard block |
||
197 | 197 | |
198 | 198 | endif; |
199 | 199 | |
200 | -add_filter( 'lsx_customizer_controls', 'lsx_customizer_font_controls' ); |
|
200 | +add_filter('lsx_customizer_controls', 'lsx_customizer_font_controls'); |
|
201 | 201 | |
202 | -if ( ! function_exists( 'lsx_get_customizer_controls' ) ) : |
|
202 | +if ( ! function_exists('lsx_get_customizer_controls')) : |
|
203 | 203 | |
204 | 204 | /** |
205 | 205 | * Returns an array of $controls for the customizer class to generate. |
@@ -211,10 +211,10 @@ discard block |
||
211 | 211 | */ |
212 | 212 | function lsx_get_customizer_controls() { |
213 | 213 | $lsx_controls = array(); |
214 | - $lsx_controls = apply_filters( 'lsx_customizer_controls', $lsx_controls ); |
|
214 | + $lsx_controls = apply_filters('lsx_customizer_controls', $lsx_controls); |
|
215 | 215 | return $lsx_controls; |
216 | 216 | } |
217 | 217 | |
218 | 218 | endif; |
219 | 219 | |
220 | -$lsx_customizer = new LSX_Theme_Customizer( lsx_get_customizer_controls() ); |
|
220 | +$lsx_customizer = new LSX_Theme_Customizer(lsx_get_customizer_controls()); |