wpseek.com
WordPress开发者和主题制作者的搜索引擎



is_uninstallable_plugin › WordPress Function

Since2.7.0
已弃用n/a
is_uninstallable_plugin ( $plugin )
参数:
  • (string) $plugin Path to the plugin file relative to the plugins directory.
    Required: Yes
返回:
  • (bool) Whether plugin can be uninstalled.
定义在:
文档:

Determines whether the plugin can be uninstalled.



源码

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

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

	return false;
}