PluginProbe
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder / 51.1.86
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder v51.1.86
51.1.86 51.1.84 51.1.85 51.1.83 51.1.82 51.1.81 51.1.79 51.1.78 51.1.77 51.1.76 51.1.74 51.1.75 51.1.65 51.1.64 51.1.63 trunk 51.1.14 51.1.2 51.1.35 51.1.36 51.1.37 51.1.38 51.1.39 51.1.44 51.1.45 All 40 releases
← All changes | includes/widgets/TB_Related_Posts/TB_Related_Posts.php +8 -2 51.1.78 → 51.1.86 View file →
@@ -47,9 +47,9 @@
47 47 * @return string
48 48 */
49 49 public function get_icon(): string
50 50 {
51 - return 'eicon-posts-grid';
51 + return 'king-addons-icon king-addons-tb-related-posts';
52 52 }
53 53
54 54 /**
55 55 * Style dependencies.
@@ -77,9 +77,9 @@
77 77 * @return array<int, string>
78 78 */
79 79 public function get_categories(): array
80 80 {
81 - return ['king-addons'];
81 + return ['king-addons-theme-builder'];
82 82 }
83 83
84 84 /**
85 85 * Keywords.
@@ -470,8 +470,9 @@
470 470 $args['orderby'] = $orderby;
471 471
472 472 $source = $settings['kng_source'] ?? 'categories';
473 473 $tax_query = [];
474 + $needs_terms = in_array($source, ['categories', 'tags', 'taxonomy'], true);
474 475 if ('categories' === $source) {
475 476 $terms = wp_get_post_categories($post->ID);
476 477 if (!empty($terms)) {
477 478 $tax_query[] = [
@@ -502,8 +503,13 @@
502 503 }
503 504
504 505 if (!empty($tax_query)) {
505 506 $args['tax_query'] = $tax_query;
507 + } elseif ($needs_terms) {
508 + // No matching terms is “nothing related”, not “every other post”.
509 + // Without this, fallback=hide never ran because the unfiltered query
510 + // always found latest posts.
511 + $args['post__in'] = [0];
506 512 }
507 513
508 514 return new WP_Query($args);
509 515 }