Skip to:
Content

#7042 closed defect (bug) (wontfix)

bp_send_email function not working with numeric string for $to argument

Reported by: WeddyWood Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.5.0
Component: Emails Keywords:
Cc:

Description

For example: bp_send_email('email_type','4747',[]) not working with numeric user id.

This not working because is_int( $email_or_user ) used instead of is_numeric().

__construct method of BP_Email_Recipient class uses get_user_by WP function which uses get_data_by with is_numeric() function for 'id'

Therefore, for consistency of behavior need to use is_numeric().

Change History (4)

#1 @DJPaul
21 months ago

  • Milestone changed from Awaiting Review to Under Consideration

Hi @WeddyWood, thanks for starting a discussion. The BuddyPress Emails API is designed to be strictly-typed on purpose, and making this change would weaken that architectural decision. This is not a change we will make, unless...

how are you passing numeric strings to bp_send_email()? Is this in custom code, or have you filtered something that causes this to break?

This ticket was mentioned in Slack in #buddypress by dcavins. View the logs.


21 months ago

#3 @DJPaul
19 months ago

  • Milestone changed from Under Consideration to Awaiting Review

#4 @DJPaul
19 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

This report has had no follow-up from the original reporter, and I don't like the suggestion, so I'm closing it.

Note: See TracTickets for help on using tickets.