wc_sanitize_phone_number()
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 8.7.0
function wc_sanitize_phone_number( $phone ) { return preg_replace( '/[^\d+]/', '', $phone ?? '' ); }