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.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 20 | do_action('activate_' . $plugin); |
| 21 | ob_end_clean(); |
| 22 | } |
| 23 | wp_redirect('plugins.php?activate=true'); // overrides the ?error=true one above |
| 24 | } else if ('deactivate' == $_GET['action']) { |
| 25 | check_admin_referer('deactivate-plugin_' . $_GET['plugin']); |
| 26 | $current = get_option('active_plugins'); |
| 27 | array_splice($current, array_search( $_GET['plugin'], $current), 1 ); // Array-fu! |
| 28 | update_option('active_plugins', $current); |
| 29 | do_action('deactivate_' . trim( $_GET['plugin'] )); |
| 30 | wp_redirect('plugins.php?deactivate=true'); |
| 31 | } elseif ($_GET['action'] == 'deactivate-all') { |
| 32 | check_admin_referer('deactivate-all'); |
| 33 | $current = get_option('active_plugins'); |
| 34 | |
| 35 | foreach ($current as $plugin) { |
| 36 | array_splice($current, array_search($plugin, $current), 1); |
| 37 | do_action('deactivate_' . $plugin); |
| 38 | } |
| 39 | |
| 40 | update_option('active_plugins', array()); |
| 41 | wp_redirect('plugins.php?deactivate-all=true'); |
| 42 | } |
| 43 | exit; |
| 44 | } |
| 45 | |
| 46 | $title = __('Manage Plugins'); |