WordPress at Your Fingertips
function is not described

wc_sanitize_phone_number() WC 3.6.0

Sanitize phone number. Allows only numbers and "+" (plus sign).

No Hooks.

Return

String.

Usage

wc_sanitize_phone_number( $phone );
$phone(string) (required)
Phone number.

Changelog

Since 3.6.0 Introduced.

Code of wc_sanitize_phone_number() WC 6.1.1

function wc_sanitize_phone_number( $phone ) {
	return preg_replace( '/[^\d+]/', '', $phone );
}