PDA

View Full Version : Minimum Length for Custom Profile Fields


Rogue_SSEi
08-13-2010, 12:22 PM
I'd like to require a minimum length (say 2 or 3 chars) for some custom user profile fields. Can anyone point me to a good place to start?

kh99
08-13-2010, 01:18 PM
I think the code for that is in profile.php, and it looks like there's a "profile_start" hook that you could use for a plugin to check the values. Of course you'd have to figure out what variables to check to determine if a specific field is being updated, and figure out what to do if the value is below minimum length. One thing that confused me when I first looked at that code is remembering that $_REQUEST['do'] and $_POST['do'] are two different variables.

Hope this helps. Maybe someone will know more about this and will post a reply.

Rogue_SSEi
08-13-2010, 05:11 PM
I appreciate the response. I'll start looking there :)