Skip to main content

GFFeedAddOn

Source: includes/addon/class-gf-feed-addon.php:18

Details​

  • Kind: class
  • Namespace: (global)
  • Extends: GFAddOn

Properties​

PropertyTypeDescription
$_multiple_feedsboolIf set to true, Add-On can have multiple feeds configured. If set to false, feed list page doesn't exist and only one feed can be configured.
$_single_feed_submissionboolIf true, only first matching feed will be processed. Multiple feeds can still be configured, but only one is executed during the submission (i.e. Payment Add-Ons)
$_single_submission_feedmixed(bool | Feed Object)
$_supports_feed_orderingboolIf true, users can configure what order feeds are executed in from the feed list page.
$_async_feed_processingboolIf true, feeds will be processed asynchronously in the background.
$_supports_frontend_feedsboolIf true, feeds w/ conditional logic will evaluated on the frontend and a JS event will be triggered when the feed
$_bypass_feed_delayboolIf true, maybe_delay_feed() checks will be bypassed allowing the feeds to be processed.
$_supports_feed_reprocessingboolIndicates if the add-on supports processing feeds multiple times for the same entry.
$delayed_payment_integrationarrayAn array of properties relating to the delayed payment functionality.

Methods​

MethodDescription
get_registered_feed_addons()Gets all active, registered feed add-ons.
bootstrap()Attaches any filters or actions needed to bootstrap the addon.
init()Plugin starting point. Handles hooks and loading of language files.
init_ajax()Override this function to add AJAX hooks or to add initialization code when an AJAX request is being performed
init_admin()Override this function to add initialization code (i.e. hooks) for the admin site (WP dashboard)
setup()Performs upgrade tasks when the version of the Add-On changes. To add additional upgrade tasks, override the upgrade() function, which will only get executed when the plugin version has changed.
post_gravityforms_upgrade()Gets called when Gravity Forms upgrade process is completed. This function is intended to be used internally, override the upgrade() function to execute database update scripts.
uninstall()Deletes the feeds and clears queued background tasks on uninstall.
maybe_process_feed()Determines what feeds need to be processed for the provided entry.
get_feed_name()Retrieves the name of the given feed.
save_entry_feed_status()Saves the status of the given feed to the "feed_{$feed_id}_status" entry meta.
post_process_feed()Triggers the post_process_feed hooks.
fulfill_entry()Sets the "{slug}_is_fulfilled" entry meta.
maybe_delay_feed()Determines if feed processing is delayed by another add-on.
is_delayed()Retrieves the delay setting for the current add-on from the payment feed.
is_asynchronous()Determines if feed processing should happen asynchronously.
is_reprocessing_supported()Determines if the add-on supports processing feeds multiple times for the same entry (e.g. by the async processor).
can_process_feed()Determines if the feed can be processed based on the contents of the processed feeds entry meta.
is_feed_error_retryable()Determines if the feed should remain in the queue for another attempt based on the error that occurred during processing.
process_feed()Processes feed action.
is_feed_condition_met()Determines if the feed should be processed based on the conditional logic rules.
has_payment_status_condition()Determines if the given feed has a conditional logic rule based on the entry payment status.
create_feed_nonce()Create nonce for asynchronous feed processing.
verify_feed_nonce()Verify nonce for asynchronous feed processing.
supported_notification_events()Retrieves notification events supported by Add-On.
notification_events()Add notifications events supported by Add-On to notification events list.
get_feeds()Gets the feeds for the specified form id.
get_feeds_by_slug()Gets the feeds for the specified addon slug and form id.
get_feed()Gets a feed by its id.
get_single_submission_feed()Return the active feed to be used when processing the given form and entry, evaluating conditional logic if configured.
get_single_submission_feed_by_form()Return the active feed to be used when processing the current entry, evaluating conditional logic if configured.
pre_process_feeds()Allows the feeds to be filtered before they are processed.
get_default_feed_name()Get default feed name.
update_feed_meta()Updates the feed meta
insert_feed()Insert a new feed record.
get_fields_to_encrypt()Get the array of feed settings field names that are configured to be encrypted.
duplicate_feed()Duplicates the feed.
post_form_duplicated()Maybe duplicate feeds when a form is duplicated.
save_feed_order()Save order of feeds.
is_feed_edit_page()Determine if the current view is the screen for editing a form's feed settings for a given add-on.
feed_settings_init()Initialize feed settings page.
get_feed_settings_entry_meta()Returns an array of entry meta fields to be assigned to the JavaScript entry_meta variable used by the feed condition setting.
feed_edit_page()Render feed edit page.
feed_list_no_item_message()Override this function to change the message that is displayed when the feed list is empty
feed_list_message()Override this function to force a message to be displayed in the feed list (instead of data). Useful to alert users when main plugin settings haven't been completed.
can_create_feed()Override this function to prevent the feed creation UI from being rendered.
can_duplicate_feed()Override this function to allow the feed to being duplicated.
add_paypal_post_payment_actions()Add the Post Payments Actions setting to the PayPal feed.
add_post_payment_actions()Add the Post Payments Actions setting to the payment add-on feed.
action_trigger_payment_delayed_feeds()Triggers processing of feeds delayed by payment add-ons.
add_feed_error()Writes to the add-on log and adds an entry note when a feed processing error occurs.

