Filter: bricks/password_protection/cookie_expires
Adjust the expiration time for the password cookie used by the password protection template. By default, when a password is set in the template settings, the cookie expires after 10 days. This filter allows you to customize how long the cookie remains valid.
Example Usage:
Section titled “Example Usage:”add_filter( 'bricks/password_protection/cookie_expires', function( $expire ) { // Set cookie expiration to 1 hour (3600 seconds) return time() + 3600;} );In this example, the password cookie will expire after 1 hour, requiring users to re-enter the password if they revisit the page after that time.
Parameters:
$expire(int): The default expiration timestamp for the password cookie, which is set to 10 days.
Return:
- (int): The Unix timestamp for when the cookie should expire.
Was this helpful?
A quick vote and short notes help us improve these docs faster.
Leave a note for us
Please do not include passwords, license keys, or personal data. We store submitted notes to improve the docs.
Thanks for sharing feedback. We're using it to improve these docs.