gform_square_show_custom_app_settings

Description

The gform_square_show_custom_app_settings filter allows displaying the custom app settings link in the Square add-on settings page.

Usage

add_filter( 'gform_square_show_custom_app_settings', 'your_function_name', 10, 1 );

Parameters

  • $show_settings bool

    Defaults to false, return true to show custom app settings.

Examples

add_filter( 'gform_square_show_custom_app_settings', '__return_true' );

Placement

Your code snippet should be placed in the functions.php file of your active theme.

Input for Custom App Settings for Square

After you’ve added the filter above, you will have a new option in the Form > Settings > Square Settings screen:

Square Settings Custom Application Option

You will have a new link underneath the regular Mode selection for Square to “I want to use a custom app”. Selecting this link will present you with a new screen to input your Custom Application authentication:

Square Settings Custom Application Authentication Option Settings

In addition to the regular Mode Settings for Square (Live and Sandbox), the following three fields are available:

  1. OAuth Redirect URI: This will change depending on whether you are pointing to Live or Sandbox, but the URI is not editable.
  2. App ID: This input will be provided by the Custom Application settings in Square and you can copy and paste them from the Square configuration.
  3. App Secret: This will also be provided by the Custom Application settings in Square.

If you no longer wish to use a Custom App Settings, click the link for “I do not want to use a custom app”.

Since

This filter was added in Square version 1.0.

Source Code

$show_settings = apply_filters( 'gform_square_show_custom_app_settings', false );

This hook is located in GF_Square::show_custom_app_settings() in class-gf-square.php.