Last active
March 6, 2024 10:41
-
-
Save codersaiful/3dd54d67ec0f0db9eb7a1ca5144bf5c9 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Replace your item and items text | |
* for Footer Cart | |
*/ | |
add_filter('ngettext_woo-product-table', 'wpt_custom_item_text_change', 10, 5); | |
function wpt_custom_item_text_change($translation, $single, $plural, $number, $domain) { | |
if ($single !== '%d item') return $translation; | |
switch ($translation) { | |
case '%d item': | |
return '%d iTEM'; // Replace with custom text, ensuring '%d' is present. | |
case '%d items': | |
return '%d iTEMSS'; // Replace with custom text, ensuring '%d' is present. | |
default: | |
return $translation; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment