I'm trying to change the $admin_email used as the "from" address when new people register for my WPMS site. I see from the wpmu_signup_user_notification docblock that you can bypass and override the function but I don't know how. The pertinent section of the docblock reads:

  • Filter {@see 'wpmu_signup_user_notification'} to bypass this function or
  • replace it with your own notification behavior.

How do I use a filter to replace this function with my own notification logic?


This is actually quite easy. All I needed was to inject the appropriate add_filter() and follow it up with my custom function. That's all I needed to completely override the original function. So sweeet.

To bypass wpmu_signup_user_notification() and use my own custom function I needed the following:

add_filter('wpmu_signup_user_notification', 'gqa_signup_user_notification', 10, 4);

And in my custom function I actually just copied the entire function from ms-function.php and only changed the part I needed to change (the $admin_email variable), but I could have entirely rewritten it had I needed to.

I don't know what WPMU functions behave in this way, or why they didn't just make them pluggable, but whatevs, I'm happy to have this kind of control.

FWIW I was also able to do the same with wpmu_welcome_user_notification.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.