Created
November 9, 2021 18:19
-
-
Save DumahX/92fdfa8bce2aef1063bc10f60b72b50d to your computer and use it in GitHub Desktop.
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 | |
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