gform_max_async_feed_attempts

Description

Allows the number of retries to be modified before the feed is abandoned.

Usage

add_filter( 'gform_max_async_feed_attempts', 'your_filter_name', 10, 5 );

Parameters

  • $max_attempts int

    The maximum number of retries allowed. The default is 1.

  • $form Form Object

    The form object.

  • $entry Entry Object

    The entry object.

  • $addon_slug string

    The add-on slug.

  • $feed Feed Object

    The feed object.

Examples

add_filter( 'gform_max_async_feed_attempts', 'filter_gform_max_async_feed_attempts', 10, 5 );
function filter_gform_max_async_feed_attempts( $max_attempts, $form, $entry, $addon_slug, $feed ) {
    if ( $addon_slug == 'gravityformswebhooks' ) {
	    $max_attempts = 2;
    }

    return $max_attempts;
}

Placement

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

Since

This filter was added in Gravity Forms 2.4.

Source Code

This filter is located in GF_Feed_Processor::task() in class-gf-feed-processor.php.