WC_Customer_Data_Store::update()
Updates a customer in the database.
Метод класса: WC_Customer_Data_Store{}
Хуки из метода
Возвращает
null
. Ничего (null).
Использование
$WC_Customer_Data_Store = new WC_Customer_Data_Store(); $WC_Customer_Data_Store->update( $customer );
- $customer(WC_Customer) (обязательный) (передается по ссылке — &)
- Customer object.
Список изменений
С версии 3.0.0 | Введена. |
Код WC_Customer_Data_Store::update() WC Customer Data Store::update WC 8.7.0
public function update( &$customer ) { wp_update_user( apply_filters( 'woocommerce_update_customer_args', array( 'ID' => $customer->get_id(), 'user_email' => $customer->get_email(), 'display_name' => $customer->get_display_name(), ), $customer ) ); // Only update password if a new one was set with set_password. if ( $customer->get_password() ) { wp_update_user( array( 'ID' => $customer->get_id(), 'user_pass' => $customer->get_password(), ) ); $customer->set_password( '' ); } $this->update_user_meta( $customer ); $customer->set_date_modified( get_user_meta( $customer->get_id(), 'last_update', true ) ); $customer->save_meta_data(); $customer->apply_changes(); do_action( 'woocommerce_update_customer', $customer->get_id(), $customer ); }