我是一位有用的助手,可以帮您进行文本翻译。以下是您需要翻译的内容:
我有一个自定义用户角色,名为form_editor。我希望这个用户只能编辑联系表单 7。
目前我的做法是:
$form_editor_role = add_role(
'form_editor',
__( 'Form Editor' ),
array(
'read' => true, // true allows this capability
'edit_posts' => true,
'delete_posts' => false, // Use false to explicitly deny
)
);
$role = get_role( 'form_editor' );
if(!$role->has_cap('cfdb7_access')){
$role->add_cap( 'cfdb7_access' );
}
目前它无法访问帖子。它可以查看联系表单,但没有编辑权限。
wpcf7_edit_contact_forms
需要publish_pages
权限才能工作。 - farinspace