Last active
November 6, 2020 13:42
-
-
Save bolderelements/0c51079ea00c9181c10d7eb34eb0e53b to your computer and use it in GitHub Desktop.
Remove WooCommerce Shipping Title
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
/* | |
* Removes the title from a shipping option. | |
* Best to be used when only one shipping option is returned. | |
* | |
* Requires WooCommerce 2.1+ | |
*/ | |
function remove_title_from_shipping_label( $full_label, $method ){ | |
return str_replace( $method->get_label() . ': ', "", $full_label ); | |
} | |
add_filter( 'woocommerce_cart_shipping_method_full_label', 'remove_title_from_shipping_label', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment