Skip to main content
5 events
when toggle format what by license comment
Jul 2, 2015 at 8:39 comment added Nick The following did not work. Help.
Jul 2, 2015 at 8:29 comment added Nick Which Is this correct? ///time out login so you must reenter it every time// add_action( 'wp', 'post_pw_sess_expire' ); function post_password_expires() { return time() + 10; // Expire in 10 seconds } add_filter( 'post_password_expires', 'post_password_expires' ); }
Jun 13, 2015 at 11:41 comment added TheDeadMedic wpse_191369 is a prefix I use when naming functions in answers - WPSE = WordPress Stack Exchange, 191369 = the ID of this question. My answer is all the code you need. It overrides the default cookie timeout for all post passwords. You don't need to handle the cookie/password yourself i.e. You don't need post_pw_sess_expire or any of the code you've tried so far.
Jun 13, 2015 at 11:01 comment added Nick Thanks, but will this work with other pages? wpse_191369 looks it might only work on this page. How did you discover this number? Is this correct ///time out login so you must reenter it every time// add_action( 'wp', 'post_pw_sess_expire' ); function wpse_191369_post_password_expires() { return time() + 10; // Expire in 10 seconds } add_filter( 'post_password_expires', 'wpse_191369_post_password_expires' ); }
Jun 13, 2015 at 10:52 history answered TheDeadMedic CC BY-SA 3.0