0

I added this code snippet to my function.php to create a user but after logging with this role I'm unable to edit the learndash course lessons quizzes...

add_role( 'learndash_content_manager', 'Learndash Content Manager', array(
    'read' => true,
    'manage_options' => true,
    'edit_posts' => true,
    'edit_others_posts' => true,
    'edit_files' => true,
    'publish_posts' => true,
    'delete_posts' => true,
    'delete_others_posts' => true,
    'manage_categories' => true,
    'edit_ld_courses' => true,
    'edit_ld_lessons' => true,
    'edit_ld_topics' => true,
    'edit_ld_quizzes' => true,
    'edit_ld_questions' => true,
    'manage_links' => true,
    'manage_options' => true,
    'post_manage_options' => true,
    'edit_published_ld_courses' => true
));

1 Answer 1

0

Example:

add_role('student', __(
        'Student'),
        array(
            'read'            => true, // Allows a user to read
            'create_posts'      => false, // Allows user to create new posts
            'edit_posts'        => false, // Allows user to edit their own posts
            'edit_others_posts' => false, // Allows user to edit others posts too
            'publish_posts' => false, // Allows the user to publish posts
            'manage_categories' => false, // Allows user to manage post categories
            )
     );
    

Please also consider removing admin bar for certain users:

function remove_admin_bar() {
    if (!current_user_can('administrator') && !is_admin()) {
        show_admin_bar(false);
    }
}
add_action('after_setup_theme', 'remove_admin_bar');

Take a look are your "ld" keys hooked right. If they are not, wp could clash.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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