Hi,
if you mean post meta, you can use the pll_copy_post_metas filter.
Cheers,
Česlav
Hi Česlav,
thanks for your reply. I did it like this:
// copy selected post metas for polylang plugin
add_filter('pll_copy_post_metas', 'copy_post_metas');
function copy_post_metas($metas) {
return array_merge($metas, array('konzertdaten_konzertdatum','konzertdaten_konzertdatum_archiv'));
}
However, it’s being copied _and_ synchronized. I don’t see how to disable synchronization. Where do I have to put the respective argument?
Kind regards
joschi81
PS: And is it also possible to copy post title and content when a translation is created – without synchronization during the following changes?
Hi joschi,
You should check the second argument ($sync
) in function hooked up to the filter:
// copy selected post metas for polylang plugin
add_filter('pll_copy_post_metas', 'copy_post_metas', 10, 2);
function copy_post_metas($metas, $sync) {
if ( $sync ) {
// If syncing, ignore custom meta.
return $metas;
}
else {
// Otherwise (when creating new translation) copy custom meta.
return array_merge(
$metas,
array(
'konzertdaten_konzertdatum',
'konzertdaten_konzertdatum_archiv'
)
);
}
}
Hope that helps,
Česlav
That works, thank you very much. Now, the only question is how to copy title and content initially to new translations. Is tehre a way to achieve that?
Resolved, I found the solution for copying title and content to new translations here:
http://www.junaidbhura.com/make-polylang-wordpress-plugin-copy-the-content-from-the-original-post/
Thus, thanks junaid – and thanks again Česlav for the great plugin.
Hi joshi,
I’m glad I could help, but I’m not the author of Polylang, so your thanks should go to Chouby 🙂
Cheers,
Česlav
Yes, sorry… 🙂 Like this:
Thanks Česlav for your help and thanks Chouby for the great plugin!