is_uninstallable_plugin

Whether the plugin can be uninstalled.

Description

is_uninstallable_plugin( (string) $plugin ); 

Parameters (1)

0. $plugin (string)
Plugin path to check.

Usage

  1. if ( !function_exists( 'is_uninstallable_plugin' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/plugin.php'; 
  3.  
  4. // Plugin path to check. 
  5. $plugin = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = is_uninstallable_plugin($plugin); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/plugin.php  
  1. function is_uninstallable_plugin($plugin) { 
  2. $file = plugin_basename($plugin); 
  3.  
  4. $uninstallable_plugins = (array) get_option('uninstall_plugins'); 
  5. if ( isset( $uninstallable_plugins[$file] ) || file_exists( WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php' ) ) 
  6. return true; 
  7.  
  8. return false;