Automattic\WooCommerce\StoreApi\Schemas\V1

BillingAddressSchema::sanitize_callback()publicWC 1.0

Sanitize and format the given address object.

Method of the class: BillingAddressSchema{}

No Hooks.

Return

Array.

Usage

$BillingAddressSchema = new BillingAddressSchema();
$BillingAddressSchema->sanitize_callback( $address, $request, $param );
$address(array) (required)
Value being sanitized.
$request(\WP_REST_Request) (required)
The Request.
$param(string) (required)
The param being sanitized.

BillingAddressSchema::sanitize_callback() code WC 8.9.0

public function sanitize_callback( $address, $request, $param ) {
	$address = parent::sanitize_callback( $address, $request, $param );
	if ( isset( $address['email'] ) ) {
		$address['email'] = sanitize_email( wp_unslash( $address['email'] ) );
	}
	return $address;
}