The gform_paypal_action_fields action is used to add individual options to the PayPal feed.
Usage
add_action('gform_paypal_action_fields', 'add_paypal_options', 10, 2);
Parameters
- $feed (Feed Object): The configuration details for the current feed. This will be empty when initially creating a new form.
- $form (Form Object): The form for the current feed. This will be empty when initially creating a new form.
More information
See Gravity Forms Docs: gform_paypal_action_fields
Examples
Add a custom option with a checkbox
This example adds a checkbox field which would enable/disable a custom option.
add_action('gform_paypal_action_fields', 'add_paypal_options', 10, 2); function add_paypal_options($feed, $form) { ?> <li id="my_third_party_option"> <input type="checkbox" value="1" id="paypal_my_third_party" name="paypal_my_third_party"> <label for="paypal_my_third_party" class="inline">Send transactions to My Third Party</label> </li> <?php }
Note: Since this is an action hook, there is no need for a return statement. The provided code snippet adds a custom option directly to the PayPal feed settings.