How to force login after user browses for a few minutes or browses a few pages?
You could hook into template_redirect and check a cookie. Just an idea, not tested: add_action( ‘template_redirect’, ‘t5_force_login_after_time_span’ ); function t5_force_login_after_time_span() { $cookie_name=”first_visit”; $now = time(); if ( is_user_logged_in() ) return; if ( empty ( $_COOKIE[‘first_visit’] ) ) { setcookie( $cookie_name, $now, $now + WEEK_IN_SECONDS ); return; } $first_visit = (int) $_COOKIE[‘first_visit’]; if ( ( $now … Read more