woocommerce_set_cookie_enabled хук-фильтрWC 1.0

Set a cookie - wrapper for setcookie using WP constants.

Использование

add_filter( 'woocommerce_set_cookie_enabled', 'wp_kama_woocommerce_set_cookie_enabled_filter', 10, 5 );

/**
 * Function for `woocommerce_set_cookie_enabled` filter-hook.
 * 
 * @param string  $name     Name of the cookie being set.
 * @param string  $value    Value of the cookie.
 * @param integer $expire   Expiry of the cookie.
 * @param bool    $secure   Whether the cookie should be served only over https.
 * @param bool    $httponly Whether the cookie is only accessible over HTTP, not scripting languages like JavaScript. @since 3.6.0.
 *
 * @return string
 */
function wp_kama_woocommerce_set_cookie_enabled_filter( $name, $value, $expire, $secure, $httponly ){

	// filter...
	return $name;
}
$name(строка)
Name of the cookie being set.
$value(строка)
Value of the cookie.
$expire(int)
Expiry of the cookie.
$secure(true|false)
Whether the cookie should be served only over https.
$httponly(true|false)
Whether the cookie is only accessible over HTTP, not scripting languages like JavaScript. @since 3.6.0.

Где вызывается хук

wc_setcookie()
woocommerce_set_cookie_enabled
woocommerce/includes/wc-core-functions.php 1051
if ( ! apply_filters( 'woocommerce_set_cookie_enabled', true, $name ,$value, $expire, $secure ) ) {

Где используется хук в WooCommerce

Использование не найдено.