Skip to content
Snippets Groups Projects
Commit dc233d1e authored by Hugues Lesecq's avatar Hugues Lesecq Committed by Jeff Geerling
Browse files

Issue #1489304 by hles, gregarios: Per-Site Honeypot CSS Class Naming.

parent 32628391
No related branches found
No related tags found
No related merge requests found
......@@ -132,17 +132,19 @@ function honeypot_add_form_protection(&$form, &$form_state, $options = array())
$honeypot_element = variable_get('honeypot_element_name', 'homepage');
// Build the honeypot element.
$honeypot_class = $honeypot_element . '-textfield';
$form[$honeypot_element] = array(
'#type' => 'textfield',
'#title' => t('Leave this field blank'),
'#size' => 20,
'#weight' => 100,
'#attributes' => array('autocomplete' => 'off'),
'#element_validate' => array('_honeypot_honeypot_validate'),
'#prefix' => '<div class="honeypot-textfield">',
'#prefix' => '<div class="' . $honeypot_class . '">',
'#suffix' => '</div>',
'#attached' => array(
'css' => array(
'.honeypot-textfield { display: none !important; }' => array('type' => 'inline'), // Hide honeypot.
'.' . $honeypot_class . ' { display: none !important; }' => array('type' => 'inline'), // Hide honeypot.
),
),
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment