is_uninstallable_plugin()

最后更新于:2021-11-27 12:01:22

is_uninstallable_plugin( string$plugin)

Whether the plugin can be uninstalled.

参数

$plugin

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

响应

(bool) Whether plugin can be uninstalled.

源文件

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

function is_uninstallable_plugin( $plugin ) {
	$file = plugin_basename( $plugin );

	$uninstallable_plugins = (array) get_option( 'uninstall_plugins' );
	if ( isset( $uninstallable_plugins[ $file ] ) || file_exists( GC_PLUGIN_DIR . '/' . dirname( $file ) . '/uninstall.php' ) ) {
		return true;
	}

	return false;
}