ID, 'home', 'Accueil'); echo $fr_id ? "Home EN #{$en->ID} → FR #$fr_id\n" : "Home FR creation FAILED\n"; // Also set FR home as static front page for FR language via WPML if ($fr_id) { global $sitepress; if ($sitepress && method_exists($sitepress, 'set_setting')) { $settings = (array) $sitepress->get_setting('language_negotiation_type'); // WPML language-specific home pages are stored as 'translated-flags' or // similar. The simplest approach is to register the FR home through // WPML's icl_object_id mapping — already done via set_element_language_details. } } echo "\nNow run /?av_generate_home=1 to push translated structure.\n"; exit; });