is_plugin_inactive() WordPress Function

The is_plugin_inactive() function is used to check if a plugin is inactive. This function is useful for plugin developers who need to know if their plugin is inactive.

is_plugin_inactive( string $plugin ) #

Determines whether the plugin is inactive.


Description

Reverse of is_plugin_active(). Used as a callback.

For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.

Top ↑

See also


Top ↑

Parameters

$plugin

(string)(Required)Path to the plugin file relative to the plugins directory.


Top ↑

Return

(bool) True if inactive. False if active.


Top ↑

More Information

Usage:

In the Admin Area:

<?php $active = is_plugin_inactive( $plugin ); ?>

In the front end, in a theme, etc…

<?php
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
$active = is_plugin_inactive( $plugin );
?>

Top ↑

Source

File: wp-admin/includes/plugin.php

function is_plugin_inactive( $plugin ) {
	return ! is_plugin_active( $plugin );
}


Top ↑

Changelog

Changelog
VersionDescription
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.