wc_sanitize_phone_number() WC 3.6.0
Sanitize phone number. Allows only numbers and "+" (plus sign).
Хуков нет.
Возвращает
Строку.
Использование
wc_sanitize_phone_number( $phone );
- $phone(строка) (обязательный)
- Phone number.
Список изменений
С версии 3.6.0 | Введена. |
Код wc_sanitize_phone_number() wc sanitize phone number WC 5.0.0
function wc_sanitize_phone_number( $phone ) {
return preg_replace( '/[^\d+]/', '', $phone );
}