好的Riaan,
感谢您的回复。
我用这种方式解决了(可能会有帮助):
if ($idarticolo = wp_insert_post($post, true)) {
// inserisco l\'articolo nelle altre lingue: En Es Fr
$idarticoloEn = wp_insert_post($post, true);
$idarticoloEs = wp_insert_post($post, true);
$idarticoloFr = wp_insert_post($post, true);
$polylang->model->set_post_language($idarticolo, \'it\');
$polylang->model->set_post_language($idarticoloEn, \'en\');
$polylang->model->set_post_language($idarticoloEs, \'es\');
$polylang->model->set_post_language($idarticoloFr, \'fr\');
$polylang->model->save_translations(\'post\', $idarticolo, array(\'en\' => $idarticoloEn));
$polylang->model->save_translations(\'post\', $idarticolo, array(\'es\' => $idarticoloEs));
$polylang->model->save_translations(\'post\', $idarticolo, array(\'fr\' => $idarticoloFr));
我用意大利语插入帖子,然后用其他语言创建相应的翻译。
再次感谢您的帮助!
M:)