is_plugin_paused() WordPress Function

If you need to pause a plugin, for example during development, you can use the is_plugin_paused() function. This function will check if a plugin is paused and return true or false.

is_plugin_paused( string $plugin ) #

Determines whether a plugin is technically active but was paused while loading.


Description

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


Top ↑

Parameters

$plugin

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


Top ↑

Return

(bool) True, if in the list of paused plugins. False, if not in the list.


Top ↑

Source

File: wp-admin/includes/plugin.php

function is_plugin_paused( $plugin ) {
	if ( ! isset( $GLOBALS['_paused_plugins'] ) ) {
		return false;
	}

	if ( ! is_plugin_active( $plugin ) ) {
		return false;
	}

	list( $plugin ) = explode( '/', $plugin );

	return array_key_exists( $plugin, $GLOBALS['_paused_plugins'] );
}


Top ↑

Changelog

Changelog
VersionDescription
5.2.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.