deleted_plugin
Action HookDescription
Fires immediately after a plugin deletion attempt.Hook Information
| File Location | 
                                wp-admin/includes/plugin.php
                                
                                    View on GitHub
                                
                             | 
                        
| Hook Type | Action | 
| Line Number | 1002 | 
                        
Hook Parameters
| Type | Name | Description | 
|---|---|---|
                                    string
                                 | 
                                
                                    $plugin_file
                                 | 
                                Path to the plugin file relative to the plugins directory. | 
                                    bool
                                 | 
                                
                                    $deleted
                                 | 
                                Whether the plugin deletion was successful. | 
Usage Examples
                        Basic Usage
                    
                    <?php
// Hook into deleted_plugin
add_action('deleted_plugin', 'my_custom_function', 10, 2);
function my_custom_function($plugin_file, $deleted) {
    // Your custom code here
}
                        
                    Source Code Context
                        wp-admin/includes/plugin.php:1002
                        - How this hook is used in WordPress core
                    
                    <?php
 997  		 * @since 4.4.0
 998  		 *
 999  		 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
1000  		 * @param bool   $deleted     Whether the plugin deletion was successful.
1001  		 */
1002  		do_action( 'deleted_plugin', $plugin_file, $deleted );
1003  
1004  		if ( ! $deleted ) {
1005  			$errors[] = $plugin_file;
1006  			continue;
1007  		}
                    PHP Documentation
<?php
/**
		 * Fires immediately after a plugin deletion attempt.
		 *
		 * @since 4.4.0
		 *
		 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
		 * @param bool   $deleted     Whether the plugin deletion was successful.
		 */
                
            
                        Quick Info
                    
                    - Hook Type: Action
 - Parameters: 2
 - File: wp-admin/includes/plugin.php
 
                        Related Hooks
                    
                    Related hooks will be displayed here in future updates.