Skip to main content

GF_Zero_Spam

Source: gravityforms-zero-spam.php:27

Details

  • Kind: class
  • Namespace: (global)

Methods

MethodDescription
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

NameTypeDefaultDescription
$submission_jsonstringThe JSON representation of the form submission.
$resume_tokenstringThe resume token for the submission.
$formarrayThe Gravity Forms form object.

Returns

  • string — The modified JSON representation of the form submission.

See Also

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

NameTypeDefaultDescription
$formarrayThe 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

NameTypeDefaultDescription
$is_spamboolfalseIndicates if the submission has been flagged as spam.
$formarray[]The form currently being processed.
$entryarray[]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

NameTypeDefaultDescription
$entryarrayThe entry data.

Since: 1.1.3

Source: gravityforms-zero-spam.php:233