gform_user_registration_config_validation

Removed: This filter was removed in version 3.0. New feed settings defined using gform_userregistration_feed_settings_fields can be validated by defining the validation_callback property for the field.

Description

Used to validate custom settings/meta specified using the gform_user_registration_add_option_section or gform_user_registration_add_option_group action hooks.

Usage

add_filter( 'gform_user_registration_config_validation', 'your_function_name', 2 );

Parameters

  • $is_validation_error array
    Boolean value indicating whether there was a validation error with the User Registration configuration.
  • $config array
    The User Registration configuration array.

Examples

This example is a bit of modified code from the User Registration source code that demonstrates how to validate the custom option fields added using the gform_user_registration_add_option_section hook to support the multisite options.

add_filter( 'gform_user_registration_config_validation', 'validate_multisite_config' );
public static function validate_multisite_config( $is_validation_error ) {

    $multisite_options = $config['meta']['multisite_options'];

    if(empty($multisite_options['create_site']))
        return $is_validation_error;

    if(empty($multisite_options['site_address']) || empty($multisite_options['site_title']))
        return true;

    return $is_validation_error;
}

Source Code

This action hook is located in userregistration.php.