wphooks.info - option_page_capability_{$option_page}

option_page_capability_{$option_page}

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-admin/options.php:
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
	/**
	 * Filters the capability required when using the Settings API.
	 *
	 * By default, the options groups for all registered settings require the manage_options capability.
	 * This filter is required to change the capability required for a certain options page.
	 *
	 * @since 3.2.0
	 *
	 * @param string $capability The capability used for the page, which is manage_options by default.
	 */
	$capability = apply_filters( "option_page_capability_{$option_page}", $capability );
}

if ( ! current_user_can( $capability ) ) {
	wp_die(
		'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
		'<p>' . __( 'Sorry, you are not allowed to manage these options.' ) . '</p>',
		403
	);
}