Method Reference​

get_registered_feed_addons()​

public static function get_registered_feed_addons()

Gets all active, registered feed add-ons.

Returns​

  • (GFFeedAddOn | GFPaymentAddOn)[]

Since: 2.9.2

Source: includes/addon/class-gf-feed-addon.php:116

bootstrap()​

public function bootstrap()

Attaches any filters or actions needed to bootstrap the addon.

Since: 2.5.2

Source: includes/addon/class-gf-feed-addon.php:129

init()​

public function init()

Plugin starting point. Handles hooks and loading of language files.

Source: includes/addon/class-gf-feed-addon.php:147

init_ajax()​

public function init_ajax()

Override this function to add AJAX hooks or to add initialization code when an AJAX request is being performed

Source: includes/addon/class-gf-feed-addon.php:166

init_admin()​

public function init_admin()

Override this function to add initialization code (i.e. hooks) for the admin site (WP dashboard)

Source: includes/addon/class-gf-feed-addon.php:178

setup()​

public function setup()

Performs upgrade tasks when the version of the Add-On changes. To add additional upgrade tasks, override the upgrade() function, which will only get executed when the plugin version has changed.

Source: includes/addon/class-gf-feed-addon.php:191

post_gravityforms_upgrade()​

public function post_gravityforms_upgrade( $db_version, $previous_db_version, $force_upgrade )

Gets called when Gravity Forms upgrade process is completed. This function is intended to be used internally, override the upgrade() function to execute database update scripts.

Parameters​

NameTypeDefaultDescription
$db_versionCurrent Gravity Forms database version
$previous_db_versionPrevious Gravity Forms database version
$force_upgradeTrue if this is a request to force an upgrade. False if this is a standard upgrade (due to version change)

Source: includes/addon/class-gf-feed-addon.php:235

uninstall()​

public function uninstall()

Deletes the feeds and clears queued background tasks on uninstall.

Returns​

  • void

Since:

  • unknown
  • 2.9.25 (Updated to clear queued background tasks.)

Source: includes/addon/class-gf-feed-addon.php:318

maybe_process_feed()​

public function maybe_process_feed( $entry, $form )

Determines what feeds need to be processed for the provided entry.

Parameters​

NameTypeDefaultDescription
$entryarrayThe Entry Object currently being processed.
$formarrayThe Form Object currently being processed.

Returns​

  • array — $entry

Since:

  • 1.7.7
  • 2.9.4 (Updated to save the processing status for each feed of compatible add-ons.)
  • 3.2.0 (Updated to run delay_feed() when the feed has a condition based on the payment status and the form submission is being processed.)

Source: includes/addon/class-gf-feed-addon.php:348

get_feed_name()​

public function get_feed_name( $feed, $key='' )

Retrieves the name of the given feed.

Parameters​

NameTypeDefaultDescription
$feedarrayThe feed.
$keystring''Optional. The key used to store the name.

Returns​

  • string

Since: 2.9.9

Source: includes/addon/class-gf-feed-addon.php:486

save_entry_feed_status()​

public function save_entry_feed_status( $result, $entry_id, $feed_id, $form_id )

Saves the status of the given feed to the "feed_{$feed_id}_status" entry meta.

Parameters​

NameTypeDefaultDescription
$resultnull | bool | array | WP_Error | ExceptionThe value returned by process_feed().
$entry_idintThe ID of the entry the feed was processed for.
$feed_idintThe ID of the feed that was processed.
$form_idintThe ID of the form the entry and feed belong to.

Returns​

  • void

Since: 2.9.4

Source: includes/addon/class-gf-feed-addon.php:502

post_process_feed()​

public function post_process_feed( $feed, $entry, $form )

Triggers the post_process_feed hooks.

Parameters​

NameTypeDefaultDescription
$feedarrayThe feed which was processed.
$entryarrayThe entry the feed was processed for.
$formarrayThe form the entry and feed belong to.

Returns​

  • void

Since: 2.9.4

Source: includes/addon/class-gf-feed-addon.php:540

fulfill_entry()​

public function fulfill_entry( $entry_id, $form_id )

Sets the "{slug}_is_fulfilled" entry meta.

Parameters​

NameTypeDefaultDescription
$entry_idintThe entry ID.
$form_idintThe form ID.

Returns​

  • void

Since: 2.9.4

Source: includes/addon/class-gf-feed-addon.php:582

maybe_delay_feed()​

public function maybe_delay_feed( $entry, $form )

Determines if feed processing is delayed by another add-on.

Also enables use of the gform_is_delayed_pre_process_feed filter.

Parameters​

NameTypeDefaultDescription
$entryarrayThe Entry Object currently being processed.
$formarrayThe Form Object currently being processed.

Returns​

  • bool

Source: includes/addon/class-gf-feed-addon.php:598

is_delayed()​

public function is_delayed( $payment_feed )

Retrieves the delay setting for the current add-on from the payment feed.

Parameters​

NameTypeDefaultDescription
$payment_feedarrayThe payment feed which is being used to process the current submission.

Returns​

  • bool | null

Source: includes/addon/class-gf-feed-addon.php:627

is_asynchronous()​

public function is_asynchronous( $feed, $entry, $form )

Determines if feed processing should happen asynchronously.

Parameters​

NameTypeDefaultDescription
$feedarrayThe Feed Object currently being processed.
$entryarrayThe Entry Object currently being processed.
$formarrayThe Form Object currently being processed.

Returns​

  • bool

Since: 2.2

Source: includes/addon/class-gf-feed-addon.php:645

is_reprocessing_supported()​

public function is_reprocessing_supported( $feed, $entry, $form )

Determines if the add-on supports processing feeds multiple times for the same entry (e.g. by the async processor).

Parameters​

NameTypeDefaultDescription
$feedarrayThe feed to be processed
$entryarrayThe entry being processed.
$formarrayThe form that the entry belongs to

Returns​

  • bool

Since: 2.9.2

Source: includes/addon/class-gf-feed-addon.php:677

can_process_feed()​

public function can_process_feed( $feed, $entry, $form )

Determines if the feed can be processed based on the contents of the processed feeds entry meta.

Parameters​

NameTypeDefaultDescription
$feedarrayThe feed being processing.
$entryarrayThe entry being processed.
$formarrayThe form the entry belongs to.

Returns​

  • bool — Returns true if the feed can be processed, otherwise false.

Since: 2.9.19

Source: includes/addon/class-gf-feed-addon.php:692

is_feed_error_retryable()​

public function is_feed_error_retryable( $retry, $error, $feed, $entry, $form )

Determines if the feed should remain in the queue for another attempt based on the error that occurred during processing.

If overriding in an add-on, call the parent method last to trigger the filter.

Parameters​

NameTypeDefaultDescription
$retryboolIndicates if the feed can be retried following an error. Default is true.
$errorWP_ErrorThe error that occurred during feed processing.
$feedarrayThe feed that was processed.
$entryarrayThe entry the feed was processed for.
$formarrayThe form the entry and feed belong to.

Returns​

  • bool

Since: 2.9.25

Source: includes/addon/class-gf-feed-addon.php:767

process_feed()​

public function process_feed( $feed, $entry, $form )

Processes feed action.

Parameters​

