Last active
February 3, 2017 18:13
-
-
Save strangerstudios/8135527 to your computer and use it in GitHub Desktop.
Keep non-members from posting comments with Paid Memberships Pro
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
//keep non-members from posting comments | |
function my_pmpro_pre_comment_approved($approved) | |
{ | |
if(function_exists('pmpro_hasMembershipLevel') && !pmpro_hasMembershipLevel()) | |
wp_die("Only members can post comments."); | |
return $approved; | |
} | |
add_filter( 'pre_comment_approved', 'my_pmpro_pre_comment_approved' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment