Opened 9 years ago
Closed 9 years ago
#7042 closed defect (bug) (wontfix)
bp_send_email function not working with numeric string for $to argument
Reported by: |
|
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)
This ticket was mentioned in Slack in #buddypress by dcavins. View the logs.
9 years ago
Note: See
TracTickets for help on using
tickets.
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?