WP Video Subscriptions
  • General
  • Products
    • VS Netflix Theme
    • WP Video Memberships
  • FAQ
  • Developers
  • Submit A Ticket
  • General
  • Products
    • VS Netflix Theme
    • WP Video Memberships
  • FAQ
  • Developers
  • Submit A Ticket
Hooks & Filters / Do After New Purchase

Do After New Purchase

After a customer has:

  • purchased a video
  • rented a video
  • or purchased access to a series / season

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_product_purchase', 'wpvs_my_custom_after_purchase_function', 10, 3 );

function wpvs_my_custom_after_purchase_function($user_id, $product_id, $purchase_type) {
    // YOUR CUSTOM CODE HERE
}

Parameters

  • user_id: The ID of the user who purchased the video
  • product_id:
    • The Video (POST) ID when purchase_type is purchase or rental
    • The Term ID (Series / Season) when purchase_type is termpurchase
  • purchase_type: Type of purchase (purchase, rental or termpurchase)
VS Netflix Theme
Changelog Creating A Full-Width Menu Creating TV Shows & Series Customizing Your Theme Featured Area Sliders Importing Demo Content Turning On Video Reviews VS Netflix Shortcodes Why aren’t my videos displaying on the home page?
WP Video Memberships
Account Page Setup Adding Fields To Account Forms Changelog Free Memberships Hooks & Filters PayPal Payments Setup Restrict Members From WP Admin Stripe Payments Setup WP Video Memberships Shortcodes
General
Activating Your Website Helpful Links Restricting Vimeo Videos To Your Website Only
FAQ
Can’t Login on WordPress.com site Enabling Registration (Registration is disabled) How can I customize the Create Account form? Why aren’t my payment buttons displaying on the checkout page? Why won’t my Gmail work for sending emails?
Developers
Continue Watching for Custom Players Customizing WP Videos Archive Templates REST API Endpoints Restricting REST API Data
Cookie Notice Setup
Quick Links
  • General
  • VS Netflix Theme
  • WP Video Memberships
  • FAQ
Account
  • Login
Support
  • Submit A Ticket

© WP Video Subscriptions 2025