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 |
|---|---|
| 34 | * Filter the capability required when using the Settings API. |
| 35 | * |
| 36 | * By default, the options groups for all registered settings require the manage_options capability. |
| 37 | * This filter is required to change the capability required for a certain options page. |
| 38 | * |
| 39 | * @since 3.2.0 |
| 40 | * |
| 41 | * @param string $capability The capability used for the page, which is manage_options by default. |
| 42 | */ |
| 43 | $capability = apply_filters( "option_page_capability_{$option_page}", $capability ); |
| 44 | |
| 45 | if ( !current_user_can( $capability ) ) |
| 46 | wp_die(__('Cheatin’ uh?')); |
| 47 | |
| 48 | // Handle admin email change requests |
| 49 | if ( is_multisite() ) { |
| 50 | if ( ! empty($_GET[ 'adminhash' ] ) ) { |
| 51 | $new_admin_details = get_option( 'adminhash' ); |
| 52 | $redirect = 'options-general.php?updated=false'; |