WC_Customer_Data_Store::update() public WC 3.0.0
Updates a customer in the database.
{} Это метод класса: WC_Customer_Data_Store{}
Хуки из метода
Возвращает
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 4.9.2
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 );
}