Plugins: Add a new `pre_uninstall_plugin` action that runs right before uninstalling a plugin.

Fixes #34569.
Built from https://develop.svn.wordpress.org/trunk@36124


git-svn-id: http://core.svn.wordpress.org/trunk@36090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2015-12-30 22:38:26 +00:00
parent 66d239c034
commit 7e516f5cf8
2 changed files with 12 additions and 1 deletions

View File

@ -971,6 +971,17 @@ function uninstall_plugin($plugin) {
$file = plugin_basename($plugin);
$uninstallable_plugins = (array) get_option('uninstall_plugins');
/**
* Fires in uninstall_plugin() before the plugin is uninstalled.
*
* @since 4.5.0
*
* @param string $plugin Relative plugin path from plugin directory.
* @param array $uninstallable_plugins Uninstallable plugins.
*/
do_action( 'pre_uninstall_plugin', $plugin, $uninstallable_plugins );
if ( file_exists( WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php' ) ) {
if ( isset( $uninstallable_plugins[$file] ) ) {
unset($uninstallable_plugins[$file]);

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-alpha-36123';
$wp_version = '4.5-alpha-36124';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.