我正试图制作一份登记表,登记过程如下。能做到吗?
这些是注册表的字段。
Username
Email Address
First Name
Last Name
Contact Tel No
Company Name
Address (room for 3 lines of text)
Postcode
Industry (drop down list)
Product Interests (tick box / multi choice)
Status (drop down list: End User, Reseller/Partner, Distributor, Other). If other selected then \'Other\' free type box appears.
data consent tick box (a tick box which is default to being \'ticked\' should show \'Opt-in to receive relevant information concerning products and services\')
anti-spam widget (to avoid robots trawling the site can we add an anti-spam verification box for submissions)
所有字段都是必填字段*
如果用户选择“经销商/合作伙伴”,则流程如下:屏幕上的确认消息:
“感谢您注册成为合作伙伴。此请求需要授权,自动授权完成后将很快通知您。”
用户收到文本与上述内容类似的确认电子邮件站点工作人员(自定义/任何角色-预定义)收到包含用户信息的电子邮件,并请求他们从系统工作人员(自定义/任何角色-预定义)处授权用户“恭喜!您现在已被批准访问www.example.com/partners。”
用户现在可以登录,如果用户选择除“经销商/合作伙伴”以外的任何状态*,系统将自动重定向到合作伙伴页面,流程如下:- 屏幕上的确认消息-“感谢您的注册。您将知道被定向到“我的打印机”页面。
- 用户被定向到“我的打印机”页面
- 用户收到的确认与上面的文本类似
- 站点工作人员(自定义/任何角色-预定义)收到的包含用户信息的电子邮件
SO网友:Vimal
我也在尝试同样的东西,经过大量的努力,终于找到了解决办法。
使用的插件:http://wordpress.org/plugins/wp-roles-at-registration/
将这些行添加到函数中。php
add_role(\'user\', \'User\', array(
\'read\' => false, // True allows that capability
\'edit_posts\' => false,
\'delete_posts\' => false, // Use false to explicitly deny
));
remove_role( \'company\' );
add_role(\'company\', \'Company\', array(
\'read\' => true, // True allows that capability
\'edit_profile\' => true,
\'delete_posts\' => false, // Use false to explicitly deny
));
在我这边,一切都很好。