Description
The gform_aweber_post_subscriber_created hook can be used to perform custom actions after the subscriber has been successfully added to the AWeber list.
Usage
The hook which would run for all AWeber feeds can be used like so:
add_filter( 'gform_aweber_post_subscriber_created', 'your_function_name', 10, 4 );
Parameters
| Parameter | Type | Description |
|---|---|---|
$subscriber | array | An associative array containing the subscriber properties returned by AWeber in the response to the create request. |
$form | Form Object | The Form which is currently being processed. |
$entry | Entry Object | The Entry which is currently being processed. |
$feed | Feed Object | The Feed which is currently being processed. |
Examples
Store a property in the entry meta.
The following example shows how you can store the value from one of the subscriber properties in the entry meta.
add_action( 'gform_aweber_post_subscriber_created', function ( $subscriber, $form, $entry, $feed ) {
gform_update_meta( $entry['id'], 'aweber_subscriber_status', rgar( $subscriber, 'status' ) );
}, 10, 4 );
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Since
This hook was added in AWeber version 2.4.1.
Source Code
This filter is located in GFAWeber::export_feed() in class-gf-aweber.php.