Automattic\WooCommerce\Internal\Admin\Notes
MerchantEmailNotifications::get_merchant_preferred_name()
Get the preferred name for user. First choice is the user's first name, and then display_name.
Method of the class: MerchantEmailNotifications{}
No Hooks.
Return
String
. User's name.
Usage
$result = MerchantEmailNotifications::get_merchant_preferred_name( $user );
- $user(WP_User) (required)
- Recipient to send the note to.
MerchantEmailNotifications::get_merchant_preferred_name() MerchantEmailNotifications::get merchant preferred name code WC 9.5.1
public static function get_merchant_preferred_name( $user ) { $first_name = get_user_meta( $user->ID, 'first_name', true ); if ( $first_name ) { return $first_name; } if ( $user->display_name ) { return $user->display_name; } return ''; }