Created
February 27, 2020 14:56
-
-
Save jesseeproductions/f4252037707ca825cad5bb0c47d47e24 to your computer and use it in GitHub Desktop.
Change Categories to Location for Coupon Creator Pro Filter Bar
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
/** | |
* Change Categories to Location for Coupon Creator Pro Filter Bar | |
* | |
* @param string $translation The translated text. | |
* @param string $text The text to translate. | |
* @param string $domain The domain slug of the translated text. | |
* @param string $context The option context string. | |
* | |
* @return string The translated text or the custom text. | |
*/ | |
add_filter( 'gettext', 'cctor_change_category_to_location', 20, 3 ); | |
function cctor_change_category_to_location( $translation, $text, $domain, $context = "" ) { | |
if ( | |
$domain != "default" && | |
( | |
strpos( $domain, 'coupon-creator' ) !== 0 | |
) | |
) { | |
return $translation; | |
} | |
$custom_text = array( | |
'Categories:' => 'Location:', | |
); | |
// If we don't have replacement text, bail. | |
if ( empty( $custom_text[ $text ] ) ) { | |
return $translation; | |
} | |
return $custom_text[ $text ]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment