Created
June 16, 2020 11:40
-
-
Save kimcoleman/b5d72fabff360d0a336c4a1038ebb585 to your computer and use it in GitHub Desktop.
Assign level ID 1 after submission of form ID 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_gform_after_submission( $entry, $form ) { | |
if ( ! function_exists( 'pmpro_changeMembershipLevel' ) ) { | |
return; | |
} | |
global $current_user; | |
$user_id = $current_user->ID; | |
pmpro_changeMembershipLevel( 1, $user_id ); | |
} | |
add_action( 'gform_after_submission_1', 'my_gform_after_submission', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment