ID, false); foreach (['police','special-forces','military','firefighters'] as $slug) { $p = get_page_by_path("industries/$slug"); if ($p) av_wpml_rescan_one($p->ID, false); } echo "Done."; exit; } }); function av_wpml_rescan_one($post_id, $output = true) { $post = get_post($post_id); if (! $post) { if ($output) wp_die("post $post_id not found"); return; } $package_data = [ 'kind' => 'Bricks', 'name' => (string) $post->ID, 'post_id' => $post->ID, 'title' => "Bricks (ID {$post->ID})", ]; do_action('wpml_page_builder_register_strings', $post, $package_data); if ($output) { header('Content-Type: text/plain; charset=utf-8'); echo "Rescan triggered : post #$post_id (\"{$post->post_title}\")\n"; echo "WPML String Translation should now have the Bricks strings registered.\n"; echo "Return to ATE and reopen the translation — strings should appear.\n"; } else { echo " rescanned #$post_id ({$post->post_title})\n"; } }