Skip to main content

GFFormSettings

Class GFFormSettings

Handles the form settings page.

Since: Unknown

Source: form_settings.php:16

Details

  • Kind: class
  • Namespace: (global)

Methods

MethodDescription
form_settings_page()Determines which form settings page to display.
form_settings_ui()Displays the form settings UI.
form_settings_fields()Prepare form settings fields.
legacy_markup_enabled_or_posted()The Settings API runs the settings field method before processing the postback,
show_legacy_markup_setting()Determine whether to show the legacy markup setting.
legacy_is_in_use()Check whether any forms on this site use legacy markup.
legacy_markup_warning()Get the warning for the legacy markup field.
deprecated_classes_warning()Displays a warning if confirmation deprecated CSS Ready Classes are used in the form settings.
initialize_settings_renderer()Initialize Plugin Settings fields renderer.
notification_page()Runs the notification page.
personal_data_page()Renders the Personal Data page.
page_header()Displays the form settings page header.
page_footer()Displays the Settings page footer.
get_tabs()Gets the Settings page tabs.
sorting_tabs_alphabetical()Orders tabs array into alphabetical order
maybe_process_confirmation_list_action()Processes actions made from the Confirmations List page.
delete_confirmation()Delete a form confirmation by ID.
output()Echos a variable.
output_field_scripts()Outputs scripts for conditional logic fields.
activate_save()Handles the saving of notifications and confirmations when activated.
deactivate_save()Handles the saving of confirmation and notifications when deactivating.
toggle_spam_confirmation()Adds or removes the custom spam confirmation based on the value of the enableSpamConfirmation toggle.
save_form_title()Handles the saving of form titles.
save_changed_form_settings_fields()Saves new or changed form settings fields to the form object to automatically save custom fields.

Method Reference

form_settings_page()

public static function form_settings_page()

Determines which form settings page to display.

Returns

  • void

Since: Unknown

Source: form_settings.php:34

form_settings_ui()

public static function form_settings_ui()

Displays the form settings UI.

Returns

  • void

Since: Unknown

Source: form_settings.php:76

form_settings_fields()

public static function form_settings_fields( $form )

Prepare form settings fields.

Parameters

NameTypeDefaultDescription
$formarrayForm being edited.

Returns

  • array

Since:

  • 2.5
  • 2.9.8 (Updated honeypotAction default to spam.)
  • 2.9.21 (Moved the honeypot fields to a new spam section and added submission speed check fields.)
  • 2.10.0 (Added the enableSpamConfirmation toggle to the spam section.)

Source: form_settings.php:108

legacy_markup_enabled_or_posted()

public static function legacy_markup_enabled_or_posted( $form )

The Settings API runs the settings field method before processing the postback,

so we have to run this hack to ensure we're respecting the posted value on initial load.

Parameters

NameTypeDefaultDescription
$formarrayThe form to check.

Returns

  • bool

Since: 3.0.0

Source: form_settings.php:825

show_legacy_markup_setting()

public static function show_legacy_markup_setting()

Determine whether to show the legacy markup setting.

Returns

  • bool

Since: 2.7.15

Source: form_settings.php:840

legacy_is_in_use()

public static function legacy_is_in_use()

Check whether any forms on this site use legacy markup.

Returns

  • bool

Since: 2.7.15

Source: form_settings.php:857

legacy_markup_warning()

public static function legacy_markup_warning()

Get the warning for the legacy markup field.

Returns

  • string

Since: 2.7.15

Source: form_settings.php:876

deprecated_classes_warning()

public static function deprecated_classes_warning( $form )

Displays a warning if confirmation deprecated CSS Ready Classes are used in the form settings.

This method checks if the form uses any deprecated CSS Ready Classes and displays a warning message. It also ensures the warning is not shown if the user has dismissed it.

Parameters

NameTypeDefaultDescription
$formarrayThe form object being checked for deprecated classes.

Returns

  • string | false — The HTML for the warning message or false if no warning is needed.

Since: 2.9.15

Source: form_settings.php:911

initialize_settings_renderer()

public static function initialize_settings_renderer()

Initialize Plugin Settings fields renderer.

Since:

  • 2.5
  • 2.9.8 (Updated honeypotAction default to spam.)
  • 2.9.21 (Updated to save the submission speed check fields.)
  • 2.10.0 (Updated to handle the enableSpamConfirmation toggle.)

Source: form_settings.php:957

notification_page()

public static function notification_page()

Runs the notification page.

Returns

  • void

Since: Unknown

Source: form_settings.php:1239

personal_data_page()

public static function personal_data_page()

Renders the Personal Data page.

Since: 2.4

Source: form_settings.php:1252

public static function page_header( $title='' )

Displays the form settings page header.

Parameters

NameTypeDefaultDescription
$titlestring''The title to display as the page header. Defaults to empty string.

Returns

  • void

Since: Unknown

Source: form_settings.php:1290

public static function page_footer()

Displays the Settings page footer.

Since: Unknown

Source: form_settings.php:1376

get_tabs()

public static function get_tabs( $form_id )

Gets the Settings page tabs.

Parameters

NameTypeDefaultDescription
$form_idintThe form ID to get tabs for.

Returns

  • array — $settings_tabs The form settings tabs to display.

Since: Unknown

Source: form_settings.php:1394

sorting_tabs_alphabetical()

public static function sorting_tabs_alphabetical( array $settings_tab, array $primary_settings_tab_keys )

Orders tabs array into alphabetical order

Parameters

NameTypeDefaultDescription
$settings_tabarray
$primary_settings_tab_keysarray

Returns

  • array

Since: 2.7.4

Source: form_settings.php:1459

maybe_process_confirmation_list_action()

public static function maybe_process_confirmation_list_action()

Processes actions made from the Confirmations List page.

Returns

  • void

Since: Unknown

Source: form_settings.php:1495

delete_confirmation()

public static function delete_confirmation( $confirmation_id, $form_id )

Delete a form confirmation by ID.

Parameters

NameTypeDefaultDescription
$confirmation_idstringThe confirmation to be deleted.
$form_idint | arrayThe form ID or Form Object form the confirmation being deleted.

Returns

  • false | int — The result of the database operation.

Since: Unknown

Source: form_settings.php:1526

output()

public static function output( $a )

Echos a variable.

Parameters

NameTypeDefaultDescription
$astringThing to echo.

Returns

  • void

Since: Unknown

Source: form_settings.php:1544

output_field_scripts()

public static function output_field_scripts( $echo=true )

Outputs scripts for conditional logic fields.

Parameters

NameTypeDefaultDescription
$echobooltrueIf the scripts should be echoed. Defaults to true.

Returns

  • string — $script_str The scripts to be output.

Since: Unknown

Source: form_settings.php:1561

activate_save()

public static function activate_save( $form )

Handles the saving of notifications and confirmations when activated.

Parameters

NameTypeDefaultDescription
$formarrayThe Form Object to be saved.

Returns

  • array — $form The Form Object.

Since: Unknown

Source: form_settings.php:1594

deactivate_save()

public static function deactivate_save( $form )

Handles the saving of confirmation and notifications when deactivating.

Parameters

NameTypeDefaultDescription
$formarrayThe Form Object.

Returns

  • array — $form The Form Object.

Since: Unknown

Source: form_settings.php:1653

toggle_spam_confirmation()

public static function toggle_spam_confirmation( $form )

Adds or removes the custom spam confirmation based on the value of the enableSpamConfirmation toggle.

Parameters

NameTypeDefaultDescription
$formarrayThe form being edited.

Returns

  • array

Since: 2.10.0

Source: form_settings.php:1689

save_form_title()

public static function save_form_title()

Handles the saving of form titles.

Returns

  • void

Since: Unknown

Source: form_settings.php:1732

save_changed_form_settings_fields()

public static function save_changed_form_settings_fields( $form, $values )

Saves new or changed form settings fields to the form object to automatically save custom fields.

Parameters

NameTypeDefaultDescription
$formarrayThe form object.
$valuesarrayThe array of values being saved.

Returns

  • array — $form The Form Object.

Since: 2.5.2

Source: form_settings.php:1774