woocommerce_cookie_httponly
Controls whether the cookie should only be accessible via the HTTP protocol, or if it should also be accessible to Javascript.
Использование
add_filter( 'woocommerce_cookie_httponly', 'wp_kama_woocommerce_cookie_httponly_filter', 10, 5 ); /** * Function for `woocommerce_cookie_httponly` filter-hook. * * @param bool $httponly If the cookie should only be accessible via the HTTP protocol. * @param string $name Cookie name. * @param string $value Cookie value. * @param int $expire When the cookie should expire. * @param bool $secure If the cookie should only be served over HTTPS. * * @return bool */ function wp_kama_woocommerce_cookie_httponly_filter( $httponly, $name, $value, $expire, $secure ){ // filter... return $httponly; }
- $httponly(true|false)
- If the cookie should only be accessible via the HTTP protocol.
- $name(строка)
- Cookie name.
- $value(строка)
- Cookie value.
- $expire(int)
- When the cookie should expire.
- $secure(true|false)
- If the cookie should only be served over HTTPS.
Список изменений
С версии 3.3.0 | Введена. |
Где вызывается хук
woocommerce/includes/wc-core-functions.php 1091
'httponly' => apply_filters( 'woocommerce_cookie_httponly', $httponly, $name, $value, $expire, $secure ),