Created
September 28, 2016 22:43
-
-
Save mikeyarce/bf9600a373ea21493c23f665af5e6851 to your computer and use it in GitHub Desktop.
WooCommerce Memberships restrict through template
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 | |
$user_id = get_current_user_id(); | |
if ( wc_memberships_is_user_active_member( $user_id, 'gold' ) ) { | |
get_template_part( 'template', 'gold' ); | |
} else { | |
echo "You are not allowed to view this content"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment