PluginProbe
SQL Chart Builder / 3.0.3
SQL Chart Builder v3.0.3
3.0.4 3.0.3 3.0.2 3.0.1 trunk 1.0.2 1.0.3 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.7.1 2.3.7.2 2.3.8 3.0.0
← All changes | initial_data.php +13 -1 2.3.13.0.3 View file →
@@ -75,9 +75,21 @@
75 75
76 76
77 77
78 78 foreach ($data['titles'] as $key => $value) {
79 - $existence = get_page_by_title($value, OBJECT, 'gvn_schart');
79 + $args = [
80 + 'post_type' => 'gvn_schart',
81 + 'title' => $value,
82 + 'post_status' => 'any', // Adjust if you only want published posts
83 + 'numberposts' => 1,
84 + ];
85 +
86 + $query = new WP_Query($args);
87 + $existence = $query->have_posts() ? $query->posts[0] : null;
88 +
89 + // Clean up after the query
90 + wp_reset_postdata();
91 +
80 92
81 93 if (empty($existence)) {
82 94 $newid = wp_insert_post(array(
83 95 'post_title' => $value,