Last active
September 15, 2016 18:17
-
-
Save bryceadams/96f080b5118c8f1fdf20 to your computer and use it in GitHub Desktop.
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
<?php | |
// Change 'add to cart' text on single product page (depending on product IDs) | |
add_filter( 'woocommerce_product_single_add_to_cart_text', 'bryce_id_multiple_add_to_cart_text' ); | |
function bryce_id_multiple_add_to_cart_text( $default ) { | |
if ( get_the_ID() == 386 ) { | |
return __( 'Yes! I WANT this!', 'your-slug' ); | |
} elseif ( get_the_ID() == 125 ) { | |
return __( 'This is number 125! Add!', 'your-slug' ); | |
} elseif ( get_the_ID() == 225 ) { | |
return __( 'Add number 225 too!', 'your-slug' ); | |
} else { | |
return $default; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment