woocommerce_format_phone_number
Filters the formatted phone number.
Использование
add_filter( 'woocommerce_format_phone_number', 'wp_kama_woocommerce_format_phone_number_filter', 10, 3 );
/**
* Function for `woocommerce_format_phone_number` filter-hook.
*
* @param string $formatted The formatted phone number, or an empty string if $original isn't a valid phone number.
* @param string $original The phone number passed to the function.
* @param bool $is_valid Whether $original passed the default phone number validation.
*
* @return string
*/
function wp_kama_woocommerce_format_phone_number_filter( $formatted, $original, $is_valid ){
// filter...
return $formatted;
}
- $formatted(строка)
- The formatted phone number, or an empty string if $original isn't a valid phone number.
- $original(строка)
- The phone number passed to the function.
- $is_valid(true|false)
- Whether $original passed the default phone number validation.
Список изменений
| С версии 11.0.0 | Введена. |
Где вызывается хук
woocommerce_format_phone_number
woocommerce/includes/wc-formatting-functions.php 1101
return apply_filters( 'woocommerce_format_phone_number', $formatted, $original, $is_valid );