is_uninstallable_plugin( string $plugin )

Whether the plugin can be uninstalled.


Description Description


Parameters Parameters

$plugin

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


Top ↑

Return Return

(bool) Whether plugin can be uninstalled.


Top ↑

Source Source

File: wp-admin/includes/plugin.php

1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
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;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.7.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.