Skip to content

Instantly share code, notes, and snippets.

@zgordon
Last active March 10, 2020 17:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zgordon/1fab8bbe39e4fe318a78d6292b047395 to your computer and use it in GitHub Desktop.
Save zgordon/1fab8bbe39e4fe318a78d6292b047395 to your computer and use it in GitHub Desktop.
This function hooks in when Gravity Forms Registers a New User and then Adds them to a LearnDash Group using ld_update_group_access
<?php
add_action( 'gform_activate_user', 'apply_learndash_group', 10, 3 );
function apply_learndash_group( $user_id, $user_data ) {
// Change to be group ID for your group
$group_id = XXXX;
ld_update_group_access( $user_id, $group_id, false );
}
@g-rzegorz
Copy link

Hi,

For me 'gform_activate_user' not working.

But i trynig and start working with 'gform_user_registered' :

Cheers

@zgordon
Copy link
Author

zgordon commented Mar 10, 2020

Cool thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment