Created
April 29, 2022 12:36
-
-
Save kerijacoby/8f4a039c382daa76f13cb7876e6c91d4 to your computer and use it in GitHub Desktop.
Hide a 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[14] ); // hide level 14 from non-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