gform_user_registration_meta_value

gform_user_registration_meta_value

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
This filter can be used to modify a value before it is saved to the user meta.
Usage
add_filter( 'gform_user_registration_meta_value', 'your_function_name', 10, 6 );

Parameters

$value string
The value to be modified.

$meta_key string
The meta key as specified in the Feed Object.

$meta User Registration Feed Meta
The ID of the field input currently being processed.

$form Form Object
The form currently being processed.

$entry Entry Object
The entry currently being processed.

$is_username bool
Indicates if the current field is mapped to the username.

Examples
The following example shows how you can override the the site address meta value.
add_filter( 'gform_user_registration_meta_value', function ( $value, $meta_key, $meta, $form, $entry, $is_username ) {
if ( $meta_key == 'siteAddress' ) {
$value = 'your new value';
}
return $value;
}, 10, 6 );

Placement
Your code snippet should be placed in the functions.php file of your active theme.
Since
This filter was added in version 3.0.
Source Code
$value = apply_filters( 'gform_user_registration_meta_value', $value, $meta_key, $meta, $form, $entry, $is_username );

This filter is located in GF_User_Registration::get_prepared_value() in class-gf-user-registration.php.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注