Plugins: Introduce the delete_plugin transactional hook, which fires immediately after a plugin deletion attempt occurs.

Props Veraxus for the initial patch.
Fixes #26904.

Built from https://develop.svn.wordpress.org/trunk@35094


git-svn-id: http://core.svn.wordpress.org/trunk@35059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2015-10-13 00:57:25 +00:00
parent ad6a1303dc
commit bcc7f8d079
2 changed files with 11 additions and 1 deletions

View File

@ -824,6 +824,16 @@ function delete_plugins( $plugins, $deprecated = '' ) {
$deleted = $wp_filesystem->delete( $plugins_dir . $plugin_file );
}
/**
* Fires immediately after a plugin deletion attempt.
*
* @since 4.4.0
*
* @param string $plugin_file Plugin file name.
* @param bool $deleted Whether the plugin deletion was successful.
*/
do_action( 'delete_plugin', $plugin_file, $deleted );
if ( ! $deleted ) {
$errors[] = $plugin_file;
continue;

View File

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