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

Chouby on "[Plugin: Polylang] get attachments for original post"

$
0
0

Polylang does not automatically tranlate attachments when you create a new post translation. But if you create a translation for a media attached to a certain post, the translated media is attached to the post translation.

You can't expect your code to work. When you specify the 'post_parent' argument, you retrieve only attachments of post_id which are in 'post_id' language. So either the lang parameter is useless (if you query the same language with 'post_parent' and 'lang') or the query will return an empty array (if both languages are different).


Viewing all articles
Browse latest Browse all 11471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>