| | 58 | * Change the capability required to save the 'twentyeleven_options' options group. |
| | 59 | * |
| | 60 | * @see twentyeleven_theme_options_init() First parameter to register_setting() is the name of the options group. |
| | 61 | * @see twentyeleven_theme_options_add_page() The edit_theme_options capability is used for viewing the page. |
| | 62 | * |
| | 63 | * By default, the options groups for all registered settings require the manage_options capability. |
| | 64 | * This filter is required to change our theme options page to edit_theme_options instead. |
| | 65 | * By default, only administrators have either of these capabilities, but the desire here is |
| | 66 | * to allow for finer-grained control for roles and users. |
| | 67 | * |
| | 68 | * @param string $capability The capability used for the page, which is manage_options by default. |
| | 69 | * @return string The capability to actually use. |
| | 70 | */ |
| | 71 | function twentyeleven_option_page_capability( $capability ) { |
| | 72 | return 'edit_theme_options'; |
| | 73 | } |
| | 74 | add_filter( 'option_page_capability_twentyeleven_options', 'twentyeleven_option_page_capability' ); |
| | 75 | |
| | 76 | /** |