is_uninstallable_plugin

Advertisement

Summery Summery

Whether the plugin can be uninstalled.

Syntax Syntax

is_uninstallable_plugin( string $plugin )

Parameters Parameters

$plugin

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

Return Return

(bool) Whether plugin can be uninstalled.

Source Source

File: wp-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( WP_PLUGIN_DIR . '/' . dirname( $file ) . '/uninstall.php' ) ) {
		return true;
	}

	return false;
}

Advertisement

Changelog Changelog

Changelog
Version Description
2.7.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.