- This topic has 1 reply, 1 voice, and was last updated 11 years ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
WordPress Membership Plugin
Simple Membership Plugin › Forums › Simple Membership Plugin › Redirect all "inactiv" account to login page
Hello,
I want to redirect users who are not logged in or with an inactive account from some protected pages to the login page.
I tried: ucfirst($auth->get(‘account_state’)
but wordpress respond with: Fatal error: Call to a member function get() on a non-object in
I want something like this in my archive.php
if (
!is_user_logged_in() || ucfirst($auth->get('account_state')) == 'Inactive'
) {
wp_redirect('loginpage.php', 301);
exit;
}
How can I achieve that?
Thanks for your help
I managed to do something with:
global $wpdb;
$auth = BAuth::get_instance();
$user_account = ucfirst($auth->get('account_state'));
Working well for “active” users, but expired users cant even loggin on website, is that normal?