Filter get_terms by lang on init
-
Hi,
I am creating a theme for a polylang multilingual site where I have a CPT ‘tour’ and a Custom Tax ‘destination’ (hierarchical)
I want my destinations URLs to look like example.com/en/parent-destination/child-destination/
And my tour URLs like example.com/en/parent-destination/child-destination/great-tour/To do that, on ‘init’ I have to crate the rewrite rules and I have to loop around terms language by language. So I call get_terms with the lang parameter.
It seems to be too soon to use lang on init to call get_terms (it returns all terms). If I do a test call to get_posts, the lang filter works. And, if I do the exact same call later on on WP execution, the filter works properly.
Is it possible to make the lang filter to work for get_terms on init?
Thanks!
- The topic ‘Filter get_terms by lang on init’ is closed to new replies.