I created a custom post type ("Organization"), and I've also created a custom user role ("Representative"). Also, I've ensured that the Representative role has read/edit/create/publish post capabilities.
I then, programmatically, assigned a Representative as the "author" of the Organization.
When I am on the Organizations overview screen (WP Admin > Organizations), I see the proper representative in the "Author" column.
However, when editing the Organization, the "Author" dropdown only shows Admin/Editor/Contributors. It does not allow me to view/select Representatives as the author of an organization.
I've searched and cannot find the answer. Am I doing this wrong, or is there a way to hook into WP and have it recognize other roles?
Edit: Here is the Custom Post Type:
function cptui_register_my_cpts_organization_info() {
/**
* Post Type: Organizations.
*/
$labels = [
"name" => __( "Organizations", "hello-elementor-child" ),
"singular_name" => __( "Organization", "hello-elementor-child" ),
"menu_name" => __( "Organizations", "hello-elementor-child" ),
"all_items" => __( "All Organizations", "hello-elementor-child" ),
"add_new" => __( "Add New", "hello-elementor-child" ),
"add_new_item" => __( "Add new Organization", "hello-elementor-child" ),
"edit_item" => __( "Edit Organization", "hello-elementor-child" ),
"new_item" => __( "New Organization", "hello-elementor-child" ),
"view_item" => __( "View Organization", "hello-elementor-child" ),
"view_items" => __( "View Organizations", "hello-elementor-child" ),
"search_items" => __( "Search Organizations", "hello-elementor-child" ),
"not_found" => __( "No Organizations found", "hello-elementor-child" ),
"not_found_in_trash" => __( "No Organizations found in trash", "hello-elementor-child" ),
"parent" => __( "Parent Organization:", "hello-elementor-child" ),
"featured_image" => __( "Organization Logo", "hello-elementor-child" ),
"set_featured_image" => __( "Upload Organization Logo", "hello-elementor-child" ),
"remove_featured_image" => __( "Remove Organization Logo", "hello-elementor-child" ),
"use_featured_image" => __( "Use as logo for this Organization", "hello-elementor-child" ),
"archives" => __( "Organization archives", "hello-elementor-child" ),
"insert_into_item" => __( "Insert into Organization", "hello-elementor-child" ),
"uploaded_to_this_item" => __( "Upload to this Organization", "hello-elementor-child" ),
"filter_items_list" => __( "Filter Organizations list", "hello-elementor-child" ),
"items_list_navigation" => __( "Organizations list navigation", "hello-elementor-child" ),
"items_list" => __( "Organizations list", "hello-elementor-child" ),
"attributes" => __( "Organizations attributes", "hello-elementor-child" ),
"name_admin_bar" => __( "Organization", "hello-elementor-child" ),
"item_published" => __( "Organization published", "hello-elementor-child" ),
"item_published_privately" => __( "Organization published privately.", "hello-elementor-child" ),
"item_reverted_to_draft" => __( "Organization reverted to draft.", "hello-elementor-child" ),
"item_scheduled" => __( "Organization scheduled", "hello-elementor-child" ),
"item_updated" => __( "Organization updated.", "hello-elementor-child" ),
"parent_item_colon" => __( "Parent Organization:", "hello-elementor-child" ),
];
$args = [
"label" => __( "Organizations", "hello-elementor-child" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => true,
"rest_base" => "",
"rest_controller_class" => "WP_REST_Posts_Controller",
"has_archive" => true,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"delete_with_user" => false,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"rewrite" => [ "slug" => "org", "with_front" => true ],
"query_var" => true,
"menu_icon" => "dashicons-networking",
"supports" => [ "title", "editor", "thumbnail", "custom-fields", "author" ],
"taxonomies" => [ "organization_services" ],
"show_in_graphql" => false,
];
register_post_type( "organization_info", $args );
}
add_action( 'init', 'cptui_register_my_cpts_organization_info' );
Edit Furthermore, I ensure that the role "Representative" has a user level of at least 1:
After making these changes, however, I still did not see the Representative showing in the "Author" dropdown for this custom post type.
I even manually added wp_user_level
and set it to 2
inside of wp_usermeta
in the DB, but still didn't work.