Skip to content

Instantly share code, notes, and snippets.

@BurlesonBrad
Last active April 8, 2020 20:30
Show Gist options
  • Save BurlesonBrad/2c52958ab38ac0413edd23628ee75f27 to your computer and use it in GitHub Desktop.
Save BurlesonBrad/2c52958ab38ac0413edd23628ee75f27 to your computer and use it in GitHub Desktop.
For Alyssa
<?php
/**
* Plugin Name: Alyssa Gets to Change Her Text
* Plugin URI: https://bradgriffin.me
* Description: Engage Maverick | ENGAGE! Make a conversation with your customer and customize EVERY piece of Text!
* Version: 1
* Author: Brad
* Author URI: https://bradgriffin.me
* Requires at least: 4.6
* Tested up to: 4.6
**/
/* USE THIS ---> https://wordpress.org/plugins/code-snippets | Then GoTo Snippets --> Add New > Copy & Paste the code below */
/* or via FTP, drop this file into the /plugins folder right next to all the other plugins! #whoop! */
/* Or add the code to your child themes functions.php */
/* See the pattern below? Take the text you want to change & put in between the single quote right after the word case */
/* Now add the NEW text that you want on the next line between the single quotes */
add_filter( 'gettext', 'bkg_text_strings', 20, 3 );
function bkg_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Cart Totals' :
$translated_text = __( 'Here are your items!', 'woocommerce' );
break;
}
switch ( $translated_text ) {
case 'Billing Details' :
$translated_text = __( 'Lets Talk About You', 'woocommerce' );
break;
}
switch ( $translated_text ) {
case 'Your order' :
$translated_text = __( 'Sweetness! Here Are Your Items!', 'woocommerce' );
break;
}
switch ( $translated_text ) {
case 'Shop' :
$translated_text = __( 'Grab Whatever You Need!', 'woocommerce' );
break;
}
switch ( $translated_text ) {
case 'Add To Cart' :
$translated_text = __( 'Heck Yeah!', 'woocommerce' );
break;
}
switch ( $translated_text ) {
case 'No products in the cart.' :
$translated_text = __( 'Awww. Look at that lonely Cart. It seems so Empty!', 'woocommerce' );
break;
}
switch ( $translated_text ) {
case 'Your cart is currently empty.' :
$translated_text = __( 'Your Cart Seems So Empty. Lets fill it Up!', 'woocommerce' );
break;
}
switch ( $translated_text ) {
case 'Continue to payment' :
$translated_text = __( 'Great Job! Now Click Here To Finish!', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'bkg_text_strings', 20, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment