WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 844 | } |
| 845 | |
| 846 | /** |
| 847 | * Fires immediately before a plugin deletion attempt. |
| 848 | * |
| 849 | * @since 4.4.0 |
| 850 | * |
| 851 | * @param string $plugin_file Plugin file name. |
| 852 | */ |
| 853 | do_action( 'delete_plugin', $plugin_file ); |
| 854 | |
| 855 | $this_plugin_dir = trailingslashit( dirname( $plugins_dir . $plugin_file ) ); |
| 856 | |
| 857 | // If plugin is in its own directory, recursively delete the directory. |
| 858 | if ( strpos( $plugin_file, '/' ) && $this_plugin_dir != $plugins_dir ) { //base check on if plugin includes directory separator AND that it's not the root plugin folder |
| 859 | $deleted = $wp_filesystem->delete( $this_plugin_dir, true ); |
| 860 | } else { |
| 861 | $deleted = $wp_filesystem->delete( $plugins_dir . $plugin_file ); |
| 862 | } |