End of Month Sale: 25% Off. Unlock Deal

wsf_cookie_expiry

Description

The wsf_cookie_expiry filter hook can be used to override the Cookie Expiry setting in WS Form > Settings > Advanced. The returned value should be in seconds.

Usage

add_filter( 'wsf_cookie_expiry', 'my_hook_function', 10, 4 );

Parameters

  1. $cookie_timeout Integer
    The cookie timeout in seconds.
  2. $cookie_name String
    The name of the cookie being set.
  3. $cookie_value String
    The value of the cookie being set.
  4. $form_id Integer
    The form ID the cookie is being set from.

Example

// Callback function for the wsf_cookie_expiry filter hook
function my_hook_function( $cookie_timeout, $cookie_name, $cookie_value, $form_id ) {
	
	// Your code here ...

	// Return value
	return $cookie_timeout;
}

// Add a callback function for the wsf_cookie_expiry filter hook
add_filter( 'wsf_cookie_expiry', 'my_hook_function', 10, 4 );

Source File

This hook can be found in: <plugin root>/includes/class-ws-form-common.php