PluginProbe
SQL Chart Builder / 2.2.2
SQL Chart Builder v2.2.2
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 +1 -13 trunk2.2.2 View file →
@@ -75,21 +75,9 @@
75 75
76 76
77 77
78 78 foreach ($data['titles'] as $key => $value) {
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 -
79 + $existence = get_page_by_title($value, OBJECT, 'gvn_schart');
92 80
93 81 if (empty($existence)) {
94 82 $newid = wp_insert_post(array(
95 83 'post_title' => $value,