You are here

function hook_honeypot_add_form_protection in Honeypot 7

Same name and namespace in other branches
  1. 8 honeypot.api.php \hook_honeypot_add_form_protection()
  2. 6 honeypot.api.php \hook_honeypot_add_form_protection()
  3. 2.0.x honeypot.api.php \hook_honeypot_add_form_protection()

React to an addition of honeypot form protections for a given form_id.

After honeypot has added its protections to a form, this hook will be called. You can use this hook to track when and how many times certain protected forms are displayed to certain users, or for other tracking purposes.

Parameters

array $options: Protections that were applied to the form. Includes 'honeypot' and/or 'time_restriction'.

array $form: The Form API form to which protections were added.

1 invocation of hook_honeypot_add_form_protection()
honeypot_add_form_protection in ./honeypot.module
Form builder function to add different types of protection to forms.

File

./honeypot.api.php, line 42
API Functionality for Honeypot module.

Code

function hook_honeypot_add_form_protection($options, $form) {
  if ($form['form_id']['#value'] == 'mymodule_form') {

    // Do something...
  }
}