← All changes
|
modules/ramble-carousel/widgets/ramble-carousel.php
+10
-9
4.1.1
→
4.5.6
View file →
| @@ -154,8 +154,9 @@ | ||
| 154 | 154 | $this->add_group_control( |
| 155 | 155 | Group_Control_Image_Size::get_type(), |
| 156 | 156 | [ |
| 157 | 157 | 'name' => 'primary_thumbnail', |
| 158 | + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Elementor widget query built from user-configured controls; expected behaviour. | |
| 158 | 159 | 'exclude' => ['custom'], |
| 159 | 160 | 'default' => 'medium', |
| 160 | 161 | ] |
| 161 | 162 | ); |
| @@ -184,8 +185,11 @@ | ||
| 184 | 185 | ], |
| 185 | 186 | 'default' => [ |
| 186 | 187 | 'size' => 6, |
| 187 | 188 | ], |
| 189 | + 'condition' => [ | |
| 190 | + 'posts_source!' => 'current_query', | |
| 191 | + ] | |
| 188 | 192 | ] |
| 189 | 193 | ); |
| 190 | 194 | |
| 191 | 195 | $this->register_query_builder_controls(); |
| @@ -1239,9 +1243,8 @@ | ||
| 1239 | 1243 | $default = $this->getGroupControlQueryArgs(); |
| 1240 | 1244 | $args = []; |
| 1241 | 1245 | if ($posts_per_page) { |
| 1242 | 1246 | $args['posts_per_page'] = $posts_per_page; |
| 1243 | - // $args['paged'] = max(1, get_query_var('paged'), get_query_var('page')); | |
| 1244 | 1247 | } |
| 1245 | 1248 | $args = array_merge($default, $args); |
| 1246 | 1249 | $this->_query = new WP_Query($args); |
| 1247 | 1250 | } |
| @@ -1268,9 +1271,9 @@ | ||
| 1268 | 1271 | |
| 1269 | 1272 | <?php if ($settings['show_date'] or $settings['show_reading_time']) : ?> |
| 1270 | 1273 | <div class="upk-date-reading-time upk-flex upk-flex-middle"> |
| 1271 | 1274 | <?php if ($settings['show_date'] == 'yes') : ?> |
| 1272 | - <div data-separator="<?php echo esc_html($settings['meta_separator']); ?>"> | |
| 1275 | + <div data-separator="<?php echo esc_attr($settings['meta_separator']); ?>"> | |
| 1273 | 1276 | <?php $this->render_date(); ?> |
| 1274 | 1277 | </div> |
| 1275 | 1278 | <?php endif; ?> |
| 1276 | 1279 | |
| @@ -1275,9 +1278,9 @@ | ||
| 1275 | 1278 | <?php endif; ?> |
| 1276 | 1279 | |
| 1277 | 1280 | <?php if (_is_upk_pro_activated()) : |
| 1278 | 1281 | if ('yes' === $settings['show_reading_time']) : ?> |
| 1279 | - <div class="upk-reading-time" data-separator="<?php echo esc_html($settings['meta_separator']); ?>"> | |
| 1282 | + <div class="upk-reading-time" data-separator="<?php echo esc_attr($settings['meta_separator']); ?>"> | |
| 1280 | 1283 | <?php echo esc_html( ultimate_post_kit_reading_time( get_the_content(), $settings['avg_reading_speed'], $settings['hide_seconds'] ?? 'no', $settings['hide_minutes'] ?? 'no' ) ); ?> |
| 1281 | 1284 | </div> |
| 1282 | 1285 | <?php endif; ?> |
| 1283 | 1286 | <?php endif; ?> |
| @@ -1295,13 +1298,11 @@ | ||
| 1295 | 1298 | |
| 1296 | 1299 | if (!$this->get_settings('show_comments')) { |
| 1297 | 1300 | return; |
| 1298 | 1301 | } |
| 1299 | - | |
| 1300 | - ?> | |
| 1302 | + ?> | |
| 1301 | 1303 | <div class="upk-comments"> |
| 1302 | - <?php echo get_comments_number($id) ?> | |
| 1303 | - <?php echo esc_html__('Comments', 'ultimate-post-kit') ?> | |
| 1304 | + <?php echo esc_html( $this->upk_get_formatted_comments_count( $id ) ); ?> | |
| 1304 | 1305 | </div> |
| 1305 | 1306 | <?php |
| 1306 | 1307 | } |
| 1307 | 1308 | |
| @@ -1314,14 +1315,14 @@ | ||
| 1314 | 1315 | |
| 1315 | 1316 | $animation = ($this->get_settings('readmore_hover_animation')) ? ' elementor-animation-' . $this->get_settings('readmore_hover_animation') : ''; |
| 1316 | 1317 | |
| 1317 | 1318 | ?> |
| 1318 | - <a href="<?php echo esc_url(get_permalink()); ?>" class="upk-readmore <?php echo esc_html($animation); ?>"> | |
| 1319 | + <a href="<?php echo esc_url(get_permalink()); ?>" class="upk-readmore <?php echo esc_attr($animation); ?>"> | |
| 1319 | 1320 | <span class="upk-flex upk-flex-middle"> |
| 1320 | 1321 | <?php echo esc_html($this->get_settings('readmore_text')); ?> |
| 1321 | 1322 | |
| 1322 | 1323 | <?php if ($settings['readmore_icon']['value']) : ?> |
| 1323 | - <span class="upk-readmore-btn-icon upk-flex-align-<?php echo esc_html($this->get_settings('icon_align')); ?>"> | |
| 1324 | + <span class="upk-readmore-btn-icon upk-flex-align-<?php echo esc_attr($this->get_settings('icon_align')); ?>"> | |
| 1324 | 1325 | |
| 1325 | 1326 | <?php Icons_Manager::render_icon($settings['readmore_icon'], ['aria-hidden' => 'true', 'class' => 'fa-fw']); ?> |
| 1326 | 1327 | |
| 1327 | 1328 | </span> |