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/helpers/Theme_Builder/Repository.php +21 -1 51.1.44 → 51.1.86 View file →
@@ -36,17 +36,26 @@
36 36 if (is_array($cached)) {
37 37 return $cached;
38 38 }
39 39
40 + // Query for templates that have EITHER ENABLED OR LOCATION meta key.
41 + // This ensures templates created via Theme Builder are shown,
42 + // even if they were created before the ENABLED key was set or if they
43 + // have only the LOCATION key set.
40 44 $query = new WP_Query([
41 45 'post_type' => 'elementor_library',
42 46 'post_status' => ['publish', 'draft', 'pending', 'future'],
43 47 'posts_per_page' => -1,
44 48 'meta_query' => [
49 + 'relation' => 'OR',
45 50 [
46 51 'key' => Meta_Keys::ENABLED,
47 52 'compare' => 'EXISTS',
48 53 ],
54 + [
55 + 'key' => Meta_Keys::LOCATION,
56 + 'compare' => 'EXISTS',
57 + ],
49 58 ],
50 59 'fields' => 'ids',
51 60 'no_found_rows' => true,
52 61 ]);
@@ -54,14 +63,25 @@
54 63 $templates = [];
55 64
56 65 foreach ($query->posts as $post_id) {
57 66 $location = get_post_meta($post_id, Meta_Keys::LOCATION, true) ?: '';
67 +
68 + // Skip templates without location - they're not Theme Builder templates
69 + if (empty($location)) {
70 + continue;
71 + }
72 +
58 73 $sub_location = get_post_meta($post_id, Meta_Keys::SUB_LOCATION, true) ?: '';
59 74 $conditions_meta = get_post_meta($post_id, Meta_Keys::CONDITIONS, true);
60 75 $conditions = Conditions::normalize($conditions_meta);
61 76 $priority = (int) get_post_meta($post_id, Meta_Keys::PRIORITY, true);
62 77 $is_pro_only = (bool) get_post_meta($post_id, Meta_Keys::IS_PRO_ONLY, true);
63 - $enabled = (string) get_post_meta($post_id, Meta_Keys::ENABLED, true) === '1';
78 +
79 + // Check if ENABLED meta exists
80 + $enabled_meta = get_post_meta($post_id, Meta_Keys::ENABLED, true);
81 + // If ENABLED meta doesn't exist but LOCATION does, default to enabled
82 + // If ENABLED meta exists, use its value
83 + $enabled = ($enabled_meta === '') ? true : ((string) $enabled_meta === '1');
64 84
65 85 $templates[] = [
66 86 'id' => (int) $post_id,
67 87 'location' => $location,