is_plugin_inactive( string $plugin )

Determines whether the plugin is inactive.


Description 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.

See also See also


Top ↑

Parameters Parameters

$plugin

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


Top ↑

Return Return

(bool) True if inactive. False if active.


Top ↑

More Information 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 Source

File: wp-admin/includes/plugin.php

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


Top ↑

Changelog Changelog

Changelog
Version Description
3.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by Codex

    Example

    // Makes sure the function is defined before trying to use it
    if ( ! function_exists( 'is_plugin_inactive' ) ) {
        require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
    }
    
    if ( is_plugin_inactive( 'plugin-directory/plugin-file.php' ) ) {
        //plugin is not activated
    }
    

You must log in before being able to contribute a note or feedback.