Contents |
Introduction
The User Registration provides an assortment of hooks that can be used to modify the default functionality or extend it.
Hooks and Filters
Following is a list of available hooks and filters.
Form Submission
The following hooks are fired when a Gravity Form with an attached User Registration form is submitted. You can use these hooks for actions such as custom validation specific to forms with User Registration feeds and triggering actions to occur when a new user is registered through such a form.
- gform_user_registration_validation
- Used to validate Gravity Form submissions that have a User Registration feed attached.
- gform_user_registered
- Fires after the user has been registered and passes the user id of the newly created user, the User Registration config meta and Gravity Form entry used to create the user.
- gform_user_registration_validation_message
- Used to customize the default User Registration validation messages
- gform_username
- Used to dynamically generate or alter the username
- gform_site_created
- Fires after the site has been created. Only applicable to Network installs with the "Create Site" option enabled.
- gform_user_updated
- Fires after the user has been updated and passed the user id, the User Registration config meta and Gravity Form entry used to update the user.
Settings / Feed Configuration
The following hooks are fired within the User Registration Add-on's settings page and the feed configuration page and allow you to add new or modify existing settings and meta.
- gform_user_registration_add_option_section
- Used to add a custom option section to the User Registration Feed (similar to how BuddyPress and MultiSite are integrated with the User Registration add-on).
- gform_user_registration_add_option_group
- Used to add a group of options to the "Additional Options" section of the User Registration Feed. Useful when you want to add one or two options without requiring a whole section.
- gform_user_registration_save_config
- Used to save custom settings/meta specified using the gform_user_registration_add_option_section or gform_user_registration_add_option_group action hooks.
- gform_user_registration_config_validation
- Used to validate custom settings/meta specified using the gform_user_registration_add_option_section or gform_user_registration_add_option_group action hooks.
Javascript
The following events are fired via jQuery and allow custom client side scripts to be executed.
- gform_gfuser_object_init
- Fires on the feed configuration page after the DOM has been loaded and the GFUser javascript object has been initialized.
- gform_user_registration_form_selected
- Fires on the feed configuration page after a form has been selected from the "Select Form" dropdown.
Role Management
The User Registration Add-on introduces some new capabilities to the WordPress Role system. For more information, check out the Role Management page.