在wordpress中使用邀请码将用户角色设置为自定义角色

问题描述 投票:0回答:1

我正在使用 register-plus-redux 和 press allowed 核心插件。第一个插件允许我在注册表中添加邀请码框,第二个插件允许我创建自定义角色。我喜欢做的是获取用户输入的邀请码,然后将他分配给特定的角色。如何修改register-plus-redux插件来实现我的目标?

插件链接:

wordpress plugins roles
1个回答
0
投票

注册后使用WP钩子:

https://codex.wordpress.org/Plugin_API/Action_Reference/user_register

从用户的 wp_usermeta 中获取邀请码,并添加您的自定义功能。

© www.soinside.com 2019 - 2024. All rights reserved.