Last active
February 19, 2019 17:09
-
-
Save andrewlimaza/5700438f7e8a24e87e1343a9e2c7d64d to your computer and use it in GitHub Desktop.
Remove homepage replacement for admins only (Paid Memberships Pro HomePages Add On)
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
<?php | |
/** | |
* Remove the homepage replacement on the Member HomePages Add On for Paid Memberships Pro. | |
* This will only remove the homepage replacement for administrators. | |
* Add this code (L9-L14 only) to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function remove_memberhome_pages_redirect(){ | |
if ( current_user_can( 'manage_options' ) ) { | |
remove_action('template_redirect', 'pmpromh_template_redirect_homepage'); | |
} | |
} | |
add_action( 'template_redirect', 'remove_memberhome_pages_redirect', 5 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment