← All changes
|
modules/harold-carousel/widgets/harold-carousel.php
+13
-9
4.0.9
→
4.5.6
View file →
| @@ -128,8 +128,9 @@ | ||
| 128 | 128 | $this->add_group_control( |
| 129 | 129 | Group_Control_Image_Size::get_type(), |
| 130 | 130 | [ |
| 131 | 131 | 'name' => 'primary_thumbnail', |
| 132 | + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour. | |
| 132 | 133 | 'exclude' => ['custom'], |
| 133 | 134 | 'default' => 'medium', |
| 134 | 135 | ] |
| 135 | 136 | ); |
| @@ -158,8 +159,11 @@ | ||
| 158 | 159 | ], |
| 159 | 160 | 'default' => [ |
| 160 | 161 | 'size' => 6, |
| 161 | 162 | ], |
| 163 | + 'condition' => [ | |
| 164 | + 'posts_source!' => 'current_query', | |
| 165 | + ] | |
| 162 | 166 | ] |
| 163 | 167 | ); |
| 164 | 168 | |
| 165 | 169 | $this->register_query_builder_controls(); |
| @@ -168,9 +172,9 @@ | ||
| 168 | 172 | |
| 169 | 173 | $this->start_controls_section( |
| 170 | 174 | 'section_content_additional', |
| 171 | 175 | [ |
| 172 | - 'label' => esc_html__('Additional', 'ultimate-post-kit'), | |
| 176 | + 'label' => esc_html__('Additional Options', 'ultimate-post-kit'), | |
| 173 | 177 | ] |
| 174 | 178 | ); |
| 175 | 179 | |
| 176 | 180 | $this->add_control( |
| @@ -564,9 +568,9 @@ | ||
| 564 | 568 | [ |
| 565 | 569 | 'label' => esc_html__('Hover Color', 'ultimate-post-kit'), |
| 566 | 570 | 'type' => Controls_Manager::COLOR, |
| 567 | 571 | 'selectors' => [ |
| 568 | - '{{WRAPPER}} .upk-harold-carousel .upk-meta .upk-author a:hover' => 'color: {{VALUE}};', | |
| 572 | + '{{WRAPPER}} .upk-harold-carousel .upk-meta .upk-author a:hover *' => 'color: {{VALUE}};', | |
| 569 | 573 | ], |
| 570 | 574 | ] |
| 571 | 575 | ); |
| 572 | 576 | |
| @@ -608,9 +612,9 @@ | ||
| 608 | 612 | Group_Control_Typography::get_type(), |
| 609 | 613 | [ |
| 610 | 614 | 'name' => 'meta_typography', |
| 611 | 615 | 'label' => esc_html__('Typography', 'ultimate-post-kit'), |
| 612 | - 'selector' => '{{WRAPPER}} .upk-harold-carousel .upk-meta', | |
| 616 | + 'selector' => '{{WRAPPER}} .upk-harold-carousel .upk-meta, {{WRAPPER}} .upk-harold-carousel .upk-meta *', | |
| 613 | 617 | ] |
| 614 | 618 | ); |
| 615 | 619 | |
| 616 | 620 | $this->end_controls_section(); |
| @@ -816,11 +820,11 @@ | ||
| 816 | 820 | */ |
| 817 | 821 | public function query_posts($posts_per_page) { |
| 818 | 822 | |
| 819 | 823 | $default = $this->getGroupControlQueryArgs(); |
| 824 | + $args = []; | |
| 820 | 825 | if ($posts_per_page) { |
| 821 | 826 | $args['posts_per_page'] = $posts_per_page; |
| 822 | - // $args['paged'] = max(1, get_query_var('paged'), get_query_var('page')); | |
| 823 | 827 | } |
| 824 | 828 | $args = array_merge($default, $args); |
| 825 | 829 | $this->_query = new WP_Query($args); |
| 826 | 830 | } |
| @@ -841,9 +845,9 @@ | ||
| 841 | 845 | } |
| 842 | 846 | |
| 843 | 847 | ?> |
| 844 | 848 | |
| 845 | - <img class="upk-harold-img" src="<?php echo esc_url($image_src); ?>" alt="<?php echo esc_html(get_the_title()); ?>"> | |
| 849 | + <img class="upk-harold-img" src="<?php echo esc_url($image_src); ?>" alt="<?php echo esc_attr(get_the_title()); ?>"> | |
| 846 | 850 | |
| 847 | 851 | <?php |
| 848 | 852 | } |
| 849 | 853 | |
| @@ -902,9 +906,9 @@ | ||
| 902 | 906 | |
| 903 | 907 | ?> |
| 904 | 908 | <div <?php $this->print_render_attribute_string('carousel'); ?>> |
| 905 | 909 | <div class="upk-wrapper"> |
| 906 | - <div <?php echo $this->get_render_attribute_string('swiper'); ?>> | |
| 910 | + <div <?php $this->print_render_attribute_string('swiper'); ?>> | |
| 907 | 911 | <div class="swiper-wrapper"> |
| 908 | 912 | <?php |
| 909 | 913 | } |
| 910 | 914 | |
| @@ -932,16 +936,16 @@ | ||
| 932 | 936 | <?php if ($settings['show_author'] or $settings['show_date'] or $settings['show_reading_time']) : ?> |
| 933 | 937 | <div class="upk-meta"> |
| 934 | 938 | <?php $this->render_author(); ?> |
| 935 | 939 | <?php if ($settings['show_date']) : ?> |
| 936 | - <div data-separator="<?php echo esc_html($settings['meta_separator']); ?>"> | |
| 940 | + <div data-separator="<?php echo esc_attr($settings['meta_separator']); ?>"> | |
| 937 | 941 | <?php $this->render_date(); ?> |
| 938 | 942 | </div> |
| 939 | 943 | <?php endif; ?> |
| 940 | 944 | <?php if (_is_upk_pro_activated()) : |
| 941 | 945 | if ('yes' === $settings['show_reading_time']) : ?> |
| 942 | - <div class="upk-reading-time" data-separator="<?php echo esc_html($settings['meta_separator']); ?>"> | |
| 943 | - <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'] ) ); ?> | |
| 946 | + <div class="upk-reading-time" data-separator="<?php echo esc_attr($settings['meta_separator']); ?>"> | |
| 947 | + <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'], $settings['hide_seconds'] ?? 'no', $settings['hide_minutes'] ?? 'no' ) ); ?> | |
| 944 | 948 | </div> |
| 945 | 949 | <?php endif; ?> |
| 946 | 950 | <?php endif; ?> |
| 947 | 951 | </div> |