NameTypeDefaultDescription
$feedarrayThe Feed Object currently being processed.
$entryarrayThe Entry Object currently being processed.
$formarrayThe Form Object currently being processed.

Returns​

  • void | null | bool | WP_Error | array — The returned value determines if the feed status is saved to the "feed_{$feed_id}_status" entry meta. - void or null when the feed status should not be saved. - false or a WP_Error when a failed status should be saved. - true or the entry array when a success status should be saved.

Since:

  • Unknown
  • 2.9.4 (Documented the supported return types for saving the feed status.)

Source: includes/addon/class-gf-feed-addon.php:800

is_feed_condition_met()​

public function is_feed_condition_met( $feed, $form, $entry, $without_payment_status_rule=false )

Determines if the feed should be processed based on the conditional logic rules.

Parameters​

NameTypeDefaultDescription
$feedarrayThe feed to be evaluated.
$formarrayThe form the feed belongs to.
$entryarrayThe current entry.
$without_payment_status_ruleboolfalseIf true, the payment status rule will be removed before the rules are evaluated.

Returns​

  • bool

Since:

  • unknown
  • 3.2.0 (Added the $without_payment_status_rule param.)

Source: includes/addon/class-gf-feed-addon.php:823

has_payment_status_condition()​

public function has_payment_status_condition( $feed )

Determines if the given feed has a conditional logic rule based on the entry payment status.

Parameters​

NameTypeDefaultDescription
$feedarrayThe feed to check.

Returns​

  • bool

Since: 3.2.0

Source: includes/addon/class-gf-feed-addon.php:860

create_feed_nonce()​

public function create_feed_nonce()

Create nonce for asynchronous feed processing.

Returns​

  • string — The nonce.

Since: 2.2

Source: includes/addon/class-gf-feed-addon.php:883

verify_feed_nonce()​

public function verify_feed_nonce( $nonce )

Verify nonce for asynchronous feed processing.

Parameters​

NameTypeDefaultDescription
$noncestringNonce to be verified.

Returns​

  • int | bool

Since: 1.0

Source: includes/addon/class-gf-feed-addon.php:901

supported_notification_events()​

public function supported_notification_events( $form )

Retrieves notification events supported by Add-On.

Parameters​

NameTypeDefaultDescription
$formarray

Returns​

  • array

Source: includes/addon/class-gf-feed-addon.php:930

notification_events()​

public function notification_events( $events, $form )

Add notifications events supported by Add-On to notification events list.

Parameters​

NameTypeDefaultDescription
$eventsarray
$formarray

Returns​

  • array — $events

Source: includes/addon/class-gf-feed-addon.php:944

get_feeds()​

public function get_feeds( $form_id=null )

Gets the feeds for the specified form id.

Parameters​

NameTypeDefaultDescription
$form_idintnullThe form id to get feeds for.

Returns​

  • array — Returns an array of feeds for the specified form id.

Since:

  • Unknown
  • 2.7.17 (Added support for decrypting settings fields.)

Source: includes/addon/class-gf-feed-addon.php:970

get_feeds_by_slug()​

public function get_feeds_by_slug( $slug, $form_id=null )

Gets the feeds for the specified addon slug and form id.

Parameters​

NameTypeDefaultDescription
$slugstringThe addon slug to get feeds for.
$form_idintnull(optional) The form id to get feeds for. If not specified, all feeds for the specified addon slug will be returned.

Returns​

  • array — Returns an array of feeds for the specified form id.

Since:

  • Unknown
  • 2.7.17 (Added support for decrypting settings fields.)

Source: includes/addon/class-gf-feed-addon.php:1031

get_feed()​

public function get_feed( $id )

Gets a feed by its id.

Parameters​

NameTypeDefaultDescription
$idintThe feed id.

Returns​

  • array — Returns the feed array if found, false otherwise.

Since:

  • Unknown
  • 2.7.17 (Added support for decrypting settings fields.)

Source: includes/addon/class-gf-feed-addon.php:1079

get_single_submission_feed()​

public function get_single_submission_feed( $entry=false, $form=false, $check_for_payment_status_rule=false )

Return the active feed to be used when processing the given form and entry, evaluating conditional logic if configured.

Parameters​

