它使用本地化调用获取标签,__(\'IBAN\', \'woocommerce\')
, 因此,您可以随时截取并更改文本:
/**
* filter translations, to replace some WooCommerce text with our own
* @param string $translation the translated text
* @param string $text the text before translation
* @param string $domain the gettext domain for translation
* @return string
*/
function wpse_77783_woo_bacs_ibn($translation, $text, $domain) {
if ($domain == \'woocommerce\') {
switch ($text) {
case \'IBAN\':
$translation = \'MICR\';
break;
case \'BIC\':
$translation = \'IFSC\';
break;
}
}
return $translation;
}
add_filter(\'gettext\', \'wpse_77783_woo_bacs_ibn\', 10, 3);