Skip to content

Instantly share code, notes, and snippets.

@lumpysimon
Created July 7, 2015 16:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lumpysimon/545c54e2876ebcbaf3c0 to your computer and use it in GitHub Desktop.
Save lumpysimon/545c54e2876ebcbaf3c0 to your computer and use it in GitHub Desktop.
Set the WordPress password-protected post cookie expiry time
add_filter( 'post_password_expires', 'my_cookie_time' );
function my_cookie_time( $time ) {
return 600; // 600 = 10 minutes. Use 0 to expire the cookie at the end of the current browsing session.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment