Skip to content

Instantly share code, notes, and snippets.

@dparker1005
Created October 12, 2023 19:30
Show Gist options
  • Save dparker1005/32ab4edd802e6b24402a28fe643e08c7 to your computer and use it in GitHub Desktop.
Save dparker1005/32ab4edd802e6b24402a28fe643e08c7 to your computer and use it in GitHub Desktop.
Set the level order in which the PMPro Member Homepages Add On should try to redirect members to the corresponding homepage.
<?php
/**
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
*/
// Copy from below this line.
/*
* Set the level order in which the PMPro Member Homepages Add On
* should try to redirect members to the corresponding homepage.
*/
function my_pmpromh_prioritized_levels( $prioritized_levels ) {
// Ex. This line will first try to redirect the user for the homepage for level 2.
// If the user does not have level 2 or level 2 does not have a homepage set,
// The code will try level 3. If the user does not have level 3 or level 3 does
// not have a homepage set, it will try level 1.
return array( 2, 3, 1 );
}
add_filter( 'pmpromh_prioritized_levels', 'my_pmpromh_prioritized_levels' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment