我需要能够允许管理员为他们在admin中创建或编辑的帖子选择其他作者。
我添加了post-author功能,选择字段显示在编辑屏幕上,但如果已经设置,则只提供Admin和当前post-author选项。
其他用户具有organization\\u administrator角色。
以下是我的post\\u类型设置:
$post_type = register_extended_post_type(\'organization_event\', [
\'supports\' => [\'title\', \'author\'],
\'public\' => true,
\'publicly_queryable\' => true,
\'show_in_admin_bar\' => true,
\'show_in_menu\' => true,
\'menu_icon\' => \'dashicons-calendar-alt\',
\'has_archive\' => true,
\'capabilities\' => array(
\'edit_post\' => \'edit_organization_event\',
\'edit_posts\' => \'edit_organization_events\',
\'edit_others_posts\' => \'edit_other_organization_events\',
\'publish_posts\' => \'publish_organization_events\',
\'read_post\' => \'read_organization_event\',
\'read_private_posts\' => \'read_private_organization_events\',
\'delete_post\' => \'delete_organization_event\'
),
\'map_meta_cap\' => true,
]);
$admins = get_role(\'administrator\');
$admins->add_cap(\'edit_organization_event\');
$admins->add_cap(\'edit_organization_events\');
$admins->add_cap(\'edit_other_organization_events\');
$admins->add_cap(\'publish_organization_events\');
$admins->add_cap(\'read_organization_event\');
$admins->add_cap(\'read_private_organization_events\');
$admins->add_cap(\'delete_organization_event\');
以及organization\\u administrator角色
add_role(\'organization_administrator\', __(\'Organization Administrator\', \'sage\'), [
\'edit_organization\' => true,
\'edit_organizations\' => true,
\'edit_organization_event\' => true,
\'edit_organization_events\' => true,
]);
感谢您提供的任何帮助。