Front-end filters for links available also on back-end?
-
Hello,
I have a dev question: I would like to use
get_post_type_archive_link()
function in back-end. I noticed that its return value is not filtered by Polylang and thus it lacks language code.I find out that link filters are activated only on front-end and I guess that they won’t work right out of the box on back-end, because they rely on current language and “current language” in back-end seems to be whatever is the value of language filter, so there is no actual current language when “Show all languages” item is selected.
My intention is to display post type archive link with current language of the back-end user – is there an easy way to do it with Polylang? Or should I rather try to implement it on my own? I know I can get current back-end user language via
get_locale()
, but I would like to reuse link filters from Polylang as much as possible.I’m working with Polylang 1.8.1 and WordPress 4.4.1.
Greetings,
Česlav
- The topic ‘Front-end filters for links available also on back-end?’ is closed to new replies.