pmpro_has_membership_access_filter

The Paid Memberships Pro pmpro has membership access filter hook.

Description

apply_filters( 'pmpro_has_membership_access_filter', (unknown) $hasaccess, (unknown) $mypost, (unknown) $myuser, (unknown) $post_membership_levels ); 

Parameters (4)

0. $hasaccess (unknown)
The hasaccess.
1. $mypost (unknown)
The mypost.
2. $myuser (unknown)
The myuser.
3. $post_membership_levels (unknown)
The post membership levels.

Usage

To run the hook, copy the example below.
  1. $hasaccess = apply_filters( 'pmpro_has_membership_access_filter', $hasaccess, $mypost, $myuser, $post_membership_levels ); 
  2.  
  3. if ( !empty( $hasaccess ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the pmpro_has_membership_access_filter callback 
  2. function filter_pmpro_has_membership_access_filter( $hasaccess, $mypost, $myuser, $post_membership_levels ) { 
  3. // make filter magic happen here... 
  4. return $hasaccess
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'pmpro_has_membership_access_filter', 'filter_pmpro_has_membership_access_filter', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'pmpro_has_membership_access_filter', 'filter_pmpro_has_membership_access_filter', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/content.php  
  1. $hasaccess = apply_filters("pmpro_has_membership_access_filter", $hasaccess, $mypost, $myuser, $post_membership_levels);