ASM – WOOCOM MEMBERSHIP – DEFAULT MEMBERSHIP ASSIGNMENT AT REGISTRATION Posted on November 11, 2020 by CG Team ============================================ // WOOCOMMERCE FUNCTIONS FOR MEMBERSHIP ASSIGNMENT AT REGISTRATION // Automatically grant membership to a plan at registration function asm_add_membership_at_registration( $user_id ) { if ( ! function_exists( 'wc_memberships' ) ) { return; } // Woocom Function $args = array( // Enter the ID (post ID) of the plan to grant at registration 'plan_id' => 8741, // Free Coach's Plan 'user_id' => $user_id, ); wc_memberships_create_user_membership( $args ); } add_action( 'user_register', 'asm_add_membership_at_registration', 25 ); ============================================