• Resolved lsec

    (@lsec)


    Hello,

    I’m using the wp_insert_post() function to add new posts. Is there a way to assign a language to the post programmatically, thus eliminating the need for manual editing in the backend editor?

    $post_data = array(
    'post_title' => $job_name,
    'post_content' => $content,
    'post_type' => $custom_post_type,
    'post_status' => 'publish',
    );
    $post_id = wp_insert_post($post_data);

    It gets exhausting when you have to manually adapt 10 posts with different content in different languages.

    So is there any function I can use, to set a specific language to a post?

Viewing 1 replies (of 1 total)
  • Plugin Support Anca

    (@ancavictoria)

    Hello,

    Translations can only be added through our Translation Interface.

    Posts do not have a language assigned to them, as they are not duplicated when translating. Therefore, they should be written in the default language of the website.

    Kind Regards,

    Anca

Viewing 1 replies (of 1 total)

The topic ‘Translate site via code insert’ is closed to new replies.