Best way to pragmatically add a post in a language?
-
Hi!
In a theme I’m developing, I’m programatically adding a (custom post type) post for each user, to act as a “profile” page in a membership directory. For a single language, this is working fine:
$post = array ( 'post_author' => $user_id, 'post_type' => 'jnet_member' ); $result = wp_insert_post ( $post, true );
Now I’m moving to polylang, I’d like to add two posts instead, one in English and one in Japanese, so that the membership directory can also be bilingual, using polylang’s helpful support for translation of custom post types.
What’s the best way of programatically adding a post in one language, and its translation in another language?
(I had a look through previous questions, but I wasn’t sure if things had moved on, as they’re all quite old, and I know polylang is being developed very rapidly…)
Thanks,
Matt
- The topic ‘Best way to pragmatically add a post in a language?’ is closed to new replies.