WordPress at Your Fingertips
function is not described

WC_Customer::has_shipping_address() public WC 5.3.0

Indicates if the customer has a non-empty shipping address.

Note that this does not indicate if the customer's shipping address is complete, only that one or more fields are populated.

{} It's a method of the class: WC_Customer{}

No Hooks.




$WC_Customer = new WC_Customer();


Since 5.3.0 Introduced.

Code of WC_Customer::has_shipping_address() WC 5.9.0

public function has_shipping_address() {
	foreach ( $this->get_shipping() as $address_field ) {
		// Trim guards against a case where a subset of saved shipping address fields contain whitespace.
		if ( strlen( trim( $address_field ) ) > 0 ) {
			return true;

	return false;