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 |
|---|---|
| 23 | $parent_file = 'options-general.php'; |
| 24 | |
| 25 | wp_reset_vars(array('action', 'option_page')); |
| 26 | |
| 27 | $capability = 'manage_options'; |
| 28 | |
| 29 | if ( empty($option_page) ) // This is for back compat and will eventually be removed. |
| 30 | $option_page = 'options'; |
| 31 | else |
| 32 | $capability = apply_filters( "option_page_capability_{$option_page}", $capability ); |
| 33 | |
| 34 | if ( !current_user_can( $capability ) ) |
| 35 | wp_die(__('Cheatin’ uh?')); |
| 36 | |
| 37 | // Handle admin email change requests |
| 38 | if ( is_multisite() ) { |
| 39 | if ( ! empty($_GET[ 'adminhash' ] ) ) { |
| 40 | $new_admin_details = get_option( 'adminhash' ); |
| 41 | $redirect = 'options-general.php?updated=false'; |