Resource icon

Unmaintained Custom user field callback, validate value 1.x

No permission to download
This is a skeleton for creating a callback for a custom user field. The callback is used to validate the value entered by the user. For example, if you are collecting some kind of ID that you need to check against another database.

The callback is specified when editing the custom field:

Screen shot 2012-01-12 at 10.51.04 PM.png

The skeleton contains this file which matches the callback name:


The example code only accepts a value of '123'. Otherwise it defines an error message and returns false. It's a very simple example for demonstration. You can use your own code inside of the validate() function:


class Callback_UserField
	public static function validate($field, &$value, &$error)
		if ($value == '123')
			return true;
			$error = 'what no';
			return false;
Jake Bunce
First release
Last update
5.00 star(s) 2 ratings

More resources from Jake Bunce

Latest reviews

Thank you! This is just what I was looking for. Always great to see nifty tutorials like this one. Although I wish I could rate the resource without having to download it. (Since I'm only using my own class.)
Didn't know how to scrub profile details, followed this guide and it worked like a charm!
Top Bottom