My blog is being hammered by sploggers. The good news is that in every case the role displays as "None" in the list of Users. Is there a way to use add_action("user register") in functions.php to prevent these registrations based on the role being empty or None?
While I assume the code would look something like this:
add_action("user register","spike_registrations");
function spike_registrations($user_id){
//pull out role, evaluate role, if role = "" or None stop registration
}
What I'm unsure about is the specific code that goes into my function. What is the data set used by the registration process, for example, and how do I pull out the role from that data set? Is there any special way to evaluate the value of role? And what WP function is used to stop the registration process?
Thanks for any ideas how to pull this off. It would save me an hour every few weeks spent going through 20 plus pages worth of bogus registrations.