Forked from andrewlimaza/remove-homepage-replacement.php
Last active
April 12, 2021 20:22
-
-
Save travislima/67c13bfd563e5ce3867f50403ca0550f to your computer and use it in GitHub Desktop.
Remove homepage replacement for admins only (Paid Memberships Pro HomePages Add On)
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 characters
<?php | |
/** | |
* Remove the replacement homepage from the Member HomePages Add On for Paid Memberships Pro. | |
* | |
* Add this code (L7-L12 only) to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function remove_member_homepages_redirect(){ | |
if ( current_user_can( 'manage_options' ) ) { | |
remove_action( 'template_redirect', 'pmpromh_template_redirect_homepage' ); | |
} | |
} | |
add_action( 'template_redirect', 'remove_member_homepages_redirect', 5 ); |
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 "Remove homepage redirect for admins only (PMPro Member Homepages Add On)" at Paid Memberships Pro here: https://www.paidmembershipspro.com/remove-homepage-replacement-for-admins-only/