Last active
May 19, 2016 14:02
-
-
Save goliver79/8824504 to your computer and use it in GitHub Desktop.
[WOOCOMMERCE] Translate product variations labels and names using filters
This file contains hidden or 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 | |
/** | |
* | |
* Translate product variations labels and names with filters | |
* lgpd_translate_attributes_label | |
* lgpd_translate_variation_option_name | |
*/ | |
add_filter( 'woocommerce_variation_option_name', 'translate_variation_option_name' ); | |
add_filter( 'woocommerce_attribute_label', 'translate_attributes_label' ); | |
function translate_attributes_label( $result ){ | |
return __( $result, 'my_textdomain' ); | |
} | |
function translate_variation_option_name( $name ){ | |
return __( $name, 'my_textdomain' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment