gform_user_registration_user_meta_options

Description

The “gform_user_registration_user_meta_options” filter is used by the User Registration Add-On for Gravity Forms. When creating a feed for User Registration, the User Meta has a section titled “Other User Meta”. The “gform_user_registration_user_meta_options” filter allows the options for this group to be set instead of pulling the meta keys from the database. If you do not want the “Other User Meta” section displayed at all, return false from this filter.

Usage

add_filter( 'gform_user_registration_user_meta_options', 'your_function_name' );

Parameters

  • $keys array

    An array of meta keys.

Example

add_filter( 'gform_user_registration_user_meta_options', 'add_keys', 10, 1 );
function add_keys( $keys ) {
	$keys = array(
				array( 'name'=>'test1',
					   'label'=> 'test1',
					   'required'=> false),
				array( 'name' => 'test2',
					   'label' => 'test2',
					   'required' => true )
	);
	return $keys;
}

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

This action is located in GF_User_Registration::get_user_meta_choices() in gravityformsuserregistration/class-gf-user-registration.php.