1

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.