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.

Return

true|false.

Usage

$WC_Customer = new WC_Customer();
$WC_Customer->has_shipping_address();

Changelog

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;
}