NameTypeDefaultDescription
$entryfalse | arrayfalseThe current entry.
$formfalse | arrayfalseThe current form.
$check_for_payment_status_ruleboolfalseWhether to check if a feed has a conditional logic rule based on the entry payment status.

Returns​

  • bool | array

Since:

  • unknown
  • 3.2.0 (Added the $check_for_payment_status_rule param.)

Source: includes/addon/class-gf-feed-addon.php:1161

get_single_submission_feed_by_form()​

public function get_single_submission_feed_by_form( $form, $entry, $check_for_payment_status_rule=false )

Return the active feed to be used when processing the current entry, evaluating conditional logic if configured.

Parameters​

NameTypeDefaultDescription
$formarrayThe current form.
$entryarray | falseThe current entry.
$check_for_payment_status_ruleboolfalseWhether to check if a feed has a conditional logic rule based on the entry payment status.

Returns​

  • bool | array

Since:

  • 1.9.16
  • 3.2.0 (Added the $check_for_payment_status_rule param.)

Source: includes/addon/class-gf-feed-addon.php:1197

pre_process_feeds()​

public function pre_process_feeds( $feeds, $entry, $form )

Allows the feeds to be filtered before they are processed.

Parameters​

NameTypeDefaultDescription
$feedsfalse | arrayFalse or an array of feeds for the current form.
$entryarrayThe entry being processed.
$formarrayThe form the entry and feeds belong to.

Returns​

  • false | array

Since: 2.0

Source: includes/addon/class-gf-feed-addon.php:1230

get_default_feed_name()​

public function get_default_feed_name()

Get default feed name.

Returns​

  • string

Since: Unknown

Source: includes/addon/class-gf-feed-addon.php:1267

update_feed_meta()​

public function update_feed_meta( $id, $meta )

Updates the feed meta

Parameters​

NameTypeDefaultDescription
$idintFeed ID
$metaarrayFeed meta to be updated

Returns​

  • bool

Since:

  • Unknown
  • 2.7.17 (Added support for encrypting of settings fields.)

Source: includes/addon/class-gf-feed-addon.php:1347

insert_feed()​

public function insert_feed( $form_id, $is_active, $meta )

Insert a new feed record.

Parameters​

NameTypeDefaultDescription
$form_idintForm ID.
$is_activeboolIf the feed is active or not.
$metaarrayFeed meta

Returns​

  • false | int — Returns the ID of the newly created feed or false if the feed table does not exist.

Since:

  • Unknown
  • 2.7.17 (Added support for encrypting settings fields.)

Source: includes/addon/class-gf-feed-addon.php:1393

get_fields_to_encrypt()​

public function get_fields_to_encrypt()

Get the array of feed settings field names that are configured to be encrypted.

Returns​

  • array — Returns an array with all field names that are configured to be encrypted.

Since: 2.7.16

Source: includes/addon/class-gf-feed-addon.php:1416

duplicate_feed()​

public function duplicate_feed( $id, $new_form_id=false )

Duplicates the feed.

Parameters​

NameTypeDefaultDescription
$idint | arrayThe ID of the feed to be duplicated or the feed object when duplicating a form.
$new_form_idmixedfalseFalse when using feed actions or the ID of the new form when duplicating a form.

Returns​

  • int — New feed ID.

Since: 1.9.15

Source: includes/addon/class-gf-feed-addon.php:1495

post_form_duplicated()​

public function post_form_duplicated( $form_id, $new_id )

Maybe duplicate feeds when a form is duplicated.

Parameters​

NameTypeDefaultDescription
$form_idintThe ID of the original form.
$new_idintThe ID of the duplicate form.

Source: includes/addon/class-gf-feed-addon.php:1604

save_feed_order()​

public function save_feed_order( $feed_order )

Save order of feeds.

Parameters​

NameTypeDefaultDescription
$feed_orderarrayArray of feed IDs in desired order.

Since: 2.0

Source: includes/addon/class-gf-feed-addon.php:1626

is_feed_edit_page()​

public function is_feed_edit_page()

Determine if the current view is the screen for editing a form's feed settings for a given add-on.

