Last active
June 11, 2020 20:15
-
-
Save andrewlimaza/bb1150acaf01ecd4f7b351488665cec4 to your computer and use it in GitHub Desktop.
Revisions
-
andrewlimaza revised this gist
Nov 15, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,10 +3,10 @@ * This will redirect members from Page A to Page B. Non-members will be able to access Page A. * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ */ function my_template_redirect_members() { if ( is_page('join') && pmpro_hasMembershipLevel() ) { wp_redirect(home_url( '/my-page-slug' ) ); exit; } } add_action('template_redirect', 'my_template_redirect_members'); -
andrewlimaza created this gist
Nov 15, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ <?php /** * This will redirect members from Page A to Page B. Non-members will be able to access Page A. * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ */ function my_template_redirect_require_membership_access() { if ( is_page('join') && pmpro_hasMembershipLevel() ) { wp_redirect(home_url( '/my-page-slug' ) ); exit; } } add_action('template_redirect', 'my_template_redirect_require_membership_access');