mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
https://stackoverflow.com/questions/68257028/remove-double-quotes-from-add-to-cart-message-in-woocommerce/68257276
7 lines
382 B
Text
7 lines
382 B
Text
function filter_woocommerce_add_to_cart_item_name_in_quotes( $item_name, $product_id ) {
|
|
// Item name
|
|
$item_name = sprintf( _x( '%s', 'Item name in quotes', 'woocommerce' ), strip_tags( get_the_title( $product_id ) ) );
|
|
|
|
return $item_name;
|
|
}
|
|
add_filter ( 'woocommerce_add_to_cart_item_name_in_quotes', 'filter_woocommerce_add_to_cart_item_name_in_quotes', 10, 2 );
|