Last active
October 15, 2021 05:24
-
-
Save sybrew/ad9ae08724f05c7edb10e780d642cb8d to your computer and use it in GitHub Desktop.
Removes "Continue Shopping" message from WooCommerce after item has been added to cart.
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 | |
\add_filter( 'wc_add_to_cart_message', function( $string, $product_id = 0 ) { | |
$start = strpos( $string, '<a href=' ) ?: 0; | |
$end = strpos( $string, '</a>', $start ) ?: 0; | |
return substr( $string, $end ) ?: $string; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks. Here's the updated snippet (credit to mayersdesign from Stackoverflow):