Created
October 3, 2019 14:08
-
-
Save ideadude/76872d4ee982f7add05dafb69cf00d13 to your computer and use it in GitHub Desktop.
Disable the PMPro CPT redirect for non-members.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/