Last active
May 10, 2020 11:58
-
-
Save Oscar-Abad-Folgueira/8a419546ea69d0792ad900afd82ef8aa to your computer and use it in GitHub Desktop.
Traducir cualquier texto en WordPress
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 | |
/** | |
* @snippet Traducir cualquier texto en WordPress | |
* @author Oscar Abad Folgueira | |
* @author_url https://www.oscarabadfolgueira.com | |
* @snippet_url https://www.oscarabadfolgueira.com/como-traducir-cualquier-texto-en-wordpress/ | |
*/ | |
add_filter( 'gettext', 'traducir_cualquier_texto', 10, 3 ); | |
function traducir_cualquier_texto( $translated, $original, $domain ) { | |
if ( $original == "Out of stock" ) { | |
$translated = "Sacabao!"; | |
} | |
return $translated; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment