Created
July 27, 2015 08:35
-
-
Save woogist/fc8dded0c354bdd8b8b4 to your computer and use it in GitHub Desktop.
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
// Automatically grant membership at registration | |
function sv_add_membership_at_registration( $user_id ) { | |
$args = array( | |
// Enter the ID (post ID) of the plan to grant at registration | |
'plan_id' => 253, | |
'user_id' => $user_id, | |
); | |
wc_memberships_create_user_membership( $args ); | |
} | |
add_action( 'user_register', 'sv_add_membership_at_registration', 15 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment