plugin_is_active — Determine whether a plugin is installed and active.

Plugin-related functions

Summary

plugin_is_active($name, $version = null, $compOperator = '>=')

Determine whether a plugin is installed and active.

May be used by theme/plugin writers to customize behavior based on the existence of certain plugins. Some examples of how to use this function:

Check if ExhibitBuilder is installed and activated. <code> if (plugin_is_active(‘ExhibitBuilder’)): </code>

Check if installed version of ExhibitBuilder is at least version 1.0 or higher. <code> if (plugin_is_active(‘ExhibitBuilder’, ‘1.0’)): </code>

Check if installed version of ExhibitBuilder is anything less than 2.0. <code> if (plugin_is_active(‘ExhibitBuilder’, ‘2.0’, ‘<’)): </code>

Parameters:
  • $name (string) – Directory name of the plugin.

  • $version (string) – Version of the plugin to check.

  • $compOperator (string) – Comparison operator to use when checking the installed version of ExhibitBuilder.

Returns:

bool

Usage

Examples

See Also