private static function add_user_meta($user_id, $key, $value)
{
// We can't use add_user_meta because there is no equivalent on VIP.
// Instead manage values within the same variable for consistency.
$values = self::get_user_meta($user_id, $key);
if (empty($values)) {
$values = array();
}
// Add the new value
$values[] = $value;
// Save using the appropriate method
if (defined('WPCOM_IS_VIP_ENV') && true === WPCOM_IS_VIP_ENV) {
return update_user_attribute($user_id, $key, $values);
} else {
return update_user_meta($user_id, $key, $values);
}
}