Editor access to plugin settings

Unfortunately, the plugin author did not leave room for a filter. But I did request one for you here.

I suggested changing:

/* Add option page */
function cd_setting_page(){

    add_options_page( 'Commenter data Settings', 'Commenter data Settings', 'administrator', 'commenterdata-settings', array( $this, 'cd_renderer' ));
}

to

/* Add option page */
        function cd_setting_page(){
$cap = apply_filters( 'commenter_data_settings_page_capability_filter', 'administrator' );
            add_options_page( 'Commenter data Settings', 'Commenter data Settings', $cap, 'commenterdata-settings', array( $this, 'cd_renderer' ));
        }

so you could use this in your theme’s functions.php file if the plugin author makes it exactly what I suggested.

    add_filter( 'commenter_data_settings_page_capability_filter','my_settings_page_filter' );

function my_settings_page_filter( $cap )
{
// allow Editor role the ability to access Commenter Data Settings Page
return 'edit_posts';
}

Leave a Comment