Last active
March 7, 2019 05:33
-
-
Save felipemotabr/90dbb4f1cb4a59a8eb21f0f5ce5f159c to your computer and use it in GitHub Desktop.
Wordpress: String replace
This file contains hidden or 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
| add_action('wp_footer', 'replace_this'); | |
| function replace_this(){ | |
| ?> | |
| <script> | |
| var myExpression = document.getElementById("masthead").innerHTML; //Find ID | |
| var newExpression = myExpression.replace("View your shopping cart", "Carrinho"); //Find expression and exchange | |
| document.getElementById("masthead").innerHTML = newExpression; //Print on screen | |
| </script> | |
| <?php | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment