不幸的是,插件作者没有留下过滤器的空间。但我确实为你要了一个here.
我建议更改:
/* Add option page */
function cd_setting_page(){
add_options_page( \'Commenter data Settings\', \'Commenter data Settings\', \'administrator\', \'commenterdata-settings\', array( $this, \'cd_renderer\' ));
}
至
/* 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\' ));
}
所以你可以在主题的功能中使用它。php文件,如果插件作者完全按照我的建议制作。
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\';
}