Use this hook to filter the membership access of a given post. This overrides the output of the pmpro_has_membership_access() function and returns the boolean true or false, the WP_Post object, the  WP_User object, and an array of the membership levels required for the post.


apply_filters("pmpro_has_membership_access_filter", bool $hasaccess, WP_post $mypost, WP_user $myuser, array $post_membership_levels);

Parameters

$hasaccess
bool
mypost
WP_Post
$myuser
WP_User
$post_membership_level
array

Source

File: https://github.com/strangerstudios/paid-memberships-pro/blob/master/includes/content.php

View in Source Code

Related Articles and Recipes

Allow Authors to View Their Posts Regardless of Membership Level By Kimberly Coleman

Lock or Unlock Posts Based on Age and Post Date By Kimberly Coleman

Lock Posts to Members-Only After Specific Timeframe By Kimberly Coleman

Sister Plugin for Addon Packages: Apply Parent Page’s Protection to All Child Pages By Kimberly Coleman

Sell Access to Post Categories “à la carte” Using Price-Adjusting Register Helper Fields By Kimberly Coleman

Sell Access to a Single Post Category Using the Addon Packages Plugin By Jason Coleman

How To Have a Paid Memberships Pro level with access to EVERYTHING. By Jason Coleman

Hide Old Posts From New Members By Jason Coleman