Print This page

Exclude the pages/posts from force login feature (Hook)

If you want to exclude specific pages or posts (like the Privacy Policy page) from the LoginPress Force Login feature. The following filter will help you achieve the task

function loginpress_exclude_forcelogin_callback() {
return array( 'privacy-policy', '1' ); //Here '1' is the ID of the post.
add_filter('loginpress_exclude_forcelogin', 'loginpress_exclude_forcelogin_callback' );

Here you can return a single value or array. You can return the slug of the post or the post-id.