May 2017
Beginner to intermediate
536 pages
14h 25m
English
This is the highest level of restriction compared to other restriction types as it blocks the entire site for unauthorized users. Implementing this technique requires many settings and hence we are going to keep it simple by hardcoding the setting values.
Similar to individual post/page restrictions, we can use the template_redirect action to implement the site lockdown features. Let's start by adding the action definition to the constructor as following:
class WPWAF_Content_Restrictions{ public function __construct(){ // Other actions add_action( 'template_redirect' , array( $this, 'validate_site_lockdown_restrictions')); } }
Basically, we need to restrict the entire site to guest users and allow it to any logged in ...
Read now
Unlock full access