GFFeedAddOn
Source: includes/addon/class-gf-feed-addon.php:18
Details
- Kind:
class - Namespace:
(global) - Extends: GFAddOn
Properties
| Property | Type | Description |
|---|---|---|
$_multiple_feeds | bool | If 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_submission | bool | If 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_feed | mixed | (bool | Feed Object) |
$_supports_feed_ordering | bool | If true, users can configure what order feeds are executed in from the feed list page. |
$_async_feed_processing | bool | If true, feeds will be processed asynchronously in the background. |
$_supports_frontend_feeds | bool | If true, feeds w/ conditional logic will evaluated on the frontend and a JS event will be triggered when the feed |
$_bypass_feed_delay | bool | If true, maybe_delay_feed() checks will be bypassed allowing the feeds to be processed. |
$_supports_feed_reprocessing | bool | Indicates if the add-on supports processing feeds multiple times for the same entry. |
$delayed_payment_integration | array | An array of properties relating to the delayed payment functionality. |
Methods
| Method | Description |
|---|---|
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. |
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_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
| Name | Type | Default | Description |
|---|---|---|---|
$db_version | Current Gravity Forms database version | ||
$previous_db_version | Previous Gravity Forms database version | ||
$force_upgrade | True 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:
unknown2.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
| Name | Type | Default | Description |
|---|---|---|---|
$entry | array | The Entry Object currently being processed. | |
$form | array | The Form Object currently being processed. |
Returns
array— $entry
Since:
Source: includes/addon/class-gf-feed-addon.php:347
get_feed_name()
public function get_feed_name( $feed, $key='' )
Retrieves the name of the given feed.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$feed | array | The feed. | |
$key | string | '' | Optional. The key used to store the name. |
Returns
string
Since: 2.9.9
Source: includes/addon/class-gf-feed-addon.php:485
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
| Name | Type | Default | Description |
|---|---|---|---|
$result | null | bool | array | WP_Error | Exception | The value returned by process_feed(). | |
$entry_id | int | The ID of the entry the feed was processed for. | |
$feed_id | int | The ID of the feed that was processed. | |
$form_id | int | The ID of the form the entry and feed belong to. |
Returns
void
Since: 2.9.4
Source: includes/addon/class-gf-feed-addon.php:501
post_process_feed()
public function post_process_feed( $feed, $entry, $form )
Triggers the post_process_feed hooks.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$feed | array | The feed which was processed. | |
$entry | array | The entry the feed was processed for. | |
$form | array | The form the entry and feed belong to. |
Returns
void
Since: 2.9.4
Source: includes/addon/class-gf-feed-addon.php:539
fulfill_entry()
public function fulfill_entry( $entry_id, $form_id )
Sets the "{slug}_is_fulfilled" entry meta.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry_id | int | The entry ID. | |
$form_id | int | The form ID. |
Returns
void
Since: 2.9.4
Source: includes/addon/class-gf-feed-addon.php:581
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
| Name | Type | Default | Description |
|---|---|---|---|
$entry | array | The Entry Object currently being processed. | |
$form | array | The Form Object currently being processed. |
Returns
bool
Source: includes/addon/class-gf-feed-addon.php:597
is_delayed()
public function is_delayed( $payment_feed )
Retrieves the delay setting for the current add-on from the payment feed.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$payment_feed | array | The payment feed which is being used to process the current submission. |
Returns
bool|null
Source: includes/addon/class-gf-feed-addon.php:626
is_asynchronous()
public function is_asynchronous( $feed, $entry, $form )
Determines if feed processing should happen asynchronously.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$feed | array | The Feed Object currently being processed. | |
$entry | array | The Entry Object currently being processed. | |
$form | array | The Form Object currently being processed. |
Returns
bool
Since: 2.2
Source: includes/addon/class-gf-feed-addon.php:644
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
| Name | Type | Default | Description |
|---|---|---|---|
$feed | array | The feed to be processed | |
$entry | array | The entry being processed. | |
$form | array | The form that the entry belongs to |
Returns
bool
Since: 2.9.2
Source: includes/addon/class-gf-feed-addon.php:676
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
| Name | Type | Default | Description |
|---|---|---|---|
$feed | array | The feed being processing. | |
$entry | array | The entry being processed. | |
$form | array | The 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:691
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
| Name | Type | Default | Description |
|---|---|---|---|
$retry | bool | Indicates if the feed can be retried following an error. Default is true. | |
$error | WP_Error | The error that occurred during feed processing. | |
$feed | array | The feed that was processed. | |
$entry | array | The entry the feed was processed for. | |
$form | array | The form the entry and feed belong to. |
Returns
bool
Since: 2.9.25
Source: includes/addon/class-gf-feed-addon.php:766
process_feed()
public function process_feed( $feed, $entry, $form )
Processes feed action.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$feed | array | The Feed Object currently being processed. | |
$entry | array | The Entry Object currently being processed. | |
$form | array | The 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:
Unknown2.9.4(Documented the supported return types for saving the feed status.)
Source: includes/addon/class-gf-feed-addon.php:799
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:830
verify_feed_nonce()
public function verify_feed_nonce( $nonce )
Verify nonce for asynchronous feed processing.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$nonce | string | Nonce to be verified. |
Returns
int|bool
Since: 1.0
Source: includes/addon/class-gf-feed-addon.php:848
supported_notification_events()
public function supported_notification_events( $form )
Retrieves notification events supported by Add-On.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array |
Returns
array
Source: includes/addon/class-gf-feed-addon.php:877
notification_events()
public function notification_events( $events, $form )
Add notifications events supported by Add-On to notification events list.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$events | array | ||
$form | array |
Returns
array— $events
Source: includes/addon/class-gf-feed-addon.php:891
get_feeds()
public function get_feeds( $form_id=null )
Gets the feeds for the specified form id.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | int | null | The form id to get feeds for. |
Returns
array— Returns an array of feeds for the specified form id.
Since:
Unknown2.7.17(Added support for decrypting settings fields.)
Source: includes/addon/class-gf-feed-addon.php:917
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
| Name | Type | Default | Description |
|---|---|---|---|
$slug | string | The addon slug to get feeds for. | |
$form_id | int | null | (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:
Unknown2.7.17(Added support for decrypting settings fields.)
Source: includes/addon/class-gf-feed-addon.php:978
get_feed()
public function get_feed( $id )
Gets a feed by its id.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$id | int | The feed id. |
Returns
array— Returns the feed array if found, false otherwise.
Since:
Unknown2.7.17(Added support for decrypting settings fields.)
Source: includes/addon/class-gf-feed-addon.php:1026
get_single_submission_feed_by_form()
public function get_single_submission_feed_by_form( $form, $entry )
Return the active feed to be used when processing the current entry, evaluating conditional logic if configured.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The current form. | |
$entry | array | false | The current entry. |
Returns
bool|array
Source: includes/addon/class-gf-feed-addon.php:1128
pre_process_feeds()
public function pre_process_feeds( $feeds, $entry, $form )
Allows the feeds to be filtered before they are processed.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$feeds | false | array | False or an array of feeds for the current form. | |
$entry | array | The entry being processed. | |
$form | array | The form the entry and feeds belong to. |
Returns
false|array
Since: 2.0
Source: includes/addon/class-gf-feed-addon.php:1154
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:1191
update_feed_meta()
public function update_feed_meta( $id, $meta )
Updates the feed meta
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$id | int | Feed ID | |
$meta | array | Feed meta to be updated |
Returns
bool
Since:
Unknown2.7.17(Added support for encrypting of settings fields.)
Source: includes/addon/class-gf-feed-addon.php:1271
insert_feed()
public function insert_feed( $form_id, $is_active, $meta )
Insert a new feed record.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | int | Form ID. | |
$is_active | bool | If the feed is active or not. | |
$meta | array | Feed meta |
Returns
false|int— Returns the ID of the newly created feed or false if the feed table does not exist.
Since:
Unknown2.7.17(Added support for encrypting settings fields.)
Source: includes/addon/class-gf-feed-addon.php:1317
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:1340
duplicate_feed()
public function duplicate_feed( $id, $new_form_id=false )
Duplicates the feed.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$id | int | array | The ID of the feed to be duplicated or the feed object when duplicating a form. | |
$new_form_id | mixed | false | False 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:1419
post_form_duplicated()
public function post_form_duplicated( $form_id, $new_id )
Maybe duplicate feeds when a form is duplicated.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | int | The ID of the original form. | |
$new_id | int | The ID of the duplicate form. |
Source: includes/addon/class-gf-feed-addon.php:1528
save_feed_order()
public function save_feed_order( $feed_order )
Save order of feeds.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$feed_order | array | Array of feed IDs in desired order. |
Since: 2.0
Source: includes/addon/class-gf-feed-addon.php:1550
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:1733
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:1772
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
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The form the feed is being created or edited for. | |
$entry_meta | array | [] | 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:1892
feed_edit_page()
public function feed_edit_page( $form, $feed_id )
Render feed edit page.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | Current Form object. | |
$feed_id | int | Current feed ID. |
Since: Unknown
Source: includes/addon/class-gf-feed-addon.php:1913
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:2267
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:2276
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:2297
can_duplicate_feed()
public function can_duplicate_feed( $id )
Override this function to allow the feed to being duplicated.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$id | int | array | The 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:2308
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
| Name | Type | Default | Description |
|---|---|---|---|
$feed_settings_fields | array | The PayPal feed settings. |
Returns
array
Since:
2.4.13(Call $this->add_post_payment_actions().)Unknown
Source: includes/addon/class-gf-feed-addon.php:2473
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
| Name | Type | Default | Description |
|---|---|---|---|
$feed_settings_fields | array | The add-on feed settings. | |
$addon | GFAddOn | The 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:2494
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
| Name | Type | Default | Description |
|---|---|---|---|
$transaction_id | string | The transaction or subscription ID. | |
$payment_feed | array | The payment feed which originated the transaction. | |
$entry | array | The entry currently being processed. | |
$form | null | array | null | The form currently being processed or null for the legacy PayPal integration. |
Since: 2.4.13
Source: includes/addon/class-gf-feed-addon.php:2563
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
| Name | Type | Default | Description |
|---|---|---|---|
$error_message | string | The error message. | |
$feed | array | The feed which was being processed when the error occurred. | |
$entry | array | The entry which was being processed when the error occurred. | |
$form | array | The form which was being processed when the error occurred. |
Since: 1.9.12
Source: includes/addon/class-gf-feed-addon.php:2593