admin管理员组文章数量:1415484
I have a custom post type created for new users when they are added to a multisite environment using the wpmu_new_user hook, but I noticed that it was only fired on new user creation and not when an existing user is added to a site. Is there a hook that gets fired when both new or existing users are added to a site?
I have a custom post type created for new users when they are added to a multisite environment using the wpmu_new_user hook, but I noticed that it was only fired on new user creation and not when an existing user is added to a site. Is there a hook that gets fired when both new or existing users are added to a site?
Share Improve this question asked Aug 16, 2019 at 17:37 C0c0b33fC0c0b33f 606 bronze badges1 Answer
Reset to default 2There's one called added_existing_user
that fires immediately after adding an existing user.
Digging a little deeper, I find the function add_user_to_blog()
is used by both add_new_user_to_blog()
and add_existing_user_to_blog()
, and has an action hook named add_user_to_blog
. I'd look into using that last hook, if I wanted to ensure something happened when a user was added to a site, whether they were _new_
or _existing_
.
本文标签: multisite hook for Add Existing User
版权声明:本文标题:multisite hook for Add Existing User 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745232349a2648881.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论