WC_Customer::set_display_name()publicWC 3.1.0

Set customer's display name.

Method of the class: WC_Customer{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Customer = new WC_Customer();
$WC_Customer->set_display_name( $display_name );
$display_name(string) (required)
Display name.

Changelog

Since 3.1.0 Introduced.

WC_Customer::set_display_name() code WC 9.4.2

public function set_display_name( $display_name ) {
	/* translators: 1: first name 2: last name */
	$this->set_prop( 'display_name', is_email( $display_name ) ? sprintf( _x( '%1$s %2$s', 'display name', 'woocommerce' ), $this->get_first_name(), $this->get_last_name() ) : $display_name );
}