Skip to content

Instantly share code, notes, and snippets.

@DumahX
Created November 9, 2021 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DumahX/92fdfa8bce2aef1063bc10f60b72b50d to your computer and use it in GitHub Desktop.
Save DumahX/92fdfa8bce2aef1063bc10f60b72b50d to your computer and use it in GitHub Desktop.
<?php
function block_member_by_name($errors) {
$first_name = isset($_POST['user_first_name']) && !empty($_POST['user_first_name']) ? trim($_POST['user_first_name']) : '';
$last_name = isset($_POST['user_last_name']) && !empty($_POST['user_last_name']) ? trim($_POST['user_last_name']) : '';
// If first or last name is empty, just don't do anything.
if(empty($first_name) || empty($last_name)) {
return $errors;
}
if($first_name == 'Rey' && $last_name == 'Reyes') {
$errors[] = "Sorry, we weren't able to complete your registration.";
}
return $errors;
}
add_filter('mepr-validate-signup', 'block_member_by_name');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment