Automattic\WooCommerce\Admin\API\Reports\Customers
DataStore::update_registered_customer_via_last_active
Update the database if the "last active" meta value was changed. Function expects to be hooked into the added_user_meta updated_user_meta
Метод класса: DataStore{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$result = DataStore::update_registered_customer_via_last_active( $meta_id, $user_id, $meta_key );
- $meta_id(int) (обязательный)
- ID of updated metadata entry.
- $user_id(int) (обязательный)
- ID of the user being updated.
- $meta_key(строка) (обязательный)
- Meta key being updated.
Код DataStore::update_registered_customer_via_last_active() DataStore::update registered customer via last active WC 11.1.2
public static function update_registered_customer_via_last_active( $meta_id, $user_id, $meta_key ) {
if ( 'wc_last_active' === $meta_key ) {
// Optimization note related to guarded updates in `wc_update_user_last_active`: the meta update will trigger
// this method execution. We evaluated adding `! doing_action( 'wp' )` here, but the performance gain lays
// in the micro-optimization area while exposing the Analytics to certain edge-cases.
self::update_registered_customer( $user_id );
}
}