get attachments for original post
-
When using translated media, how can I query for attachments independent of the current language?
Unlike WPML, Polylang does not copy attachments to translated posts. Which is fine for my current project.
Also, from the uploader I will only see media in the same language as the post I’m looking at.Now I would expect to be able to use get_posts in this fashion:
1) If this is a translated post, get the original post. This works fine.
2) Then: use get_posts to get the attachments for the original posts:
$args = array( 'post_type' => 'attachment', 'lang' => 'en', // language of original post 'post_parent' => $post_id // id of original post ); $attachments = get_posts($args);
This doesn’t return any results. What is the expected behavior, and what should I do?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘get attachments for original post’ is closed to new replies.