gform_spinner_url

Note: This filter was removed in Gravity Forms 3.0.0 and is no longer supported. Gravity Forms transitioned from image-based spinners to CSS animations. To use a custom image spinner instead, you can implement this CSS snippet.

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.