Skip to content

Instantly share code, notes, and snippets.

@ideadude
Created October 3, 2019 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ideadude/76872d4ee982f7add05dafb69cf00d13 to your computer and use it in GitHub Desktop.
Save ideadude/76872d4ee982f7add05dafb69cf00d13 to your computer and use it in GitHub Desktop.
Disable the PMPro CPT redirect for non-members.
/**
* Disable the PMPro CPT redirect for non-members.
* The PMPro the_content filters will still run,
* but might not be adequate to protect some CPTs.
*/
function my_disable_pmpro_cpt_redirect() {
remove_action( 'template_redirect', 'pmprocpt_template_redirect' );
}
add_action( 'init', 'my_disable_pmpro_cpt_redirect' );
@laurenhagan0306
Copy link

This recipe is included in the blog post on "How to Remove the Redirect from a Protected CPT using the Custom Post Type Membership Access Add On" at Paid Memberships Pro here: https://www.paidmembershipspro.com/how-to-remove-the-redirect-from-a-protected-cpt-using-the-custom-post-type-membership-access-add-on/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment