BP_Email_Recipient::get_user( string $transform = 'raw' )
Get WP_User object for this recipient.
Description
Parameters
- $transform
-
(Optional) How to transform the return value. Accepts 'raw' (default) or 'search-email'.
Default value: 'raw'
Return
(WP_User|null) WP_User object, or null if not set.
Source
File: bp-core/classes/class-bp-email-recipient.php
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | public function get_user( $transform = 'raw' ) { // If transform "search-email", find the WP_User if not already set. if ( $transform === 'search-email' && ! $this ->user_object && $this ->address ) { $this ->user_object = get_user_by( 'email' , $this ->address ); } /** * Filters the WP_User object for this recipient before it's returned. * * @since BuddyPress 2.5.0 * * @param WP_User $name WP_User object for this recipient, or null if not set. * @param string $transform Optional. How the return value was transformed. * Accepts 'raw' (default) or 'search-email'. * @param BP_Email $recipient $this Current instance of the email recipient class. */ return apply_filters( 'bp_email_recipient_get_user' , $this ->user_object, $transform , $this ); } |
Changelog
Version | Description |
---|---|
BuddyPress 2.5.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.