1

Wp pro quiz has no option to let other user roles to add and edit quizzes and questions other than admin.

In the lib/helper/WpProQuiz_Helper_Upgrade.php I saw this code,

 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');
}

So, I decided to replace 'administrator' with 'author' to let the author roles to use this plugin.

But it didn't work. Do i need to do anything further.

0

A much more efficient way that doesn't require editing the source code:

install and activate wpfront User role editor,

go to all roles,

edit the author role,

scroll down to the 'other capabilities' section,

check the following capabilities: wpProQuiz_show, wpProQuiz_add_quiz, wpProQuiz_edit_quiz Save.

The authors on your site should now be able to add and edit quizes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.