WordPress.org

Ready to get started?Download WordPress

Forums

creating a user that shall not write post, but write captions (1 post)

  1. kohni
    Member
    Posted 1 year ago #

    Hi
    I have a problem with my user-roles.
    I want to have a user, that can write Pages, but not Posts.

    I decided to take the editor-role and remove the post-capabilites and other stuff. It looks like this:

    <?php
    // EDITOR-Role ohne Posts, Categories und Links
    function add_theme_caps() {
    $role = get_role( 'editor' );
    $role->remove_cap( 'edit_post');
    $role->remove_cap( 'manage_categories');
    $role->remove_cap( 'manage_links');
    $role->add_cap( 'edit_theme_options');
    }
    add_action( 'admin_init', 'add_theme_caps');
    ?>

    Everything is perfect, except one thing:
    The user isn't able to write captions. (The images are on Pages).
    I figured out, that the problem is solved as soon as I add "edit_post" to the capabilities. But my user must not be able to do anything with the posts!

    Is there a solution to this Problem?
    How can I create a User, that can't edit posts, but write captions?

Topic Closed

This topic has been closed to new replies.

About this Topic