Using Gravity Forms ‘gform_user_registration_add_option_group’ PHP filter

The gform_user_registration_add_option_group Gravity Forms PHP action was used to add a group of options to the “Additional Options” section of the User Registration Feed.

This action has been removed in version 3.0 and replaced by gform_userregistration_feed_settings_fields.

Usage

add_action('gform_user_registration_add_option_group', 'your_function_name', 10, 3);

Parameters

  • $config (array): The User Registration configuration array.
  • $form (Form Object): The Form Object for which the current user registration feed is for.
  • $is_validation_error (boolean): Boolean value indicating whether there was a validation error with the User Registration configuration.

More information

See Gravity Forms Docs: gform_user_registration_add_option_group

Examples

Adding a custom group to the User Registration Feed

This example demonstrates how to add the “Send User Email” option using the gform_user_registration_add_option_group action, as if this option was not already available.

add_action('gform_user_registration_add_option_group', 'add_custom_group', 10, 3);

function add_custom_group($config, $form, $is_validation_error) {
    ?>
    <div>
        <label class="left_header"><?php _e("Send Email?", "gravityformsuserregistration"); ?><?php gform_tooltip("user_registration_notification") ?></label>
        <input type="checkbox" id="gf_user_registration_notification" name="gf_user_registration_notification" value="1" <?php echo ($config["meta"]["notification"] == 1 || !isset($config["meta"]["notification"])) ? "checked='checked'" : "" ?> />
        <label for="gf_user_registration_notification" class="checkbox-label"><?php _e("Send this password to the new user by email.", "gravityformsuserregistration"); ?></label>
    </div> <!-- / send email? -->
    <?php
}

This code adds a custom group with a “Send User Email” option in the “Additional Options” section of the User Registration Feed. When enabled, the new user will receive an email containing their password.