gform_signature_url

Description

The gform_signature_url filter allows the signature URL to be customized.

Usage

The base filter which would run for all forms would be used like so:

add_filter( 'gform_signature_url', 'your_function_name', 10, 4 );

You can also target all signature fields in a form by adding the form id after the hook name.

// The following declaration targets all fields in form 6
add_filter( 'gform_signature_url_6', 'your_function_name', 10, 4 );

You can also target a specific field by adding the form id and field id after the hook name.

// The following declaration targets field 1 in form 6
add_filter( 'gform_signature_url_6_1', 'your_function_name', 10, 4 );

Parameters

  • $url string

    The signature URL.

  • $filename string

    The signature filename excluding extension.

  • $form_id int

    The ID of the form used to create the requested signature.

  • $field_id int

    The ID of the field used to create the requested signature.

Examples

1. Enable transparency

add_filter( 'gform_signature_url', 'enable_signature_transparency', 10, 4 );
function enable_signature_transparency( $url, $file_name, $form_id, $field_id ){

return add_query_arg( 't', 1, $url );
}

Placement

This code should be placed in the functions.php file of your active theme or a custom functions plugin.

Since

This filter was added in version 4.0.

Source Code

This filter is located in GF_Signature_Image::get_url() in includes/class-gf-signature-image.php.