• I have a contributor with custom title and custom permissions, given a “contributing editor” role.

    His name is not included in the posts’ authorship field. I cannot transfer a draft or post to his name – his name is missing from the list. How can I add his name back to the list? If I switch his role back to a standard role, his name reappears in the list.

    The change was made a year ago. I cannot tell if this is a recent break, or something that was broken from the start.

    //Special Role Creation

    $result = add_role(
    ‘contributing_editor’,
    __( ‘Contributing Editor’ ),
    array(
    ‘read’ => true, // true allows this capability
    ‘edit_posts’ => true,
    ‘delete_posts’ => true, // Use false to explicitly deny
    ‘upload_files’ => true,
    ‘moderate_comments’ => true,
    ‘edit_others_posts’ => true,
    )
    );
    if ( null !== $result ) {
    echo ‘Yay! New role created!’;
    }
    else {
    echo ‘Oh… the contributing_editor role already exists.’;
    }

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Adding roles is usually done inside a theme or plugin activation hook and you don’t show us that.

    Perhaps this plugin will help you fix the problem:
    https://wordpress.org/plugins/user-role-editor/

    Thread Starter SirStuey

    (@sirstuey)

    I showed exactly what I ran to create a new role and assign custom permissions to it.

    That role, and its permissions, has been working perfectly. Except, no user at any level can switch authorship of any post to this user account.

    User John might be given this custom role. When looking at changing the author for a post, the list of names might say Allan, Charles, Ethan, etc, completely omitting this user name as an option.

    There’s nothing wrong with the role or its permissions. I suppose it’s registering it in the admin panel that I seem to be having trouble with.

    I’d rather not use a plugin to modify roles, I wanted to create a custom role for one user, as I’ve done. It’s a cross between author, contributor, and editor. https://codex.wordpress.org/Roles_and_Capabilities

    The issue isn’t with roles or capabilities, because not even admin accounts can see that user’s name in the admin panels when trying to change the author to a post to that user.

    Respectfully, I don’t want to use a plugin, I’m looking to understand what’s wrong and why the user with this custom role won’t show up in the author drop-down options.

    • This reply was modified 6 years, 10 months ago by SirStuey.
    Thread Starter SirStuey

    (@sirstuey)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Missing Custom Role Author Name’ is closed to new replies.