I am in trouble. I have a travel site…I have created a page where users can write a form to insert their houses.
The houses are of course a custom post type.
This is a piece of my code:
...
some validation here
if ($idarticolo = wp_insert_post($post)) {
//lingua
global $polylang;
$lang = pll_current_language();
$polylang->set_post_language($idarticolo, $lang);
...
everything works fine, the house is inserted in my current language; but when I try to translate this post from admin panel, I get an error.
The post is not translated, and no language is detected.
Please help!!!…many thanks in advance!
M.:)