Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Gravity Wiz // Skip Registration for Logged In Users
* Skip Registration for Logged In Users
* Works for GF User Registration versions before 3.0. For version 3.0 and greater, use this alternate snippet:
add_action('gform_post_submission', 'maybe_skip_registration', 9);
add_action('gform_after_submission', 'maybe_skip_registration', 9);
function maybe_skip_registration($entry) {
if(is_user_logged_in()) {
remove_action('gform_post_submission', array('GFUser', 'gf_create_user'));
remove_action('gform_after_submission', array('GFUser', 'gf_create_user'));
add_filter('gform_validation', 'maybe_skip_validation', 9);
function maybe_skip_validation($validation_result) {
if(is_user_logged_in()) {
remove_filter('gform_validation', array('GFUser', 'user_registration_validation'));
return $validation_result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment