Adding 20 minute timeout for the protected pages.
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 13 Jun 2017 12:39:42 +0000 (08:39 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 13 Jun 2017 12:39:42 +0000 (08:39 -0400)
This is for the Welcome Partners section.

functions.php
style.css

index cc80c47..b7bd50d 100644 (file)
@@ -357,6 +357,15 @@ function tracking_pixels(){
 
 <?php
 }
-
+add_action( 'wp', 'post_pw_sess_expire' );
+function post_pw_sess_expire() {
+    global $post;
+    if ( $post->ID == 4727 ) {
+        if ( isset( $_COOKIE['wp-postpass_' . COOKIEHASH] )) {
+            // Setting a time of 0 in setcookie() forces the cookie to expire with the session
+            setcookie('wp-postpass_' . COOKIEHASH, $_COOKIE['wp-postpass_' . COOKIEHASH], strtotime( '+20 minutes' ), COOKIEPATH);
+        }
+    }
+}
 
 ?>
index 54f86e6..6c9a152 100644 (file)
--- a/style.css
+++ b/style.css
@@ -3,5 +3,5 @@ Theme Name: Capstone
 Author: Gaslight Media
 Author URI: http://www.gaslightmedia.com
 Description: A theme for Capstone
-Version: 1.0.21
+Version: 1.0.22
 */