← All changes
|
includes/widgets/WooCommerce_Grid/WooCommerce_Grid.php
+23
-23
51.1.83
→
51.1.87
View file →
| @@ -8808,38 +8808,41 @@ | ||
| 8808 | 8808 | } |
| 8809 | 8809 | |
| 8810 | 8810 | public function get_animation_class($data, $object) |
| 8811 | 8811 | { |
| 8812 | - $class = ''; | |
| 8813 | - if ('overlay' !== $object && 'yes' === $data[$object . '_animation_disable_mobile'] && wp_is_mobile()) { | |
| 8814 | - return $class; | |
| 8812 | + if ( | |
| 8813 | + 'overlay' !== $object | |
| 8814 | + && 'yes' === ($data[$object . '_animation_disable_mobile'] ?? '') | |
| 8815 | + && wp_is_mobile() | |
| 8816 | + ) { | |
| 8817 | + return ''; | |
| 8815 | 8818 | } |
| 8816 | - if ('none' !== $data[$object . '_animation']) { | |
| 8817 | - $class .= ' king-addons-' . $object . '-' . $data[$object . '_animation']; | |
| 8818 | - $class .= ' king-addons-anim-size-' . $data[$object . '_animation_size']; | |
| 8819 | - $class .= ' king-addons-animation-timing-' . $data[$object . '_animation_timing']; | |
| 8820 | - if ('yes' === $data[$object . '_animation_tr']) { | |
| 8821 | - $class .= ' king-addons-anim-transparency'; | |
| 8822 | - } | |
| 8819 | + | |
| 8820 | + $animation = Grid_Ajax_Security::sanitize_animation($data[$object . '_animation'] ?? 'none'); | |
| 8821 | + if ('none' === $animation) { | |
| 8822 | + return ''; | |
| 8823 | 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 | + } | |
| 8824 | 8831 | return $class; |
| 8825 | 8832 | } |
| 8826 | 8833 | |
| 8827 | 8834 | public function get_image_effect_class($settings) |
| 8828 | 8835 | { |
| 8836 | + $effect = Grid_Ajax_Security::sanitize_image_effect($settings['image_effects'] ?? 'none'); | |
| 8829 | 8837 | $class = ''; |
| 8830 | - if (!king_addons_freemius()->can_use_premium_code__premium_only()) { | |
| 8831 | - if (in_array($settings['image_effects'], ['pro-zi', 'pro-zo', 'pro-go', 'pro-bo'])) { | |
| 8832 | - $settings['image_effects'] = 'none'; | |
| 8833 | - } | |
| 8838 | + if ('none' !== $effect) { | |
| 8839 | + $class .= ' king-addons-' . $effect; | |
| 8834 | 8840 | } |
| 8835 | - if ('none' !== $settings['image_effects']) { | |
| 8836 | - $class .= ' king-addons-' . $settings['image_effects']; | |
| 8837 | - } | |
| 8838 | - if ('slide' !== $settings['image_effects']) { | |
| 8839 | - $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'); | |
| 8840 | 8843 | } else { |
| 8841 | - $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'); | |
| 8842 | 8845 | } |
| 8843 | 8846 | return $class; |
| 8844 | 8847 | } |
| 8845 | 8848 | |
| @@ -9344,11 +9347,8 @@ | ||
| 9344 | 9347 | { |
| 9345 | 9348 | global $product; |
| 9346 | 9349 | if (is_null($product)) return; |
| 9347 | 9350 | echo '<div class="' . esc_attr($class) . '"><div class="inner-block"><span>' . wp_kses_post($product->get_price_html()) . '</span>'; |
| 9348 | - $sale_price_dates_to = ($date = get_post_meta($product->get_id(), '_sale_price_dates_to', true)) ? date_i18n('Y-m-d', $date) : ''; | |
| 9349 | - $sale_price_dates_to = apply_filters('king_addons_custom_sale_price_dates_to_filter', $sale_price_dates_to, $product); | |
| 9350 | - echo $sale_price_dates_to; | |
| 9351 | 9351 | echo '</div></div>'; |
| 9352 | 9352 | } |
| 9353 | 9353 | |
| 9354 | 9354 | public function render_product_sale_dates($settings, $class) |