最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

multisite hook for Add Existing User

programmeradmin1浏览0评论

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 badges
Add a comment  | 

1 Answer 1

Reset to default 2

There'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_.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论