gform_spinner_url

gform_spinner_url

DescriptionUsageParametersExamplePlacementSinceSource Code

Description
Allows modifying the spinner URL when the gformAddSpinner() function is called directly.
If the spinner URL is not implemented using the gformAddSpinner function, the URL should be changed using the gform_ajax_spinner_url filter.
Usage
gform.addFilter('gform_spinner_url', 'change_spinner');
function change_spinner(){ spinnerUrl, formId )
//do something here
return spinnerUrl;
}

Parameters

spinnerUrl string
The URL to the image used for the spinner.

formId int
The current form ID.

Example
gform.addFilter('gform_spinner_url', 'change_spinner');
function change_spinner(){ spinnerUrl, formId )
spinnerUrl = 'https://your-domain-here.test/wp-content/uploads/spinner.svg';
return spinnerUrl;
}

Placement
This code should be placed in a custom JavaScript file used by your theme.
Since
This filter was added in Gravity Forms version 1.8.
Source Code
This filter is located in gformAddSpinner() in js/gravityforms.js.

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注