Skip to content

Instantly share code, notes, and snippets.

@growdev
Last active February 3, 2022 02:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save growdev/43e441bba1ab3cc5a13beb9698dfcec0 to your computer and use it in GitHub Desktop.
Save growdev/43e441bba1ab3cc5a13beb9698dfcec0 to your computer and use it in GitHub Desktop.
Remove the add address button from the My Account page when using WooCommerce Multiple Shipping Addresses
<?php
add_action( 'init', 'wcmsa_remove_action', 10 );
function wcmsa_remove_action() {
remove_action( 'woocommerce_after_my_account', array( WC_Multiple_Shipping_Addresses()->account, 'add_address_button' ) );
}
@sfmedia
Copy link

sfmedia commented May 20, 2021

Thanks for this, but i'm having issues as the class isn't available in the function? Has this been tested? Any advice welcome... Thanks

@growdev
Copy link
Author

growdev commented May 20, 2021

@sfmedia

This snippet is intended for use with my WC Multiple Shipping Address plugin. That plugin isn't currently for sale, but will be for sale later this year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment