Opened 3 years ago

Last modified 3 years ago

#11210 new enhancement

Split wp_new_user_notification() into two functions

Reported by: sirzooro Owned by: westi
Priority: normal Milestone: Future Release
Component: Plugins Version: 2.9
Severity: normal Keywords: needs-patch
Cc: m@…, jeff@…, beau@…

Description

wp_new_user_notification() sends emails to newly registered user and to admin. One of my plugins (WyPiekacz) redefines it in order to to disable emails sent to admin. Now I want to extend my other plugin (User Locker) so newly registered users will have to activate theirs accounts by clicking on link sent in email. In order to do this, I have to redefine the same function. I how to do this so both plugins could work at the same time - this is not a problem for me.

However it will be better to allow to redefine only part of wp_new_user_notification() function - either one which sends email to new user, or to admin. Therefore I ask to split this function into two new ones. Attached patch does this.

Attachments (2)

pluggable.php.diff (2.4 KB) - added by sirzooro 3 years ago.
11210_pluggable.php.adds-hooks.patch (2.6 KB) - added by nacin 3 years ago.
Quick attempt to add hooks to wp_new_user_notification

Download all attachments as: .zip

Change History (11)

Why not just add some hooks instead? That function has none currently.

nacin3 years ago

Quick attempt to add hooks to wp_new_user_notification

After going through and adding the hooks, your way seems like a better idea. Figured I'd try it and share anyway.

  • Milestone changed from 2.9 to 3.0

Postponing for now.

  • Cc m@… added

I think both Ideas should be combined: split and hooks.

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 3.0 to Future Release

combining both ideas gets my vote too.

I like the idea by @nacin. It needs some adjustments, but why introduce new functions when the old one can handle it just fine? I need this same functionality as @sirzooro for my plugin "Theme My Login" as well.

See #12184

  • Cc jeff@… added
  • Cc beau@… added

Any movement on this one? Seems like it'd be a good one to have, especially with people building more and more customized network/multi-site installs. Consider me a +1 to the combined approach as well.

Note: See TracTickets for help on using tickets.