Welcome, visitor! Log in
 

Source View: deactivate_{$plugin}

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: 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.

Source View

Line Code
12                update_option('active_plugins', $current);
13                include(ABSPATH . 'wp-content/plugins/' . trim( $_GET['plugin'] ));
14                do_action('activate_' . trim( $_GET['plugin'] ));
15           }
16           header('Location: plugins.php?activate=true');
17      } else if ('deactivate' == $_GET['action']) {
18           $current = get_settings('active_plugins');
19           array_splice($current, array_search( $_GET['plugin'], $current), 1 ); // Array-fu!
20           update_option('active_plugins', $current);
21           do_action('deactivate_' . trim( $_GET['plugin'] ));
22           header('Location: plugins.php?deactivate=true');
23      }
24 }
25
26 $title = __('Manage Plugins');
27 require_once('admin-header.php');
28
29 // Clean up options
30 // If any plugins don't exist, axe 'em