Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taxonomy terms are fetched with "get_term_by" during taxonomy import -> localisation is not supported. #22

Open
ironland opened this issue May 19, 2019 · 0 comments

Comments

@ironland
Copy link

We have to change the method to get_terms which has support for language through polylang. Here's a quick example:

$lang     = ! empty( $this->i18n['locale'] ) ? $this->i18n['locale'] : \pll_default_language();

$found_terms = \get_terms( [
    'slug'       => $slug,
    'taxonomy'   => $taxonomy,
    'lang'       => $lang,
    'hide_empty' => false,
    'fields'     => 'ids',
] );

the existence of pll should also be checked in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant