Skip to content
Docs
Get RestroPress

Filter

rpress_use_cart_cookie

Updated
On this page

Filters whether the items-in-cart cookie is used.

Applied in RPRESS_Session::use_cart_cookie(). The default is true unless the RPRESS_USE_CART_COOKIE constant is defined as false. The result is cast to bool. The cookie helps page caches serve the correct cart state.

Parameters#

ParameterTypeDescription
$use_cookieboolWhether the cart cookie is used.

Return value#

bool. True to use the cart cookie.

Example#

function my_use_cart_cookie( $use_cookie ) {
	return $use_cookie;
}
add_filter( 'rpress_use_cart_cookie', 'my_use_cart_cookie' );

Source#

Applied in:

  • includes/class-rpress-session.php (line 263), in RPRESS_Session::use_cart_cookie()

See also#

Was this page helpful?