devinsays/options-framework-theme — Issue #16: edit_theme_options fix
Author: zslabs
Created: 2011-11-08 13:48:49+00:00
State: open

Hi Devin,
WordPress 3.2 has a bug that doesn't allow users of the Editor role (for example) to save the theme_options pages due to a bug in how the capabilities are figured into posting to options.php. I believe 3.3 addresses this properly. I know the Options Framework theme builds off of Twenty Eleven (which already has this fix in it), but if you add the following to options-framework.php this fixed it for me (for people building their own theme):

/**
* Change the capability required to save the 'twentyeleven_options' options group.
*
* @see twentyeleven_theme_options_init() First parameter to register_setting() is the name of the options group.
* @see twentyeleven_theme_options_add_page() The edit_theme_options capability is used for viewing the page.
*
* By default, the options groups for all registered settings require the manage_options capability.
* This filter is required to change our theme options page to edit_theme_options instead.
* By default, only administrators have either of these capabilities, but the desire here is
* to allow for finer-grained control for roles and users.
*
* @param string $capability The capability used for the page, which is manage_options by default.
* @return string The capability to actually use.
*/
function of_option_page_capability( $capability ) {
return 'edit_theme_options';
}
add_filter( 'option_page_capability_optionsframework', 'of_option_page_capability' );