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 / Customer Has Access Filter

Customer Has Access Filter

The wpvs_custom_has_access_check filter allows you to customize video restriction and permission.

Add the following to either your themes functions.php file or within your plugin files:

add_action( 'wpvs_custom_has_access_check', 'wpvs_my_custom_has_access_check', 10, 4 );

function wpvs_my_custom_has_access_check($user_id, $membership_array, $user_memberships, $post_id) {
    // YOUR CUSTOM CODE HERE
$return_array = array(
'has_access' => true|false,
'no_access_reason' => $your_reason,
'message' => $message_to_display
); return $return_array; }

Parameters

  • user_id: The current users ID
  • membership_array: All memberships required to access the video (see below for variables)
  • user_memberships: The current users memberships
  • post_id: The current post (video) ID

user_memberships (individual) structure:

The user_memberships parameter is an array of memberships, each one with the following 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)
);

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