GF_Zero_Spam
Source: gravityforms-zero-spam.php:27
Details
- Kind:
class - Namespace:
(global)
Methods
| Method | Description |
|---|---|
gform_loaded() | Instantiate the plugin on Gravity Forms loading. |
deactivate() | Cleans up plugin options when deactivating. |
add_zero_spam_key_to_entry() | Adds the Zero Spam key to the Gravity Forms entry during form submission. |
get_key() | Retrieves the zero spam key (generating if needed). |
add_key_field() | Injects the hidden field and key into the form at submission. |
check_key_field() | Checks for our zero spam key during validation. |
add_entry_note() | Adds a note to the entry once the spam status is set (GF 2.4.18+). |
Method Reference
gform_loaded()
public static function gform_loaded()
Instantiate the plugin on Gravity Forms loading.
Source: gravityforms-zero-spam.php:32
deactivate()
public static function deactivate()
Cleans up plugin options when deactivating.
Returns
void
Source: gravityforms-zero-spam.php:43
add_zero_spam_key_to_entry()
public function add_zero_spam_key_to_entry( $submission_json, $resume_token, $form )
Adds the Zero Spam key to the Gravity Forms entry during form submission.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$submission_json | string | The JSON representation of the form submission. | |
$resume_token | string | The resume token for the submission. | |
$form | array | The Gravity Forms form object. |
Returns
string— The modified JSON representation of the form submission.
See Also
\GFFormsModel::filter_draft_submission_pre_save()The source of the hook.
Since: 1.4.1
Source: gravityforms-zero-spam.php:69
get_key()
public function get_key()
Retrieves the zero spam key (generating if needed).
Returns
false|mixed|void
Source: gravityforms-zero-spam.php:101
add_key_field()
public function add_key_field( $form )
Injects the hidden field and key into the form at submission.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The Form Object. |
Returns
void
Source: gravityforms-zero-spam.php:121
check_key_field()
public function check_key_field( $is_spam=false, $form=[], $entry=[] )
Checks for our zero spam key during validation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$is_spam | bool | false | Indicates if the submission has been flagged as spam. |
$form | array | [] | The form currently being processed. |
$entry | array | [] | The entry currently being processed. |
Returns
bool— True: it's spam; False: it's not spam!
Source: gravityforms-zero-spam.php:178
add_entry_note()
public function add_entry_note( $entry )
Adds a note to the entry once the spam status is set (GF 2.4.18+).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry | array | The entry data. |
Since: 1.1.3
Source: gravityforms-zero-spam.php:233