Title: willfaulds's Replies | WordPress.org

---

# willfaulds

  [  ](https://wordpress.org/support/users/willfaulds/)

 *   [Profile](https://wordpress.org/support/users/willfaulds/)
 *   [Topics Started](https://wordpress.org/support/users/willfaulds/topics/)
 *   [Replies Created](https://wordpress.org/support/users/willfaulds/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/willfaulds/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/willfaulds/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/willfaulds/engagements/)
 *   [Favorites](https://wordpress.org/support/users/willfaulds/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Age Gate] using age_gate_restricted filter and condition based on is_page](https://wordpress.org/support/topic/using-age_gate_restricted-filter-and-condition-based-on-is_page/)
 *  Thread Starter [willfaulds](https://wordpress.org/support/users/willfaulds/)
 * (@willfaulds)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/using-age_gate_restricted-filter-and-condition-based-on-is_page/#post-14777460)
 * Hi [@philsbury](https://wordpress.org/support/users/philsbury/), email sent
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Age Gate] using age_gate_restricted filter and condition based on is_page](https://wordpress.org/support/topic/using-age_gate_restricted-filter-and-condition-based-on-is_page/)
 *  Thread Starter [willfaulds](https://wordpress.org/support/users/willfaulds/)
 * (@willfaulds)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/using-age_gate_restricted-filter-and-condition-based-on-is_page/#post-14777247)
 * alternatively is there a way to check the current session Age Gate restricted
   status in PHP?
 * I could do something like –
 *     ```
       add_action( 'template_redirect', function() {
           if ( is_page( 'checkout' ) ) {
             $age_gate_token = ??;//check if there's a valid token already      
   
             if ( ! $age_gate_token ) {
       	$age_gate_url = 'url'; //page with Age Gate restriction required.
               wp_safe_redirect( $checkout_url );
               die();
             }
           }
       } );
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)