函数原型
is_plugin_active( string $plugin ): bool
函数描述
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.
函数位置
File: wp-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 );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |

