wc_sanitize_coupon_code() WC 3.6.0
Sanitize a coupon code.
Uses sanitize_post_field since coupon codes are stored as post_titles - the sanitization and escaping must match.
Хуков нет.
Возвращает
Строку.
Использование
wc_sanitize_coupon_code( $value );
- $value(строка) (обязательный)
- Coupon code to format.
Список изменений
С версии 3.6.0 | Введена. |
Код wc_sanitize_coupon_code() wc sanitize coupon code WC 5.0.0
function wc_sanitize_coupon_code( $value ) {
return wp_filter_kses( sanitize_post_field( 'post_title', $value, 0, 'db' ) );
}