Automattic\WooCommerce\Admin\API\Reports\Customers

DataStore::delete_customer_by_user_id()public staticWC 1.0

Delete a customer lookup row by WordPress User ID.

Method of the class: DataStore{}

No Hooks.

Return

null. Nothing.

Usage

$result = DataStore::delete_customer_by_user_id( $user_id );
$user_id(int) (required)
WordPress User ID.

DataStore::delete_customer_by_user_id() code WC 7.3.0

public static function delete_customer_by_user_id( $user_id ) {
	global $wpdb;

	$user_id     = (int) $user_id;
	$num_deleted = $wpdb->delete( self::get_db_table_name(), array( 'user_id' => $user_id ) );

	if ( $num_deleted ) {
		ReportsCache::invalidate();
	}
}