Skip to content

Instantly share code, notes, and snippets.

@kimcoleman
Created June 16, 2020 11:40
Show Gist options
  • Save kimcoleman/b5d72fabff360d0a336c4a1038ebb585 to your computer and use it in GitHub Desktop.
Save kimcoleman/b5d72fabff360d0a336c4a1038ebb585 to your computer and use it in GitHub Desktop.
Assign level ID 1 after submission of form ID 1
<?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