'University Selection & Admission', 3041 => 'Visa & Study Permit Support', 3043 => 'SOP & Documentation Preparation', 1876 => 'Pre-Departure Briefing & Support', ]; foreach ($service_titles as $post_id => $new_title) { $post = get_post($post_id); if ($post && $post->post_title !== $new_title) { wp_update_post(['ID' => $post_id, 'post_title' => $new_title, 'post_name' => sanitize_title($new_title)]); } } ['title' => 'University Selection & Admission', 'slug' => 'university-selection-admission'], 3041 => ['title' => 'Visa & Study Permit Support', 'slug' => 'visa-study-permit-support'], 3043 => ['title' => 'SOP & Documentation Preparation', 'slug' => 'sop-documentation-preparation'], 1876 => ['title' => 'Pre-Departure Briefing & Support', 'slug' => 'pre-departure-briefing-support'], ]; foreach ($svc_updates as $pid => $data) { $current = $wpdb->get_var($wpdb->prepare("SELECT post_title FROM {$wpdb->posts} WHERE ID=%d", $pid)); if ($current && $current !== $data['title']) { $wpdb->query($wpdb->prepare( "UPDATE {$wpdb->posts} SET post_title=%s, post_name=%s WHERE ID=%d", $data['title'], $data['slug'], $pid )); clean_post_cache($pid); } }// ── 2. Draft broken PHP snippets 3793 and 3792 ── foreach ([3793, 3792] as $broken_id) { $s = get_post($broken_id); if ($s && $s->post_status === 'publish') { $wpdb->query($wpdb->prepare( "UPDATE {$wpdb->posts} SET post_status='draft' WHERE ID=%d", $broken_id )); clean_post_cache($broken_id); } }// ── 3. Also draft old snippet 3827 (superseded by this snippet) ── $old = get_post(3827); if ($old && $old->post_status === 'publish') { $wpdb->query($wpdb->prepare( "UPDATE {$wpdb->posts} SET post_status='draft' WHERE ID=%d", 3827 )); clean_post_cache(3827); }// ── 4. Purge LiteSpeed Cache so updated titles serve fresh ── if (function_exists('do_action')) { do_action('litespeed_purge_all'); } if (class_exists('LiteSpeedPurge')) { LiteSpeedPurge::purge_all(); } wp_cache_flush();
