Last active
September 15, 2019 14:34
-
-
Save andrii-kvlnko/0d61182c477389f2e26a936f2e897c8a to your computer and use it in GitHub Desktop.
Polylang | Woocommerce | Product Attributes | set Language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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