return new WP_Error( 'fs_no_plugins_dir',
__( 'Unable to locate WordPress plugin directory.'
) );
} $plugins_dir =
trailingslashit( $plugins_dir );
$plugin_translations =
wp_get_installed_translations( 'plugins'
);
$errors = array
();
foreach ( $plugins as $plugin_file ) { // Run Uninstall hook.
if ( is_uninstallable_plugin( $plugin_file ) ) { uninstall_plugin( $plugin_file );
} /**
* Fires immediately before a plugin deletion attempt.
*
* @since 4.4.0
*
* @param string $plugin_file Path to the plugin file relative to the plugins directory.
*/
do_action( 'delete_plugin',
$plugin_file );