Make WordPress Core

Opened 11 years ago

Closed 10 years ago

Last modified 8 years ago

#36009 closed enhancement (fixed)

wp_new_user_notification "user" option for third parameter

Reported by: Jonathandejong Owned by: SergeyBiryukov
Priority: normal Milestone: 4.6
Component: Users Version: 4.4.2
Severity: normal Keywords: has-patch needs-unit-tests
Cc: Focuses: administration

Description

I propose adding a third option for the third parameter $notify in wp_new_user_notification() called "user" (string) which would allow for sending the notification to the user only. Many user-driven sites have the need for sending this email to new users but would rather not flood an admin email with registration notifications.

I don't think this only flaw is enough to justify plugging the function with a custom one. It'd be much preferred to allow for this third option in the core function instead.

Attachments (2)

36009.diff​ (1.8 KB ) - added by akibjorklund 11 years ago.
36009.2.diff​ (2.3 KB ) - added by akibjorklund 11 years ago.

Download all attachments as: .zip

Change History (16)

@akibjorklund
11 years ago

#1 @akibjorklund
11 years ago

I agree this would be a useful addition. I've attached 36009.diff​ which adds this functionality. The few lines indented by the if block added are also fixed for spacing issues to adhere to the WordPress coding standards.

#2 @akibjorklund
11 years ago

  • Keywords has-patch needs-testing added

#3 @boonebgorges
11 years ago

  • Keywords needs-docs added
  • Milestone Awaiting Review → 4.6

Patch seems pretty good to me. Can we get a @since annotation for the new accepted value?

#4 @akibjorklund
11 years ago

Indeed. Patch updated.

#5 @Jonathandejong
11 years ago

Great to hear!

#6 @DrewAPicture
10 years ago

  • Keywords commit added; needs-docs removed

The changelog entry in 36009.2.diff​ looks good.

#7 @SergeyBiryukov
10 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 37276:

Users: In wp_new_user_notification(), sdd 'user' option for the $notify parameter, which allows for sending notification only to the user created.

Props akibjorklund.
Fixes #36009.

#8 follow-up: @ocean90
10 years ago

  • Keywords needs-unit-tests added; needs-testing commit removed
  • Resolution fixed
  • Status closed → reopened

I'm shocked that this landed without a unit test. May I remind you about [35735]?

Also,wp_send_new_user_notifications() is a wrapper for wp_new_user_notification() and should get a note about the new parameter too.

#9 @SergeyBiryukov
10 years ago

In 37277:

Users: Add a unit test for [37276].

See #36009.

#10 in reply to: ↑ 8 @SergeyBiryukov
10 years ago

Replying to ocean90:

I'm shocked that this landed without a unit test. May I remind you about [35735]?

Right, sorry for that. Thanks for reminding :)

#11 @SergeyBiryukov
10 years ago

  • Resolution → fixed
  • Status reopened → closed

In 37278:

Docs: Reflect the new 'user' option for wp_new_user_notification()'s $notify parameter added in [37276] in wp_send_new_user_notifications() docs as well.

Props ocean90.
Fixes #36009.

#12 @boonebgorges
10 years ago

#36970 was marked as a duplicate.

#13 @jshrek
10 years ago

I submitted the following suggestion here https://core.trac.wordpress.org/ticket/36970 which turns out to be a duplicate of this one!

Adding a user email only option is great idea.

#14 @zodiac1978
8 years ago

FYI: If BuddyPress is active, this is not sufficient.

Please see also: ​https://buddypress.trac.wordpress.org/ticket/7597#comment:7

Note: See TracTickets for help on using tickets.