pmpro_hide_pages_redirect

The Paid Memberships Pro pmpro hide pages redirect function.

Description

pmpro_hide_pages_redirect(); 

Usage

  1. if ( !function_exists( 'pmpro_hide_pages_redirect' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/content.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = pmpro_hide_pages_redirect(); 
  7.  

Defined (1)

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

/includes/content.php  
  1. function pmpro_hide_pages_redirect() 
  2. global $post; 
  3.  
  4. if(!is_admin() && !empty($post->ID)) 
  5. if($post->post_type == "attachment") 
  6. //check if the user has access to the parent 
  7. if(!pmpro_has_membership_access($post->ID)) 
  8. wp_redirect(pmpro_url("levels")); 
  9. exit;