Created
December 20, 2016 13:59
-
-
Save andrewlimaza/19970038b897f596fb951c90b2c9a287 to your computer and use it in GitHub Desktop.
Example of pmpro_hasMembershipLevel() usage
This file contains hidden or 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 | |
//You may either create a function or place this code in a custom page template. | |
//Find more here -> https://www.paidmembershipspro.com/documentation/content-controls/require-membership-function/ | |
if( is_user_logged_in() ){ | |
if( pmpro_hasMembershipLevel( 'silver' ) ){ | |
//show this for 'silver level' | |
echo 'show this for silver'; | |
} | |
if( pmpro_hasMembershipLevel( 'gold' ) ){ | |
echo 'show this for gold'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