Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created December 20, 2016 13:59
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewlimaza/19970038b897f596fb951c90b2c9a287 to your computer and use it in GitHub Desktop.
Save andrewlimaza/19970038b897f596fb951c90b2c9a287 to your computer and use it in GitHub Desktop.
Example of pmpro_hasMembershipLevel() usage
<?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';
}
}
@samuelstevens9
Copy link

👍

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