Am_Lite
Am_Lite is a special class that you may include in your application to get access to aMember database information without overhead of including the entire aMember Pro codebase and its bootstrap. Am_Lite does not require any other files to work.
This class was designed to retrieve data about currently logged in user within 3rd party PHP scripts. Do not use this class within aMember codebase.
From any your PHP file (located outside of aMember), include the Lite.php library:
<?phprequire_once '/home/myusername/public_html/amember/library/Am/Lite.php';If you use aMember with Wordpress and has aMember plugin installed in wordpress already, you can access Am_Lite API from Wordpress php files or templates:
$lite = am4PluginsManager::getAPI();Am_Lite class is located inside file amember/library/Am/Lite.php and provides the following functions:
Get Library instance;
Section titled “Get Library instance;”$lite = Am_Lite::getInstance();Check if user logged in and have required subscription otherwise redirect to login page or no-access page. Check $search parameters below
Section titled “Check if user logged in and have required subscription otherwise redirect to login page or no-access page. Check $search parameters below”Am_Lite::getInstance()->checkAccess($search);Checks if user has been authenticated
Section titled “Checks if user has been authenticated”Am_Lite::getInstance()->isLoggedIn();Get Username
Section titled “Get Username”Am_Lite::getInstance()->getUsername();Returns first&last name of logged-in customer, not HTML-escaped!
Section titled “Returns first&last name of logged-in customer, not HTML-escaped!”Am_Lite::getInstance()->getName();Returns e-mail address of logged-in customer, not HTML-escaped
Section titled “Returns e-mail address of logged-in customer, not HTML-escaped”Am_Lite::getInstance()->getEmail();Returns array of all user fields for logged-in customer
Section titled “Returns array of all user fields for logged-in customer”Am_Lite::getInstance()->getUser();Returns URL of aMember logout page
Section titled “Returns URL of aMember logout page”Am_Lite::getInstance()->getLogoutURL();Returns URL of aMember user profile page
Section titled “Returns URL of aMember user profile page”Am_Lite::getInstance()->getProfileURL();Returns URL of aMember login page
Section titled “Returns URL of aMember login page”Am_Lite::getInstance()->getLoginURL();Returns URL of aMember signup page
Section titled “Returns URL of aMember signup page”Am_Lite::getInstance()->getSignupURL();Renders aMember login form
Section titled “Renders aMember login form”Am_Lite::getInstance()->renderLoginForm();Returns root URL of aMember installation
Section titled “Returns root URL of aMember installation”Am_Lite::getInstance()->getRootURL();Returns true if user have active subscription to $search
Section titled “Returns true if user have active subscription to $search”Am_Lite::getInstance()->haveSubscriptions($search);Return true if user had before or has now subscription to $search
Section titled “Return true if user had before or has now subscription to $search”Am_Lite::getInstance()->hadSubscriptions($search);Return greatest expiration date for $search
Section titled “Return greatest expiration date for $search”Am_Lite::getInstance()->getExpire($search);Return all payment records for currently logged-in user
Section titled “Return all payment records for currently logged-in user”Am_Lite::getInstance()->getPayments();Return all links defined for currently logged-in user
Section titled “Return all links defined for currently logged-in user”Am_Lite::getInstance()->getUserLinks();Return all access records for currently logged-in user
Section titled “Return all access records for currently logged-in user”Am_Lite::getInstance()->getAccess();Has the currently logged-in user an active subscription?
Section titled “Has the currently logged-in user an active subscription?”Am_Lite::getInstance()->isUserActive();Get array of all defined in aMember products [product_id => title]
Section titled “Get array of all defined in aMember products [product_id => title]”Am_Lite::getInstance()->getProducts()Get array of all defined in aMember product categories [product_category_id => title]
Section titled “Get array of all defined in aMember product categories [product_category_id => title]”Am_Lite::getInstance()->getCategories()Retrieve array of product ids that is member of specific category
Section titled “Retrieve array of product ids that is member of specific category”accept either single category id or array of category ids as argument
Am_Lite::getInstance()->getCategoryProducts($category_id)Search Parameter
Section titled “Search Parameter”There are functions that utilize the $search parameter. It may be:
- array of product ids, for example [1,3]
- constant Am_Lite::ANY - subscription to any product
- constant Am_Lite::PAID - any not-free subscription
- constant Am_Lite::FREE - any free subscription
- constant Am_Lite::ONLY_LOGIN - only check that user is logged in
Copyright © 2002–2026 www.amember.com. All Rights Reserved.