← All changes
|
includes/widgets/WooCommerce_Grid/WooCommerce_Grid.php
+26
-28
51.1.77
→
51.1.87
View file →
| @@ -39,9 +39,9 @@ | ||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | public function get_categories() |
| 42 | 42 | { |
| 43 | - return ['king-addons']; | |
| 43 | + return ['king-addons-woo']; | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | public function get_keywords() |
| 47 | 47 | { |
| @@ -1567,12 +1567,10 @@ | ||
| 1567 | 1567 | 'separator' => 'after' |
| 1568 | 1568 | ] |
| 1569 | 1569 | ); |
| 1570 | 1570 | |
| 1571 | - Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'element_select', ['pro-lk', 'pro-shr', 'pro-sd']); | |
| 1571 | + Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'element_select', ['pro-lk', 'pro-shr', 'pro-sd', 'pro-ws', 'pro-cm']); | |
| 1572 | 1572 | |
| 1573 | - Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'element_select', ['pro-ws', 'pro-cm']); | |
| 1574 | - | |
| 1575 | 1573 | $repeater->add_control( |
| 1576 | 1574 | 'element_location', |
| 1577 | 1575 | [ |
| 1578 | 1576 | 'label' => esc_html__('Location', 'king-addons'), |
| @@ -8810,38 +8808,41 @@ | ||
| 8810 | 8808 | } |
| 8811 | 8809 | |
| 8812 | 8810 | public function get_animation_class($data, $object) |
| 8813 | 8811 | { |
| 8814 | - $class = ''; | |
| 8815 | - if ('overlay' !== $object && 'yes' === $data[$object . '_animation_disable_mobile'] && wp_is_mobile()) { | |
| 8816 | - return $class; | |
| 8812 | + if ( | |
| 8813 | + 'overlay' !== $object | |
| 8814 | + && 'yes' === ($data[$object . '_animation_disable_mobile'] ?? '') | |
| 8815 | + && wp_is_mobile() | |
| 8816 | + ) { | |
| 8817 | + return ''; | |
| 8817 | 8818 | } |
| 8818 | - if ('none' !== $data[$object . '_animation']) { | |
| 8819 | - $class .= ' king-addons-' . $object . '-' . $data[$object . '_animation']; | |
| 8820 | - $class .= ' king-addons-anim-size-' . $data[$object . '_animation_size']; | |
| 8821 | - $class .= ' king-addons-animation-timing-' . $data[$object . '_animation_timing']; | |
| 8822 | - if ('yes' === $data[$object . '_animation_tr']) { | |
| 8823 | - $class .= ' king-addons-anim-transparency'; | |
| 8824 | - } | |
| 8819 | + | |
| 8820 | + $animation = Grid_Ajax_Security::sanitize_animation($data[$object . '_animation'] ?? 'none'); | |
| 8821 | + if ('none' === $animation) { | |
| 8822 | + return ''; | |
| 8825 | 8823 | } |
| 8824 | + | |
| 8825 | + $class = ' king-addons-' . sanitize_html_class((string) $object) . '-' . $animation; | |
| 8826 | + $class .= ' king-addons-anim-size-' . Grid_Ajax_Security::sanitize_animation_size($data[$object . '_animation_size'] ?? 'large'); | |
| 8827 | + $class .= ' king-addons-animation-timing-' . Grid_Ajax_Security::sanitize_animation_timing($data[$object . '_animation_timing'] ?? 'ease-default'); | |
| 8828 | + if ('yes' === Grid_Ajax_Security::sanitize_yes_no_switcher($data[$object . '_animation_tr'] ?? '')) { | |
| 8829 | + $class .= ' king-addons-anim-transparency'; | |
| 8830 | + } | |
| 8826 | 8831 | return $class; |
| 8827 | 8832 | } |
| 8828 | 8833 | |
| 8829 | 8834 | public function get_image_effect_class($settings) |
| 8830 | 8835 | { |
| 8836 | + $effect = Grid_Ajax_Security::sanitize_image_effect($settings['image_effects'] ?? 'none'); | |
| 8831 | 8837 | $class = ''; |
| 8832 | - if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 8833 | - if (in_array($settings['image_effects'], ['pro-zi', 'pro-zo', 'pro-go', 'pro-bo'])) { | |
| 8834 | - $settings['image_effects'] = 'none'; | |
| 8835 | - } | |
| 8838 | + if ('none' !== $effect) { | |
| 8839 | + $class .= ' king-addons-' . $effect; | |
| 8836 | 8840 | } |
| 8837 | - if ('none' !== $settings['image_effects']) { | |
| 8838 | - $class .= ' king-addons-' . $settings['image_effects']; | |
| 8839 | - } | |
| 8840 | - if ('slide' !== $settings['image_effects']) { | |
| 8841 | - $class .= ' king-addons-effect-size-' . $settings['image_effects_size']; | |
| 8841 | + if ('slide' !== $effect) { | |
| 8842 | + $class .= ' king-addons-effect-size-' . Grid_Ajax_Security::sanitize_image_effect_size($settings['image_effects_size'] ?? 'medium'); | |
| 8842 | 8843 | } else { |
| 8843 | - $class .= ' king-addons-effect-dir-' . $settings['image_effects_direction']; | |
| 8844 | + $class .= ' king-addons-effect-dir-' . Grid_Ajax_Security::sanitize_image_effect_direction($settings['image_effects_direction'] ?? 'bottom'); | |
| 8844 | 8845 | } |
| 8845 | 8846 | return $class; |
| 8846 | 8847 | } |
| 8847 | 8848 | |
| @@ -9346,11 +9347,8 @@ | ||
| 9346 | 9347 | { |
| 9347 | 9348 | global $product; |
| 9348 | 9349 | if (is_null($product)) return; |
| 9349 | 9350 | echo '<div class="' . esc_attr($class) . '"><div class="inner-block"><span>' . wp_kses_post($product->get_price_html()) . '</span>'; |
| 9350 | - $sale_price_dates_to = ($date = get_post_meta($product->get_id(), '_sale_price_dates_to', true)) ? date_i18n('Y-m-d', $date) : ''; | |
| 9351 | - $sale_price_dates_to = apply_filters('king_addons_custom_sale_price_dates_to_filter', $sale_price_dates_to, $product); | |
| 9352 | - echo $sale_price_dates_to; | |
| 9353 | 9351 | echo '</div></div>'; |
| 9354 | 9352 | } |
| 9355 | 9353 | |
| 9356 | 9354 | public function render_product_sale_dates($settings, $class) |
| @@ -9790,9 +9788,9 @@ | ||
| 9790 | 9788 | 'selector' => '.king-addons-grid-image-wrap', |
| 9791 | 9789 | 'iframeMaxWidth' => '60%', |
| 9792 | 9790 | 'hash' => false, |
| 9793 | 9791 | 'autoplay' => $settings['lightbox_popup_autoplay'], |
| 9794 | - 'pause' => $settings['lightbox_popup_pause'] * 1000, | |
| 9792 | + 'pause' => Core::jsNumber($settings, 'lightbox_popup_pause', 5) * 1000, | |
| 9795 | 9793 | 'progressBar' => $settings['lightbox_popup_progressbar'], |
| 9796 | 9794 | 'counter' => $settings['lightbox_popup_counter'], |
| 9797 | 9795 | 'controls' => $settings['lightbox_popup_arrows'], |
| 9798 | 9796 | 'getCaptionFromTitleOrAlt' => false, |