Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created December 15, 2017 14:37
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewlimaza/5c526c1c815c5d01e42f71b9da2bdc98 to your computer and use it in GitHub Desktop.
Save andrewlimaza/5c526c1c815c5d01e42f71b9da2bdc98 to your computer and use it in GitHub Desktop.
Remove homepage replacement for Member Home Pages Paid Memberships Pro
<?php
/**
* Removes the always redirect to member homepages. Only allows login redirect functionality.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function remove_memberhome_pages_redirect(){
remove_action('template_redirect', 'pmpromh_template_redirect_homepage');
}
add_action( 'template_redirect', 'remove_memberhome_pages_redirect', 5 );
@physiostasis
Copy link

This worked great, thanks!

@lexinamer
Copy link

This didn't work as of March 2019. Any suggestions? Did the action change with an update?

@andrewlimaza
Copy link
Author

@lexinamer I have tested this and it still works. I would check to see if your other plugins or theme is doing a template redirect for similar functionality.

@MaryOJob
Copy link

Still works

@laurenhagan0306
Copy link

This recipe is included in the blog post on "Let members access your original homepage when using the Member Homepages Add On." at Paid Memberships Pro here: https://www.paidmembershipspro.com/let-members-access-your-original-homepage-when-using-the-member-homepages-add-on/

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