| @@ -86,20 +86,20 @@ | ||
| 86 | 86 | |
| 87 | 87 | $this->add_responsive_control( |
| 88 | 88 | 'columns', |
| 89 | 89 | [ |
| 90 | - 'label' => __('Columns', 'ultimate-post-kit'), | |
| 90 | + 'label' => esc_html__('Columns', 'ultimate-post-kit'), | |
| 91 | 91 | 'type' => Controls_Manager::SELECT, |
| 92 | 92 | 'default' => 3, |
| 93 | 93 | 'tablet_default' => 2, |
| 94 | 94 | 'mobile_default' => 1, |
| 95 | 95 | 'options' => [ |
| 96 | - 1 => '1', | |
| 97 | - 2 => '2', | |
| 98 | - 3 => '3', | |
| 99 | - 4 => '4', | |
| 100 | - 5 => '5', | |
| 101 | - 6 => '6', | |
| 96 | + 1 => esc_html__('1', 'ultimate-post-kit'), | |
| 97 | + 2 => esc_html__('2', 'ultimate-post-kit'), | |
| 98 | + 3 => esc_html__('3', 'ultimate-post-kit'), | |
| 99 | + 4 => esc_html__('4', 'ultimate-post-kit'), | |
| 100 | + 5 => esc_html__('5', 'ultimate-post-kit'), | |
| 101 | + 6 => esc_html__('6', 'ultimate-post-kit'), | |
| 102 | 102 | ], |
| 103 | 103 | ] |
| 104 | 104 | ); |
| 105 | 105 | |
| @@ -105,9 +105,9 @@ | ||
| 105 | 105 | |
| 106 | 106 | $this->add_responsive_control( |
| 107 | 107 | 'item_gap', |
| 108 | 108 | [ |
| 109 | - 'label' => __('Item Gap', 'ultimate-post-kit'), | |
| 109 | + 'label' => esc_html__('Item Gap', 'ultimate-post-kit'), | |
| 110 | 110 | 'type' => Controls_Manager::SLIDER, |
| 111 | 111 | 'default' => [ |
| 112 | 112 | 'size' => 20, |
| 113 | 113 | ], |
| @@ -170,8 +170,9 @@ | ||
| 170 | 170 | $this->add_group_control( |
| 171 | 171 | Group_Control_Image_Size::get_type(), |
| 172 | 172 | [ |
| 173 | 173 | 'name' => 'primary_thumbnail', |
| 174 | + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour. | |
| 174 | 175 | 'exclude' => ['custom'], |
| 175 | 176 | 'default' => 'medium', |
| 176 | 177 | ] |
| 177 | 178 | ); |
| @@ -181,9 +182,9 @@ | ||
| 181 | 182 | // Query Settings |
| 182 | 183 | $this->start_controls_section( |
| 183 | 184 | 'section_post_query_builder', |
| 184 | 185 | [ |
| 185 | - 'label' => __('Query', 'ultimate-post-kit') . BDTUPK_NC, | |
| 186 | + 'label' => esc_html__('Query', 'ultimate-post-kit'), | |
| 186 | 187 | 'tab' => Controls_Manager::TAB_CONTENT, |
| 187 | 188 | ] |
| 188 | 189 | ); |
| 189 | 190 | |
| @@ -200,8 +201,11 @@ | ||
| 200 | 201 | ], |
| 201 | 202 | 'default' => [ |
| 202 | 203 | 'size' => 5, |
| 203 | 204 | ], |
| 205 | + 'condition' => [ | |
| 206 | + 'posts_source!' => 'current_query', | |
| 207 | + ] | |
| 204 | 208 | ] |
| 205 | 209 | ); |
| 206 | 210 | |
| 207 | 211 | $this->register_query_builder_controls(); |
| @@ -210,9 +214,9 @@ | ||
| 210 | 214 | |
| 211 | 215 | $this->start_controls_section( |
| 212 | 216 | 'section_content_additional', |
| 213 | 217 | [ |
| 214 | - 'label' => esc_html__('Additional', 'ultimate-post-kit'), | |
| 218 | + 'label' => esc_html__('Additional Options', 'ultimate-post-kit'), | |
| 215 | 219 | ] |
| 216 | 220 | ); |
| 217 | 221 | |
| 218 | 222 | //Global Title Controls |
| @@ -244,9 +248,9 @@ | ||
| 244 | 248 | |
| 245 | 249 | $this->add_control( |
| 246 | 250 | 'meta_separator', |
| 247 | 251 | [ |
| 248 | - 'label' => __('Separator', 'ultimate-post-kit') . BDTUPK_NC, | |
| 252 | + 'label' => esc_html__('Separator', 'ultimate-post-kit'), | |
| 249 | 253 | 'type' => Controls_Manager::TEXT, |
| 250 | 254 | 'default' => '.', |
| 251 | 255 | 'label_block' => false, |
| 252 | 256 | ] |
| @@ -254,12 +258,12 @@ | ||
| 254 | 258 | |
| 255 | 259 | $this->add_control( |
| 256 | 260 | 'global_link', |
| 257 | 261 | [ |
| 258 | - 'label' => __('Item Wrapper Link', 'ultimate-post-kit'), | |
| 262 | + 'label' => esc_html__('Item Wrapper Link', 'ultimate-post-kit'), | |
| 259 | 263 | 'type' => Controls_Manager::SWITCHER, |
| 260 | 264 | 'prefix_class' => 'upk-global-link-', |
| 261 | - 'description' => __('Be aware! When Item Wrapper Link activated then title link and read more link will not work', 'ultimate-post-kit'), | |
| 265 | + 'description' => esc_html__('Be aware! When Item Wrapper Link activated then title link and read more link will not work', 'ultimate-post-kit'), | |
| 262 | 266 | 'separator' => 'before' |
| 263 | 267 | ] |
| 264 | 268 | ); |
| 265 | 269 | |
| @@ -279,13 +283,13 @@ | ||
| 279 | 283 | |
| 280 | 284 | $this->add_responsive_control( |
| 281 | 285 | 'content_padding', |
| 282 | 286 | [ |
| 283 | - 'label' => __('Content Padding', 'ultimate-post-kit'), | |
| 287 | + 'label' => esc_html__('Content Padding', 'ultimate-post-kit'), | |
| 284 | 288 | 'type' => Controls_Manager::DIMENSIONS, |
| 285 | 289 | 'size_units' => ['px', 'em', '%'], |
| 286 | 290 | 'selectors' => [ |
| 287 | - '{{WRAPPER}} .upk-alice-carousel .upk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 291 | + '{{WRAPPER}} .upk-alice-carousel .upk-item-box .upk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 288 | 292 | ], |
| 289 | 293 | ] |
| 290 | 294 | ); |
| 291 | 295 | |
| @@ -303,9 +307,9 @@ | ||
| 303 | 307 | [ |
| 304 | 308 | 'label' => esc_html__('Glassmorphism', 'ultimate-post-kit'), |
| 305 | 309 | 'type' => Controls_Manager::SWITCHER, |
| 306 | 310 | // translators: %1s: Opening anchor tag with link to MDN backdrop-filter documentation, %2s: Closing anchor tag |
| 307 | - 'description' => sprintf(__('This feature will not work in the Firefox browser untill you enable browser compatibility so please %1s look here %2s', 'ultimate-post-kit'), '<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility" target="_blank">', '</a>'), | |
| 311 | + 'description' => sprintf(__('This feature will not work in the Firefox browser untill you enable browser compatibility so please %1$s look here %2$s', 'ultimate-post-kit'), '<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility" target="_blank">', '</a>'), | |
| 308 | 312 | ] |
| 309 | 313 | ); |
| 310 | 314 | |
| 311 | 315 | $this->add_control( |
| @@ -310,9 +314,9 @@ | ||
| 310 | 314 | |
| 311 | 315 | $this->add_control( |
| 312 | 316 | 'overlay_blur_level', |
| 313 | 317 | [ |
| 314 | - 'label' => __('Blur Level', 'ultimate-post-kit'), | |
| 318 | + 'label' => esc_html__('Blur Level', 'ultimate-post-kit'), | |
| 315 | 319 | 'type' => Controls_Manager::SLIDER, |
| 316 | 320 | 'range' => [ |
| 317 | 321 | 'px' => [ |
| 318 | 322 | 'min' => 0, |
| @@ -346,9 +350,9 @@ | ||
| 346 | 350 | $this->add_group_control( |
| 347 | 351 | Group_Control_Border::get_type(), |
| 348 | 352 | [ |
| 349 | 353 | 'name' => 'item_border', |
| 350 | - 'selector' => '{{WRAPPER}} .upk-alice-carousel .upk-item', | |
| 354 | + 'selector' => '{{WRAPPER}} .upk-alice-carousel .upk-item-box', | |
| 351 | 355 | ] |
| 352 | 356 | ); |
| 353 | 357 | |
| 354 | 358 | $this->add_responsive_control( |
| @@ -365,13 +369,13 @@ | ||
| 365 | 369 | |
| 366 | 370 | $this->add_responsive_control( |
| 367 | 371 | 'item_padding', |
| 368 | 372 | [ |
| 369 | - 'label' => __('Padding', 'ultimate-post-kit'), | |
| 373 | + 'label' => esc_html__('Padding', 'ultimate-post-kit'), | |
| 370 | 374 | 'type' => Controls_Manager::DIMENSIONS, |
| 371 | 375 | 'size_units' => ['px', 'em', '%'], |
| 372 | 376 | 'selectors' => [ |
| 373 | - '{{WRAPPER}} .upk-alice-carousel .upk-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 377 | + '{{WRAPPER}} .upk-alice-carousel .upk-item-box' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 374 | 378 | ], |
| 375 | 379 | ] |
| 376 | 380 | ); |
| 377 | 381 | |
| @@ -378,9 +382,9 @@ | ||
| 378 | 382 | $this->add_group_control( |
| 379 | 383 | Group_Control_Box_Shadow::get_type(), |
| 380 | 384 | [ |
| 381 | 385 | 'name' => 'item_box_shadow', |
| 382 | - 'selector' => '{{WRAPPER}} .upk-alice-carousel .upk-item', | |
| 386 | + 'selector' => '{{WRAPPER}} .upk-alice-carousel .upk-item-box', | |
| 383 | 387 | ] |
| 384 | 388 | ); |
| 385 | 389 | |
| 386 | 390 | $this->end_controls_tab(); |
| @@ -394,9 +398,9 @@ | ||
| 394 | 398 | |
| 395 | 399 | $this->add_control( |
| 396 | 400 | 'overlay_blur_level_hover', |
| 397 | 401 | [ |
| 398 | - 'label' => __('Blur Level', 'ultimate-post-kit'), | |
| 402 | + 'label' => esc_html__('Blur Level', 'ultimate-post-kit'), | |
| 399 | 403 | 'type' => Controls_Manager::SLIDER, |
| 400 | 404 | 'range' => [ |
| 401 | 405 | 'px' => [ |
| 402 | 406 | 'min' => 0, |
| @@ -435,9 +439,9 @@ | ||
| 435 | 439 | 'condition' => [ |
| 436 | 440 | 'item_border_border!' => '', |
| 437 | 441 | ], |
| 438 | 442 | 'selectors' => [ |
| 439 | - '{{WRAPPER}} .upk-alice-carousel .upk-item:hover' => 'border-color: {{VALUE}};', | |
| 443 | + '{{WRAPPER}} .upk-alice-carousel .upk-item-box:hover' => 'border-color: {{VALUE}};', | |
| 440 | 444 | ], |
| 441 | 445 | ] |
| 442 | 446 | ); |
| 443 | 447 | |
| @@ -444,9 +448,9 @@ | ||
| 444 | 448 | $this->add_group_control( |
| 445 | 449 | Group_Control_Box_Shadow::get_type(), |
| 446 | 450 | [ |
| 447 | 451 | 'name' => 'item_hover_box_shadow', |
| 448 | - 'selector' => '{{WRAPPER}} .upk-alice-carousel .upk-item:hover', | |
| 452 | + 'selector' => '{{WRAPPER}} .upk-alice-carousel .upk-item-box:hover', | |
| 449 | 453 | ] |
| 450 | 454 | ); |
| 451 | 455 | |
| 452 | 456 | $this->add_responsive_control( |
| @@ -451,10 +455,10 @@ | ||
| 451 | 455 | |
| 452 | 456 | $this->add_responsive_control( |
| 453 | 457 | 'item_shadow_padding', |
| 454 | 458 | [ |
| 455 | - 'label' => __('Match Padding', 'ultimate-post-kit'), | |
| 456 | - 'description' => __('You have to add padding for matching overlaping normal/hover box shadow when you used Box Shadow option.', 'ultimate-post-kit'), | |
| 459 | + 'label' => esc_html__('Match Padding', 'ultimate-post-kit'), | |
| 460 | + 'description' => esc_html__('You have to add padding for matching overlaping normal/hover box shadow when you used Box Shadow option.', 'ultimate-post-kit'), | |
| 457 | 461 | 'type' => Controls_Manager::SLIDER, |
| 458 | 462 | 'range' => [ |
| 459 | 463 | 'px' => [ |
| 460 | 464 | 'min' => 0, |
| @@ -487,9 +491,9 @@ | ||
| 487 | 491 | |
| 488 | 492 | $this->add_control( |
| 489 | 493 | 'title_style', |
| 490 | 494 | [ |
| 491 | - 'label' => esc_html__('Style', 'ultimate-post-kit') . BDTUPK_NC, | |
| 495 | + 'label' => esc_html__('Style', 'ultimate-post-kit'), | |
| 492 | 496 | 'type' => Controls_Manager::SELECT, |
| 493 | 497 | 'default' => 'underline', |
| 494 | 498 | 'options' => [ |
| 495 | 499 | 'underline' => esc_html__('Underline', 'ultimate-post-kit'), |
| @@ -551,9 +555,9 @@ | ||
| 551 | 555 | $this->add_group_control( |
| 552 | 556 | Group_Control_Text_Shadow::get_type(), |
| 553 | 557 | [ |
| 554 | 558 | 'name' => 'title_text_shadow', |
| 555 | - 'label' => __('Text Shadow', 'ultimate-post-kit'), | |
| 559 | + 'label' => esc_html__('Text Shadow', 'ultimate-post-kit'), | |
| 556 | 560 | 'selector' => '{{WRAPPER}} .upk-alice-carousel .upk-title a', |
| 557 | 561 | ] |
| 558 | 562 | ); |
| 559 | 563 | |
| @@ -842,11 +846,11 @@ | ||
| 842 | 846 | */ |
| 843 | 847 | public function query_posts($posts_per_page) { |
| 844 | 848 | |
| 845 | 849 | $default = $this->getGroupControlQueryArgs(); |
| 850 | + $args = []; | |
| 846 | 851 | if ($posts_per_page) { |
| 847 | 852 | $args['posts_per_page'] = $posts_per_page; |
| 848 | - // $args['paged'] = max(1, get_query_var('paged'), get_query_var('page')); | |
| 849 | 853 | } |
| 850 | 854 | $args = array_merge($default, $args); |
| 851 | 855 | $this->_query = new WP_Query($args); |
| 852 | 856 | } |
| @@ -856,12 +860,15 @@ | ||
| 856 | 860 | if (!$this->get_settings('show_author')) { |
| 857 | 861 | return; |
| 858 | 862 | } |
| 859 | 863 | |
| 860 | -?> | |
| 864 | + ?> | |
| 861 | 865 | <div class="upk-author"> |
| 862 | 866 | <span><?php echo esc_html_x('by', 'Frontend', 'ultimate-post-kit') ?></span> |
| 863 | - <a href="<?php echo esc_url( get_author_posts_url(get_the_author_meta('ID')) ); ?>"> | |
| 867 | + <a | |
| 868 | + href="<?php echo esc_url( get_author_posts_url(get_the_author_meta('ID')) ); ?>" | |
| 869 | + aria-label="<?php echo esc_attr( 'View all posts by ' . get_the_author() ); ?>" | |
| 870 | + > | |
| 864 | 871 | <?php echo esc_html( get_the_author() ) ?> |
| 865 | 872 | </a> |
| 866 | 873 | </div> |
| 867 | 874 | <?php |
| @@ -874,10 +881,10 @@ | ||
| 874 | 881 | $this->render_header_attribute('alice'); |
| 875 | 882 | |
| 876 | 883 | ?> |
| 877 | 884 | <div <?php $this->print_render_attribute_string('carousel'); ?>> |
| 878 | - <div class="upk-content-<?php echo esc_html($settings['content_position']) ?>"> | |
| 879 | - <div <?php echo $this->get_render_attribute_string('swiper'); ?>> | |
| 885 | + <div class="upk-content-<?php echo esc_attr($settings['content_position']) ?>"> | |
| 886 | + <div <?php $this->print_render_attribute_string('swiper'); ?>> | |
| 880 | 887 | <div class="swiper-wrapper"> |
| 881 | 888 | <?php |
| 882 | 889 | } |
| 883 | 890 | |
| @@ -901,15 +908,15 @@ | ||
| 901 | 908 | <?php $this->render_title(substr($this->get_name(), 4)); ?> |
| 902 | 909 | <?php if ($settings['show_author'] or $settings['show_date'] or $settings['show_reading_time']) : ?> |
| 903 | 910 | <div class="upk-meta"> |
| 904 | 911 | <?php $this->render_author(); ?> |
| 905 | - <div data-separator="<?php echo esc_html($settings['meta_separator']); ?>"> | |
| 912 | + <div data-separator="<?php echo esc_attr($settings['meta_separator']); ?>"> | |
| 906 | 913 | <?php $this->render_date(); ?> |
| 907 | 914 | </div> |
| 908 | 915 | <?php if (_is_upk_pro_activated()) : |
| 909 | 916 | if ('yes' === $settings['show_reading_time']) : ?> |
| 910 | - <div class="upk-reading-time" data-separator="<?php echo esc_html($settings['meta_separator']); ?>"> | |
| 911 | - <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'] ) ); ?> | |
| 917 | + <div class="upk-reading-time" data-separator="<?php echo esc_attr($settings['meta_separator']); ?>"> | |
| 918 | + <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'], $settings['hide_seconds'] ?? 'no', $settings['hide_minutes'] ?? 'no' ) ); ?> | |
| 912 | 919 | </div> |
| 913 | 920 | <?php endif; ?> |
| 914 | 921 | <?php endif; ?> |
| 915 | 922 | </div> |