PluginProbe
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets / 4.5.6
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets v4.5.6
4.5.6 4.5.5 4.5.4 4.2.1 4.2.2 4.2.3 4.5.0 4.5.2 4.5.3 4.2.0 4.1.18 4.1.17 4.1.16 4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.0.9 4.1.0 4.1.1 4.1.2 All 148 releases
← All changes | modules/alice-grid/module.php +11 -8 4.1.16 → 4.5.6 View file →
@@ -32,8 +32,14 @@
32 32 return $widgets;
33 33 }
34 34
35 35 public function callback_ajax_loadmore_posts() {
36 + // Verify the front-end nonce (sent by UltimatePostKitConfig.nonce) before
37 + // processing this public load-more request.
38 + if ( ! check_ajax_referer( 'upk-site', 'nonce', false ) ) {
39 + wp_send_json_error( array( 'message' => esc_html__( 'Security check failed.', 'ultimate-post-kit' ) ), 403 );
40 + }
41 +
36 42
37 43 $settings = [];
38 44
39 45 if ( isset( $_POST['settings'] ) && is_array( $_POST['settings'] ) ) {
@@ -55,8 +61,11 @@
55 61 ],
56 62 $settings
57 63 );
58 64
65 + // Fill display flags the request may have omitted (see trait) before the render loop reads them.
66 + $settings = array_merge( $this->loadmore_display_defaults(), $settings );
67 +
59 68 $ajaxposts = $this->query_args($settings);
60 69
61 70 ob_start();
62 71 $found_posts = false;
@@ -77,16 +86,10 @@
77 86 $placeholder_image_src = \Elementor\Utils::get_placeholder_image_src();
78 87 $image_src = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' );
79 88 $image_src = $image_src ? $image_src[0] : $placeholder_image_src;
80 89
81 - $onclick = '';
82 -
83 - if (!empty($settings['global_link']) && $settings['global_link'] === 'yes') {
84 - $onclick = ' onclick="window.open(\'' . $post_link . '\', \'_self\')"';
85 - }
86 -
87 90 ?>
88 - <div <?php echo $onclick; ?> class="upk-item">
91 + <div <?php if ( ! empty( $settings['global_link'] ) && $settings['global_link'] === 'yes' ) { printf( 'onclick="window.open(\'%s\', \'_self\')"', esc_url( $post_link ) ); } ?> class="upk-item">
89 92 <div class="upk-item-box">
90 93
91 94 <div class="upk-img-wrap">
92 95 <img class="upk-img" src="<?php echo esc_url( $image_src ); ?>" alt="<?php echo esc_attr( $title ); ?>">
@@ -93,9 +96,9 @@
93 96 </div>
94 97
95 98 <?php if ( isset( $settings['show_category'] ) && 'yes' === $settings['show_category'] ) : ?>
96 99 <div class="upk-category">
97 - <?php echo upk_get_category( $settings['post_source'] ); ?>
100 + <?php echo wp_kses_post( upk_get_category( $settings['posts_source'] ?? 'post' ) ); ?>
98 101 </div>
99 102 <?php endif; ?>
100 103
101 104 <div class="upk-content">