Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

Chouby on ""Translating" untitled posts containing only images with Polylang"

$
0
0

Polylang does not offer this possibility. However, if you have some PHP skills it should be achievable using the functions get_posts to query the posts you want to translate and wp_insert_post to create a new post. Once you have the two posts, you can do something like this:

global $polylang;
$polylang->set_post_language($translated_id, 'fr');
$polylang->save_translations('post', $translated_id, array('en' => $original_id, 'fr' => $translated_id));

Viewing all articles
Browse latest Browse all 11471

Trending Articles