option_page_capability_(option_page)
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.
Usage
add_filter( 'option_page_capability_(option_page)', 'wp_kama_option_page_capability_filter' ); /** * Function for `option_page_capability_(option_page)` filter-hook. * * @param string $capability The capability used for the page, which is manage_options by default. * * @return string */ function wp_kama_option_page_capability_filter( $capability ){ // filter... return $capability; }
- $capability(string)
- The capability used for the page, which is manage_options by default.
Changelog
Since 3.2.0 | Introduced. |
Where the hook is called
In file: /wp-admin/options.php
option_page_capability_(option_page)
wp-admin/options.php 45
$capability = apply_filters( "option_page_capability_{$option_page}", $capability );