WordPress.org

Make WordPress Core

Ticket #34569: 34569.diff

File 34569.diff, 854 bytes (added by swissspidy, 6 years ago)
  • src/wp-admin/includes/plugin.php

    diff --git src/wp-admin/includes/plugin.php src/wp-admin/includes/plugin.php
    index 1dfc977..d1d20b4 100644
    function uninstall_plugin($plugin) { 
    971971        $file = plugin_basename($plugin);
    972972
    973973        $uninstallable_plugins = (array) get_option('uninstall_plugins');
     974
     975        /**
     976         * Fires in uninstall_plugin() before the plugin is uninstalled.
     977         *
     978         * @since 4.5.0
     979         *
     980         * @param string $plugin                Relative plugin path from plugin directory.
     981         * @param array  $uninstallable_plugins Uninstallable plugins.
     982         */
     983        do_action( 'pre_uninstall_plugin', $plugin, $uninstallable_plugins );
     984
    974985        if ( file_exists( WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php' ) ) {
    975986                if ( isset( $uninstallable_plugins[$file] ) ) {
    976987                        unset($uninstallable_plugins[$file]);