Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: option_page_capability_{$option_page}

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.

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