Uses
Uses | Description |
---|---|
wp-includes/plugin.php: plugin_basename() | Gets the basename of a plugin. |
wp-includes/option.php: get_option() | Retrieves an option value based on an option name. |
Whether the plugin can be uninstalled.
(string) (Required) Path to the plugin file relative to the plugins directory.
(bool) Whether plugin can be uninstalled.
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; }
Version | Description |
---|---|
2.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/is_uninstallable_plugin