How to use wordpress $polylang->model->set_post_language in custom php code?
Turns out that the language relationship is simple and set in just a few functions: // Insert the EN post which returns the EN post id. $post_data_en = array( // add EN post data like the title and content ) $post_id_en = wp_insert_post($post_data_en, true); // Then set the language of the post pll_set_post_language($post_id_en, ‘en’); // … Read more