pluginActive (function)

Last updated: Mon, May 15, 2023 8:44 pm
Return to Knowledgebase

Purpose

Check if a plugin is active, with a redirect back to the Plugin Manager if not [optional]

Location

users/helpers/us_helpers.php

Parameters

# Parameter Data Type Required Description
1 $plugin string Yes Reserved name for plugin
2 $checkOnly = false bool No Prevent redirect if this is a code only check and you are not hooking into the Plugin Manager

Returns

Data Type Description of Returned Data
bool true/false

Example

pluginActive('localhostlogin', true)

Further Documentation:

if(pluginActive('localhostlogin', true)) {
echo "You'll be able to login via localhostlogin on the login page";
} else {
echo "You won't be able to login via localhostlogin on the login page";
}