| @@ -96,20 +96,20 @@ | ||
| 96 | 96 | |
| 97 | 97 | $this->add_responsive_control( |
| 98 | 98 | 'columns', |
| 99 | 99 | [ |
| 100 | - 'label' => __('Columns', 'ultimate-post-kit'), | |
| 100 | + 'label' => esc_html__('Columns', 'ultimate-post-kit'), | |
| 101 | 101 | 'type' => Controls_Manager::SELECT, |
| 102 | 102 | 'default' => 3, |
| 103 | 103 | 'tablet_default' => 2, |
| 104 | 104 | 'mobile_default' => 1, |
| 105 | 105 | 'options' => [ |
| 106 | - 1 => '1', | |
| 107 | - 2 => '2', | |
| 108 | - 3 => '3', | |
| 109 | - 4 => '4', | |
| 110 | - 5 => '5', | |
| 111 | - 6 => '6', | |
| 106 | + 1 => esc_html__('1', 'ultimate-post-kit'), | |
| 107 | + 2 => esc_html__('2', 'ultimate-post-kit'), | |
| 108 | + 3 => esc_html__('3', 'ultimate-post-kit'), | |
| 109 | + 4 => esc_html__('4', 'ultimate-post-kit'), | |
| 110 | + 5 => esc_html__('5', 'ultimate-post-kit'), | |
| 111 | + 6 => esc_html__('6', 'ultimate-post-kit'), | |
| 112 | 112 | ], |
| 113 | 113 | ] |
| 114 | 114 | ); |
| 115 | 115 | |
| @@ -115,9 +115,9 @@ | ||
| 115 | 115 | |
| 116 | 116 | $this->add_responsive_control( |
| 117 | 117 | 'item_gap', |
| 118 | 118 | [ |
| 119 | - 'label' => __('Item Gap', 'ultimate-post-kit'), | |
| 119 | + 'label' => esc_html__('Item Gap', 'ultimate-post-kit'), | |
| 120 | 120 | 'type' => Controls_Manager::SLIDER, |
| 121 | 121 | 'default' => [ |
| 122 | 122 | 'size' => 20, |
| 123 | 123 | ], |
| @@ -139,8 +139,9 @@ | ||
| 139 | 139 | $this->add_group_control( |
| 140 | 140 | Group_Control_Image_Size::get_type(), |
| 141 | 141 | [ |
| 142 | 142 | 'name' => 'primary_thumbnail', |
| 143 | + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour. | |
| 143 | 144 | 'exclude' => ['custom'], |
| 144 | 145 | 'default' => 'medium', |
| 145 | 146 | ] |
| 146 | 147 | ); |
| @@ -167,9 +168,9 @@ | ||
| 167 | 168 | // Query Settings |
| 168 | 169 | $this->start_controls_section( |
| 169 | 170 | 'section_post_query_builder', |
| 170 | 171 | [ |
| 171 | - 'label' => __('Query', 'ultimate-post-kit') . BDTUPK_NC, | |
| 172 | + 'label' => esc_html__('Query', 'ultimate-post-kit'), | |
| 172 | 173 | 'tab' => Controls_Manager::TAB_CONTENT, |
| 173 | 174 | ] |
| 174 | 175 | ); |
| 175 | 176 | |
| @@ -186,8 +187,11 @@ | ||
| 186 | 187 | ], |
| 187 | 188 | 'default' => [ |
| 188 | 189 | 'size' => 6, |
| 189 | 190 | ], |
| 191 | + 'condition' => [ | |
| 192 | + 'posts_source!' => 'current_query', | |
| 193 | + ] | |
| 190 | 194 | ] |
| 191 | 195 | ); |
| 192 | 196 | |
| 193 | 197 | $this->register_query_builder_controls(); |
| @@ -196,9 +200,9 @@ | ||
| 196 | 200 | |
| 197 | 201 | $this->start_controls_section( |
| 198 | 202 | 'section_content_additional', |
| 199 | 203 | [ |
| 200 | - 'label' => esc_html__('Additional', 'ultimate-post-kit'), | |
| 204 | + 'label' => esc_html__('Additional Options', 'ultimate-post-kit'), | |
| 201 | 205 | ] |
| 202 | 206 | ); |
| 203 | 207 | |
| 204 | 208 | //Global Title Controls |
| @@ -217,9 +221,9 @@ | ||
| 217 | 221 | |
| 218 | 222 | $this->add_control( |
| 219 | 223 | 'meta_separator', |
| 220 | 224 | [ |
| 221 | - 'label' => __('Separator', 'ultimate-post-kit') . BDTUPK_NC, | |
| 225 | + 'label' => esc_html__('Separator', 'ultimate-post-kit'), | |
| 222 | 226 | 'type' => Controls_Manager::TEXT, |
| 223 | 227 | 'default' => '|', |
| 224 | 228 | 'label_block' => false, |
| 225 | 229 | ] |
| @@ -259,9 +263,9 @@ | ||
| 259 | 263 | |
| 260 | 264 | $this->add_control( |
| 261 | 265 | 'item_match_height', |
| 262 | 266 | [ |
| 263 | - 'label' => __('Item Match Height', 'ultimate-post-kit'), | |
| 267 | + 'label' => esc_html__('Item Match Height', 'ultimate-post-kit'), | |
| 264 | 268 | 'type' => Controls_Manager::SWITCHER, |
| 265 | 269 | 'default' => 'yes', |
| 266 | 270 | 'prefix_class' => 'upk-item-match-height--', |
| 267 | 271 | 'separator' => 'before', |
| @@ -271,9 +275,9 @@ | ||
| 271 | 275 | |
| 272 | 276 | $this->add_control( |
| 273 | 277 | 'meta_end_position', |
| 274 | 278 | [ |
| 275 | - 'label' => esc_html__('Meta End Position', 'ultimate-post-kit') . BDTUPK_NC, | |
| 279 | + 'label' => esc_html__('Meta End Position', 'ultimate-post-kit'), | |
| 276 | 280 | 'type' => Controls_Manager::SWITCHER, |
| 277 | 281 | 'prefix_class' => 'upk-meta-end-position--', |
| 278 | 282 | 'condition' => [ |
| 279 | 283 | 'item_match_height' => 'yes' |
| @@ -283,9 +287,9 @@ | ||
| 283 | 287 | |
| 284 | 288 | $this->add_control( |
| 285 | 289 | 'show_post_format', |
| 286 | 290 | [ |
| 287 | - 'label' => esc_html__('Post Format', 'ultimate-post-kit') . BDTUPK_NC, | |
| 291 | + 'label' => esc_html__('Post Format', 'ultimate-post-kit'), | |
| 288 | 292 | 'type' => Controls_Manager::SWITCHER, |
| 289 | 293 | 'separator' => 'before' |
| 290 | 294 | ] |
| 291 | 295 | ); |
| @@ -292,12 +296,12 @@ | ||
| 292 | 296 | |
| 293 | 297 | $this->add_control( |
| 294 | 298 | 'global_link', |
| 295 | 299 | [ |
| 296 | - 'label' => __('Item Wrapper Link', 'ultimate-post-kit'), | |
| 300 | + 'label' => esc_html__('Item Wrapper Link', 'ultimate-post-kit'), | |
| 297 | 301 | 'type' => Controls_Manager::SWITCHER, |
| 298 | 302 | 'prefix_class' => 'upk-global-link-', |
| 299 | - 'description' => __('Be aware! When Item Wrapper Link activated then title link and read more link will not work', 'ultimate-post-kit'), | |
| 303 | + 'description' => esc_html__('Be aware! When Item Wrapper Link activated then title link and read more link will not work', 'ultimate-post-kit'), | |
| 300 | 304 | 'separator' => 'before', |
| 301 | 305 | ] |
| 302 | 306 | ); |
| 303 | 307 | |
| @@ -305,9 +309,9 @@ | ||
| 305 | 309 | |
| 306 | 310 | $this->start_controls_section( |
| 307 | 311 | 'section_content_readmore', |
| 308 | 312 | [ |
| 309 | - 'label' => esc_html__('Read More', 'ultimate-post-kit') . BDTUPK_NC, | |
| 313 | + 'label' => esc_html__('Read More', 'ultimate-post-kit'), | |
| 310 | 314 | 'condition' => [ |
| 311 | 315 | 'readmore_type' => 'classic', |
| 312 | 316 | ], |
| 313 | 317 | ] |
| @@ -317,8 +321,9 @@ | ||
| 317 | 321 | 'readmore_text', |
| 318 | 322 | [ |
| 319 | 323 | 'label' => esc_html__('Read More Text', 'ultimate-post-kit'), |
| 320 | 324 | 'type' => Controls_Manager::TEXT, |
| 325 | + 'dynamic' => [ 'active' => true ], | |
| 321 | 326 | 'default' => esc_html__('Read More', 'ultimate-post-kit'), |
| 322 | 327 | 'placeholder' => esc_html__('Read More', 'ultimate-post-kit'), |
| 323 | 328 | ] |
| 324 | 329 | ); |
| @@ -395,9 +400,9 @@ | ||
| 395 | 400 | |
| 396 | 401 | $this->add_responsive_control( |
| 397 | 402 | 'content_padding', |
| 398 | 403 | [ |
| 399 | - 'label' => __('Content Padding', 'ultimate-post-kit'), | |
| 404 | + 'label' => esc_html__('Content Padding', 'ultimate-post-kit'), | |
| 400 | 405 | 'type' => Controls_Manager::DIMENSIONS, |
| 401 | 406 | 'size_units' => ['px', 'em', '%'], |
| 402 | 407 | 'selectors' => [ |
| 403 | 408 | '{{WRAPPER}} .upk-alter-carousel .upk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| @@ -425,9 +430,9 @@ | ||
| 425 | 430 | $this->add_group_control( |
| 426 | 431 | Group_Control_Border::get_type(), |
| 427 | 432 | [ |
| 428 | 433 | 'name' => 'item_border', |
| 429 | - 'label' => __('Border', 'ultimate-post-kit'), | |
| 434 | + 'label' => esc_html__('Border', 'ultimate-post-kit'), | |
| 430 | 435 | 'placeholder' => '1px', |
| 431 | 436 | 'default' => '1px', |
| 432 | 437 | 'selector' => '{{WRAPPER}} .upk-alter-carousel .upk-item', |
| 433 | 438 | ] |
| @@ -494,10 +499,10 @@ | ||
| 494 | 499 | |
| 495 | 500 | $this->add_responsive_control( |
| 496 | 501 | 'item_shadow_padding', |
| 497 | 502 | [ |
| 498 | - 'label' => __('Match Padding', 'ultimate-post-kit'), | |
| 499 | - 'description' => __('You have to add padding for matching overlaping normal/hover box shadow when you used Box Shadow option.', 'ultimate-post-kit'), | |
| 503 | + 'label' => esc_html__('Match Padding', 'ultimate-post-kit'), | |
| 504 | + 'description' => esc_html__('You have to add padding for matching overlaping normal/hover box shadow when you used Box Shadow option.', 'ultimate-post-kit'), | |
| 500 | 505 | 'type' => Controls_Manager::SLIDER, |
| 501 | 506 | 'range' => [ |
| 502 | 507 | 'px' => [ |
| 503 | 508 | 'min' => 0, |
| @@ -616,9 +621,9 @@ | ||
| 616 | 621 | $this->add_group_control( |
| 617 | 622 | Group_Control_Text_Shadow::get_type(), |
| 618 | 623 | [ |
| 619 | 624 | 'name' => 'title_text_shadow', |
| 620 | - 'label' => __('Text Shadow', 'ultimate-post-kit'), | |
| 625 | + 'label' => esc_html__('Text Shadow', 'ultimate-post-kit'), | |
| 621 | 626 | 'selector' => '{{WRAPPER}} .upk-alter-carousel .upk-title a', |
| 622 | 627 | 'condition' => [ |
| 623 | 628 | 'title_advanced_style' => 'yes' |
| 624 | 629 | ] |
| @@ -638,9 +643,9 @@ | ||
| 638 | 643 | |
| 639 | 644 | $this->add_responsive_control( |
| 640 | 645 | 'title_border_radius', |
| 641 | 646 | [ |
| 642 | - 'label' => __('Border Radius', 'ultimate-post-kit'), | |
| 647 | + 'label' => esc_html__('Border Radius', 'ultimate-post-kit'), | |
| 643 | 648 | 'type' => Controls_Manager::DIMENSIONS, |
| 644 | 649 | 'size_units' => ['px', '%'], |
| 645 | 650 | 'selectors' => [ |
| 646 | 651 | '{{WRAPPER}} .upk-alter-carousel .upk-title a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| @@ -664,9 +669,9 @@ | ||
| 664 | 669 | |
| 665 | 670 | $this->add_responsive_control( |
| 666 | 671 | 'title_text_padding', |
| 667 | 672 | [ |
| 668 | - 'label' => __('Padding', 'ultimate-post-kit'), | |
| 673 | + 'label' => esc_html__('Padding', 'ultimate-post-kit'), | |
| 669 | 674 | 'type' => Controls_Manager::DIMENSIONS, |
| 670 | 675 | 'size_units' => ['px', 'em', '%'], |
| 671 | 676 | 'selectors' => [ |
| 672 | 677 | '{{WRAPPER}} .upk-alter-carousel .upk-title a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| @@ -712,9 +717,9 @@ | ||
| 712 | 717 | |
| 713 | 718 | $this->add_responsive_control( |
| 714 | 719 | 'text_margin', |
| 715 | 720 | [ |
| 716 | - 'label' => __('Margin', 'ultimate-post-kit'), | |
| 721 | + 'label' => esc_html__('Margin', 'ultimate-post-kit'), | |
| 717 | 722 | 'type' => Controls_Manager::DIMENSIONS, |
| 718 | 723 | 'size_units' => ['px', 'em', '%'], |
| 719 | 724 | 'selectors' => [ |
| 720 | 725 | '{{WRAPPER}} .upk-alter-carousel .upk-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| @@ -980,9 +985,9 @@ | ||
| 980 | 985 | |
| 981 | 986 | $this->start_controls_section( |
| 982 | 987 | 'section_style_post_format', |
| 983 | 988 | [ |
| 984 | - 'label' => esc_html__('Post Format', 'ultimate-post-kit') . BDTUPK_NC, | |
| 989 | + 'label' => esc_html__('Post Format', 'ultimate-post-kit'), | |
| 985 | 990 | 'tab' => Controls_Manager::TAB_STYLE, |
| 986 | 991 | 'condition' => [ |
| 987 | 992 | 'show_post_format' => 'yes', |
| 988 | 993 | ], |
| @@ -1137,11 +1142,11 @@ | ||
| 1137 | 1142 | public function query_posts($posts_per_page) |
| 1138 | 1143 | { |
| 1139 | 1144 | |
| 1140 | 1145 | $default = $this->getGroupControlQueryArgs(); |
| 1146 | + $args = []; | |
| 1141 | 1147 | if ($posts_per_page) { |
| 1142 | 1148 | $args['posts_per_page'] = $posts_per_page; |
| 1143 | - // $args['paged'] = max(1, get_query_var('paged'), get_query_var('page')); | |
| 1144 | 1149 | } |
| 1145 | 1150 | $args = array_merge($default, $args); |
| 1146 | 1151 | $this->_query = new WP_Query($args); |
| 1147 | 1152 | } |
| @@ -1153,9 +1158,9 @@ | ||
| 1153 | 1158 | |
| 1154 | 1159 | ?> |
| 1155 | 1160 | <div <?php $this->print_render_attribute_string('carousel'); ?>> |
| 1156 | 1161 | <div class="upk-post-grid"> |
| 1157 | - <div <?php echo $this->get_render_attribute_string('swiper'); ?>> | |
| 1162 | + <div <?php $this->print_render_attribute_string('swiper'); ?>> | |
| 1158 | 1163 | <div class="swiper-wrapper"> |
| 1159 | 1164 | <?php |
| 1160 | 1165 | } |
| 1161 | 1166 | |
| @@ -1204,17 +1209,20 @@ | ||
| 1204 | 1209 | |
| 1205 | 1210 | <?php if ($settings['show_author'] or $settings['show_date'] or $settings['show_reading_time']) : ?> |
| 1206 | 1211 | <div class="upk-meta"> |
| 1207 | 1212 | <?php if ($settings['show_author']) : ?> |
| 1208 | - <div class="upk-blog-author" data-separator="<?php echo esc_html($settings['meta_separator']); ?>"> | |
| 1209 | - <a class="author-name" href="<?php echo esc_url( get_author_posts_url(get_the_author_meta('ID')) ); ?>"> | |
| 1213 | + <div class="upk-blog-author" data-separator="<?php echo esc_attr($settings['meta_separator']); ?>"> | |
| 1214 | + <a | |
| 1215 | + class="author-name" | |
| 1216 | + href="<?php echo esc_url( get_author_posts_url(get_the_author_meta('ID')) ); ?>" | |
| 1217 | + aria-label="<?php echo esc_attr( 'View all posts by ' . get_the_author() ); ?>" | |
| 1218 | + > | |
| 1210 | 1219 | <?php echo esc_html( get_the_author() ) ?> |
| 1211 | 1220 | </a> |
| 1212 | 1221 | </div> |
| 1213 | - <?php endif; ?> | |
| 1214 | - | |
| 1222 | + <?php endif; ?> | |
| 1215 | 1223 | <?php if ('yes' === $settings['show_date']) : ?> |
| 1216 | - <div data-separator="<?php echo esc_html($settings['meta_separator']); ?>"> | |
| 1224 | + <div data-separator="<?php echo esc_attr($settings['meta_separator']); ?>"> | |
| 1217 | 1225 | <?php $this->render_date(); ?> |
| 1218 | 1226 | </div> |
| 1219 | 1227 | <?php endif; ?> |
| 1220 | 1228 | |
| @@ -1219,10 +1227,10 @@ | ||
| 1219 | 1227 | <?php endif; ?> |
| 1220 | 1228 | |
| 1221 | 1229 | <?php if (_is_upk_pro_activated()) : |
| 1222 | 1230 | if ('yes' === $settings['show_reading_time']) : ?> |
| 1223 | - <div class="upk-reading-time" data-separator="<?php echo esc_html($settings['meta_separator']); ?>"> | |
| 1224 | - <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'] ) ); ?> | |
| 1231 | + <div class="upk-reading-time" data-separator="<?php echo esc_attr($settings['meta_separator']); ?>"> | |
| 1232 | + <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'], $settings['hide_seconds'] ?? 'no', $settings['hide_minutes'] ?? 'no' ) ); ?> | |
| 1225 | 1233 | </div> |
| 1226 | 1234 | <?php endif; ?> |
| 1227 | 1235 | <?php endif; ?> |
| 1228 | 1236 | </div> |