Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Last active February 3, 2017 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save strangerstudios/8135527 to your computer and use it in GitHub Desktop.
Save strangerstudios/8135527 to your computer and use it in GitHub Desktop.
Keep non-members from posting comments with Paid Memberships Pro
//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