is_plugin_active()

最后更新于:2021-11-27 09:49:24

is_plugin_active( string$plugin)

Determines whether a plugin is active.

参数

$plugin

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

响应

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

源文件

文件: gc-admin/includes/plugin.php

function is_plugin_active( $plugin ) {
	return in_array( $plugin, (array) get_option( 'active_plugins', array() ), true ) || is_plugin_active_for_network( $plugin );
}