Wp pro quiz 没有允许其他用户角色添加和编辑除管理员以外的测验和问题的选项。
在lib/helper/WpProQuiz_Helper_Upgrade.php 我看到了这个代码,
private static function install()
{
$role = get_role(\'administrator\');
$role->add_cap(\'wpProQuiz_show\');
$role->add_cap(\'wpProQuiz_add_quiz\');
$role->add_cap(\'wpProQuiz_edit_quiz\');
$role->add_cap(\'wpProQuiz_delete_quiz\');
$role->add_cap(\'wpProQuiz_show_statistics\');
$role->add_cap(\'wpProQuiz_reset_statistics\');
$role->add_cap(\'wpProQuiz_import\');
$role->add_cap(\'wpProQuiz_export\');
$role->add_cap(\'wpProQuiz_change_settings\');
$role->add_cap(\'wpProQuiz_toplist_edit\');
//ACHIEVEMENTS Version 2.x.x
if (defined(\'ACHIEVEMENTS_IS_INSTALLED\') && ACHIEVEMENTS_IS_INSTALLED === 1 && defined(\'ACHIEVEMENTS_VERSION\')) {
$version = ACHIEVEMENTS_VERSION;
if ($version{0} == \'2\') {
WpProQuiz_Plugin_BpAchievementsV2::install();
}
}
}
private static function updateV19()
{
$role = get_role(\'administrator\');
$role->add_cap(\'wpProQuiz_toplist_edit\');
}
因此,我决定用“author”替换“administrator”,让author角色使用这个插件。
但它没有起作用。我还需要做些什么吗。