Editor role cannot save custom theme options

There’s a bug(ish) report regarding this here:
http://make.wordpress.org/themes/2011/07/01/wordpress-3-2-fixing-the-edit_theme_optionsmanage_options-bug/

You can use a filter to modify the theme page capability. First you’ll want to edit your register_setting() calls to look like this:

register_setting( 'map-options', 'map_zoom' ); 
register_setting( 'map-options', 'map_longitude' ); 
register_setting( 'map-options', 'map_latitude' ); 

The first parameter is the settings group and this is what we’re filtering the capabilities for.

Second is to add the filter:

add_filter( 'option_page_capability_map-options', 'sewp_114719_map_options_capability' );
function sewp_114719_map_options_capability( $cap ) {
    return 'edit_theme_options';
}

That should do it.

You may be able to use the customiser instead if it makes sense to, not sure if editors can use that off the top of my head though.

Leave a Comment