Refactor set_display_name with a localized value and prevent email

This commit is contained in:
Arif Widianto 2017-11-24 21:19:19 +07:00
parent 0b42515c93
commit 55b65d405e
1 changed files with 1 additions and 1 deletions

View File

@ -753,7 +753,7 @@ class WC_Customer extends WC_Legacy_Customer {
* @throws WC_Data_Exception
*/
public function set_display_name( $display_name ) {
$this->set_prop( 'display_name', $display_name );
$this->set_prop( 'display_name', is_email( $display_name ) ? sprintf( __( '%1$s %2$s', 'display name', 'woocommerce' ), $this->get_first_name(), $this->get_last_name() ) : $display_name );
}
/**