Last active
April 6, 2021 22:08
-
-
Save andrewlimaza/90f9628e965910064b4e026fdf3d0cdd to your computer and use it in GitHub Desktop.
hide free level from members and premium level from non-members.
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 | |
// Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
function adjusting_the_pmpro_levels_array( $levels ) { | |
if( !pmpro_hasMembershipLevel() ) { | |
unset( $levels[1] ); // hide premium level for non-members. | |
}else{ | |
unset( $levels[2] ); // hide free level for members. | |
} | |
return $levels; | |
} | |
add_filter( 'pmpro_levels_array', 'adjusting_the_pmpro_levels_array' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment