admin管理员组文章数量:1130349
I have set of posts that i want to import to wp and they alel have 3 lang mutations. I used
foreach($pole as $key => $objekt){
$postid = wp_insert_post(array('post_type' => 'etapa','post_title'=>$key,'post_status' => 'publish'));
$postidDE = wp_insert_post(array('post_type' => 'etapa','post_title'=>$key,'post_status' => 'publish'));
$postidEN = wp_insert_post(array('post_type' => 'etapa','post_title'=>$key,'post_status' => 'publish'));
PLL()->model->post->set_language($postid, 'cs');
PLL()->model->post->set_language($postidEN, 'en');
PLL()->model->post->set_language($postidDE, 'de');
PLL()->model->post->save_translations( $postid, array('en' => $postidEN));
PLL()->model->post->save_translations( $postid, array('de' => $postidDE));
}
but only 2 mutations imports and are connected, the third one is imported but isn't connected to their counterparts. Anyone know what is wrong?
I have set of posts that i want to import to wp and they alel have 3 lang mutations. I used
foreach($pole as $key => $objekt){
$postid = wp_insert_post(array('post_type' => 'etapa','post_title'=>$key,'post_status' => 'publish'));
$postidDE = wp_insert_post(array('post_type' => 'etapa','post_title'=>$key,'post_status' => 'publish'));
$postidEN = wp_insert_post(array('post_type' => 'etapa','post_title'=>$key,'post_status' => 'publish'));
PLL()->model->post->set_language($postid, 'cs');
PLL()->model->post->set_language($postidEN, 'en');
PLL()->model->post->set_language($postidDE, 'de');
PLL()->model->post->save_translations( $postid, array('en' => $postidEN));
PLL()->model->post->save_translations( $postid, array('de' => $postidDE));
}
but only 2 mutations imports and are connected, the third one is imported but isn't connected to their counterparts. Anyone know what is wrong?
本文标签: pluginsHow to import multiple language mutations to polylang
版权声明:本文标题:plugins - How to import multiple language mutations to polylang? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749253229a2340039.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论