gform_paypal_add_option_group

Description

This hook is used to add groups of options to the PayPal feed.

Usage

add_filter( 'gform_paypal_add_option_group', 'your_function_name', 10, 2 );

Parameters

ParameterTypeDescription
$feedFeed ObjectThe configuration details for the current feed. This will be empty when initially creating a new form.
$formForm ObjectThe form for the current feed. This will be empty when initially creating a new form.

Examples

This example adds a group of checkbox fields which would allow the user to enable/disable a group of custom options.

add_filter( 'gform_paypal_add_option_group', 'add_paypal_option_group', 10, 2 );
function add_paypal_options( $feed, $form ) {
?>
<div class="margin_vertical_10">

    <label class="left_header">My Third Party Options</label>

    <ul style="overflow:hidden;">
        <li>
            <input type="checkbox" value="1" id="my_third_party_label_option" name="my_third_party_label_option">
            <label for="my_third_party_label_option" class="inline">Use My Third Party invoice IDs.</label>
        </li>
        <li>
            <input type="checkbox" value="1" id="my_third_party_transactions" name="my_third_party_transactions">
            <label for="my_third_party_transactions" class="inline">Send copy of transactions to My Third Party.</label>
        </li>
    </ul>

</div>

<?php
}

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?

Source Code

do_action( 'gform_paypal_add_option_group', $this->get_current_feed(), $this->get_current_form() );

This filter is located in GFPayPal::settings_custom() in class-gf-paypal.php.