This method first evaluates some base criteria (whether we're in the right view of the Gravity Forms admin), before determining if we're on the feed edit page depending on add-on specific configuration.

Returns​

  • bool

Since: 2.5

Source: includes/addon/class-gf-feed-addon.php:1809

feed_settings_init()​

public function feed_settings_init()

Initialize feed settings page.

Creates new instance of Settings framework.

Since: 2.5

Source: includes/addon/class-gf-feed-addon.php:1848

get_feed_settings_entry_meta()​

public function get_feed_settings_entry_meta( $form, $entry_meta=[] )

Returns an array of entry meta fields to be assigned to the JavaScript entry_meta variable used by the feed condition setting.

Parameters​

NameTypeDefaultDescription
$formarrayThe form the feed is being created or edited for.
$entry_metaarray[]An empty array or the entry meta fields to be assigned to the JavaScript entry_meta variable.

Returns​

  • array

Since: 2.9

Source: includes/addon/class-gf-feed-addon.php:1968

feed_edit_page()​

public function feed_edit_page( $form, $feed_id )

Render feed edit page.

Parameters​

NameTypeDefaultDescription
$formarrayCurrent Form object.
$feed_idintCurrent feed ID.

Since: Unknown

Source: includes/addon/class-gf-feed-addon.php:1989

feed_list_no_item_message()​

public function feed_list_no_item_message()

Override this function to change the message that is displayed when the feed list is empty

Returns​

  • string — The message

Source: includes/addon/class-gf-feed-addon.php:2343

feed_list_message()​

public function feed_list_message()

Override this function to force a message to be displayed in the feed list (instead of data). Useful to alert users when main plugin settings haven't been completed.

Returns​

  • string | false

Source: includes/addon/class-gf-feed-addon.php:2352

can_create_feed()​

public function can_create_feed()

Override this function to prevent the feed creation UI from being rendered.

Returns​

  • boolean | true

Source: includes/addon/class-gf-feed-addon.php:2373

can_duplicate_feed()​

public function can_duplicate_feed( $id )

Override this function to allow the feed to being duplicated.

Parameters​

NameTypeDefaultDescription
$idint | arrayThe ID of the feed to be duplicated or the feed object when duplicating a form.

Returns​

  • boolean | true

Source: includes/addon/class-gf-feed-addon.php:2384

add_paypal_post_payment_actions()​

public function add_paypal_post_payment_actions( $feed_settings_fields )

Add the Post Payments Actions setting to the PayPal feed.

Parameters​

NameTypeDefaultDescription
$feed_settings_fieldsarrayThe PayPal feed settings.

Returns​

  • array

Since:

  • 2.4.13 (Call $this->add_post_payment_actions().)
  • Unknown

Source: includes/addon/class-gf-feed-addon.php:2549

add_post_payment_actions()​

public function add_post_payment_actions( $feed_settings_fields, $addon )

Add the Post Payments Actions setting to the payment add-on feed.

Parameters​

NameTypeDefaultDescription
$feed_settings_fieldsarrayThe add-on feed settings.
$addonGFAddOnThe current instance of the add-on (i.e. GF_User_Registration, GFPayPal).

Returns​

  • array

Since:

  • 2.4.13 (Added the $addon arg enabling support for other payment add-ons.)
  • Unknown

Source: includes/addon/class-gf-feed-addon.php:2570

action_trigger_payment_delayed_feeds()​

public function action_trigger_payment_delayed_feeds( $transaction_id, $payment_feed, $entry, $form=null )

Triggers processing of feeds delayed by payment add-ons.

Parameters​

NameTypeDefaultDescription
$transaction_idstringThe transaction or subscription ID.
$payment_feedarrayThe payment feed which originated the transaction.
$entryarrayThe entry currently being processed.
$formnull | arraynullThe form currently being processed or null for the legacy PayPal integration.

Since: 2.4.13

Source: includes/addon/class-gf-feed-addon.php:2639

add_feed_error()​

public function add_feed_error( $error_message, $feed, $entry, $form )

Writes to the add-on log and adds an entry note when a feed processing error occurs.

Parameters​

NameTypeDefaultDescription
$error_messagestringThe error message.
$feedarrayThe feed which was being processed when the error occurred.
$entryarrayThe entry which was being processed when the error occurred.
$formarrayThe form which was being processed when the error occurred.

Since: 1.9.12

Source: includes/addon/class-gf-feed-addon.php:2669