You are here

function hook_gdpr_consent_accepted in GDPR Consent 7

Runs actions when GDPR consent is accepted.

Parameters

array $data: Data relating to the current acceptance. Includes:

  • uid: The ID of the user that accepted the terms.
  • version: The version of Terms accepted.
  • revision: The revision of Terms accepted.
  • accepted: The timestamp the Terms were accepted at.
  • language: The current language.
1 function implements hook_gdpr_consent_accepted()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

gdpr_consent_gdpr_consent_accepted in ./gdpr_consent.module
Helper function for rules.
1 invocation of hook_gdpr_consent_accepted()
gdpr_consent_save_accept in ./gdpr_consent.module
Function to save acceptance.

File

./gdpr_consent.api.php, line 35
This file contains no working PHP code.

Code

function hook_gdpr_consent_accepted(array $data) {
  if (module_exists('rules')) {
    $user = user_load($data['uid']);
    $conditions = gdpr_consent_get_conditions($data['language']);
    rules_invoke_event('gdpr_consent_accepted', $user, $conditions, $data['accepted']);
  }
}