gform_user_registration_pending_activation_expiration

gform_user_registration_pending_activation_expiration

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Allows the expiration period for pending activations to be overridden.
Usage
add_filter( 'gform_user_registration_pending_activation_expiration', 'your_function_name' );

Parameters

$expiration_time int
Expiration time in seconds. Defaults to 172800 (2 days).

Examples
add_filter( 'gform_user_registration_pending_activation_expiration', function ( $expiration ) {
// Expiration time (Seconds).
return 30;
} );

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in User Registration version 4.5
Source Code
This filter is located in gravityformsuserregistration/class-gf-user-registration.php.

gform_user_registration_new_site_meta

gform_user_registration_new_site_meta

DescriptionUsageParametersExamplePlacementSource Code

Description
This filter allows the site meta to be modified while creating a new site.
Usage
1add_filter( 'gform_user_registration_new_site_meta', 'your_function_name', 10, 6 );

Parameters

$site_meta array
An array of new site arguments (ex. if the site is public => 1).

$form Form Object
The Form Object.

$entry Entry Object
The Entry Object.

$feed Feed Object
The Feed Object.

$user_id int
The ID of the user who creates the site.

$is_update_feed boolean
True/false indicator of whether this is a feed to update an existing setup.

Example
12345add_filter( 'gform_user_registration_new_site_meta', 'add_blog_template', 10, 6 );function add_blog_template( $site_meta, $form, $entry, $feed, $user_id, $is_update_feed ) {  $signup_meta['blog_template'] = 1;  return $signup_meta;}
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GF_User_Registration::create_site() in gravityformsuserregistration/class-gf-user-registration.php.

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.

gform_user_registration_login_redirect_url

gform_user_registration_login_redirect_url

DescriptionUsageParametersExamplesRedirect all users to a custom URLRedirect to a custom URL only for users with 『administrator』 rolePlacementSinceSource Code

Description
Filters the redirect URL after login when using the User Registration add-on login widget.
Usage
add_filter( 'gform_user_registration_login_redirect_url', 'your_function_name', 10, 2 );

Parameters

$login_redirect string
The URL to which the user will be redirected.

$sign_on object
The user object if successful. Otherwise, error.

Examples
Redirect all users to a custom URL
add_filter( 'gform_user_registration_login_redirect_url', 'your_function_name', 10, 2 );
function your_function_name( $login_redirect, $sign_on ) {
//redirect to a page
return 'https://localhost/wp.dev/my-account/';
}

Redirect to a custom URL only for users with 『administrator』 role
add_filter( 'gform_user_registration_login_redirect_url', 'gf_redirect_user_role', 10, 2 );
function gf_redirect_user_role( $login_redirect, $sign_on ) {
GFCommon::log_debug( __METHOD__ . '(): Running...' );
if ( in_array( 'administrator', $sign_on->roles ) ){
// Redirect users with administrator role to a specific page.
$login_redirect = 'https://example.com/';
GFCommon::log_debug( __METHOD__ . '(): Redirecting to ' . $login_redirect );
}
return $login_redirect;
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in the User Registration version 3.2.
Source Code
This action hook is located in GF_User_Registration::handle_login_submission() in gravityformsuserregistration/class-gf-user-registration.php.

gform_userregistration_login_form

gform_userregistration_login_form

DescriptionUsageParametersExamples1. Change label for Username field2. Remove Remember Me fieldPlacementSource Code

Description
The 「gform_userregistration_login_form」 filter allows the modification of the object for the login form used in the Gravity Forms Login Widget. This filter is used in the User Registration Add-On for Gravity Forms.
Usage
add_filter( 'gform_userregistration_login_form', 'your_function_name', 10, 1 );

Parameters

$form Form Object
The Form Object of the login form.

Examples
1. Change label for Username field
add_filter( 'gform_userregistration_login_form', 'change_form', 10, 1 );
function change_form( $form ) {
$fields = $form['fields'];
foreach ( $fields as &$field ) {
if ( $field->label == 'Username' ) {
$field->label = 'Please enter your username';
}
}
return $form;
}

2. Remove Remember Me field
add_filter( 'gform_userregistration_login_form', function ( $form ) {

// Remove Remember Me field.
unset ( $form['fields']['2'] );

return $form;
} );

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GF_User_Registration::login_form_object() in gravityformsuserregistration/class-gf-user-registration.php.

gform_user_registration_login_form_description

gform_user_registration_login_form_description

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
The 「gform_user_registration_login_form_description」 filter in the Gravity Forms User Registration Add-On allows the description of the login form to be modified.
Usage
add_filter( 'gform_user_registration_login_form_description', 'your_function_name' );

Parameters
There are no parameters.

Examples
add_filter( 'gform_user_registration_login_form_description', 'change_description' );
function gform_user_registration_login_form_description(){
return 'This is my new description';
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in User Registration version 3.2.
Source Code
This filter is located in GF_User_Registration::login_form_object() in gravityformsuserregistration/class-gf-user-registration.php.

gform_user_registration_login_args

gform_user_registration_login_args

DescriptionUsageParametersExamplePlacementSource Code

Description
The 「gform_user_registration_login_args」 filter allows the modification of the login form arguments used to create the HTML for the Gravity Forms Login Widget. This filter is used in the User Registration Add-On for Gravity Forms.
Usage
1add_filter( 'gform_user_registration_login_args', 'your_function_name', 10, 1 );

Parameters

$args array
An array of the login form arguments used to generate the HTML.
Potential values:

display_title boolean
display_description boolean
display_lost_password boolean
logged_in_avatar boolean
logged_in_links array
logged_in_message string
logged_out_links array
login_redirect string
logout_redirect string
tabindex int

Example
12345add_filter( 'gform_user_registration_login_args', 'set_html_args', 10, 1 );function set_html_args( $args ) {    $args['logged_out_links'] = array();    return $args;}
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GF_User_Registration::get_login_html() in gravityformsuserregistration/class-gf-user-registration.php.

gform_user_registration_is_new_file_upload

gform_user_registration_is_new_file_upload

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description

The 「gform_user_registration_is_new_file_upload」 filter in the Gravity Forms User Registration Add-On allows you to change whether or not new files have been uploaded when an Update User feed is processed.

Usage

1add_filter( 'gform_user_registration_is_new_file_upload', 'upload_custom_action', 10, 3 );

Parameters

$is_new_file_upload bool
Whether new files have been uploaded.

$form_id int
The current form ID.

$input_name string
The current input name.

Examples

1234567add_filter( 'gform_user_registration_is_new_file_upload', 'upload_custom_action', 10, 3 );function upload_custom_action( $is_new_file_upload, $form_id, $input_name ) {     // Do your custom stuff here.     return $is_new_file_upload;}

Placement

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

Since

This filter was added in User Registration version 4.9.

Source Code

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

gform_user_registration_form_selected

gform_user_registration_form_selected

DescriptionUsageParametersExamplesSource Code

Removed: This hook was removed in version 3.0 with no replacement.

Description
Fires on the feed configuration page after a form has been selected from the 「Select Form」 dropdown. This is useful for updating or setting options that are dependent on properties of the selected form.
Usage

Parameters

event Event Object
The Javascript event object.

form Form Object
The form meta of the selected form.

Examples
This example runs a function after the form has been selected.

Source Code
This filter is located in userregistration.php.

gform_user_registration_enable_multisite_section

gform_user_registration_enable_multisite_section

DescriptionUsageParametersPlacementSource CodeSince

Description
By default multisite section of User Registration feed settings are enabled only for the main site of the network. This filter can be used to force the activation of this settings section network-wide.
Usage
add_filter( 'gform_user_registration_enable_multisite_section', '__return_true' );

Parameters

$enable_multisite_section bool
True or false.

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
$enable_multisite_section = apply_filters( 'gform_user_registration_enable_multisite_section', $this->is_root_site() );

This filter is located in GF_User_Registration::feed_settings_fields() in class-gf-user-registration.php.
Since
This filter was added in Gravity Forms User Registration Add-On 2.3.6.