Created
August 22, 2024 03:13
-
-
Save wpt00ls/66d86f2816a366a8500b785440b39d4b to your computer and use it in GitHub Desktop.
Ultimate Carousel - Custom hook to change internationalized strings
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 | |
/* | |
* Custom hook to change internationalized strings using php | |
* Add this to your child theme's functions.php file. | |
*/ | |
add_filter( | |
'gettext', | |
function ( | |
$translated_text, | |
$text, | |
$domain | |
) { | |
if ( $domain == 'ultimate-carousel-for-divi' ) { | |
switch ( $translated_text ) { | |
case 'No Products Found!': | |
$translated_text = 'Custom heading'; | |
break; | |
case 'Please check if you have product entries for the selected "Criteria".': | |
$translated_text = 'Custom description'; | |
break; | |
default: | |
break; | |
} | |
} | |
return $translated_text; | |
}, | |
99, | |
3 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment