After a new membership has been created, you can optionally run your own function to update the users meta data and more.
Add the following to either your themes functions.php file or within your plugin files:
add_action( 'wpvs_do_after_new_membership', 'wpvs_my_custom_after_function', 10, 2 ); function wpvs_my_custom_after_function($user_id, $membership_array) { // YOUR CUSTOM CODE HERE }
Parameters
- user_id: The ID of the user who purchased the membership
- membership_array: The new membership details (see below for variables)
membership_array structure:
array( 'plan' = (ID of Plan), 'id' = (Stripe Subscription ID, PayPal Billing Agreement ID or CoinGate Order ID), 'amount' = (Price of Membership), 'name' = (Name of Membership), 'interval' = (Membership Interval), 'interval_count' = (Membership Interval Count), 'ends' = (timestamp - when the membership ends), 'status' = (status_of_subscription), 'type' = (stripe, paypal, coingate, stripe_test, paypal_test, coingate_test), 'coin' = (ONLY FOR COINGATE MEMBERSHIPS IF BTC OR LTC WAS USED) );
Comments
0 comments
Article is closed for comments.