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:
parent
66d239c034
commit
7e516f5cf8
|
@ -971,6 +971,17 @@ function uninstall_plugin($plugin) {
|
||||||
$file = plugin_basename($plugin);
|
$file = plugin_basename($plugin);
|
||||||
|
|
||||||
$uninstallable_plugins = (array) get_option('uninstall_plugins');
|
$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 ( file_exists( WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php' ) ) {
|
||||||
if ( isset( $uninstallable_plugins[$file] ) ) {
|
if ( isset( $uninstallable_plugins[$file] ) ) {
|
||||||
unset($uninstallable_plugins[$file]);
|
unset($uninstallable_plugins[$file]);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue