• I have created this post type for the Human Resources role:

    // Careers
    add_action( 'init', 'create_careers' );
    
    function create_careers() {
    	register_post_type( 'careers',
    		array(
    				'labels' => array(
    				'name' => __( 'Careers' ),
    				'singular_name' => __( 'Career' ),
    				'add_new' => __( 'Add New' ),
    				'add_new_item' => __( 'Add New Career' ),
    				'edit' => __( 'Edit' ),
    				'edit_item' => __( 'Edit Career' ),
    				'new_item' => __( 'New Career' ),
    				'view' => __( 'View Career' ),
    				'view_item' => __( 'View Career' ),
    				'search_items' => __( 'Search Careers' ),
    				'not_found' => __( 'No Careers found' ),
    				'not_found_in_trash' => __( 'No Careers found in Trash' ),
    			),
    			'public' => true,
    			'capabilities' => array(
    					'edit_post' => 'edit_career',
    					'edit_posts' => 'edit_careers',
    					'edit_others_posts' => 'edit_others_careers',
    					'publish_posts' => 'publish_careers',
    					'read_post' => 'read_careers',
    					'delete_post' => 'delete_careers',
    					),
    			'rewrite' => array( 'slug' => 'opportunities/careers', 'with_front' => false ),
    			'supports' => array( 'title', 'editor', 'excerpt', 'author', 'revisions'),
    		)
    	);
    }

    In the Members Plugin I have assigned the following capabilities for the Human Resources role:

    delete_careers
    edit_careers
    edit_career
    edit_others_careers
    edit_other_career
    publish_careers
    read_careers
    read
    upload_files

    I have 2 users that have the Human Resources role – test and test2.

    When I log in as a Human Resources role (user is test) I can’t select other Human Resources users when editing careers – because the Author Metabox is not present.
    I can see admins and editors but not sibling Human Resource roles in the post_author_override when logged in as Admin.

    For example test creates a post. Test logs out and logs in as Admin. Admin can see the post_author_override drop down list containing only one of the Human Resources Role — the one that created the post originally. I can’t change it to user test2.

    Additionally I get a You are not allowed to edit this post error if logged in as Human Resources person.

Viewing 6 replies - 1 through 6 (of 6 total)
  • I have this same issue, even after upgrading all code and functions to what is expected for roles and capabilities in 3.1. I’m thinking this must be a bug related to the issues in Ticket #14122. Have anyone found any resolution?

    If I understood correctly, users belonging to the custom role are not present in “Author” dropdown. I have a similar issue… Dropdown list is generated in wp-admin/includes/meta-boxes.php using predefined function wp_dropdown_users on line 527:

    wp_dropdown_users( array(
    		'who' => 'authors',
    		'name' => 'post_author_override',
    		'selected' => empty($post->ID) ? $user_ID : $post->post_author,
    		'include_selected' => true
    	) );

    I believe the problem is the parameter “who” whis is defined as “authors”. Default parameter is “all” and solution will probably be to delete this line. Havent tried it yet…

    However, I dont like to edit core files unless absolutely necessary so I am still trying to find better solution…

    I have tested out this method and it works. WordPress 3.1 introduced the parameter ‘who’ which defaults to ‘all’ and has only 1 other possibility ‘authors’.
    In drodown user box You will only see users higher then contributor. If You want to see all users You need to add little code to functions.php

    Let me point anyone with the same issue to another thread where this has been resolved through functions.php
    http://wordpress.org/support/topic/users-missing-from-author-dropdown-after-upgrade

    @asimac2001:

    As an admin I would like to write an introductury post in another user’s name.

    The link in your last post solves the missing users and shows all of them.
    However, the users in the dropdown should really only be those that have the role(s) with the cap to write/edit post or page.

    Any ideas how to fix this?

    Dear zyrq,
    I wish I could help you out, but right now I do not know a solution for Your problem. I haven’t yet managed to do that, I will try during the weekend and get back to You if I work something out…

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘User does not appear in post_author_override drop down list’ is closed to new replies.