Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

Redirect all "inactiv" account to login page

Simple Membership Plugin › Forums › Simple Membership Plugin › Redirect all "inactiv" account to login page

  • This topic has 1 reply, 1 voice, and was last updated 11 years ago by Hybr1d.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • March 21, 2015 at 8:52 pm #1278
    Hybr1d
    Participant

    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

    March 22, 2015 at 12:52 am #1280
    Hybr1d
    Participant

    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?

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy