Add media language mismatch when creating a translation
-
Hi!
I have found a bug with following setup:
– Latest WP and Polylang
– Media translations enabledWhen I create a post where language is for example English and create a translation to this language by clicking plus icon the language in media library stays in English. This means that when I’m picking images to my translated post, Add Media offers me images that are in English instead of my translation language (the bug).
This happens only when creating a new translation. When editing translation the language in Add Media is the same as the article’s and not depended of what language is set at admin bar (which is correct).
There is a quite simple fix to this. By adding correct language to links.php in get_new_post_translation_link function. You’ll need to add ‘lang’ => $language->slug to args (not in attachments). That makes add new translation link to have for example $lang=zh which forces the media library to show images in right language.
This is more of a proposition than question. If the logic can’t be added I hoped there would be a filter that would let me add this argument there optionally.
- The topic ‘Add media language mismatch when creating a translation’ is closed to new replies.