Skip to content

Instantly share code, notes, and snippets.

@andrii-kvlnko
Last active September 15, 2019 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrii-kvlnko/0d61182c477389f2e26a936f2e897c8a to your computer and use it in GitHub Desktop.
Save andrii-kvlnko/0d61182c477389f2e26a936f2e897c8a to your computer and use it in GitHub Desktop.
Polylang | Woocommerce | Product Attributes | set Language
<?php
add_action( 'wp_loaded', 'action_wp_loaded_23235' );
function action_wp_loaded_23235() {
$taxonomies = wc_get_attribute_taxonomy_names();
$attributes_terms = get_terms(
[
'taxonomy' => $taxonomies,
'hide_empty' => false
]
);
foreach ( $attributes_terms as $term ) {
pll_set_term_language( $term->term_id, 'uk' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment