Filters the capability required when using the Settings API.
Description
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.
Parameters
$capability
string- The capability used for the page, which is manage_options by default.
Source
$capability = apply_filters( "option_page_capability_{$option_page}", $capability );
Changelog
Version | Description |
---|---|
3.2.0 | Introduced. |
{$option_page}
is actually{$option_group}
– option group used as first argument inregister_setting()
for example. Therefore this filter also works for updating options on pages added viaadd_management_page
, not justadd_options_page
as “{$option_page}
” suggests.